Merge lp:~rww-deactivatedaccount/loco-team-portal/608797 into lp:loco-team-portal

Proposed by rww
Status: Merged
Merged at revision: 205
Proposed branch: lp:~rww-deactivatedaccount/loco-team-portal/608797
Merge into: lp:loco-team-portal
Diff against target: 119 lines (+50/-0)
7 files modified
loco_directory/teams/urls.py (+1/-0)
loco_directory/teams/views.py (+14/-0)
loco_directory/templates/events/event_history_list.html (+4/-0)
loco_directory/templates/events/event_list.html (+1/-0)
loco_directory/templates/teams/team_detail.html (+1/-0)
loco_directory/templates/teams/team_event_history.html (+28/-0)
loco_directory/templates/teams/team_event_list.html (+1/-0)
To merge this branch: bzr merge lp:~rww-deactivatedaccount/loco-team-portal/608797
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+31302@code.launchpad.net

Description of the change

 - Adds /teams/teamname/events/history
 - Exposes relevant history page on /teams/teamname, /teams/teamname/events, and /events

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Good work!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/teams/urls.py'
2--- loco_directory/teams/urls.py 2010-07-15 07:56:44 +0000
3+++ loco_directory/teams/urls.py 2010-07-29 15:46:42 +0000
4@@ -3,6 +3,7 @@
5 urlpatterns = patterns('',
6 url(r'^$', 'teams.views.team_list', name='team-list'),
7 url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/edit$', 'teams.views.team_edit', name='team-edit'),
8+ url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/events/history$', 'teams.views.team_event_history', name='team-event-history'),
9 url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/events$', 'teams.views.team_event_list', name='team-event-list'),
10 url(r'(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)$', 'teams.views.team_detail', name='team-detail'),
11 )
12
13=== modified file 'loco_directory/teams/views.py'
14--- loco_directory/teams/views.py 2010-07-15 13:37:00 +0000
15+++ loco_directory/teams/views.py 2010-07-29 15:46:42 +0000
16@@ -72,6 +72,20 @@
17 return render_to_response('teams/team_event_list.html', context,
18 RequestContext(request))
19
20+def team_event_history(request, team_slug):
21+ """
22+ list with all team events in past for the given team
23+ """
24+ team_object = get_object_or_404(Team, lp_name=team_slug)
25+ team_event_list = team_object.teamevent_set.history_events()
26+ print team_event_list
27+ context = {
28+ 'team_object': team_object,
29+ 'team_event_list': team_event_list,
30+ }
31+ return render_to_response('teams/team_event_history.html', context,
32+ RequestContext(request))
33+
34 def team_detail(request, team_slug):
35 team_object = get_object_or_404(Team, lp_name=team_slug)
36 is_member = False
37
38=== modified file 'loco_directory/templates/events/event_history_list.html'
39--- loco_directory/templates/events/event_history_list.html 2010-07-26 00:35:03 +0000
40+++ loco_directory/templates/events/event_history_list.html 2010-07-29 15:46:42 +0000
41@@ -3,6 +3,10 @@
42
43 {% block title %}{% trans "Ubuntu LoCo Events History" %}{% endblock %}
44
45+{% block sub_nav_links %}
46+<a class="sub-nav-item" href="{% url event-list %}">{% trans "Upcoming Events" %}</a>
47+{% endblock %}
48+
49 {% block content %}
50 <article class="main-content">
51 <h2>{% trans "Ubuntu LoCo Global Events History" %}</h2>
52
53=== modified file 'loco_directory/templates/events/event_list.html'
54--- loco_directory/templates/events/event_list.html 2010-06-24 19:18:57 +0000
55+++ loco_directory/templates/events/event_list.html 2010-07-29 15:46:42 +0000
56@@ -10,6 +10,7 @@
57 {% if user.is_authenticated %}
58 <a class="sub-nav-item" href="{% url team-event-select %}">{% trans "Add Team Event" %}</a>
59 {% endif %}
60+<a class="sub-nav-item" href="{% url event-history-list %}">{% trans "Past Events" %}</a>
61 {% endblock %}
62
63 {% block search_box %}
64
65=== modified file 'loco_directory/templates/teams/team_detail.html'
66--- loco_directory/templates/teams/team_detail.html 2010-07-15 15:07:52 +0000
67+++ loco_directory/templates/teams/team_detail.html 2010-07-29 15:46:42 +0000
68@@ -120,6 +120,7 @@
69 </li>
70 {% endfor %}
71 <li><a href="{% url team-event-list team.lp_name %}">{% trans "Show detailed Event List" %}</a></li>
72+ <li><a href="{% url team-event-history team.lp_name %}">{% trans "Show detailed list of past events" %}</a></li>
73 </ul>
74 {% else %}{% trans "None Specified" %}{% endif %}
75 </td>
76
77=== added file 'loco_directory/templates/teams/team_event_history.html'
78--- loco_directory/templates/teams/team_event_history.html 1970-01-01 00:00:00 +0000
79+++ loco_directory/templates/teams/team_event_history.html 2010-07-29 15:46:42 +0000
80@@ -0,0 +1,28 @@
81+{% extends "base.html" %}
82+{% load i18n %}
83+
84+{% block title %}{% blocktrans with team_object.lp_name as teamname %}{{teamname}} Events History{% endblocktrans %}{% endblock %}
85+
86+{% block sub_nav_links %}
87+<a class="sub-nav-item" href="{% url team-detail team_object.lp_name %}">{% trans "Go back to team details" %}</a>
88+<a class="sub-nav-item" href="{% url team-event-list team_object.lp_name %}">{% trans "Upcoming Events" %}</a>
89+{% endblock %}
90+
91+{% block search %}{% endblock %}
92+
93+{% block content %}
94+<article class="main-content">
95+<h1>{% blocktrans with team_object.lp_name as teamname %}{{teamname}} Events History{% endblocktrans %}</h1>
96+
97+{% if team_event_list %}
98+<p>{% trans "Select a team event below to see more information about it:" %}</p>
99+
100+{% include "events/team_event_list.inc.html" %}
101+
102+{% else %}
103+<p>{% blocktrans with team_object.lp_name as teamname %}There are no past events for LoCo Team {{teamname}} :({% endblocktrans %}</p>
104+{% endif %}
105+
106+
107+</article>
108+{% endblock %}
109
110=== modified file 'loco_directory/templates/teams/team_event_list.html'
111--- loco_directory/templates/teams/team_event_list.html 2010-07-14 14:00:27 +0000
112+++ loco_directory/templates/teams/team_event_list.html 2010-07-29 15:46:42 +0000
113@@ -5,6 +5,7 @@
114
115 {% block sub_nav_links %}
116 <a class="sub-nav-item" href="{% url team-detail team_object.lp_name %}">{% trans "Go back to team details" %}</a>
117+<a class="sub-nav-item" href="{% url team-event-history team_object.lp_name %}">{% trans "Past Events" %}</a>
118 <a class="sub-nav-item" href="{% url team-events-rss team_object.lp_name %}" title="{% trans "Team Events (RSS)" %}"">{% trans "Team Events (RSS)" %}</a>
119 {% endblock %}
120

Subscribers

People subscribed via source and target branches