Repository :
http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
---------------------------------------------------------------
commit a2ddb00d257ba4966b6ea11e9a0d3ffe4760cc1c
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Nov 6 08:35:03 2012 +0100
Add links to the month calendar
---------------------------------------------------------------
fedocal/fedocallib/fedora_calendar.py | 13 +++++++++----
fedocal/static/fedocal.css | 8 ++++++++
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/fedocal/fedocallib/fedora_calendar.py
b/fedocal/fedocallib/fedora_calendar.py
index 43c1807..030d30b 100644
--- a/fedocal/fedocallib/fedora_calendar.py
+++ b/fedocal/fedocallib/fedora_calendar.py
@@ -16,6 +16,7 @@ license.
from datetime import date
from calendar import HTMLCalendar
+import flask
class FedocalCalendar(HTMLCalendar):
@@ -27,16 +28,20 @@ class FedocalCalendar(HTMLCalendar):
"""
Return a day as a table cell.
"""
+ ## TODO: Fix the links so that they point to something that
+ # makes sense
cur_date = date.today()
if day == 0:
return '<td class="noday"> </td>' #
day outside month
else:
if day == cur_date.day:
- return '<td class="%s, today">%d</td>' % (
- self.cssclasses[weekday], day)
+ return '<td class="%s, today"><a
href="%s">%d</a></td>' % (
+ self.cssclasses[weekday], flask.url_for('index'),
+ day)
else:
- return '<td class="%s">%d</td>' % (
- self.cssclasses[weekday], day)
+ return '<td class="%s"><a
href="%s">%d</a></td>' % (
+ self.cssclasses[weekday], flask.url_for('index'),
+ day)
def formatmonth(self, theyear, themonth, withyear=True):
"""
diff --git a/fedocal/static/fedocal.css b/fedocal/static/fedocal.css
index 6050067..1601415 100644
--- a/fedocal/static/fedocal.css
+++ b/fedocal/static/fedocal.css
@@ -238,6 +238,14 @@ table.month td {
background-color: #fff;
}
+table.month a{
+ color: #808080;
+}
+
+table.month .today a{
+ color: #000;
+}
+
table.month td.noday {
background-color: #f9f9f9;
}