Repository : http://git.fedorahosted.org/cgit/fedocal.git
On branch : master
commit 53e3d70c7736e07afabf0daa34d5f8bd49085207 Author: Johan Cwiklinski johan@x-tnd.be Date: Mon Nov 5 22:58:09 2012 +0100
Header and calendar colors as in mockup
fedocal/fedocallib/__init__.py | 2 +- fedocal/fedocallib/fedora_calendar.py | 4 ++-- fedocal/static/fedocal.css | 26 ++++++++++++++++++++++++++ fedocal/templates/agenda.html | 5 +---- fedocal/tests/test_fedocallib.py | 17 ++++++++--------- 5 files changed, 38 insertions(+), 16 deletions(-)
diff --git a/fedocal/fedocallib/__init__.py b/fedocal/fedocallib/__init__.py index c63eafe..e0cb601 100644 --- a/fedocal/fedocallib/__init__.py +++ b/fedocal/fedocallib/__init__.py @@ -208,7 +208,7 @@ def get_meetings(session, calendar, year=None, month=None, day=None): start_time = '0%i' % start_time if len(str(stop_time)) == 1: stop_time = '0%i' % stop_time - key = '%s:%s' % (start_time, stop_time) + key = '%sh - %sh' % (start_time, stop_time) day = meeting.meeting_date.weekday() if key in meetings: if meetings[key][day]: diff --git a/fedocal/fedocallib/fedora_calendar.py b/fedocal/fedocallib/fedora_calendar.py index 7d0ad83..093a7ba 100644 --- a/fedocal/fedocallib/fedora_calendar.py +++ b/fedocal/fedocallib/fedora_calendar.py @@ -31,8 +31,8 @@ class FedocalCalendar(HTMLCalendar): a('\n') a(self.formatmonthname(theyear, themonth, withyear=withyear)) a('\n') - a(self.formatweekheader()) - a('\n') + #a(self.formatweekheader()) + #a('\n') for week in self.monthdays2calendar(theyear, themonth): a(self.formatweek(week)) a('\n') diff --git a/fedocal/static/fedocal.css b/fedocal/static/fedocal.css index d0d40ad..ce8df93 100644 --- a/fedocal/static/fedocal.css +++ b/fedocal/static/fedocal.css @@ -77,6 +77,13 @@ section nav { #content section > header { margin-left: -200px; /* Left align with menu */ margin-bottom: .5em; + background: url(calendar.png) 0 50% no-repeat; + padding-left: 40px; + color: #666; +} + +#content section > header p { + font-style: italic; }
#content { @@ -215,3 +222,22 @@ section nav { #home:hover a { color: #fff; } + +table.month { + margin: 0 auto; + border-collapse: collapse; + margin-bottom: .5em; +} + +table.month td { + text-align: center; + border: 1px solid #e6e6e6; + color: #808080; + font-weight: bold; + padding: .2em; + background-color: #fff; +} + +table.month td.noday { + background-color: #f9f9f9; +} diff --git a/fedocal/templates/agenda.html b/fedocal/templates/agenda.html index 60b1bac..fec9462 100644 --- a/fedocal/templates/agenda.html +++ b/fedocal/templates/agenda.html @@ -11,9 +11,6 @@ <h2> <a href="{{url_for('ical_out', calendar_name=calendar.calendar_name)}}"> - <img src="{{url_for('static', filename='calendar.png')}}" - alt="iCal feed" - title="Add this calendar to your agenda"/> </a> {{ calendar.calendar_name }} </h2> @@ -38,7 +35,7 @@ <div id='agenda'> <table> <tr> - <th class="time">{{ month }}</th> + <th></th> {% for day in weekdays %} <th> {{ day }}</th> {% endfor %} diff --git a/fedocal/tests/test_fedocallib.py b/fedocal/tests/test_fedocallib.py index b813371..8451add 100644 --- a/fedocal/tests/test_fedocallib.py +++ b/fedocal/tests/test_fedocallib.py @@ -51,7 +51,6 @@ from tests import Modeltests, TODAY RESULT_201211_HTML = """ <table class="month"> <tr><th colspan="7" class="month">November 2012</th></tr> -<tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr> <tr><td class="mon">5</td><td class="tue">6</td><td class="wed">7</td><td class="thu">8</td><td class="fri">9</td><td class="sat">10</td><td class="sun">11</td></tr> <tr><td class="mon">12</td><td class="tue">13</td><td class="wed">14</td><td class="thu">15</td><td class="fri">16</td><td class="sat">17</td><td class="sun">18</td></tr> @@ -184,7 +183,7 @@ class Fedocallibtests(Modeltests): meetings = fedocallib.get_meetings(self.session, calendar) self.assertNotEqual(meetings, None) cnt = 0 - for meeting in meetings['19:20']: + for meeting in meetings['19h - 20h']: if meeting is not None: for meet in meeting: self.assertTrue(meet.meeting_name in @@ -193,14 +192,14 @@ class Fedocallibtests(Modeltests): else: cnt = cnt + 1 self.assertEqual(cnt, 6) - self.assertEqual(meetings['15:16'][0], None) + self.assertEqual(meetings['15h - 16h'][0], None)
new_day = TODAY + timedelta(days=10) meetings = fedocallib.get_meetings(self.session, calendar, new_day.year, new_day.month, new_day.day) self.assertNotEqual(meetings, None) cnt = 0 - for meeting in meetings['14:15']: + for meeting in meetings['14h - 15h']: if meeting is not None: for meet in meeting: self.assertEqual(meet.meeting_name, 'test-meeting2') @@ -208,7 +207,7 @@ class Fedocallibtests(Modeltests): cnt = cnt + 1 self.assertEqual(cnt, 6) cnt = 0 - for meeting in meetings['15:16']: + for meeting in meetings['15h - 16h']: if meeting is not None: for meet in meeting: self.assertEqual(meet.meeting_name, 'test-meeting2') @@ -216,7 +215,7 @@ class Fedocallibtests(Modeltests): cnt = cnt + 1 self.assertEqual(cnt, 6) cnt = 0 - for meeting in meetings['02:03']: + for meeting in meetings['02h - 03h']: if meeting is not None: for meet in meeting: self.assertEqual(meet.meeting_name, @@ -224,7 +223,7 @@ class Fedocallibtests(Modeltests): else: cnt = cnt + 1 self.assertEqual(cnt, 6) - self.assertEqual(meetings['19:20'][0], None) + self.assertEqual(meetings['19h - 20h'][0], None)
def test_get_meetings_with_multiple_same_time(self): """ Test the get_meetings function when there are several @@ -233,7 +232,7 @@ class Fedocallibtests(Modeltests): calendar = model.Calendar.by_id(self.session, 'test_calendar4') meetings = fedocallib.get_meetings(self.session, calendar) cnt = 0 - for meeting in meetings['14:15']: + for meeting in meetings['14h - 15h']: if meeting is not None: for meet in meeting: self.assertTrue(meet.meeting_name in @@ -242,7 +241,7 @@ class Fedocallibtests(Modeltests): cnt = cnt + 1 self.assertEqual(cnt, 6) cnt = 0 - for meeting in meetings['15:16']: + for meeting in meetings['15h - 16h']: if meeting is not None: for meet in meeting: self.assertTrue(meet.meeting_name in
fedocal-devel@lists.fedorahosted.org