Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KIF
AKPlanning
Commits
2ed7a465
Commit
2ed7a465
authored
4 years ago
by
Benjamin Hättasch
Committed by
Nadja Geisler
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Scheduling: Allow to place previously unscheduled slots
parent
2750e2f8
No related branches found
Branches containing commit
No related tags found
1 merge request
!53
Drag and drop based plan for scheduling
Pipeline
#8811
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AKScheduling/api.py
+2
-2
2 additions, 2 deletions
AKScheduling/api.py
AKScheduling/templates/admin/AKScheduling/scheduling.html
+25
-2
25 additions, 2 deletions
AKScheduling/templates/admin/AKScheduling/scheduling.html
AKScheduling/views.py
+4
-1
4 additions, 1 deletion
AKScheduling/views.py
with
31 additions
and
5 deletions
AKScheduling/api.py
+
2
−
2
View file @
2ed7a465
...
@@ -91,8 +91,8 @@ class EventSerializer(serializers.ModelSerializer):
...
@@ -91,8 +91,8 @@ class EventSerializer(serializers.ModelSerializer):
roomId
=
serializers
.
IntegerField
(
source
=
'
room.pk
'
)
roomId
=
serializers
.
IntegerField
(
source
=
'
room.pk
'
)
def
update
(
self
,
instance
,
validated_data
):
def
update
(
self
,
instance
,
validated_data
):
start
=
timezone
.
make_aware
(
timezone
.
make_naive
(
validated_data
.
get
(
'
start
'
,
instance
.
start
)),
instance
.
event
.
timezone
)
start
=
timezone
.
make_aware
(
timezone
.
make_naive
(
validated_data
.
get
(
'
start
'
)),
instance
.
event
.
timezone
)
end
=
timezone
.
make_aware
(
timezone
.
make_naive
(
validated_data
.
get
(
'
end
'
,
instance
.
end
)),
instance
.
event
.
timezone
)
end
=
timezone
.
make_aware
(
timezone
.
make_naive
(
validated_data
.
get
(
'
end
'
)),
instance
.
event
.
timezone
)
instance
.
start
=
start
instance
.
start
=
start
instance
.
room
=
get_object_or_404
(
Room
,
pk
=
validated_data
.
get
(
'
room
'
)[
"
pk
"
])
instance
.
room
=
get_object_or_404
(
Room
,
pk
=
validated_data
.
get
(
'
room
'
)[
"
pk
"
])
diff
=
end
-
start
diff
=
end
-
start
...
...
This diff is collapsed.
Click to expand it.
AKScheduling/templates/admin/AKScheduling/scheduling.html
+
25
−
2
View file @
2ed7a465
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
{% load tags_AKModel %}
{% load tags_AKModel %}
{% load i18n %}
{% load i18n %}
{% load l10n %}
{% load tz %}
{% load tz %}
{% load static %}
{% load static %}
{% load tags_AKPlan %}
{% load tags_AKPlan %}
...
@@ -19,6 +20,13 @@
...
@@ -19,6 +20,13 @@
<script
src=
"{% static locale_file %}"
></script>
<script
src=
"{% static locale_file %}"
></script>
{% endwith %}
{% endwith %}
<style>
.unscheduled-slot
{
cursor
:
move
;
}
</style>
<script>
<script>
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
document
.
addEventListener
(
'
DOMContentLoaded
'
,
function
()
{
// CSRF Protection/Authentication
// CSRF Protection/Authentication
...
@@ -62,7 +70,7 @@
...
@@ -62,7 +70,7 @@
// Calendar
// Calendar
var
planEl
=
document
.
getElementById
(
'
planCalendar
'
);
var
planEl
=
document
.
getElementById
(
'
planCalendar
'
);
var
plan
=
new
FullCalendar
.
Calendar
(
planEl
,
{
plan
=
new
FullCalendar
.
Calendar
(
planEl
,
{
timeZone
:
'
{{ event.timezone }}
'
,
timeZone
:
'
{{ event.timezone }}
'
,
headerToolbar
:
{
headerToolbar
:
{
left
:
'
today prev,next
'
,
left
:
'
today prev,next
'
,
...
@@ -118,7 +126,12 @@
...
@@ -118,7 +126,12 @@
// React to event changes (moving or change of duration)
// React to event changes (moving or change of duration)
eventChange
:
updateEvent
,
eventChange
:
updateEvent
,
eventReceive
:
updateEvent
,
editable
:
true
,
editable
:
true
,
dropable
:
true
,
drop
:
function
(
info
)
{
info
.
draggedEl
.
parentNode
.
removeChild
(
info
.
draggedEl
);
},
allDaySlot
:
false
,
allDaySlot
:
false
,
nowIndicator
:
true
,
nowIndicator
:
true
,
eventTextColor
:
'
#fff
'
,
eventTextColor
:
'
#fff
'
,
...
@@ -160,7 +173,17 @@
...
@@ -160,7 +173,17 @@
{% block content %}
{% block content %}
<div
id=
"planCalendar"
style=
"margin-bottom: 50px;"
></div>
<div
class=
"row"
style=
"margin-bottom: 50px;"
>
<div
class=
"col-md-10 col-lg-11"
>
<div
id=
"planCalendar"
></div>
</div>
<div
class=
"col-md-2 col-lg-1"
id=
"unscheduled-slots"
>
{% for slot in slots_unscheduled %}
<div
class=
"unscheduled-slot badge badge-primary"
data-event=
'{ "title": "{{ slot.ak.short_name }}", "duration": {"hours": "{{ slot.duration|unlocalize }}"}, "description": "{{ slot.ak.name }}", "slotID": "{{ slot.pk }}"}'
>
{{ slot.ak.short_name }} ({{ slot.duration }} h)
</div>
{% endfor %}
</div>
</div>
<a
href=
"{% url 'admin:event_status' event.slug %}"
>
{% trans "Event Status" %}
</a>
<a
href=
"{% url 'admin:event_status' event.slug %}"
>
{% trans "Event Status" %}
</a>
{% endblock %}
{% endblock %}
This diff is collapsed.
Click to expand it.
AKScheduling/views.py
+
4
−
1
View file @
2ed7a465
...
@@ -23,7 +23,10 @@ class UnscheduledSlotsAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView
...
@@ -23,7 +23,10 @@ class UnscheduledSlotsAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView
class
SchedulingAdminView
(
AdminViewMixin
,
FilterByEventSlugMixin
,
ListView
):
class
SchedulingAdminView
(
AdminViewMixin
,
FilterByEventSlugMixin
,
ListView
):
template_name
=
"
admin/AKScheduling/scheduling.html
"
template_name
=
"
admin/AKScheduling/scheduling.html
"
model
=
AKSlot
model
=
AKSlot
context_object_name
=
"
akslots
"
context_object_name
=
"
slots_unscheduled
"
def
get_queryset
(
self
):
return
super
().
get_queryset
().
filter
(
start__isnull
=
True
)
def
get_context_data
(
self
,
*
,
object_list
=
None
,
**
kwargs
):
def
get_context_data
(
self
,
*
,
object_list
=
None
,
**
kwargs
):
context
=
super
().
get_context_data
(
object_list
=
object_list
,
**
kwargs
)
context
=
super
().
get_context_data
(
object_list
=
object_list
,
**
kwargs
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment