Merge lp:~benji/launchpad/fix-help-link into lp:launchpad/db-devel
- fix-help-link
- Merge into db-devel
Proposed by
Benji York
Status: | Superseded |
---|---|
Proposed branch: | lp:~benji/launchpad/fix-help-link |
Merge into: | lp:launchpad/db-devel |
Diff against target: |
298 lines (+123/-50) (has conflicts) 5 files modified
lib/canonical/launchpad/templates/launchpad-loginstatus.pt (+1/-1) lib/lp/bugs/javascript/bugtask_index.js (+3/-3) lib/lp/registry/javascript/structural-subscription.js (+98/-40) scripts/get-stacked-on-branches.py (+5/-3) scripts/update-stacked-on.py (+16/-3) Text conflict in lib/lp/registry/javascript/structural-subscription.js |
To merge this branch: | bzr merge lp:~benji/launchpad/fix-help-link |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Launchpad code reviewers | Pending | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
- 10453. By Benji York
-
freshen branch from devel
- 10452. By Benji York
-
fix bug that caused the help link not to display on Chrome
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/canonical/launchpad/templates/launchpad-loginstatus.pt' | |||
2 | --- lib/canonical/launchpad/templates/launchpad-loginstatus.pt 2011-03-29 06:00:48 +0000 | |||
3 | +++ lib/canonical/launchpad/templates/launchpad-loginstatus.pt 2011-04-20 15:18:58 +0000 | |||
4 | @@ -7,7 +7,7 @@ | |||
5 | 7 | <div id="logincontrol" tal:condition="view/login_shown" | 7 | <div id="logincontrol" tal:condition="view/login_shown" |
6 | 8 | ><a tal:attributes="href view/login_url">Log in / Register</a></div> | 8 | ><a tal:attributes="href view/login_url">Log in / Register</a></div> |
7 | 9 | <div id="logincontrol" tal:condition="view/logged_in"> | 9 | <div id="logincontrol" tal:condition="view/logged_in"> |
9 | 10 | <form action="+logout" method="post"> | 10 | <form action="/+logout" method="post"> |
10 | 11 | <input type="hidden" name="loggingout" value="1" /> | 11 | <input type="hidden" name="loggingout" value="1" /> |
11 | 12 | <div id="rendertime" tal:condition="request/features/visible_render_time">Loading...</div> | 12 | <div id="rendertime" tal:condition="request/features/visible_render_time">Loading...</div> |
12 | 13 | <div id="ajax-time" tal:condition="request/features/visible_render_time"> | 13 | <div id="ajax-time" tal:condition="request/features/visible_render_time"> |
13 | 14 | 14 | ||
14 | === modified file 'lib/lp/bugs/javascript/bugtask_index.js' | |||
15 | --- lib/lp/bugs/javascript/bugtask_index.js 2011-04-12 12:16:03 +0000 | |||
16 | +++ lib/lp/bugs/javascript/bugtask_index.js 2011-04-20 15:18:58 +0000 | |||
17 | @@ -386,7 +386,7 @@ | |||
18 | 386 | if (bugs_private_notification_enabled) { | 386 | if (bugs_private_notification_enabled) { |
19 | 387 | if (Y.one('.global-notification').hasClass('hidden')) { | 387 | if (Y.one('.global-notification').hasClass('hidden')) { |
20 | 388 | Y.one('.portlet.private').setStyle('color', '#333'); | 388 | Y.one('.portlet.private').setStyle('color', '#333'); |
22 | 389 | Y.one('.portlet.private').setStyle('background-color', '#fbfbfb'); | 389 | Y.one('.portlet.private').setStyle('backgroundColor', '#fbfbfb'); |
23 | 390 | } | 390 | } |
24 | 391 | } | 391 | } |
25 | 392 | Y.one('body').replaceClass('private', 'public'); | 392 | Y.one('body').replaceClass('private', 'public'); |
26 | @@ -454,7 +454,7 @@ | |||
27 | 454 | }); | 454 | }); |
28 | 455 | var body_space = new Y.Anim({ | 455 | var body_space = new Y.Anim({ |
29 | 456 | node: 'body', | 456 | node: 'body', |
31 | 457 | to: {'padding-top': '40px'}, | 457 | to: {'paddingTop': '40px'}, |
32 | 458 | duration: 0.2, | 458 | duration: 0.2, |
33 | 459 | easing: Y.Easing.easeOut | 459 | easing: Y.Easing.easeOut |
34 | 460 | }); | 460 | }); |
35 | @@ -493,7 +493,7 @@ | |||
36 | 493 | }); | 493 | }); |
37 | 494 | var body_space = new Y.Anim({ | 494 | var body_space = new Y.Anim({ |
38 | 495 | node: 'body', | 495 | node: 'body', |
40 | 496 | to: {'padding-top': 0}, | 496 | to: {'paddingTop': 0}, |
41 | 497 | duration: 0.2, | 497 | duration: 0.2, |
42 | 498 | easing: Y.Easing.easeOut | 498 | easing: Y.Easing.easeOut |
43 | 499 | }); | 499 | }); |
44 | 500 | 500 | ||
45 | === modified file 'lib/lp/registry/javascript/structural-subscription.js' | |||
46 | --- lib/lp/registry/javascript/structural-subscription.js 2011-04-19 07:18:42 +0000 | |||
47 | +++ lib/lp/registry/javascript/structural-subscription.js 2011-04-20 15:18:58 +0000 | |||
48 | @@ -1198,6 +1198,7 @@ | |||
49 | 1198 | function wire_up_edit_links_for_filter( | 1198 | function wire_up_edit_links_for_filter( |
50 | 1199 | config, subscription, subscription_id, filter_info, filter_id, | 1199 | config, subscription, subscription_id, filter_info, filter_id, |
51 | 1200 | filter_node) { | 1200 | filter_node) { |
52 | 1201 | <<<<<<< TREE | ||
53 | 1201 | var node = filter_node || Y.one( | 1202 | var node = filter_node || Y.one( |
54 | 1202 | '#subscription-filter-'+filter_id.toString()); | 1203 | '#subscription-filter-'+filter_id.toString()); |
55 | 1203 | if (filter_info.can_mute) { | 1204 | if (filter_info.can_mute) { |
56 | @@ -1206,6 +1207,17 @@ | |||
57 | 1206 | } | 1207 | } |
58 | 1207 | if (!filter_info.subscriber_is_team || | 1208 | if (!filter_info.subscriber_is_team || |
59 | 1208 | filter_info.user_is_team_admin) { | 1209 | filter_info.user_is_team_admin) { |
60 | 1210 | ======= | ||
61 | 1211 | var node = filter_node || Y.one( | ||
62 | 1212 | '#subscription-filter-'+filter_id.toString()); | ||
63 | 1213 | if (filter_info.can_mute) { | ||
64 | 1214 | var mute_link = node.one('a.mute-subscription'); | ||
65 | 1215 | mute_link.on('click', make_mute_handler(filter_info, node)); | ||
66 | 1216 | } | ||
67 | 1217 | var can_edit = (!filter_info.subscriber_is_team || | ||
68 | 1218 | filter_info.user_is_team_admin); | ||
69 | 1219 | if (can_edit) { | ||
70 | 1220 | >>>>>>> MERGE-SOURCE | ||
71 | 1209 | var edit_link = node.one('a.edit-subscription'); | 1221 | var edit_link = node.one('a.edit-subscription'); |
72 | 1210 | var edit_handler = make_edit_handler( | 1222 | var edit_handler = make_edit_handler( |
73 | 1211 | subscription, filter_info, filter_id, config); | 1223 | subscription, filter_info, filter_id, config); |
74 | @@ -1270,46 +1282,92 @@ | |||
75 | 1270 | filter_node.appendChild(Y.Node.create( | 1282 | filter_node.appendChild(Y.Node.create( |
76 | 1271 | '<strong class="filter-name"></strong>')); | 1283 | '<strong class="filter-name"></strong>')); |
77 | 1272 | 1284 | ||
118 | 1273 | if (filter_info.can_mute) { | 1285 | <<<<<<< TREE |
119 | 1274 | filter_node.appendChild(Y.Node.create( | 1286 | if (filter_info.can_mute) { |
120 | 1275 | '<em class="mute-label" style="padding-left: 1em;">You '+ | 1287 | filter_node.appendChild(Y.Node.create( |
121 | 1276 | 'do not receive emails from this subscription.</em>')); | 1288 | '<em class="mute-label" style="padding-left: 1em;">You '+ |
122 | 1277 | } | 1289 | 'do not receive emails from this subscription.</em>')); |
123 | 1278 | 1290 | } | |
124 | 1279 | var can_edit = (!filter_info.subscriber_is_team || | 1291 | |
125 | 1280 | filter_info.user_is_team_admin); | 1292 | var can_edit = (!filter_info.subscriber_is_team || |
126 | 1281 | 1293 | filter_info.user_is_team_admin); | |
127 | 1282 | var control = filter_node.appendChild( | 1294 | |
128 | 1283 | Y.Node.create('<span style="float: right"></span>')); | 1295 | var control = filter_node.appendChild( |
129 | 1284 | 1296 | Y.Node.create('<span style="float: right"></span>')); | |
130 | 1285 | if (filter_info.can_mute) { | 1297 | |
131 | 1286 | var link = control.appendChild(Y.Node.create( | 1298 | if (filter_info.can_mute) { |
132 | 1287 | '<a href="#" class="sprite js-action mute-subscription"></a>')); | 1299 | var link = control.appendChild(Y.Node.create( |
133 | 1288 | var help = control.appendChild(Y.Node.create( | 1300 | '<a href="#" class="sprite js-action mute-subscription"></a>')); |
134 | 1289 | '<a target="help" class="sprite maybe mute-help"'+ | 1301 | var help = control.appendChild(Y.Node.create( |
135 | 1290 | ' style="visibility: hidden;"'+ | 1302 | '<a target="help" class="sprite maybe mute-help"'+ |
136 | 1291 | ' href="/+help/structural-subscription-mute.html">'+ | 1303 | ' style="visibility: hidden;"'+ |
137 | 1292 | ' <span class="invisible-link">Delivery help</span>'+ | 1304 | ' href="/+help/structural-subscription-mute.html">'+ |
138 | 1293 | '</a>')); | 1305 | ' <span class="invisible-link">Delivery help</span>'+ |
139 | 1294 | // We store a reference to the timeout that will hide the help link so | 1306 | '</a>')); |
140 | 1295 | // we can cancel it if needed. | 1307 | // We store a reference to the timeout that will hide the help link so |
141 | 1296 | var hide_help_timeout; | 1308 | // we can cancel it if needed. |
142 | 1297 | var show_help = function () { | 1309 | var hide_help_timeout; |
143 | 1298 | help.setStyle('visibility', 'visible'); | 1310 | var show_help = function () { |
144 | 1299 | // Every time we trigger the display of the help link we need to | 1311 | help.setStyle('visibility', 'visible'); |
145 | 1300 | // cancel any pending hiding of the help link so it doesn't | 1312 | // Every time we trigger the display of the help link we need to |
146 | 1301 | // dissapear on us. If there isn't one pending, this is a NOP. | 1313 | // cancel any pending hiding of the help link so it doesn't |
147 | 1302 | clearTimeout(hide_help_timeout); | 1314 | // dissapear on us. If there isn't one pending, this is a NOP. |
148 | 1303 | }; | 1315 | clearTimeout(hide_help_timeout); |
149 | 1304 | var hide_help = function () { | 1316 | }; |
150 | 1305 | hide_help_timeout = setTimeout(function () { | 1317 | var hide_help = function () { |
151 | 1306 | help.setStyle('visibility', 'hidden'); | 1318 | hide_help_timeout = setTimeout(function () { |
152 | 1307 | }, 2000); | 1319 | help.setStyle('visibility', 'hidden'); |
153 | 1308 | }; | 1320 | }, 2000); |
154 | 1309 | link.on('hover', show_help, hide_help); | 1321 | }; |
155 | 1310 | help.on('hover', show_help, hide_help); | 1322 | link.on('hover', show_help, hide_help); |
156 | 1311 | } | 1323 | help.on('hover', show_help, hide_help); |
157 | 1312 | if (can_edit) { | 1324 | } |
158 | 1325 | if (can_edit) { | ||
159 | 1326 | ======= | ||
160 | 1327 | if (filter_info.can_mute) { | ||
161 | 1328 | filter_node.appendChild(Y.Node.create( | ||
162 | 1329 | '<em class="mute-label" style="padding-left: 1em;">You '+ | ||
163 | 1330 | 'do not receive emails from this subscription.</em>')); | ||
164 | 1331 | } | ||
165 | 1332 | |||
166 | 1333 | var control = filter_node.appendChild( | ||
167 | 1334 | Y.Node.create('<span style="float: right"></span>')); | ||
168 | 1335 | |||
169 | 1336 | if (filter_info.can_mute) { | ||
170 | 1337 | var link = control.appendChild(Y.Node.create( | ||
171 | 1338 | '<a href="#" class="sprite js-action mute-subscription"></a>')); | ||
172 | 1339 | var help = control.appendChild(Y.Node.create( | ||
173 | 1340 | '<a target="help" class="sprite maybe mute-help"'+ | ||
174 | 1341 | ' style="visibility: hidden;"'+ | ||
175 | 1342 | ' href="/+help/structural-subscription-mute.html">'+ | ||
176 | 1343 | ' <span class="invisible-link">Delivery help</span>'+ | ||
177 | 1344 | '</a>')); | ||
178 | 1345 | // For some reason the help link will not appear in Chrome unless | ||
179 | 1346 | // there is a non-empty element immediately after the help node. | ||
180 | 1347 | control.append(Y.Node.create('<span> </span>')); | ||
181 | 1348 | // We store a reference to the timeout that will hide the help link so | ||
182 | 1349 | // we can cancel it if needed. | ||
183 | 1350 | var hide_help_timeout; | ||
184 | 1351 | var show_help = function () { | ||
185 | 1352 | help.setStyle('visibility', 'visible'); | ||
186 | 1353 | // Every time we trigger the display of the help link we need to | ||
187 | 1354 | // cancel any pending hiding of the help link so it doesn't | ||
188 | 1355 | // dissapear on us. If there isn't one pending, this is a NOP. | ||
189 | 1356 | clearTimeout(hide_help_timeout); | ||
190 | 1357 | }; | ||
191 | 1358 | var hide_help = function () { | ||
192 | 1359 | hide_help_timeout = setTimeout(function () { | ||
193 | 1360 | help.setStyle('visibility', 'hidden'); | ||
194 | 1361 | }, 2000); | ||
195 | 1362 | }; | ||
196 | 1363 | link.on('hover', show_help, hide_help); | ||
197 | 1364 | help.on('hover', show_help, hide_help); | ||
198 | 1365 | } | ||
199 | 1366 | |||
200 | 1367 | var can_edit = (!filter_info.subscriber_is_team || | ||
201 | 1368 | filter_info.user_is_team_admin); | ||
202 | 1369 | if (can_edit) { | ||
203 | 1370 | >>>>>>> MERGE-SOURCE | ||
204 | 1313 | // User can edit the subscription. | 1371 | // User can edit the subscription. |
205 | 1314 | control.append(Y.Node.create( | 1372 | control.append(Y.Node.create( |
206 | 1315 | '<a href="#" style="margin-right: 2em;"'+ | 1373 | '<a href="#" style="margin-right: 2em;"'+ |
207 | 1316 | 1374 | ||
208 | === modified file 'scripts/get-stacked-on-branches.py' | |||
209 | --- scripts/get-stacked-on-branches.py 2010-04-27 19:48:39 +0000 | |||
210 | +++ scripts/get-stacked-on-branches.py 2011-04-20 15:18:58 +0000 | |||
211 | @@ -11,11 +11,12 @@ | |||
212 | 11 | 11 | ||
213 | 12 | Prints the stacked branches in Launchpad to standard output in the following | 12 | Prints the stacked branches in Launchpad to standard output in the following |
214 | 13 | format: | 13 | format: |
216 | 14 | <id> <branch_type> <unique_name> <stacked_on_unique_name> | 14 | <id> <branch_type> <unique_name> <stacked_on_id> <stacked_on_unique_name> |
217 | 15 | 15 | ||
218 | 16 | <id> is the database ID of the Branch as a decimal integer. | 16 | <id> is the database ID of the Branch as a decimal integer. |
219 | 17 | <branch_type> is the name of the BranchType, e.g. 'HOSTED'. | 17 | <branch_type> is the name of the BranchType, e.g. 'HOSTED'. |
220 | 18 | <unique_name> is the unique_name property of the Branch. | 18 | <unique_name> is the unique_name property of the Branch. |
221 | 19 | <stacked_on_id> is the database ID of the Branch.stacked_on branch | ||
222 | 19 | <stacked_on_unique_name> is the unique_name property of the Branch.stacked_on | 20 | <stacked_on_unique_name> is the unique_name property of the Branch.stacked_on |
223 | 20 | branch. | 21 | branch. |
224 | 21 | 22 | ||
225 | @@ -49,9 +50,10 @@ | |||
226 | 49 | """ | 50 | """ |
227 | 50 | execute_zcml_for_scripts() | 51 | execute_zcml_for_scripts() |
228 | 51 | for db_branch in get_stacked_branches(): | 52 | for db_branch in get_stacked_branches(): |
230 | 52 | print '%s %s %s %s' % ( | 53 | stacked_on = db_branch.stacked_on |
231 | 54 | print '%s %s %s %s %s' % ( | ||
232 | 53 | db_branch.id, db_branch.branch_type.name, db_branch.unique_name, | 55 | db_branch.id, db_branch.branch_type.name, db_branch.unique_name, |
234 | 54 | db_branch.stacked_on.unique_name) | 56 | stacked_on.id, stacked_on.unique_name) |
235 | 55 | 57 | ||
236 | 56 | 58 | ||
237 | 57 | if __name__ == '__main__': | 59 | if __name__ == '__main__': |
238 | 58 | 60 | ||
239 | === modified file 'scripts/update-stacked-on.py' | |||
240 | --- scripts/update-stacked-on.py 2010-05-19 18:07:56 +0000 | |||
241 | +++ scripts/update-stacked-on.py 2011-04-20 15:18:58 +0000 | |||
242 | @@ -8,7 +8,7 @@ | |||
243 | 8 | """Update stacked_on_location for all Bazaar branches. | 8 | """Update stacked_on_location for all Bazaar branches. |
244 | 9 | 9 | ||
245 | 10 | Expects standard input of: | 10 | Expects standard input of: |
247 | 11 | '<id> <branch_type> <unique_name> <stacked_on_unique_name>\n'. | 11 | '<id> <branch_type> <unique_name> <stacked_on_id> <stacked_on_unique_name>\n'. |
248 | 12 | 12 | ||
249 | 13 | Such input can be provided using "get-stacked-on-branches.py". | 13 | Such input can be provided using "get-stacked-on-branches.py". |
250 | 14 | 14 | ||
251 | @@ -21,6 +21,7 @@ | |||
252 | 21 | __metaclass__ = type | 21 | __metaclass__ = type |
253 | 22 | 22 | ||
254 | 23 | import _pythonpath | 23 | import _pythonpath |
255 | 24 | from collections import namedtuple | ||
256 | 24 | import sys | 25 | import sys |
257 | 25 | 26 | ||
258 | 26 | from bzrlib.bzrdir import BzrDir | 27 | from bzrlib.bzrdir import BzrDir |
259 | @@ -29,9 +30,13 @@ | |||
260 | 29 | 30 | ||
261 | 30 | from lp.codehosting.vfs import get_rw_server, get_ro_server | 31 | from lp.codehosting.vfs import get_rw_server, get_ro_server |
262 | 31 | from lp.codehosting.bzrutils import get_branch_stacked_on_url | 32 | from lp.codehosting.bzrutils import get_branch_stacked_on_url |
263 | 33 | from lp.code.interfaces.codehosting import branch_id_alias | ||
264 | 32 | from lp.services.scripts.base import LaunchpadScript | 34 | from lp.services.scripts.base import LaunchpadScript |
265 | 33 | 35 | ||
266 | 34 | 36 | ||
267 | 37 | FakeBranch = namedtuple('FakeBranch', 'id') | ||
268 | 38 | |||
269 | 39 | |||
270 | 35 | def set_branch_stacked_on_url(bzrdir, stacked_on_url): | 40 | def set_branch_stacked_on_url(bzrdir, stacked_on_url): |
271 | 36 | """Set the stacked_on_location for the branch at 'bzrdir'. | 41 | """Set the stacked_on_location for the branch at 'bzrdir'. |
272 | 37 | 42 | ||
273 | @@ -57,6 +62,10 @@ | |||
274 | 57 | dest="dry_run", | 62 | dest="dry_run", |
275 | 58 | help=("Don't change anything on disk, just go through the " | 63 | help=("Don't change anything on disk, just go through the " |
276 | 59 | "motions.")) | 64 | "motions.")) |
277 | 65 | self.parser.add_option( | ||
278 | 66 | '-i', '--id', default=False, action="store_true", | ||
279 | 67 | dest="stack_on_id", | ||
280 | 68 | help=("Stack on the +branch-id alias.")) | ||
281 | 60 | 69 | ||
282 | 61 | def main(self): | 70 | def main(self): |
283 | 62 | if self.options.dry_run: | 71 | if self.options.dry_run: |
284 | @@ -131,8 +140,12 @@ | |||
285 | 131 | """ | 140 | """ |
286 | 132 | for branch_info in branches: | 141 | for branch_info in branches: |
287 | 133 | (branch_id, branch_type, unique_name, | 142 | (branch_id, branch_type, unique_name, |
290 | 134 | stacked_on_name) = branch_info | 143 | stacked_on_id, stacked_on_name) = branch_info |
291 | 135 | stacked_on_location = '/' + stacked_on_name | 144 | if self.options.stack_on_id: |
292 | 145 | branch = FakeBranch(stacked_on_id) | ||
293 | 146 | stacked_on_location = branch_id_alias(branch) | ||
294 | 147 | else: | ||
295 | 148 | stacked_on_location = '/' + stacked_on_name | ||
296 | 136 | self.updateStackedOn( | 149 | self.updateStackedOn( |
297 | 137 | branch_id, 'lp-internal:///' + unique_name, | 150 | branch_id, 'lp-internal:///' + unique_name, |
298 | 138 | stacked_on_location) | 151 | stacked_on_location) |