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
2506327c
Commit
2506327c
authored
1 year ago
by
Nadja Geisler
Browse files
Options
Downloads
Plain Diff
Merge branch '520-improve-wall' into 'main'
Only show necessary timeframes on AK wall Closes
#206
See merge request
!214
parents
f9a9c314
b0adc875
Branches
Branches containing commit
No related tags found
1 merge request
!214
Only show necessary timeframes on AK wall
Pipeline
#228472
passed
1 year ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
AKModel/views/status.py
+4
-3
4 additions, 3 deletions
AKModel/views/status.py
AKPlan/templates/AKPlan/plan_wall.html
+2
-0
2 additions, 0 deletions
AKPlan/templates/AKPlan/plan_wall.html
AKPlan/views.py
+25
-5
25 additions, 5 deletions
AKPlan/views.py
with
31 additions
and
8 deletions
AKModel/views/status.py
+
4
−
3
View file @
2506327c
...
...
@@ -122,14 +122,15 @@ class EventAKsWidget(TemplateStatusWidget):
"
text
"
:
_
(
"
AKs requiring special attention
"
),
"
url
"
:
reverse_lazy
(
"
admin:special-attention
"
,
kwargs
=
{
"
slug
"
:
context
[
"
event
"
].
slug
}),
},
{
])
if
context
[
"
event
"
].
ak_set
.
count
()
>
0
:
actions
.
append
({
"
text
"
:
_
(
"
Enter Interest
"
),
"
url
"
:
reverse_lazy
(
"
admin:enter-interest
"
,
kwargs
=
{
"
event_slug
"
:
context
[
"
event
"
].
slug
,
"
pk
"
:
context
[
"
event
"
].
ak_set
.
all
().
first
().
pk
}
),
},
])
})
actions
.
extend
([
{
"
text
"
:
_
(
"
Edit Default Slots
"
),
...
...
This diff is collapsed.
Click to expand it.
AKPlan/templates/AKPlan/plan_wall.html
+
2
−
0
View file @
2506327c
...
...
@@ -51,6 +51,8 @@
start
:
'
{{ start | timezone:event.timezone | date:"Y-m-d H:i:s" }}
'
,
end
:
'
{{ end | timezone:event.timezone | date:"Y-m-d H:i:s"}}
'
,
},
slotMinTime
:
'
{{ earliest_start_hour }}:00:00
'
,
slotMaxTime
:
'
{{ latest_end_hour }}:00:00
'
,
eventDidMount
:
function
(
info
)
{
$
(
info
.
el
).
tooltip
({
title
:
info
.
event
.
extendedProps
.
description
});
},
...
...
This diff is collapsed.
Click to expand it.
AKPlan/views.py
+
25
−
5
View file @
2506327c
from
datetime
import
timedelta
from
django.conf
import
settings
from
django.shortcuts
import
redirect
from
django.urls
import
reverse_lazy
...
...
@@ -81,11 +83,11 @@ class PlanScreenView(PlanIndexView):
return
redirect
(
reverse_lazy
(
"
plan:plan_overview
"
,
kwargs
=
{
"
event_slug
"
:
self
.
event
.
slug
}))
return
s
"""
def
get_queryset
(
self
):
# Determine interesting range (some hours ago until some hours in the future as specified in the settings)
now
=
datetime
.
now
().
astimezone
(
self
.
event
.
timezone
)
# Wall during event: Adjust, show only parts in the future
if
self
.
event
.
start
<
now
<
self
.
event
.
end
:
# Determine interesting range (some hours ago until some hours in the future as specified in the settings)
self
.
start
=
now
-
timedelta
(
hours
=
settings
.
PLAN_WALL_HOURS_RETROSPECT
)
else
:
self
.
start
=
self
.
event
.
start
...
...
@@ -93,13 +95,31 @@ class PlanScreenView(PlanIndexView):
# Restrict AK slots to relevant ones
# This will automatically filter all rooms not needed for the selected range in the orginal get_context method
return super().get_queryset().filter(start__gt=self.start)
"""
akslots
=
super
().
get_queryset
().
filter
(
start__gt
=
self
.
start
)
# Find the earliest hour AKs start and end (handle 00:00 as 24:00)
self
.
earliest_start_hour
=
23
self
.
latest_end_hour
=
1
for
akslot
in
akslots
.
all
():
start_hour
=
akslot
.
start
.
astimezone
(
self
.
event
.
timezone
).
hour
if
start_hour
<
self
.
earliest_start_hour
:
# Use hour - 1 to improve visibility of date change
self
.
earliest_start_hour
=
max
(
start_hour
-
1
,
0
)
end_hour
=
akslot
.
end
.
astimezone
(
self
.
event
.
timezone
).
hour
# Special case: AK starts before but ends after midnight -- show until midnight
if
end_hour
<
start_hour
:
self
.
latest_end_hour
=
24
elif
end_hour
>
self
.
latest_end_hour
:
# Always use hour + 1, since AK may end at :xy and not always at :00
self
.
latest_end_hour
=
min
(
end_hour
+
1
,
24
)
return
akslots
def
get_context_data
(
self
,
*
,
object_list
=
None
,
**
kwargs
):
context
=
super
().
get_context_data
(
object_list
=
object_list
,
**
kwargs
)
context
[
"
start
"
]
=
self
.
event
.
start
context
[
"
start
"
]
=
self
.
start
context
[
"
end
"
]
=
self
.
event
.
end
context
[
"
earliest_start_hour
"
]
=
self
.
earliest_start_hour
context
[
"
latest_end_hour
"
]
=
self
.
latest_end_hour
return
context
...
...
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