Merge lp:~dholbach/developer-ubuntu-com/logout into lp:developer-ubuntu-com

Proposed by Daniel Holbach
Status: Merged
Approved by: David Planella
Approved revision: 57
Merged at revision: 52
Proposed branch: lp:~dholbach/developer-ubuntu-com/logout
Merge into: lp:developer-ubuntu-com
Diff against target: 364 lines (+211/-34)
5 files modified
developer_portal/urls.py (+1/-2)
developer_portal/views.py (+8/-1)
locale/developer_portal.pot (+197/-26)
templates/base.html (+2/-2)
templates/website_base.html (+3/-3)
To merge this branch: bzr merge lp:~dholbach/developer-ubuntu-com/logout
Reviewer Review Type Date Requested Status
David Planella Approve
Review via email: mp+244978@code.launchpad.net
To post a comment you must log in.
Revision history for this message
David Planella (dpm) wrote :

Great, thanks!

Could you mark the "Log in" and "Log out" strings for translation with {% trans %}?

review: Needs Fixing
Revision history for this message
David Planella (dpm) wrote :

Also, could we make it so that on logout you're not redirected to the home page, but to the page you were in?

I've seen some templates doing it like:

href="<some url here>?next={{request.path}}"

But perhaps we can do it in the view?

review: Needs Fixing
52. By Daniel Holbach

mark a couple of strings as translatable

53. By Daniel Holbach

update .pot file

54. By Daniel Holbach

merge from trunk, resolve conflicts

55. By Daniel Holbach

mark strings for translation

56. By Daniel Holbach

update .pot file

57. By Daniel Holbach

redirect logout gracefully

Revision history for this message
David Planella (dpm) wrote :

Looks good to me and works well, thanks for taking care of the extra translations!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'developer_portal/urls.py'
2--- developer_portal/urls.py 2014-12-10 04:09:01 +0000
3+++ developer_portal/urls.py 2014-12-17 13:24:16 +0000
4@@ -10,6 +10,7 @@
5
6 urlpatterns = patterns('',
7 url(r'^admin/', include(admin.site.urls)),
8+ url(r'^logout$', 'developer_portal.views.site_logout', name='logout')
9 )
10
11 urlpatterns += patterns(
12@@ -22,11 +23,9 @@
13 )
14 listen_for_login()
15
16-
17 urlpatterns += i18n_patterns('',
18 url(r'^ckeditor/', include('ckeditor.urls')),
19 url(r'^blog/', include('zinnia.urls', namespace='zinnia')),
20 url(r'^blog/comments/', include('django_comments.urls')),
21 url(r'^', include('cms.urls')),
22 ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
23-
24
25=== modified file 'developer_portal/views.py'
26--- developer_portal/views.py 2014-11-28 20:17:54 +0000
27+++ developer_portal/views.py 2014-12-17 13:24:16 +0000
28@@ -17,9 +17,10 @@
29 from django.shortcuts import render_to_response, redirect
30 from django.template.loader import render_to_string
31 from django.template import RequestContext
32-from django.http import HttpResponse
33+from django.http import HttpResponse, HttpResponseRedirect
34 from django.core.urlresolvers import reverse
35 from django.conf import settings
36+from django.contrib.auth import logout
37
38 from django_openid_auth.signals import openid_login_complete
39
40@@ -57,3 +58,9 @@
41
42 def listen_for_login():
43 openid_login_complete.connect(promote_staff)
44+
45+def site_logout(request):
46+ logout(request)
47+ if "next" in request.GET:
48+ return HttpResponseRedirect(request.GET['next'])
49+ return HttpResponseRedirect('/')
50
51=== modified file 'locale/developer_portal.pot'
52--- locale/developer_portal.pot 2014-12-16 11:39:55 +0000
53+++ locale/developer_portal.pot 2014-12-17 13:24:16 +0000
54@@ -8,7 +8,7 @@
55 msgstr ""
56 "Project-Id-Version: PACKAGE VERSION\n"
57 "Report-Msgid-Bugs-To: \n"
58-"POT-Creation-Date: 2014-12-16 11:39+0000\n"
59+"POT-Creation-Date: 2014-12-17 13:15+0000\n"
60 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
61 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
62 "Language-Team: LANGUAGE <LL@li.org>\n"
63@@ -44,20 +44,120 @@
64 msgid "developer"
65 msgstr ""
66
67+#: templates/base.html:74
68+msgid "Ubuntu and Canonical are registered trademarks of Canonical Ltd."
69+msgstr ""
70+
71+#: templates/base.html:78
72+msgid "Report a bug on this site"
73+msgstr ""
74+
75+#: templates/website_base.html:56
76+msgid "Jump to content"
77+msgstr ""
78+
79+#: templates/website_base.html:65 templates/comments/zinnia/entry/form.html:25
80+msgid "Log out"
81+msgstr ""
82+
83+#: templates/website_base.html:71
84+msgid "Log in"
85+msgstr ""
86+
87+#: templates/comments/zinnia/entry/form.html:25
88+msgid "Comment as"
89+msgstr ""
90+
91+#: templates/comments/zinnia/entry/form.html:28
92+msgid "Post"
93+msgstr ""
94+
95+#: templates/menu/menu_footer_first_level.html:8
96 #: templates/menu/menu_header_first_level.html:8
97 #: templates/menu/sub_menu.html:8 templates/menu/sub_menu.html.py:22
98 #: templates/menu/sub_menu.html:25
99 msgid "Overview"
100 msgstr ""
101
102-#: templates/zinnia/base.html:40
103+#: templates/zinnia/_entry_detail_base.html:33
104+#, python-format
105+msgid "%(percent)s%% of %(object)s still remains to read."
106+msgstr ""
107+
108+#: templates/zinnia/_entry_detail_base.html:33
109+msgid "Continue reading"
110+msgstr ""
111+
112+#: templates/zinnia/_entry_detail_base.html:47
113+#: templates/zinnia/author_list.html:19
114+#, python-format
115+msgid "Show all %(author)s's entries"
116+msgstr ""
117+
118+#: templates/zinnia/_entry_detail_base.html:50
119+msgid "Written on"
120+msgstr ""
121+
122+#: templates/zinnia/_entry_detail_base.html:62
123+msgid "Filed under:"
124+msgstr ""
125+
126+#: templates/zinnia/_entry_detail_base.html:64
127+#: templates/zinnia/tag_list.html:19
128+#, python-format
129+msgid "Show all entries tagged by %(tag)s"
130+msgstr ""
131+
132+#: templates/zinnia/_entry_detail_base.html:66
133+msgid "No tags"
134+msgstr ""
135+
136+#: templates/zinnia/author_list.html:4 templates/zinnia/author_list.html:12
137+msgid "Author list"
138+msgstr ""
139+
140+#: templates/zinnia/author_list.html:6
141+msgid "Authors"
142+msgstr ""
143+
144+#: templates/zinnia/author_list.html:21 templates/zinnia/category_list.html:19
145+#: templates/zinnia/tag_list.html:20
146+#, python-format
147+msgid "%(entry_count)s entry"
148+msgid_plural "%(entry_count)s entries"
149+msgstr[0] ""
150+msgstr[1] ""
151+
152+#: templates/zinnia/author_list.html:25
153+msgid "No authors yet."
154+msgstr ""
155+
156+#: templates/zinnia/base.html:36
157 msgid "RSS Feed of latest entries"
158 msgstr ""
159
160-#: templates/zinnia/base.html:41
161+#: templates/zinnia/base.html:37
162 msgid "RSS Feed of latest discussions"
163 msgstr ""
164
165+#: templates/zinnia/category_list.html:4
166+#: templates/zinnia/category_list.html:12
167+msgid "Category list"
168+msgstr ""
169+
170+#: templates/zinnia/category_list.html:6
171+msgid "Categories"
172+msgstr ""
173+
174+#: templates/zinnia/category_list.html:18
175+#, python-format
176+msgid "Show all entries in %(category)s"
177+msgstr ""
178+
179+#: templates/zinnia/category_list.html:24
180+msgid "No categories yet."
181+msgstr ""
182+
183 #: templates/zinnia/entry_detail_base.html:22
184 msgid "RSS Feed of discussions on"
185 msgstr ""
186@@ -74,37 +174,108 @@
187 msgid "RSS Feed of trackbacks on"
188 msgstr ""
189
190-#: templates/zinnia/entry_detail_base.html:47
191-msgid "Next entry"
192-msgstr ""
193-
194-#: templates/zinnia/entry_detail_base.html:61
195-msgid "Previous entry"
196-msgstr ""
197-
198-#: templates/zinnia/entry_detail_base.html:77
199+#: templates/zinnia/entry_detail_base.html:43
200 msgid "Comments"
201 msgstr ""
202
203-#: templates/zinnia/entry_detail_base.html:97
204-msgctxt "on date"
205-msgid "on"
206-msgstr ""
207-
208-#: templates/zinnia/entry_detail_base.html:103
209-msgid "Direct link to this comment"
210-msgstr ""
211-
212-#: templates/zinnia/entry_detail_base.html:115
213-#: templates/zinnia/entry_detail_base.html:121
214+#: templates/zinnia/entry_detail_base.html:82
215+#: templates/zinnia/entry_detail_base.html:88
216 msgid "Comments are closed."
217 msgstr ""
218
219-#: templates/zinnia/entry_detail_base.html:119
220+#: templates/zinnia/entry_detail_base.html:86
221 msgid "No comments yet."
222 msgstr ""
223
224-#: templates/zinnia/entry_detail_base.html:138
225-#: templates/zinnia/entry_detail_base.html:139
226+#: templates/zinnia/entry_detail_base.html:96
227+msgid "Add your comment"
228+msgstr ""
229+
230+#: templates/zinnia/entry_detail_base.html:108
231+#: templates/zinnia/entry_detail_base.html:109
232 msgid "Edit the entry"
233 msgstr ""
234+
235+#: templates/zinnia/entry_list.html:4
236+msgid "Latest entries for"
237+msgstr ""
238+
239+#: templates/zinnia/entry_list.html:4
240+msgid "the category"
241+msgstr ""
242+
243+#: templates/zinnia/entry_list.html:4
244+msgid "the tag"
245+msgstr ""
246+
247+#: templates/zinnia/entry_list.html:4
248+msgid "the author"
249+msgstr ""
250+
251+#: templates/zinnia/entry_list.html:6
252+msgid "page"
253+msgstr ""
254+
255+#: templates/zinnia/entry_list.html:11 templates/zinnia/entry_list.html:14
256+#: templates/zinnia/entry_list.html:17
257+msgid "RSS Feed"
258+msgstr ""
259+
260+#: templates/zinnia/entry_list.html:21
261+msgid "Category"
262+msgstr ""
263+
264+#: templates/zinnia/entry_list.html:21
265+msgid "Tag"
266+msgstr ""
267+
268+#: templates/zinnia/entry_list.html:21
269+msgid "Author"
270+msgstr ""
271+
272+#: templates/zinnia/entry_list.html:23
273+msgid "Page"
274+msgstr ""
275+
276+#: templates/zinnia/entry_list.html:32
277+#, python-format
278+msgid "Category archives: %(category)s"
279+msgstr ""
280+
281+#: templates/zinnia/entry_list.html:41
282+#, python-format
283+msgid "Tag archives: %(tag)s"
284+msgstr ""
285+
286+#: templates/zinnia/entry_list.html:47
287+#, python-format
288+msgid "Author archives: %(author)s"
289+msgstr ""
290+
291+#: templates/zinnia/entry_list.html:58
292+msgid "No entries yet."
293+msgstr ""
294+
295+#: templates/zinnia/entry_list.html:75 templates/zinnia/entry_list.html:76
296+msgid "Edit the category"
297+msgstr ""
298+
299+#: templates/zinnia/entry_list.html:82 templates/zinnia/entry_list.html:83
300+msgid "Edit the tag"
301+msgstr ""
302+
303+#: templates/zinnia/entry_list.html:89 templates/zinnia/entry_list.html:90
304+msgid "Edit the author"
305+msgstr ""
306+
307+#: templates/zinnia/tag_list.html:4 templates/zinnia/tag_list.html.py:12
308+msgid "Tag list"
309+msgstr ""
310+
311+#: templates/zinnia/tag_list.html:6
312+msgid "Tags"
313+msgstr ""
314+
315+#: templates/zinnia/tag_list.html:24
316+msgid "No tags yet."
317+msgstr ""
318
319=== modified file 'templates/base.html'
320--- templates/base.html 2014-12-17 12:43:23 +0000
321+++ templates/base.html 2014-12-17 13:24:16 +0000
322@@ -71,11 +71,11 @@
323 </li>
324 {% endblock footer_inlines %}
325 {% block footer_legal %}
326- <p class="twelve-col">© 2014 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</p>
327+ <p class="twelve-col">© 2014 Canonical Ltd. {% trans "Ubuntu and Canonical are registered trademarks of Canonical Ltd." %}</p>
328 <ul class="inline clear">
329 <li><a href="/legal">Legal information</a>
330 </li>
331- <li><a href="https://bugs.launchpad.net/ubuntu-website-content/">Report a bug on this site</a>
332+ <li><a href="https://bugs.launchpad.net/ubuntu-website-content/">{% trans "Report a bug on this site" %}</a>
333 </li>
334 </ul>
335 <span class="accessibility-aid"><a href="#">Got to the top of the page</a></span>
336
337=== modified file 'templates/website_base.html'
338--- templates/website_base.html 2014-12-17 12:43:23 +0000
339+++ templates/website_base.html 2014-12-17 13:24:16 +0000
340@@ -53,7 +53,7 @@
341 </div>
342
343 <ul>
344- <li class="accessibility-aid"><a accesskey="s" href="#main-content">Jump to content</a></li>
345+ <li class="accessibility-aid"><a accesskey="s" href="#main-content">{% trans "Jump to content" %}</a></li>
346 {% block nav_primary_links %}{% endblock nav_primary_links %}
347 {% if user.is_authenticated %}
348 <li class="logout">
349@@ -62,13 +62,13 @@
350 <li>
351 <a href="https://myapps.developer.ubuntu.com/dev/click-apps/">My Apps</a>
352 <li>
353- <a href="/admin/logout">Log out</a>
354+ <a href="/logout?next={{request.path}}"">{% trans "Log out" %}</a>
355 </li>
356 </ul>
357 </li>
358 {% else %}
359 <li class="login">
360- <a href="/openid/login/?next={{request.path}}">Log in</a>
361+ <a href="/openid/login/?next={{request.path}}">{% trans "Log in" %}</a>
362 </li>
363 {% endif %}
364 </ul>

Subscribers

People subscribed via source and target branches