Merge lp://staging/~danilo/launchpad/bug-423136 into lp://staging/launchpad

Proposed by Данило Шеган
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~danilo/launchpad/bug-423136
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~danilo/launchpad/bug-423136
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+11051@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug #423136 =

To do top alignment, I did a crappy thing by using absolute/relative
positioning. I should have just used float:left to stack span's one
next to each other so they end up top-aligned.

(Got a tip from a web coder friend sharing the office with me, and
since tested in Epiphany, Firefox 3.0, Konqueror, Opera and Chromium to
DTRT).

In appearance, nothing changes.

== Tests ==

bin/test -vvt potemplate-export -t stories.translationgroups

(55-rosetta-pofile-upload is part of translationgroups story)

== Demo and Q/A ==

https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+export
https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+upload

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/canonical/launchpad/icing/style-3-0.css
  lib/lp/translations/templates/pofile-upload.pt
  lib/lp/translations/templates/potemplate-export.pt

Revision history for this message
Gavin Panella (allenap) wrote :

This all looks good, with the addition of the clear:both rule you figured out to fix rendering in Chromium.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
2--- lib/canonical/launchpad/icing/style-3-0.css 2009-09-01 16:19:19 +0000
3+++ lib/canonical/launchpad/icing/style-3-0.css 2009-09-02 13:06:48 +0000
4@@ -717,27 +717,28 @@
5
6 /* Provide top-alignment for radio boxes and longer explanations
7 * without using tables.
8+ *
9+ * Examples:
10+ * https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/es/+upload
11+ * https://translations.launchpad.dev/evolution/trunk/+pots/evolution-2.2/+export
12 */
13-form.translations div.fields div.alignment {
14- position: relative;
15-}
16-form.translations div.alignment div.top-alignment {
17- position: absolute;
18- top: 0px;
19-}
20-form.translations div.alignment .spacer {
21- visibility: hidden;
22-}
23 form.translations div.alignment .content {
24- display: inline-block;
25- margin-left: 0px;
26-}
27-
28+ float:left;
29+}
30+form.translations div.alignment .selector {
31+ margin-right: 0.5em;
32+ float: left;
33+ clear: both;
34+}
35 form.translations div.alignment .content label {
36 padding: 0px;
37 margin: 0px;
38 font-weight: bold;
39 }
40+form.translations div.alignment .secondary label {
41+ font-weight: normal;
42+ padding: 2px 1em 2px 2px;
43+}
44
45 table.narrow-listing {
46 width: 45em;
47
48=== modified file 'lib/lp/translations/templates/pofile-upload.pt'
49--- lib/lp/translations/templates/pofile-upload.pt 2009-08-31 13:10:50 +0000
50+++ lib/lp/translations/templates/pofile-upload.pt 2009-09-02 11:59:45 +0000
51@@ -28,32 +28,21 @@
52 <h2>What kind of upload is this?</h2>
53 <div class="fields">
54 <div class="alignment">
55- <div class="top-alignment">
56- <input id="user_type" name="upload_type" type="radio"
57- value="user" checked="checked" />
58- </div>
59- <!-- Preserve space for the input box -->
60- <input type="radio" class="spacer" />
61
62+ <input id="user_type" name="upload_type" type="radio"
63+ value="user" checked="checked" class="selector"/>
64 <span class="content">
65 <label for="user_type">
66 Updated translation
67 </label>
68 <p class="discreet">
69- You have exported a PO file from Launchpad, worked on it off-line,
70- and now you want to contribute your updates back.
71+ You have exported a PO file from Launchpad, worked on it
72+ off-line, and now you want to contribute your updates back.
73 </p>
74 </span>
75- </div>
76-
77- <div class="alignment">
78- <div class="top-alignment">
79- <input id="upstream_type" name="upload_type" type="radio"
80- value="upstream" />
81- </div>
82- <!-- Preserve space for the input box -->
83- <input type="radio" class="spacer" />
84-
85+
86+ <input id="upstream_type" name="upload_type" type="radio"
87+ value="upstream" class="selector"/>
88 <span class="content">
89 <label for="upstream_type">
90 Imported translation
91
92=== modified file 'lib/lp/translations/templates/potemplate-export.pt'
93--- lib/lp/translations/templates/potemplate-export.pt 2009-08-31 13:06:42 +0000
94+++ lib/lp/translations/templates/potemplate-export.pt 2009-09-02 13:06:48 +0000
95@@ -18,26 +18,20 @@
96 <form action="" method="post" class="translations">
97
98 <div class="fields">
99- <div>
100- <label>
101+ <div class="alignment">
102+ <div>
103+ <label>
104 <input name="what" type="radio" value="all"
105- checked="checked" />
106+ checked="checked" />
107 Everything
108- </label>
109- </div>
110-
111- <div class="alignment">
112- <div class="top-alignment">
113- <label>
114- <input name="what" type="radio" value="some" />
115- Selected files:
116 </label>
117 </div>
118- <span class="spacer">
119- <!-- preserve space for the actual radio button and label -->
120- <label><input type="radio" />Selected files.</label>
121- </span>
122- <span class="listbox" style="margin-left: 1.5em;">
123+
124+ <label class="selector">
125+ <input name="what" type="radio" value="some" />
126+ Selected files:
127+ </label>
128+ <div class="listbox content secondary">
129 <div>
130 <label>
131 <input type="checkbox" name="potemplate" />
132@@ -53,8 +47,9 @@
133 </label>
134 </div>
135 </tal:thing>
136- </span>
137+ </div>
138 </div>
139+ <div style="clear:both;">&nbsp;</div>
140 </div>
141 <h2>Choose file format for the export</h2>
142 <div class="fields">
143