Merge lp:~ronnie.vd.c/loco-team-portal/686267 into lp:loco-team-portal

Proposed by Ronnie
Status: Merged
Approved by: Chris Johnston
Approved revision: 354
Merged at revision: 357
Proposed branch: lp:~ronnie.vd.c/loco-team-portal/686267
Merge into: lp:loco-team-portal
Diff against target: 65 lines (+13/-4)
3 files modified
loco_directory/meetings/forms.py (+10/-1)
loco_directory/meetings/models.py (+1/-1)
loco_directory/templates/meetings/team_meeting_detail_basic.inc.html (+2/-2)
To merge this branch: bzr merge lp:~ronnie.vd.c/loco-team-portal/686267
Reviewer Review Type Date Requested Status
Chris Johnston Pending
Review via email: mp+45251@code.launchpad.net

Description of the change

Added the link to the details page when meeting is past

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/meetings/forms.py'
2--- loco_directory/meetings/forms.py 2011-01-05 13:38:47 +0000
3+++ loco_directory/meetings/forms.py 2011-01-05 15:52:25 +0000
4@@ -9,6 +9,7 @@
5 from userprofiles.models import UserProfile
6
7 import pytz
8+import urllib
9
10
11 class BaseMeetingForm(forms.ModelForm, RenderableMixin):
12@@ -54,7 +55,7 @@
13 """
14 class Meta(BaseMeetingForm.Meta):
15 model = TeamMeeting
16- exclude = ('teams', 'date_created')
17+ exclude = ('teams', 'date_created', 'logs')
18
19 def __init__(self, team=None, *args, **kargs):
20 super(TeamMeetingForm, self).__init__(*args, **kargs)
21@@ -74,4 +75,12 @@
22 return [('', '---------'),
23 (_('Team members'), team_members),
24 (_('Other users'), other_members)]
25+
26+ def save(self):
27+ start_date = self.cleaned_data['date_begin']
28+ self.instance.logs = 'http://irclogs.ubuntu.com/%(date)s/%(channel)s.html#t%(time)s' % {'date': start_date.strftime('%Y/%m/%d'),
29+ 'channel': urllib.quote(self.cleaned_data['channel']),
30+ 'time': start_date.strftime('%H:%M')}
31+ return super(TeamMeetingForm, self).save()
32+
33
34
35=== modified file 'loco_directory/meetings/models.py'
36--- loco_directory/meetings/models.py 2010-12-24 13:04:51 +0000
37+++ loco_directory/meetings/models.py 2011-01-05 15:52:25 +0000
38@@ -38,7 +38,7 @@
39 ''' % {'id':self.id, 'dtstart':dtstart, 'dtend':dtend, 'meetingname':self.name}
40
41 def is_past(self):
42- return self.date_end > datetime.datetime.today()
43+ return self.date_end < datetime.datetime.today()
44
45 class TeamMeetingManager(models.Manager):
46 """ manager for a team event """
47
48=== modified file 'loco_directory/templates/meetings/team_meeting_detail_basic.inc.html'
49--- loco_directory/templates/meetings/team_meeting_detail_basic.inc.html 2010-12-25 19:17:12 +0000
50+++ loco_directory/templates/meetings/team_meeting_detail_basic.inc.html 2011-01-05 15:52:25 +0000
51@@ -39,12 +39,12 @@
52 <td class="form-item-value"><a href="{{ team_meeting_object.minutes }}">{{ team_meeting_object.minutes }}</a></td>
53 </tr>
54 {% endif %}
55- {% if team_meeting_object.logs %}
56+ {% if team_meeting_object.logs %}{% if team_meeting_object.is_past %}
57 <tr>
58 <th class="form-item-label" scope="row"><label>{% trans "Meeting Logs:" %}</label></th>
59 <td class="form-item-value"><a href="{{ team_meeting_object.logs }}">{{ team_meeting_object.logs }}</a></td>
60 </tr>
61- {% endif %}
62+ {% endif %}{% endif %}
63 {% endif %}
64 </table>
65 {% endif %}

Subscribers

People subscribed via source and target branches