Skip to content
Snippets Groups Projects
Commit 69f3dd02 authored by Nadja Geisler's avatar Nadja Geisler :sunny:
Browse files

Merge branch 'fix-akwall-date-range' into 'master'

Restrict AKWall to dates belonging to the corresponding event

Closes #57

See merge request kif/akplanning!20
parents 39a761c1 062ceb9e
No related branches found
No related tags found
1 merge request!20Restrict AKWall to dates belonging to the corresponding event
...@@ -60,8 +60,12 @@ class PlanScreenView(PlanIndexView): ...@@ -60,8 +60,12 @@ class PlanScreenView(PlanIndexView):
def get_queryset(self): def get_queryset(self):
# Determine interesting range (some hours ago until some hours in the future as specified in the settings) # Determine interesting range (some hours ago until some hours in the future as specified in the settings)
self.start = datetime.now().astimezone(self.event.timezone) - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT) now = datetime.now().astimezone(self.event.timezone)
self.end = self.start + timedelta(hours=(settings.PLAN_WALL_HOURS_RETROSPECT + settings.PLAN_WALL_HOURS_FUTURE)) if self.event.start < now < self.event.end:
self.start = now - timedelta(hours=settings.PLAN_WALL_HOURS_RETROSPECT)
else:
self.start = self.event.start
self.end = self.event.end
# Restrict AK slots to relevant ones # Restrict AK slots to relevant ones
# This will automatically filter all rooms not needed for the selected range in the orginal get_context method # This will automatically filter all rooms not needed for the selected range in the orginal get_context method
......
...@@ -161,7 +161,6 @@ FOOTER_INFO = { ...@@ -161,7 +161,6 @@ FOOTER_INFO = {
PLAN_MAX_NEXT_AKS = 10 PLAN_MAX_NEXT_AKS = 10
# Specify range of plan for screen/projector view # Specify range of plan for screen/projector view
PLAN_WALL_HOURS_RETROSPECT = 3 PLAN_WALL_HOURS_RETROSPECT = 3
PLAN_WALL_HOURS_FUTURE = 18
# Should the plan use a hierarchy of buildings and rooms? # Should the plan use a hierarchy of buildings and rooms?
PLAN_SHOW_HIERARCHY = True PLAN_SHOW_HIERARCHY = True
# For which time (in seconds) should changes of akslots be highlighted in plan? # For which time (in seconds) should changes of akslots be highlighted in plan?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment