Permalink
Browse files

permettre de filtrer a partir dune date quon clique

  • Loading branch information...
juliend2
juliend2 committed Mar 2, 2010
1 parent f608277 commit 9a867f3544f0ab590babc899a142491039447452
Showing with 18 additions and 2 deletions.
  1. +2 −0 .gitignore
  2. +12 −1 index.py
  3. +4 −1 static/styles.css
View
@@ -2,3 +2,5 @@
*.pyc
*.swp
timefiles/
+.htaccess
+.htpasswd
View
@@ -3,7 +3,9 @@
import os
import re
+import cgi
import datetime
+import types
from temps import TempsDate,HourBloc,jourdesemaine
import locale
@@ -27,6 +29,15 @@
dirList=os.listdir(path) # get the files in the directory
dirList.sort()
+qs = cgi.FieldStorage()
+try:
+ from_date = qs.getvalue('from')
+ if type(from_date) is not None:
+ dirList = dirList[dirList.index(from_date+'.txt'):]
+except :
+ pass
+print '<p>'+str(len(dirList)) + ' jours calcul&eacute;s</p>'
+print '<h1><a href="index.py">Voir Tous</a></h1>'
for fname in dirList:
match = re.match('(\d\d)\-(\d\d)\-(\d\d)\.txt', fname) # get the txt files
if match:
@@ -48,7 +59,7 @@
if currentdate.weekday() == 0:
print '</tr><tr>'
print '<td valign="top" width="14%"><span class="weekday">'+jourdesemaine(currentdate.weekday())+'</span>'
- print '<h1>'+currentdate.strftime("%d %B %Y") + '</h1>'
+ print '<h1><a href="index.py?from='+currentdate.strftime("%y-%m-%d")+'">'+currentdate.strftime("%d %B %Y") + '</a></h1>'
currTemps = datetime.date(currentdate.year, currentdate.month, currentdate.day)
if currTemps in dateslist:
tdateobj = TempsDate(currentdate.strftime("%y"), currentdate.month, currentdate.day)
View
@@ -17,6 +17,9 @@ h1 {
padding-top: 0.4em;
padding-bottom: 0.5em;
}
+h1 a {
+ color: #333;
+}
h2 {
font-size: 1.5em;
}
@@ -57,4 +60,4 @@ dd {
float: left;
clear: right;
font-weight: bold;
-}
+}

0 comments on commit 9a867f3

Please sign in to comment.