Merge lp:~dholbach/developer-ubuntu-com/translations-dashboard into lp:~davidc3/developer-ubuntu-com/translations-dashboard

Proposed by Daniel Holbach
Status: Merged
Approved by: David Callé
Approved revision: 123
Merged at revision: 122
Proposed branch: lp:~dholbach/developer-ubuntu-com/translations-dashboard
Merge into: lp:~davidc3/developer-ubuntu-com/translations-dashboard
Diff against target: 144 lines (+23/-36)
6 files modified
locale/de.po (+2/-2)
locale/developer_portal.pot (+5/-1)
locale/en_GB.po (+2/-2)
locale/es.po (+2/-2)
locale/zh_CN.po (+2/-2)
translations_dashboard/views.py (+10/-27)
To merge this branch: bzr merge lp:~dholbach/developer-ubuntu-com/translations-dashboard
Reviewer Review Type Date Requested Status
David Callé Pending
Review via email: mp+263080@code.launchpad.net
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 'locale/de.po'
2--- locale/de.po 2015-05-20 05:32:03 +0000
3+++ locale/de.po 2015-06-26 09:52:30 +0000
4@@ -15,8 +15,8 @@
5 "Content-Type: text/plain; charset=UTF-8\n"
6 "Content-Transfer-Encoding: 8bit\n"
7 "Plural-Forms: nplurals=2; plural=n != 1;\n"
8-"X-Launchpad-Export-Date: 2015-05-20 05:32+0000\n"
9-"X-Generator: Launchpad (build 17508)\n"
10+"X-Launchpad-Export-Date: 2015-06-26 05:05+0000\n"
11+"X-Generator: Launchpad (build 17578)\n"
12
13 #: developer_portal/cms_plugins.py:10
14 msgid "Raw HTML"
15
16=== modified file 'locale/developer_portal.pot'
17--- locale/developer_portal.pot 2015-05-11 20:00:59 +0000
18+++ locale/developer_portal.pot 2015-06-26 09:52:30 +0000
19@@ -8,7 +8,7 @@
20 msgstr ""
21 "Project-Id-Version: PACKAGE VERSION\n"
22 "Report-Msgid-Bugs-To: \n"
23-"POT-Creation-Date: 2015-04-24 09:17+0000\n"
24+"POT-Creation-Date: 2015-06-26 07:59+0000\n"
25 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
26 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
27 "Language-Team: LANGUAGE <LL@li.org>\n"
28@@ -186,6 +186,10 @@
29 msgid "API Docs:"
30 msgstr ""
31
32+#: templates/translations_dashboard.html:6
33+msgid "Translations dashboard"
34+msgstr ""
35+
36 #: templates/webapp.html:6
37 msgid "Create your Webapp package"
38 msgstr ""
39
40=== modified file 'locale/en_GB.po'
41--- locale/en_GB.po 2015-05-20 05:32:03 +0000
42+++ locale/en_GB.po 2015-06-26 09:52:30 +0000
43@@ -15,8 +15,8 @@
44 "Content-Type: text/plain; charset=UTF-8\n"
45 "Content-Transfer-Encoding: 8bit\n"
46 "Plural-Forms: nplurals=2; plural=n != 1;\n"
47-"X-Launchpad-Export-Date: 2015-05-20 05:32+0000\n"
48-"X-Generator: Launchpad (build 17508)\n"
49+"X-Launchpad-Export-Date: 2015-06-26 05:05+0000\n"
50+"X-Generator: Launchpad (build 17578)\n"
51
52 #: developer_portal/cms_plugins.py:10
53 msgid "Raw HTML"
54
55=== modified file 'locale/es.po'
56--- locale/es.po 2015-05-20 05:32:03 +0000
57+++ locale/es.po 2015-06-26 09:52:30 +0000
58@@ -15,8 +15,8 @@
59 "Content-Type: text/plain; charset=UTF-8\n"
60 "Content-Transfer-Encoding: 8bit\n"
61 "Plural-Forms: nplurals=2; plural=n != 1;\n"
62-"X-Launchpad-Export-Date: 2015-05-20 05:32+0000\n"
63-"X-Generator: Launchpad (build 17508)\n"
64+"X-Launchpad-Export-Date: 2015-06-26 05:05+0000\n"
65+"X-Generator: Launchpad (build 17578)\n"
66
67 #: developer_portal/cms_plugins.py:10
68 msgid "Raw HTML"
69
70=== modified file 'locale/zh_CN.po'
71--- locale/zh_CN.po 2015-05-20 05:32:03 +0000
72+++ locale/zh_CN.po 2015-06-26 09:52:30 +0000
73@@ -15,8 +15,8 @@
74 "Content-Type: text/plain; charset=UTF-8\n"
75 "Content-Transfer-Encoding: 8bit\n"
76 "Plural-Forms: nplurals=1; plural=0;\n"
77-"X-Launchpad-Export-Date: 2015-05-20 05:32+0000\n"
78-"X-Generator: Launchpad (build 17508)\n"
79+"X-Launchpad-Export-Date: 2015-06-26 05:05+0000\n"
80+"X-Generator: Launchpad (build 17578)\n"
81
82 #: developer_portal/cms_plugins.py:10
83 msgid "Raw HTML"
84
85=== modified file 'translations_dashboard/views.py'
86--- translations_dashboard/views.py 2015-06-25 21:53:23 +0000
87+++ translations_dashboard/views.py 2015-06-26 09:52:30 +0000
88@@ -2,28 +2,13 @@
89 from django.template import RequestContext
90 from cms.models.pagemodel import Page
91 import json
92-from django.db import connection
93-
94-
95-def get_plugin_changes():
96- cursor = connection.cursor()
97- cursor.execute("SELECT * FROM `cms_cmsplugin` ORDER BY `changed_date` DESC")
98- row = cursor.fetchall()
99- return row
100+
101+from cms.models import CMSPlugin
102+from reversion.models import Version
103
104
105 def get_revision(plugin_id):
106- cursor = connection.cursor()
107- cursor.execute("SELECT * FROM `reversion_version` WHERE `object_id_int` = %s ORDER BY `id` DESC limit 1", [plugin_id])
108- row = cursor.fetchone()
109- return row
110-
111-
112-def get_page_for_placeholder(ph):
113- cursor = connection.cursor()
114- cursor.execute("SELECT `page_id` FROM `cms_page_placeholders` WHERE `placeholder_id` = %s", [ph])
115- row = cursor.fetchone()
116- return row
117+ return Version.objects.filter(object_id_int=plugin_id).order_by('-id')
118
119
120 def parse_time(time):
121@@ -32,17 +17,15 @@
122
123
124 class AllPages():
125- all_pages = Page.objects.filter()
126 dashboard_data = []
127 known_paths = []
128- for data in get_plugin_changes():
129- rev = get_revision(data[0])
130+ for plugin_change in CMSPlugin.objects.order_by('-changed_date'):
131+ rev = get_revision(plugin_change.id)
132 if rev:
133- content = json.loads(rev[7])
134- date = data[7]
135- lang = data[4].replace('-', '_')
136- page_id = get_page_for_placeholder(data[1])[0]
137- page = Page.objects.filter(id=page_id)[0]
138+ content = json.loads(rev[0].serialized_data)
139+ date = plugin_change.changed_date
140+ lang = plugin_change.language.replace('-', '_')
141+ page = plugin_change.placeholder.page
142 path = page.get_path()
143 if path not in known_paths:
144 known_paths.append(path)

Subscribers

People subscribed via source and target branches

to all changes: