diff options
author | goatchurch <devnull@localhost> | 2009-07-27 13:43:43 +0100 |
---|---|---|
committer | goatchurch <devnull@localhost> | 2009-07-27 13:43:43 +0100 |
commit | b135ab64e7873169e8a3c973f3ea9d0fbb18e319 (patch) | |
tree | 67f694c380bf3db61f9f5e13f182cc7d5d3b3b23 /core/views_other.py | |
parent | 694fe4b4d8325a62489ac5142942fd61598a7612 (diff) | |
download | troggle-b135ab64e7873169e8a3c973f3ea9d0fbb18e319.tar.gz troggle-b135ab64e7873169e8a3c973f3ea9d0fbb18e319.tar.bz2 troggle-b135ab64e7873169e8a3c973f3ea9d0fbb18e319.zip |
[svn] full checkin. animations disabled, sorry
Diffstat (limited to 'core/views_other.py')
-rw-r--r-- | core/views_other.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/views_other.py b/core/views_other.py index e3ecb10..b2b4a69 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -45,13 +45,23 @@ def todo(request): totallogbookentries = LogbookEntry.objects.count()
return render_with_context(request,'index.html', {'expeditions':expeditions, 'all':'all', 'totallogbookentries':totallogbookentries, "message":message})
-def calendar(request,year):
+def calendar(request, year):
week=['S','S','M','T','W','T','F']
- if year:
- expedition=Expedition.objects.get(year=year)
- PersonExpeditions=expedition.personexpedition_set.all()
+ expedition = Expedition.objects.get(year=year)
+ personexpeditions = expedition.personexpedition_set.all()
- return render_with_context(request,'calendar.html', locals())
+ listdays = [ ] # the columns of the table
+ date = expedition.date_from
+ while date <= expedition.date_to:
+ listdays.append(date)
+ date += datetime.timedelta(days=1)
+
+ personexpeditiondays = [ ]
+ for personexpedition in personexpeditions:
+ pelistdays = [ (personexpedition.date_from and (personexpedition.date_from <= date < personexpedition.date_to)) for date in listdays ]
+ personexpeditiondays.append([personexpedition, pelistdays])
+
+ return render_with_context(request,'calendar.html', {"expedition":expedition, "listdays":listdays, "personexpeditiondays":personexpeditiondays})
def controlPanel(request):
jobs_completed=[]
|