Merge lp:~daker/loco-team-portal/fix.events.history into lp:loco-team-portal

Proposed by Adnane Belmadiaf
Status: Merged
Approved by: Adnane Belmadiaf
Approved revision: 608
Merged at revision: 607
Proposed branch: lp:~daker/loco-team-portal/fix.events.history
Merge into: lp:loco-team-portal
Diff against target: 257 lines (+209/-21)
2 files modified
loco_directory/teams/views.py (+4/-4)
loco_directory/templates/teams/team_event_history.html (+205/-17)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.events.history
Reviewer Review Type Date Requested Status
LoCo Team Portal Developers Pending
Review via email: mp+147517@code.launchpad.net

Commit message

Fixed events history page

Description of the change

To post a comment you must log in.
608. By Adnane Belmadiaf

Css fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/teams/views.py'
2--- loco_directory/teams/views.py 2012-12-25 22:00:46 +0000
3+++ loco_directory/teams/views.py 2013-02-09 17:17:19 +0000
4@@ -120,11 +120,11 @@
5 """
6 list with all team events in past for the given team
7 """
8- team_object = get_object_or_404(Team, lp_name=team_slug)
9- team_event_list = team_object.teamevent_set.history_events()
10+ team = get_object_or_404(Team, lp_name=team_slug)
11+ team_events = team.teamevent_set.history_events()
12 context = {
13- 'team_object': team_object,
14- 'team_event_list': team_event_list,
15+ 'team': team,
16+ 'team_events': team_events,
17 }
18 return render_to_response('teams/team_event_history.html', context,
19 RequestContext(request))
20
21=== modified file 'loco_directory/templates/teams/team_event_history.html'
22--- loco_directory/templates/teams/team_event_history.html 2012-06-02 11:50:27 +0000
23+++ loco_directory/templates/teams/team_event_history.html 2013-02-09 17:17:19 +0000
24@@ -1,27 +1,215 @@
25 {% extends "base.html" %}
26-{% load i18n %}
27+{% load i18n teams_tags %}
28
29 {% block page_name %}{% blocktrans with team_object.name as teamname %}{{teamname}} Events History{% endblocktrans %}{% endblock %}
30
31 {% block sub_nav_links %}
32-<li><a class="sub-nav-item" href="{% url team-detail team_object.lp_name %}">{% trans "Back to Team Details" %}</a></li>
33-<li><a class="sub-nav-item" href="{% url team-event-list team_object.lp_name %}">{% trans "Upcoming Events" %}</a></li>
34+ <li><a class="sub-nav-item" href="{% url team-list %}" title="{% trans "Back to Teams List" %}">{% trans "Back to Teams List" %}</a></li>
35+ {% if is_member %}{% else %}<li><a class="sub-nav-item" href="https://launchpad.net/~{{ team.lp_name }}/+join">{% trans "Join This Team!" %}</a></li>{% endif %}
36+ {% if is_admin %}<li><a class="sub-nav-item" href="{% url team-edit team.lp_name %}" title="{% trans "Edit Details" %}">{% trans "Edit Details" %}</a></li>{% endif %}
37+ {% if is_admin and not team.active %}<li><a class="sub-nav-item" href="{% url select-other-team team.lp_name %}" title="{% trans "Merge with another team" %}">{% trans "Merge team" %}</a></li>{% endif %}
38+ {% if is_member %}<li><a class="sub-nav-item" href="{% url team-event-new team.lp_name %}" title="{% trans "Add New Event" %}">{% trans "Add New Event" %}</a></li>{% endif %}
39+ {% if is_member %}<li><a class="sub-nav-item" href="{% url team-meeting-new team.lp_name %}" title="{% trans "Add New Meeting" %}">{% trans "Add New Meeting" %}</a></li>{% endif %}
40+{% endblock %}
41+
42+
43+{% block extrahead %}{{ block.super }}
44+<link type="application/rss+xml" rel="alternate" title="{% trans "Team (RSS)" %}" href="/feeds/teams/{{ team.lp_name }}" />
45 {% endblock %}
46
47 {% block content %}
48 <div class="row">
49-<section class="span-12">
50-<h1>{% blocktrans with team_object.name as teamname %}{{teamname}} Events History{% endblocktrans %}</h1>
51-
52-{% if team_event_list %}
53-<p>{% trans "Select a team event below to see more information about it:" %}</p>
54-
55-{% include "events/team_event_list.inc.html" %}
56-
57-{% else %}
58-<p>{% blocktrans with team_object.lp_name as teamname %}There are no past events for LoCo Team {{teamname}} :({% endblocktrans %}</p>
59-{% endif %}
60-
61-</section>
62+ <section class="span-9">
63+ <div class="box_content">
64+ <div class="pagelet">
65+ <div id="locobranding">
66+ <img src="{{ team.mugshot_url }}" alt="{{ team.name }}" title="{{ team.name }}" />
67+ </div>
68+ <div id="loco-name">
69+ <h2>{{ team.name }} <a class="contact-button" href="https://launchpad.net/~{{ team.lp_name }}/+contactuser/" title="{% trans "Contact this team" %}" target="_blank">{% trans "Contact this team" %}</a></h2>
70+ <div style="display:block;">
71+ <div id="loco-location">
72+ <span title="{% trans "Location" %}" class="pictogram place"></span>
73+ <span class="value ellipsis small-ellipsis">
74+ {% if team.countries.all %}
75+ {% for country in team.countries.all %}
76+ {% if not forloop.first %}, {% endif %}{{ country.name }}
77+ {% endfor %}
78+ {% if team.spr %}, {% trans team.spr %}{% endif %}{% if team.city %}, {% trans team.city %}
79+ {% endif %}
80+ {% else %}
81+ {% trans "None Specified" %}
82+ {% endif %}
83+ </span>
84+ </div>
85+
86+ <div id="loco-language">
87+ <span title="{% trans "Languages" %}" class="pictogram language"></span>
88+ <span class="value ellipsis">
89+ {% if team.languages.all %}
90+ {% for language in team.languages.all %}
91+ {% if not forloop.first %}, {% endif %}{{ language.name }}
92+ {% endfor %}
93+ {% else %}
94+ {% trans "None Specified" %}
95+ {% endif %}
96+ </span>
97+ </div>
98+
99+ <div id="loco-support">
100+ <span title="{% trans "Local Support" %}" class="pictogram support"></span>
101+ <span class="value ellipsis medium-ellipsis">
102+ {% if team.provides_support %}
103+ {% trans "This LoCo provides support :)" %}
104+ {% else %}
105+ {% trans "This LoCo doesn't provide support :(" %}
106+ {% endif %}
107+ </span>
108+ </div>
109+ </div>
110+
111+ <div style="display:block;">
112+ <div id="loco-location">
113+ <span title="{% trans "Resources" %}" class="pictogram ml"></span>
114+ <span class="value ellipsis small-ellipsis">
115+ {% if team.web_url %}
116+ <a href="{{ team.web_url }}" title="{% trans "Website" %}" target="_blank">
117+ {% trans "Website" %}
118+ </a>
119+ {% endif %}
120+ {% if team.web_url and team.wiki_url %} / {% endif %}
121+ {% if team.wiki_url %}
122+ <a href="{{ team.wiki_url }}" title="{% trans "Wiki" %}" target="_blank">
123+ {% trans "Wiki" %}
124+ </a>
125+ {% endif %}
126+ </span>
127+ </div>
128+
129+
130+ <div id="loco-support">
131+ <span class="pictogram forums" title="{% trans "Support" %}"></span>
132+ <span class="value ellipsis">
133+ {% if team.ml_url %}
134+ <a href="{{ team.ml_url }}" title="{% trans "Mailing List" %}" target="_blank">
135+ {% trans "Mailing List" %}
136+ </a>
137+ {% endif %} /
138+ {% if team.forum_url %}
139+ <a href="{{ team.forum_url }}" title="{% trans "Forums" %}" target="_blank">
140+ {% trans "Forums" %}
141+ </a>
142+ {% endif %} /
143+ {% if team.irc_chan %}
144+ <a href="http://webchat.freenode.net/?channels={{ team.irc_chan }}&prompt=1&uio=OT10cnVlJjEwPXRydWUmMTE9MjM218&nick={% if user.is_authenticated %}{{ user.username|irc }}{% else %}locodir-user{% endif %}" title="{% trans "IRC" %}" target="_blank">
145+ {% trans "IRC" %}
146+ </a>
147+ {% endif %}
148+ </span>
149+ </div>
150+
151+ <div id="loco-support">
152+ <span title="{% trans "Reapproval Date:" %}" class="pictogram calendar"></span>
153+ <span class="value ellipsis medium-ellipsis">
154+ {% if team.approved %}
155+ {% trans "Reapproval Date:" %} {{ team.expires_date }}
156+ {% endif %}
157+ </span>
158+ </div>
159+
160+ </div>
161+ </div>
162+ </div>
163+ <div class="events-meetings-wrapper">
164+ <div style="overflow: auto; margin-bottom: 10px;border-bottom: 1px solid #E6E6E6;">
165+ <h3 class="title">{% trans "Past Events" %}</h3>
166+ <div class="team-actions">
167+ <span>
168+ <a href="{% url team-event-list team.lp_name %}" title="{% trans "All Events" %}">{% trans "All Events" %}</a>
169+ </span>
170+ <span>
171+ <a href="{% url team-meeting-list team.lp_name %}" title="{% trans "All Meetings" %}">{% trans "All Meetings" %}</a>
172+ </span>
173+ <span>
174+ <a href="{% url team-event-history team.lp_name %}" title="{% trans "Past Events" %}">{% trans "Past Events" %}</a>
175+ </span>
176+ <span>
177+ <a class="pictogram rss action" href="/feeds/teams/{{ team.lp_name }}/" title="{% trans "RSS Feed" %}"></a>
178+ </span>
179+ <span>
180+ <a class="pictogram ical action" href="{% url team-calendar team.lp_name %}" title="{% trans "iCal Feed" %}"></a>
181+ </span>
182+ </div>
183+ </div>
184+ {% if team_events %}
185+ {% regroup team_events by date_begin|date:"Y" as events %}
186+ {% for year in events %}
187+ <a name="y{{ year.grouper }}"></a>
188+ <div style="font-size: 12px;float: right; padding-top: 10px;padding-right: 15px;">
189+ <span style="margin-left: 10px; text-transform: uppercase;">{% trans "Browse by year" %} </span>
190+ {% for y in events %}
191+ <span style="margin-left: 10px;">
192+ {% if y == year %}
193+ {{ y.grouper }}
194+ {% else %}
195+ <a href="#y{{ y.grouper }}" title="{{ y.grouper }}">{{ y.grouper }}</a>
196+ {% endif %}
197+ </span>
198+ {% endfor %}
199+ </div>
200+ <h3 style="padding-left: 15px;">{{ year.grouper }}
201+ {% with events_count=year.list|length %}
202+ ({% blocktrans with events_count as events_count %}{{ events_count }} events{% endblocktrans %})
203+ {% endwith %}
204+ </h3>
205+ {% for event in year.list %}
206+ <a href="{{ event.get_absolute_url }}" title="{% if event.venue %}{% else %}{{event.date_begin|date:"M d"}}{% endif %}" class="event-meetings">
207+ <span class="title">{{ event.name }}</span>
208+ <small>{{ event.local_date_begin|date:"l, d N Y" }} {% trans "at " %}{{ event.local_date_begin|date:"H:i T" }}</small>
209+ <p>{{ event.description|truncatewords:50 }}</p>
210+ </a>
211+ {% endfor %}
212+ {% endfor %}
213+ {% else %}
214+ <div class="no-results">
215+ {% trans "There team has no events yet :(" %}
216+ </div>
217+ {% endif %}
218+ </div>
219+ </div>
220+ </section>
221+ <section class="span-3 box_content last">
222+ <div class="sidebar-inner">
223+ <h3 class="title">{% trans "Team Admin(s)" %}</h3>
224+ <div class="team-admins">
225+ {% for admin in team.admin_profiles.all %}
226+ {% ifequal team.owner admin.user.username %}
227+ <a href="{% url profile-detail admin.user.username %}">
228+ <img alt="" class="photo fn" src="{% if admin.mugshot %}{{ admin.mugshot }}{% else %}{{MEDIA_URL}}img/default-mugshot.png{% endif %}" class="mugshot">
229+ <p>{{ admin.realname }}</p>
230+ </a>
231+ {% else %}
232+ <a href="{% url profile-detail admin.user.username %}">
233+ <img alt="{{ admin.realname }}" src="{% if admin.mugshot %}{{ admin.mugshot }}{% else %}{{MEDIA_URL}}img/default-mugshot.png{% endif %}" class="mugshot" height="50" width="50">
234+ <p>{{ admin.realname }}</p>
235+ </a>
236+ {% endifequal %}
237+ {% endfor %}
238+ </div>
239+ <h3 class="title">{% trans "Team Contact(s)" %}</h3>
240+ <div class="team-admins">
241+ {% if team.contact_profiles.all %}
242+ {% for contact in team.contact_profiles.all %}
243+ <a href="{% url profile-detail contact.user.username %}">
244+ <img alt="{{ contact.realname }}" src="{% if contact.mugshot %}{{ contact.mugshot }}{% else %}{{MEDIA_URL}}img/default-mugshot.png{% endif %}" class="mugshot" height="50" width="50">
245+ <p>{{ contact.realname }}</p>
246+ </a>
247+ {% endfor %}
248+ {% else %}
249+ <p>{% trans "No LoCo Team contacts are set." %}</p>
250+ {% endif %}
251+ </div>
252+ </div>
253+ </section>
254 </div>
255-{% endblock %}
256+{% endblock %}
257\ No newline at end of file

Subscribers

People subscribed via source and target branches