]> git.0d.be Git - panikweb.git/commitdiff
grid: use schedule constant for day start hour
authorFrédéric Péters <fpeters@0d.be>
Fri, 16 Aug 2013 13:06:51 +0000 (15:06 +0200)
committerFrédéric Péters <fpeters@0d.be>
Fri, 16 Aug 2013 13:11:51 +0000 (15:11 +0200)
panikweb/views.py

index 63be5953ee1a97dbd5599c09532c99763e1c32c8..cce87ad638307633967b323b7cac512e3b5635cd 100644 (file)
@@ -63,8 +63,8 @@ class Grid(TemplateView):
         grid = []
 
         times = ['%02d:%02d' % (x/2, x%2*30) for x in range(nb_lines)]
-        # grid starts at 5am
-        times = times[2*5:] + times[:2*5]
+        # start grid after the night programs
+        times = times[2*Schedule.DAY_HOUR_START:] + times[:2*Schedule.DAY_HOUR_START]
 
         nonstops = [[0, 2, 'Biodiversite'],
                     [2, 5, 'Reveries'],
@@ -97,8 +97,8 @@ class Grid(TemplateView):
                     grid[(row_start+step)%nb_lines][day_no] = TimeCell()
                 grid[(row_start+step)%nb_lines][day_no].add_schedule(schedule)
 
-        # start grid at 5am
-        grid = grid[2*5:] + grid[:2*5]
+        # start grid after the night programs
+        grid = grid[2*Schedule.DAY_HOUR_START:] + grid[:2*Schedule.DAY_HOUR_START]
 
         # merge adjacent cells
         for i in range(nb_lines):