Merge lp:~benji/launchpad/fix-help-link into lp:launchpad/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
Reviewer Review Type Date Requested Status
Launchpad code reviewers Pending
Review via email: mp+58518@code.launchpad.net
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
=== modified file 'lib/canonical/launchpad/templates/launchpad-loginstatus.pt'
--- lib/canonical/launchpad/templates/launchpad-loginstatus.pt 2011-03-29 06:00:48 +0000
+++ lib/canonical/launchpad/templates/launchpad-loginstatus.pt 2011-04-20 15:18:58 +0000
@@ -7,7 +7,7 @@
7<div id="logincontrol" tal:condition="view/login_shown"7<div id="logincontrol" tal:condition="view/login_shown"
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>
9<div id="logincontrol" tal:condition="view/logged_in">9<div id="logincontrol" tal:condition="view/logged_in">
10 <form action="+logout" method="post">10 <form action="/+logout" method="post">
11 <input type="hidden" name="loggingout" value="1" />11 <input type="hidden" name="loggingout" value="1" />
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>
13 <div id="ajax-time" tal:condition="request/features/visible_render_time">13 <div id="ajax-time" tal:condition="request/features/visible_render_time">
1414
=== modified file 'lib/lp/bugs/javascript/bugtask_index.js'
--- lib/lp/bugs/javascript/bugtask_index.js 2011-04-12 12:16:03 +0000
+++ lib/lp/bugs/javascript/bugtask_index.js 2011-04-20 15:18:58 +0000
@@ -386,7 +386,7 @@
386 if (bugs_private_notification_enabled) {386 if (bugs_private_notification_enabled) {
387 if (Y.one('.global-notification').hasClass('hidden')) {387 if (Y.one('.global-notification').hasClass('hidden')) {
388 Y.one('.portlet.private').setStyle('color', '#333');388 Y.one('.portlet.private').setStyle('color', '#333');
389 Y.one('.portlet.private').setStyle('background-color', '#fbfbfb');389 Y.one('.portlet.private').setStyle('backgroundColor', '#fbfbfb');
390 }390 }
391 }391 }
392 Y.one('body').replaceClass('private', 'public');392 Y.one('body').replaceClass('private', 'public');
@@ -454,7 +454,7 @@
454 });454 });
455 var body_space = new Y.Anim({455 var body_space = new Y.Anim({
456 node: 'body',456 node: 'body',
457 to: {'padding-top': '40px'},457 to: {'paddingTop': '40px'},
458 duration: 0.2,458 duration: 0.2,
459 easing: Y.Easing.easeOut459 easing: Y.Easing.easeOut
460 });460 });
@@ -493,7 +493,7 @@
493 });493 });
494 var body_space = new Y.Anim({494 var body_space = new Y.Anim({
495 node: 'body',495 node: 'body',
496 to: {'padding-top': 0},496 to: {'paddingTop': 0},
497 duration: 0.2,497 duration: 0.2,
498 easing: Y.Easing.easeOut498 easing: Y.Easing.easeOut
499 });499 });
500500
=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js 2011-04-19 07:18:42 +0000
+++ lib/lp/registry/javascript/structural-subscription.js 2011-04-20 15:18:58 +0000
@@ -1198,6 +1198,7 @@
1198function wire_up_edit_links_for_filter(1198function wire_up_edit_links_for_filter(
1199 config, subscription, subscription_id, filter_info, filter_id,1199 config, subscription, subscription_id, filter_info, filter_id,
1200 filter_node) {1200 filter_node) {
1201<<<<<<< TREE
1201 var node = filter_node || Y.one(1202 var node = filter_node || Y.one(
1202 '#subscription-filter-'+filter_id.toString());1203 '#subscription-filter-'+filter_id.toString());
1203 if (filter_info.can_mute) {1204 if (filter_info.can_mute) {
@@ -1206,6 +1207,17 @@
1206 }1207 }
1207 if (!filter_info.subscriber_is_team ||1208 if (!filter_info.subscriber_is_team ||
1208 filter_info.user_is_team_admin) {1209 filter_info.user_is_team_admin) {
1210=======
1211 var node = filter_node || Y.one(
1212 '#subscription-filter-'+filter_id.toString());
1213 if (filter_info.can_mute) {
1214 var mute_link = node.one('a.mute-subscription');
1215 mute_link.on('click', make_mute_handler(filter_info, node));
1216 }
1217 var can_edit = (!filter_info.subscriber_is_team ||
1218 filter_info.user_is_team_admin);
1219 if (can_edit) {
1220>>>>>>> MERGE-SOURCE
1209 var edit_link = node.one('a.edit-subscription');1221 var edit_link = node.one('a.edit-subscription');
1210 var edit_handler = make_edit_handler(1222 var edit_handler = make_edit_handler(
1211 subscription, filter_info, filter_id, config);1223 subscription, filter_info, filter_id, config);
@@ -1270,46 +1282,92 @@
1270 filter_node.appendChild(Y.Node.create(1282 filter_node.appendChild(Y.Node.create(
1271 '<strong class="filter-name"></strong>'));1283 '<strong class="filter-name"></strong>'));
12721284
1273 if (filter_info.can_mute) {1285<<<<<<< TREE
1274 filter_node.appendChild(Y.Node.create(1286 if (filter_info.can_mute) {
1275 '<em class="mute-label" style="padding-left: 1em;">You '+1287 filter_node.appendChild(Y.Node.create(
1276 'do not receive emails from this subscription.</em>'));1288 '<em class="mute-label" style="padding-left: 1em;">You '+
1277 }1289 'do not receive emails from this subscription.</em>'));
12781290 }
1279 var can_edit = (!filter_info.subscriber_is_team ||1291
1280 filter_info.user_is_team_admin);1292 var can_edit = (!filter_info.subscriber_is_team ||
12811293 filter_info.user_is_team_admin);
1282 var control = filter_node.appendChild(1294
1283 Y.Node.create('<span style="float: right"></span>'));1295 var control = filter_node.appendChild(
12841296 Y.Node.create('<span style="float: right"></span>'));
1285 if (filter_info.can_mute) {1297
1286 var link = control.appendChild(Y.Node.create(1298 if (filter_info.can_mute) {
1287 '<a href="#" class="sprite js-action mute-subscription"></a>'));1299 var link = control.appendChild(Y.Node.create(
1288 var help = control.appendChild(Y.Node.create(1300 '<a href="#" class="sprite js-action mute-subscription"></a>'));
1289 '<a target="help" class="sprite maybe mute-help"'+1301 var help = control.appendChild(Y.Node.create(
1290 ' style="visibility: hidden;"'+1302 '<a target="help" class="sprite maybe mute-help"'+
1291 ' href="/+help/structural-subscription-mute.html">'+1303 ' style="visibility: hidden;"'+
1292 ' <span class="invisible-link">Delivery help</span>'+1304 ' href="/+help/structural-subscription-mute.html">'+
1293 '</a>'));1305 ' <span class="invisible-link">Delivery help</span>'+
1294 // We store a reference to the timeout that will hide the help link so1306 '</a>'));
1295 // we can cancel it if needed.1307 // We store a reference to the timeout that will hide the help link so
1296 var hide_help_timeout;1308 // we can cancel it if needed.
1297 var show_help = function () {1309 var hide_help_timeout;
1298 help.setStyle('visibility', 'visible');1310 var show_help = function () {
1299 // Every time we trigger the display of the help link we need to1311 help.setStyle('visibility', 'visible');
1300 // cancel any pending hiding of the help link so it doesn't1312 // Every time we trigger the display of the help link we need to
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
1302 clearTimeout(hide_help_timeout);1314 // dissapear on us. If there isn't one pending, this is a NOP.
1303 };1315 clearTimeout(hide_help_timeout);
1304 var hide_help = function () {1316 };
1305 hide_help_timeout = setTimeout(function () {1317 var hide_help = function () {
1306 help.setStyle('visibility', 'hidden');1318 hide_help_timeout = setTimeout(function () {
1307 }, 2000);1319 help.setStyle('visibility', 'hidden');
1308 };1320 }, 2000);
1309 link.on('hover', show_help, hide_help);1321 };
1310 help.on('hover', show_help, hide_help);1322 link.on('hover', show_help, hide_help);
1311 }1323 help.on('hover', show_help, hide_help);
1312 if (can_edit) {1324 }
1325 if (can_edit) {
1326=======
1327 if (filter_info.can_mute) {
1328 filter_node.appendChild(Y.Node.create(
1329 '<em class="mute-label" style="padding-left: 1em;">You '+
1330 'do not receive emails from this subscription.</em>'));
1331 }
1332
1333 var control = filter_node.appendChild(
1334 Y.Node.create('<span style="float: right"></span>'));
1335
1336 if (filter_info.can_mute) {
1337 var link = control.appendChild(Y.Node.create(
1338 '<a href="#" class="sprite js-action mute-subscription"></a>'));
1339 var help = control.appendChild(Y.Node.create(
1340 '<a target="help" class="sprite maybe mute-help"'+
1341 ' style="visibility: hidden;"'+
1342 ' href="/+help/structural-subscription-mute.html">'+
1343 ' <span class="invisible-link">Delivery help</span>'+
1344 '</a>'));
1345 // For some reason the help link will not appear in Chrome unless
1346 // there is a non-empty element immediately after the help node.
1347 control.append(Y.Node.create('<span>&nbsp;</span>'));
1348 // We store a reference to the timeout that will hide the help link so
1349 // we can cancel it if needed.
1350 var hide_help_timeout;
1351 var show_help = function () {
1352 help.setStyle('visibility', 'visible');
1353 // Every time we trigger the display of the help link we need to
1354 // cancel any pending hiding of the help link so it doesn't
1355 // dissapear on us. If there isn't one pending, this is a NOP.
1356 clearTimeout(hide_help_timeout);
1357 };
1358 var hide_help = function () {
1359 hide_help_timeout = setTimeout(function () {
1360 help.setStyle('visibility', 'hidden');
1361 }, 2000);
1362 };
1363 link.on('hover', show_help, hide_help);
1364 help.on('hover', show_help, hide_help);
1365 }
1366
1367 var can_edit = (!filter_info.subscriber_is_team ||
1368 filter_info.user_is_team_admin);
1369 if (can_edit) {
1370>>>>>>> MERGE-SOURCE
1313 // User can edit the subscription.1371 // User can edit the subscription.
1314 control.append(Y.Node.create(1372 control.append(Y.Node.create(
1315 '<a href="#" style="margin-right: 2em;"'+1373 '<a href="#" style="margin-right: 2em;"'+
13161374
=== modified file 'scripts/get-stacked-on-branches.py'
--- scripts/get-stacked-on-branches.py 2010-04-27 19:48:39 +0000
+++ scripts/get-stacked-on-branches.py 2011-04-20 15:18:58 +0000
@@ -11,11 +11,12 @@
1111
12Prints the stacked branches in Launchpad to standard output in the following12Prints the stacked branches in Launchpad to standard output in the following
13format:13format:
14 <id> <branch_type> <unique_name> <stacked_on_unique_name>14 <id> <branch_type> <unique_name> <stacked_on_id> <stacked_on_unique_name>
1515
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.
17<branch_type> is the name of the BranchType, e.g. 'HOSTED'.17<branch_type> is the name of the BranchType, e.g. 'HOSTED'.
18<unique_name> is the unique_name property of the Branch.18<unique_name> is the unique_name property of the Branch.
19<stacked_on_id> is the database ID of the Branch.stacked_on branch
19<stacked_on_unique_name> is the unique_name property of the Branch.stacked_on20<stacked_on_unique_name> is the unique_name property of the Branch.stacked_on
20 branch.21 branch.
2122
@@ -49,9 +50,10 @@
49 """50 """
50 execute_zcml_for_scripts()51 execute_zcml_for_scripts()
51 for db_branch in get_stacked_branches():52 for db_branch in get_stacked_branches():
52 print '%s %s %s %s' % (53 stacked_on = db_branch.stacked_on
54 print '%s %s %s %s %s' % (
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,
54 db_branch.stacked_on.unique_name)56 stacked_on.id, stacked_on.unique_name)
5557
5658
57if __name__ == '__main__':59if __name__ == '__main__':
5860
=== modified file 'scripts/update-stacked-on.py'
--- scripts/update-stacked-on.py 2010-05-19 18:07:56 +0000
+++ scripts/update-stacked-on.py 2011-04-20 15:18:58 +0000
@@ -8,7 +8,7 @@
8"""Update stacked_on_location for all Bazaar branches.8"""Update stacked_on_location for all Bazaar branches.
99
10Expects standard input of:10Expects standard input of:
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'.
1212
13Such input can be provided using "get-stacked-on-branches.py".13Such input can be provided using "get-stacked-on-branches.py".
1414
@@ -21,6 +21,7 @@
21__metaclass__ = type21__metaclass__ = type
2222
23import _pythonpath23import _pythonpath
24from collections import namedtuple
24import sys25import sys
2526
26from bzrlib.bzrdir import BzrDir27from bzrlib.bzrdir import BzrDir
@@ -29,9 +30,13 @@
2930
30from lp.codehosting.vfs import get_rw_server, get_ro_server31from lp.codehosting.vfs import get_rw_server, get_ro_server
31from lp.codehosting.bzrutils import get_branch_stacked_on_url32from lp.codehosting.bzrutils import get_branch_stacked_on_url
33from lp.code.interfaces.codehosting import branch_id_alias
32from lp.services.scripts.base import LaunchpadScript34from lp.services.scripts.base import LaunchpadScript
3335
3436
37FakeBranch = namedtuple('FakeBranch', 'id')
38
39
35def set_branch_stacked_on_url(bzrdir, stacked_on_url):40def set_branch_stacked_on_url(bzrdir, stacked_on_url):
36 """Set the stacked_on_location for the branch at 'bzrdir'.41 """Set the stacked_on_location for the branch at 'bzrdir'.
3742
@@ -57,6 +62,10 @@
57 dest="dry_run",62 dest="dry_run",
58 help=("Don't change anything on disk, just go through the "63 help=("Don't change anything on disk, just go through the "
59 "motions."))64 "motions."))
65 self.parser.add_option(
66 '-i', '--id', default=False, action="store_true",
67 dest="stack_on_id",
68 help=("Stack on the +branch-id alias."))
6069
61 def main(self):70 def main(self):
62 if self.options.dry_run:71 if self.options.dry_run:
@@ -131,8 +140,12 @@
131 """140 """
132 for branch_info in branches:141 for branch_info in branches:
133 (branch_id, branch_type, unique_name,142 (branch_id, branch_type, unique_name,
134 stacked_on_name) = branch_info143 stacked_on_id, stacked_on_name) = branch_info
135 stacked_on_location = '/' + stacked_on_name144 if self.options.stack_on_id:
145 branch = FakeBranch(stacked_on_id)
146 stacked_on_location = branch_id_alias(branch)
147 else:
148 stacked_on_location = '/' + stacked_on_name
136 self.updateStackedOn(149 self.updateStackedOn(
137 branch_id, 'lp-internal:///' + unique_name,150 branch_id, 'lp-internal:///' + unique_name,
138 stacked_on_location)151 stacked_on_location)

Subscribers

People subscribed via source and target branches

to status/vote changes: