Merge ~cristiangsp/launchpad:bugfix-1158242-translations-ui-changes into launchpad:master

Proposed by Cristian Gonzalez
Status: Merged
Approved by: Colin Watson
Approved revision: 827603975beb58f83268594dd290d1883225b00f
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cristiangsp/launchpad:bugfix-1158242-translations-ui-changes
Merge into: launchpad:master
Diff against target: 110 lines (+13/-14)
3 files modified
lib/lp/translations/stories/translations/xx-translations.txt (+0/-1)
lib/lp/translations/templates/distroseries-langchart.pt (+10/-10)
lib/lp/translations/templates/serieslanguage-index.pt (+3/-3)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+393639@code.launchpad.net

Commit message

Redistributing "Contributors" and "Length" columns on Translations

Description of the change

This branch introduces the 2 changes requested in bug: https://bugs.launchpad.net/launchpad/+bug/1158242

- Moving the "Contributors" column to the end of the table in the distribution's Translations page.
- Converting the "Length" column into "Total" an move it to the end of the table in the distribution series language page.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

It doesn't show clearly in the web UI, but looks like you've added some spurious trailing whitespace on five lines (more easily visible in `git diff`). Could you remove that again? (Obviously a minor point.)

The actual change looks fine to me, but to my relief there is at least a small amount of test suite fallout that you'll need to adjust to match:

Failure in test lib/lp/translations/stories/translations/xx-translations.txt
Failed doctest test for xx-translations.txt
  File "lib/lp/translations/stories/translations/xx-translations.txt", line 0

----------------------------------------------------------------------
File "lib/lp/translations/stories/translations/xx-translations.txt", line 238, in xx-translations.txt
Failed example:
    print(extract_text(evolution_line))
Differences (ndiff with -expected +actual):
      evolution-2.2
    - ...
    - 15 1 1
    - ...
    + 15
    + 1
    + 1
    + 22
    + 2005-06-06
    + Valentina Commissari

Looks like the first of the two ellipses in this doctest example should probably be dropped to match the change in the page template.

Please also link the bug report to this MP. You can do that after the fact using the "Link a bug report" facility here, or (better, for future MPs) mention the bug number in a commit message using the style shown in https://help.launchpad.net/Code/Git#Linking_to_bugs so that it can be automatically linked.

review: Needs Fixing
Revision history for this message
Colin Watson (cjwatson) wrote :

Also, I'd generally prefer that the "Commit message" field of the merge proposal conform to the recommendations for subject lines in https://chris.beams.io/posts/git-commit/.

And thanks for your first Launchpad MP!

118fa9c... by Cristian Gonzalez

Fixing addition of extra blank spaces

8276039... by Cristian Gonzalez

Fixing translations UI test

Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Suggested fixes applied and now test are green too.

Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/translations/stories/translations/xx-translations.txt b/lib/lp/translations/stories/translations/xx-translations.txt
2index f2cd87d..928b0b3 100644
3--- a/lib/lp/translations/stories/translations/xx-translations.txt
4+++ b/lib/lp/translations/stories/translations/xx-translations.txt
5@@ -237,7 +237,6 @@ Looking at the Spanish language overview page, we can see that there are
6 >>> evolution_line = find_tag_by_id(browser.contents, 'evolution-2.2')
7 >>> print(extract_text(evolution_line))
8 evolution-2.2
9- ...
10 15 1 1
11 ...
12
13diff --git a/lib/lp/translations/templates/distroseries-langchart.pt b/lib/lp/translations/templates/distroseries-langchart.pt
14index 47f9a40..28ef0bf 100644
15--- a/lib/lp/translations/templates/distroseries-langchart.pt
16+++ b/lib/lp/translations/templates/distroseries-langchart.pt
17@@ -21,11 +21,11 @@
18 <thead>
19 <tr>
20 <th>Language</th>
21- <th>Contributors</th>
22 <th>Status</th>
23 <th>Untranslated</th>
24 <th>Need review</th>
25 <th>Changed</th>
26+ <th>Contributors</th>
27 </tr>
28 </thead>
29
30@@ -48,15 +48,6 @@
31 Language Name
32 </a>
33 </td>
34- <td>
35- <span class="sortkey" tal:content="drlang/contributor_count">0</span>
36- <tal:count
37- tal:condition="drlang/contributor_count"
38- tal:replace="drlang/contributor_count">0</tal:count>
39- <tal:count condition="not: drlang/contributor_count">
40- &mdash;
41- </tal:count>
42- </td>
43 <td style="white-space: nowrap">
44 <div tal:replace="structure drlang/@@+barchart" />
45 </td>
46@@ -87,6 +78,15 @@
47 &mdash;
48 </tal:count>
49 </td>
50+ <td>
51+ <span class="sortkey" tal:content="drlang/contributor_count">0</span>
52+ <tal:count
53+ tal:condition="drlang/contributor_count"
54+ tal:replace="drlang/contributor_count">0</tal:count>
55+ <tal:count condition="not: drlang/contributor_count">
56+ &mdash;
57+ </tal:count>
58+ </td>
59 </tr>
60 </tal:loop>
61 </tbody>
62diff --git a/lib/lp/translations/templates/serieslanguage-index.pt b/lib/lp/translations/templates/serieslanguage-index.pt
63index 6c59d4f..42fbdc2 100644
64--- a/lib/lp/translations/templates/serieslanguage-index.pt
65+++ b/lib/lp/translations/templates/serieslanguage-index.pt
66@@ -66,11 +66,11 @@
67 <thead>
68 <tr>
69 <th>Template Name</th>
70- <th>Length</th>
71 <th>Status</th>
72 <th>Untranslated</th>
73 <th>Need review</th>
74 <th>Changed</th>
75+ <th>Total</th>
76 <th>Last Edited</th>
77 <th>By</th>
78 </tr>
79@@ -84,7 +84,6 @@
80 apache2-dev
81 </a>
82 </td>
83- <td tal:content="entry/potemplate/messageCount">87</td>
84 <td>
85 <tal:comment condition="nothing">
86 This text is used for the sorting.
87@@ -138,6 +137,7 @@
88 &mdash;
89 </tal:count>
90 </td>
91+ <td tal:content="entry/potemplate/messageCount">87</td>
92 <td tal:attributes="id string:${entry/potemplate/name}-time">
93 <span class="sortkey"
94 tal:condition="entry/date_changed"
95@@ -172,7 +172,6 @@
96 <tfoot>
97 <tr>
98 <th>Overall statistics:</th>
99- <td><span tal:replace="context/messageCount">N</span></td>
100 <td>
101 <span style="white-space: nowrap"
102 tal:content="structure context/@@+barchart">--</span>
103@@ -180,6 +179,7 @@
104 <td><span tal:replace="context/untranslatedCount">N</span></td>
105 <td><span tal:replace="context/unreviewedCount">N</span></td>
106 <td><span tal:replace="context/updatesCount">N</span></td>
107+ <td><span tal:replace="context/messageCount">N</span></td>
108 <td colspan="2"></td>
109 </tr>
110 </tfoot>

Subscribers

People subscribed via source and target branches

to status/vote changes: