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

Proposed by Adnane Belmadiaf on 2012-04-14
Status: Merged
Approved by: Chris Johnston on 2012-06-30
Approved revision: 530
Merged at revision: 539
Proposed branch: lp:~daker/loco-team-portal/fix.978901
Merge into: lp:loco-team-portal
Diff against target: 269 lines (+84/-101)
7 files modified
loco_directory/events/urls.py (+0/-1)
loco_directory/events/views.py (+18/-30)
loco_directory/templates/events/team_event_comment_new.html (+0/-33)
loco_directory/templates/events/team_event_comment_new.inc.html (+24/-0)
loco_directory/templates/events/team_event_detail.html (+12/-3)
loco_directory/templates/events/team_event_detail.inc.html (+30/-28)
loco_directory/templates/events/team_event_detail_comments.inc.html (+0/-6)
To merge this branch: bzr merge lp:~daker/loco-team-portal/fix.978901
Reviewer Review Type Date Requested Status
Chris Johnston 2012-04-14 Approve on 2012-06-30
Review via email: mp+102019@code.launchpad.net

Commit Message

Moved the comment form to the page details

To post a comment you must log in.
Chris Johnston (cjohnston) wrote :

Please fix conflicts:

Contents conflict in loco_directory/templates/events/team_event_comment_new.html
Text conflict in loco_directory/templates/events/team_event_detail.html
Text conflict in loco_directory/templates/events/team_event_detail.inc.html

review: Needs Fixing
528. By Adnane Belmadiaf on 2012-06-30

* Merged trunk
* Fixed conflicts

Chris Johnston (cjohnston) wrote :

Line 167 below, the team is missing <li></li>

review: Needs Fixing
529. By Adnane Belmadiaf on 2012-06-30

* Added missing <li>

Chris Johnston (cjohnston) wrote :

Change to:

<div class="row">
    <section class="span-8">

and change the <legend> to an <h3>

Look at view-source:http://summit.linuxplumbersconf.org/lpc-2012/create_meeting/ for more info

review: Needs Fixing
Chris Johnston (cjohnston) wrote :

and the social stuff probably should be above the comments stuff, not below.

530. By Adnane Belmadiaf on 2012-06-30

* Some ui changes

Chris Johnston (cjohnston) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/events/urls.py'
2--- loco_directory/events/urls.py 2012-02-15 15:56:28 +0000
3+++ loco_directory/events/urls.py 2012-06-30 19:01:18 +0000
4@@ -25,7 +25,6 @@
5 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/(?P<team_event_id>\d+)/detail/$', 'events.views.team_event_detail', name='team-event-detail'),
6 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/(?P<team_event_id>\d+)/delete/$', 'events.views.team_event_delete', name='team-event-delete'),
7 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/(?P<team_event_id>\d+)/update/$', 'events.views.team_event_update', name='team-event-update'),
8- url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/(?P<team_event_id>\d+)/comment/$', 'events.views.team_event_comment_new', name='team-event-comment-new'),
9 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/(?P<team_event_id>\d+)/copy/$', 'events.views.team_event_copy', name='team-event-copy'),
10 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/add/$', 'events.views.team_event_new', name='team-event-new'),
11 url(r'^(?P<team_slug>[a-zA-Z0-9\-\.\+?]+)/rss/$', 'events.views.team_events_rss', name='team-events-rss'),
12
13=== modified file 'loco_directory/events/views.py'
14--- loco_directory/events/views.py 2012-03-22 21:57:48 +0000
15+++ loco_directory/events/views.py 2012-06-30 19:01:18 +0000
16@@ -140,10 +140,28 @@
17 for team_object in team_event_object.teams.all():
18 is_member = is_member or launchpad.is_team_member(request.user, team_object)
19
20+ if request.user.is_authenticated():
21+ if request.method == 'POST':
22+ form = TeamEventCommentForm(data=request.POST)
23+ if form.is_valid():
24+ team_event_comment = form.save(commit=False)
25+ team_event_comment.team_event = team_event_object
26+ from userprofiles.models import create_profile
27+ profile = create_profile(request.user.username)
28+ team_event_comment.commenter_profile = profile
29+ team_event_comment.save()
30+ request.user.message_set.create(message=_('Comment saved.'))
31+ return redirect( team_event_object )
32+ else:
33+ form = TeamEventCommentForm()
34+ else:
35+ form = None
36+
37 context = {
38 'team_event_object': team_event_object,
39 'user_is_attending': team_event_object.is_attending(request.user),
40 'user_is_team_member': is_member,
41+ 'form': form,
42 }
43 return render_to_response('events/team_event_detail.html',
44 context, RequestContext(request))
45@@ -354,36 +372,6 @@
46 return render_to_response('events/team_event_register.html',
47 context, RequestContext(request))
48
49-@login_required
50-def team_event_comment_new(request, team_slug, team_event_id):
51- """
52- create a comment for a team event
53- """
54- team_event_object = get_object_or_404(TeamEvent, pk=team_event_id)
55-
56- if request.method == 'POST':
57- form = TeamEventCommentForm(data=request.POST)
58- if form.is_valid():
59- team_event_comment = form.save(commit=False)
60- team_event_comment.team_event = team_event_object
61- from userprofiles.models import create_profile
62- profile = create_profile(request.user.username)
63- team_event_comment.commenter_profile = profile
64- team_event_comment.save()
65- request.user.message_set.create(message=_('Comment saved.'))
66- return redirect( team_event_object )
67- else:
68- form = TeamEventCommentForm()
69-
70- context = {
71- 'team_event_object': team_event_object,
72- 'form': form,
73- }
74- return render_to_response('events/team_event_comment_new.html',
75- context, RequestContext(request))
76-
77-
78-
79
80 #################################################################
81 # Global Events
82
83=== removed file 'loco_directory/templates/events/team_event_comment_new.html'
84--- loco_directory/templates/events/team_event_comment_new.html 2012-06-07 04:19:26 +0000
85+++ loco_directory/templates/events/team_event_comment_new.html 1970-01-01 00:00:00 +0000
86@@ -1,33 +0,0 @@
87-{% extends "base.html" %}
88-{% load i18n %}
89-
90-{% block page_name %}{% trans "Team Event Comment" %}{% endblock %}
91-
92-{% block extrahead %}{{ block.super }}
93-{{form.media}}
94-{% endblock %}
95-
96-{% block extrafooter %}
97-<script type="text/javascript"><!--
98-$(document).ready(function(){
99- $('span[rel*=help]').colorTip({color:'orange'});
100-});
101---></script>
102-{% endblock %}
103-
104-{% block content %}
105-<div class="row">
106-<section class="span-9">
107- <form action="." method="post">
108- <fieldset>
109- <h3>{% trans "Team Event Comment" %}</h3>
110- {{ form.as_template }}
111- </fieldset>
112- {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}
113- <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" />
114- </form>
115-</section></div>
116-
117-{% include "events/team_event_detail.inc.html" %}
118-
119-{% endblock %}
120
121=== added file 'loco_directory/templates/events/team_event_comment_new.inc.html'
122--- loco_directory/templates/events/team_event_comment_new.inc.html 1970-01-01 00:00:00 +0000
123+++ loco_directory/templates/events/team_event_comment_new.inc.html 2012-06-30 19:01:18 +0000
124@@ -0,0 +1,24 @@
125+{% load i18n %}
126+
127+{% if user.is_authenticated %}
128+<div class="row">
129+ <section class="span-8">
130+ <form action="." method="post">
131+ <fieldset>
132+ <h3>{%trans "Team Event Comment" %}</h3>
133+ {{ form.as_template }}
134+ </fieldset>
135+ {% if is_popup %}<input type="hidden" name="_popup" value="1">{% endif %}
136+ <input type="submit" name="submit" value="{% trans "Submit" %}" class="submit-button" />
137+ </form>
138+ </section>
139+</div>
140+
141+{% else %}
142+
143+<div class="row">
144+ <section class="span-8">
145+ {% blocktrans with team_event_object.get_absolute_url as login_next %}To post your comment you need to <a href="openid/login/?next={{ login_next }}">login</a> or <a href="openid/login/?next={{ login_next }}">create</a> a new account{% endblocktrans %}
146+ </section>
147+</div>
148+{% endif %}
149\ No newline at end of file
150
151=== modified file 'loco_directory/templates/events/team_event_detail.html'
152--- loco_directory/templates/events/team_event_detail.html 2012-06-02 11:50:27 +0000
153+++ loco_directory/templates/events/team_event_detail.html 2012-06-30 19:01:18 +0000
154@@ -19,12 +19,21 @@
155 <meta property="og:street-address" content="{{ team_event_object.venue.name }} "/>
156 <meta property="og:locality" content="{% if team_event_object.venue.city %}{{ team_event_object.venue.city }}{% endif %}"/>
157 {% endif %}
158+{{form.media}}
159+<script type="text/javascript">
160+ $(document).ready(function(){
161+ $('span[rel*=help]').colorTip({color:'orange'});
162+ });
163+</script>
164 {% endblock %}
165
166+
167 {% block sub_nav_links %}
168-{% for team in team_event_object.teams.all %}<li><a class="sub-nav-item" href="{{ team.get_absolute_url }}">{{ team.name }}</a></li>{% endfor %}
169-
170-<li><a class="sub-nav-item" href="{% url team-event-comment-new team_event_object.first_team.lp_name team_event_object.id %}#comment">{% trans "Add Comment" %}</a></li>
171+
172+{% for team in team_event_object.teams.all %}
173+ <li><a class="sub-nav-item" href="{{ team.get_absolute_url }}">{{ team.name }}</a></li>
174+{% endfor %}
175+
176 {% if user.is_authenticated %}
177 {% if user_is_team_member %}
178 <li><a class="sub-nav-item" href="{% url team-event-update team_event_object.first_team.lp_name team_event_object.id %}">{% trans "Edit Details" %}</a></li>
179
180=== modified file 'loco_directory/templates/events/team_event_detail.inc.html'
181--- loco_directory/templates/events/team_event_detail.inc.html 2012-06-02 11:50:27 +0000
182+++ loco_directory/templates/events/team_event_detail.inc.html 2012-06-30 19:01:18 +0000
183@@ -1,38 +1,40 @@
184 {% load i18n markup %}
185 <div class="row">
186-<section class="span-6">
187- <h2>{{team_event_object.name}}</h2>
188- {% if team_event_object.description %}
189- <table id="team-event-basic">
190- <tr>
191- <td class="form-item-value">{{ team_event_object.description|markdown:'safe' }}</td>
192- </tr>
193- </table>
194- {% endif %}
195- <h3>{% trans "Details" %}</h3>
196- {% include "events/team_event_detail_basic.inc.html" %}
197-</section>
198-<section class="span-6 last">
199- <h3>
200- {% if team_event_object.registration %}
201- <a class="rsvp-link" href="{{team_event_object.registration}}" target="external_registration">{% trans 'Register' %}</a>
202- {% else %}
203- {% if user.is_authenticated and user_is_attending %}
204- <a class="rsvp-link" href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Update Registration' %}</a>
205+ <section class="span-6">
206+ <h2>{{team_event_object.name}}</h2>
207+ {% if team_event_object.description %}
208+ <table id="team-event-basic">
209+ <tr>
210+ <td class="form-item-value">{{ team_event_object.description|markdown:'safe' }}</td>
211+ </tr>
212+ </table>
213+ {% endif %}
214+ <h3>{% trans "Details" %}</h3>
215+ {% include "events/team_event_detail_basic.inc.html" %}
216+ </section>
217+ <section class="span-6 last">
218+ <h3>
219+ {% if team_event_object.registration %}
220+ <a class="rsvp-link" href="{{team_event_object.registration}}" target="external_registration">{% trans 'Register' %}</a>
221 {% else %}
222- <a class="rsvp-link" href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Register' %}</a>
223+ {% if user.is_authenticated and user_is_attending %}
224+ <a class="rsvp-link" href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Update Registration' %}</a>
225+ {% else %}
226+ <a class="rsvp-link" href="{% url team-event-register team_event_object.first_team.lp_name team_event_object.id %}">{% trans 'Register' %}</a>
227+ {% endif %}
228 {% endif %}
229- {% endif %}
230- </h3>
231- {% include "events/team_event_detail_attendees.inc.html" %}
232-</section>
233+ </h3>
234+ {% include "events/team_event_detail_attendees.inc.html" %}
235+ </section>
236 </div>
237
238 {% if team_event_object.teameventcomment_set.all %}
239 <div class="row">
240-<section class="span-12">
241- <h3>{% blocktrans with team_event_object.teameventcomment_set.all.count as comment_count %}Event Comments ({{ comment_count }}){% endblocktrans %}</h3>
242- {% include "events/team_event_detail_comments.inc.html" %}
243-</section>
244+ <section class="span-12">
245+ <h3>{% blocktrans with team_event_object.teameventcomment_set.all.count as comment_count %}Event Comments ({{ comment_count }}){% endblocktrans %}</h3>
246+ {% include "events/team_event_detail_comments.inc.html" %}
247+ </section>
248 </div>
249 {% endif %}
250+{% include "events/team_event_comment_new.inc.html" %}
251+
252
253=== modified file 'loco_directory/templates/events/team_event_detail_comments.inc.html'
254--- loco_directory/templates/events/team_event_detail_comments.inc.html 2011-08-07 02:53:40 +0000
255+++ loco_directory/templates/events/team_event_detail_comments.inc.html 2012-06-30 19:01:18 +0000
256@@ -1,13 +1,7 @@
257 {% load i18n %}
258 {% if team_event_object.teameventcomment_set.all %}
259 <table id="team-event-comments">
260- <tr>
261- <td colspan="2" class="form-item-value">
262- <a href="{% url team-event-comment-new team_event_object.first_team.lp_name team_event_object.id %}#comment">{% trans "Add Comment" %}</a>
263- </td>
264- </tr>
265 {% regroup team_event_object.teameventcomment_set.all by local_date_created|date:"D d M Y" as comment_list %}
266-
267 {% for comment_date in comment_list %}
268 <tr>
269 <th class="form-item-label" scope="row" colspan=2><label>{{comment_date.grouper}}</label></th>

Subscribers

People subscribed via source and target branches