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
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 <div id="logincontrol" tal:condition="view/login_shown"
6 ><a tal:attributes="href view/login_url">Log in / Register</a></div>
7 <div id="logincontrol" tal:condition="view/logged_in">
8- <form action="+logout" method="post">
9+ <form action="/+logout" method="post">
10 <input type="hidden" name="loggingout" value="1" />
11 <div id="rendertime" tal:condition="request/features/visible_render_time">Loading...</div>
12 <div id="ajax-time" tal:condition="request/features/visible_render_time">
13
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 if (bugs_private_notification_enabled) {
19 if (Y.one('.global-notification').hasClass('hidden')) {
20 Y.one('.portlet.private').setStyle('color', '#333');
21- Y.one('.portlet.private').setStyle('background-color', '#fbfbfb');
22+ Y.one('.portlet.private').setStyle('backgroundColor', '#fbfbfb');
23 }
24 }
25 Y.one('body').replaceClass('private', 'public');
26@@ -454,7 +454,7 @@
27 });
28 var body_space = new Y.Anim({
29 node: 'body',
30- to: {'padding-top': '40px'},
31+ to: {'paddingTop': '40px'},
32 duration: 0.2,
33 easing: Y.Easing.easeOut
34 });
35@@ -493,7 +493,7 @@
36 });
37 var body_space = new Y.Anim({
38 node: 'body',
39- to: {'padding-top': 0},
40+ to: {'paddingTop': 0},
41 duration: 0.2,
42 easing: Y.Easing.easeOut
43 });
44
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 function wire_up_edit_links_for_filter(
50 config, subscription, subscription_id, filter_info, filter_id,
51 filter_node) {
52+<<<<<<< TREE
53 var node = filter_node || Y.one(
54 '#subscription-filter-'+filter_id.toString());
55 if (filter_info.can_mute) {
56@@ -1206,6 +1207,17 @@
57 }
58 if (!filter_info.subscriber_is_team ||
59 filter_info.user_is_team_admin) {
60+=======
61+ var node = filter_node || Y.one(
62+ '#subscription-filter-'+filter_id.toString());
63+ if (filter_info.can_mute) {
64+ var mute_link = node.one('a.mute-subscription');
65+ mute_link.on('click', make_mute_handler(filter_info, node));
66+ }
67+ var can_edit = (!filter_info.subscriber_is_team ||
68+ filter_info.user_is_team_admin);
69+ if (can_edit) {
70+>>>>>>> MERGE-SOURCE
71 var edit_link = node.one('a.edit-subscription');
72 var edit_handler = make_edit_handler(
73 subscription, filter_info, filter_id, config);
74@@ -1270,46 +1282,92 @@
75 filter_node.appendChild(Y.Node.create(
76 '<strong class="filter-name"></strong>'));
77
78- if (filter_info.can_mute) {
79- filter_node.appendChild(Y.Node.create(
80- '<em class="mute-label" style="padding-left: 1em;">You '+
81- 'do not receive emails from this subscription.</em>'));
82- }
83-
84- var can_edit = (!filter_info.subscriber_is_team ||
85- filter_info.user_is_team_admin);
86-
87- var control = filter_node.appendChild(
88- Y.Node.create('<span style="float: right"></span>'));
89-
90- if (filter_info.can_mute) {
91- var link = control.appendChild(Y.Node.create(
92- '<a href="#" class="sprite js-action mute-subscription"></a>'));
93- var help = control.appendChild(Y.Node.create(
94- '<a target="help" class="sprite maybe mute-help"'+
95- ' style="visibility: hidden;"'+
96- ' href="/+help/structural-subscription-mute.html">'+
97- ' <span class="invisible-link">Delivery help</span>'+
98- '</a>'));
99- // We store a reference to the timeout that will hide the help link so
100- // we can cancel it if needed.
101- var hide_help_timeout;
102- var show_help = function () {
103- help.setStyle('visibility', 'visible');
104- // Every time we trigger the display of the help link we need to
105- // cancel any pending hiding of the help link so it doesn't
106- // dissapear on us. If there isn't one pending, this is a NOP.
107- clearTimeout(hide_help_timeout);
108- };
109- var hide_help = function () {
110- hide_help_timeout = setTimeout(function () {
111- help.setStyle('visibility', 'hidden');
112- }, 2000);
113- };
114- link.on('hover', show_help, hide_help);
115- help.on('hover', show_help, hide_help);
116- }
117- if (can_edit) {
118+<<<<<<< TREE
119+ if (filter_info.can_mute) {
120+ filter_node.appendChild(Y.Node.create(
121+ '<em class="mute-label" style="padding-left: 1em;">You '+
122+ 'do not receive emails from this subscription.</em>'));
123+ }
124+
125+ var can_edit = (!filter_info.subscriber_is_team ||
126+ filter_info.user_is_team_admin);
127+
128+ var control = filter_node.appendChild(
129+ Y.Node.create('<span style="float: right"></span>'));
130+
131+ if (filter_info.can_mute) {
132+ var link = control.appendChild(Y.Node.create(
133+ '<a href="#" class="sprite js-action mute-subscription"></a>'));
134+ var help = control.appendChild(Y.Node.create(
135+ '<a target="help" class="sprite maybe mute-help"'+
136+ ' style="visibility: hidden;"'+
137+ ' href="/+help/structural-subscription-mute.html">'+
138+ ' <span class="invisible-link">Delivery help</span>'+
139+ '</a>'));
140+ // We store a reference to the timeout that will hide the help link so
141+ // we can cancel it if needed.
142+ var hide_help_timeout;
143+ var show_help = function () {
144+ help.setStyle('visibility', 'visible');
145+ // Every time we trigger the display of the help link we need to
146+ // cancel any pending hiding of the help link so it doesn't
147+ // dissapear on us. If there isn't one pending, this is a NOP.
148+ clearTimeout(hide_help_timeout);
149+ };
150+ var hide_help = function () {
151+ hide_help_timeout = setTimeout(function () {
152+ help.setStyle('visibility', 'hidden');
153+ }, 2000);
154+ };
155+ link.on('hover', show_help, hide_help);
156+ help.on('hover', show_help, hide_help);
157+ }
158+ if (can_edit) {
159+=======
160+ if (filter_info.can_mute) {
161+ filter_node.appendChild(Y.Node.create(
162+ '<em class="mute-label" style="padding-left: 1em;">You '+
163+ 'do not receive emails from this subscription.</em>'));
164+ }
165+
166+ var control = filter_node.appendChild(
167+ Y.Node.create('<span style="float: right"></span>'));
168+
169+ if (filter_info.can_mute) {
170+ var link = control.appendChild(Y.Node.create(
171+ '<a href="#" class="sprite js-action mute-subscription"></a>'));
172+ var help = control.appendChild(Y.Node.create(
173+ '<a target="help" class="sprite maybe mute-help"'+
174+ ' style="visibility: hidden;"'+
175+ ' href="/+help/structural-subscription-mute.html">'+
176+ ' <span class="invisible-link">Delivery help</span>'+
177+ '</a>'));
178+ // For some reason the help link will not appear in Chrome unless
179+ // there is a non-empty element immediately after the help node.
180+ control.append(Y.Node.create('<span>&nbsp;</span>'));
181+ // We store a reference to the timeout that will hide the help link so
182+ // we can cancel it if needed.
183+ var hide_help_timeout;
184+ var show_help = function () {
185+ help.setStyle('visibility', 'visible');
186+ // Every time we trigger the display of the help link we need to
187+ // cancel any pending hiding of the help link so it doesn't
188+ // dissapear on us. If there isn't one pending, this is a NOP.
189+ clearTimeout(hide_help_timeout);
190+ };
191+ var hide_help = function () {
192+ hide_help_timeout = setTimeout(function () {
193+ help.setStyle('visibility', 'hidden');
194+ }, 2000);
195+ };
196+ link.on('hover', show_help, hide_help);
197+ help.on('hover', show_help, hide_help);
198+ }
199+
200+ var can_edit = (!filter_info.subscriber_is_team ||
201+ filter_info.user_is_team_admin);
202+ if (can_edit) {
203+>>>>>>> MERGE-SOURCE
204 // User can edit the subscription.
205 control.append(Y.Node.create(
206 '<a href="#" style="margin-right: 2em;"'+
207
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
213 Prints the stacked branches in Launchpad to standard output in the following
214 format:
215- <id> <branch_type> <unique_name> <stacked_on_unique_name>
216+ <id> <branch_type> <unique_name> <stacked_on_id> <stacked_on_unique_name>
217
218 <id> is the database ID of the Branch as a decimal integer.
219 <branch_type> is the name of the BranchType, e.g. 'HOSTED'.
220 <unique_name> is the unique_name property of the Branch.
221+<stacked_on_id> is the database ID of the Branch.stacked_on branch
222 <stacked_on_unique_name> is the unique_name property of the Branch.stacked_on
223 branch.
224
225@@ -49,9 +50,10 @@
226 """
227 execute_zcml_for_scripts()
228 for db_branch in get_stacked_branches():
229- print '%s %s %s %s' % (
230+ stacked_on = db_branch.stacked_on
231+ print '%s %s %s %s %s' % (
232 db_branch.id, db_branch.branch_type.name, db_branch.unique_name,
233- db_branch.stacked_on.unique_name)
234+ stacked_on.id, stacked_on.unique_name)
235
236
237 if __name__ == '__main__':
238
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 """Update stacked_on_location for all Bazaar branches.
244
245 Expects standard input of:
246- '<id> <branch_type> <unique_name> <stacked_on_unique_name>\n'.
247+ '<id> <branch_type> <unique_name> <stacked_on_id> <stacked_on_unique_name>\n'.
248
249 Such input can be provided using "get-stacked-on-branches.py".
250
251@@ -21,6 +21,7 @@
252 __metaclass__ = type
253
254 import _pythonpath
255+from collections import namedtuple
256 import sys
257
258 from bzrlib.bzrdir import BzrDir
259@@ -29,9 +30,13 @@
260
261 from lp.codehosting.vfs import get_rw_server, get_ro_server
262 from lp.codehosting.bzrutils import get_branch_stacked_on_url
263+from lp.code.interfaces.codehosting import branch_id_alias
264 from lp.services.scripts.base import LaunchpadScript
265
266
267+FakeBranch = namedtuple('FakeBranch', 'id')
268+
269+
270 def set_branch_stacked_on_url(bzrdir, stacked_on_url):
271 """Set the stacked_on_location for the branch at 'bzrdir'.
272
273@@ -57,6 +62,10 @@
274 dest="dry_run",
275 help=("Don't change anything on disk, just go through the "
276 "motions."))
277+ self.parser.add_option(
278+ '-i', '--id', default=False, action="store_true",
279+ dest="stack_on_id",
280+ help=("Stack on the +branch-id alias."))
281
282 def main(self):
283 if self.options.dry_run:
284@@ -131,8 +140,12 @@
285 """
286 for branch_info in branches:
287 (branch_id, branch_type, unique_name,
288- stacked_on_name) = branch_info
289- stacked_on_location = '/' + stacked_on_name
290+ stacked_on_id, stacked_on_name) = branch_info
291+ if self.options.stack_on_id:
292+ branch = FakeBranch(stacked_on_id)
293+ stacked_on_location = branch_id_alias(branch)
294+ else:
295+ stacked_on_location = '/' + stacked_on_name
296 self.updateStackedOn(
297 branch_id, 'lp-internal:///' + unique_name,
298 stacked_on_location)

Subscribers

People subscribed via source and target branches

to status/vote changes: