← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~benji/launchpad/bug-771751 into lp:launchpad

 

Benji York has proposed merging lp:~benji/launchpad/bug-771751 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #771232 in Launchpad itself: "Edit structural subscription overlay is headed "Add a mail subscription for...""
  https://bugs.launchpad.net/launchpad/+bug/771232
  Bug #771751 in Launchpad itself: ""Edit all of your subscriptions" oversells what the page does"
  https://bugs.launchpad.net/launchpad/+bug/771751

For more details, see:
https://code.launchpad.net/~benji/launchpad/bug-771751/+merge/59280

This branch fixes a couple of small UI bugs (bug 771751 and bug 771232)
by changing some UI text.

The make lint report is clean.

The related JS test is
lib/lp/registry/javascript/tests/test_structural_subscription.html which
can be run by loading that file in your browser.

-- 
https://code.launchpad.net/~benji/launchpad/bug-771751/+merge/59280
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~benji/launchpad/bug-771751 into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py	2011-04-21 17:35:05 +0000
+++ lib/lp/bugs/browser/bug.py	2011-04-27 19:44:25 +0000
@@ -275,7 +275,7 @@
 
     def editsubscriptions(self):
         """Return the 'Edit subscriptions' Link."""
-        text = 'Edit all of your subscriptions'
+        text = 'Edit bug mail'
         return Link(
             '+subscriptions', text, icon='edit', summary=(
                 'View and change your subscriptions to this bug'))

=== modified file 'lib/lp/registry/javascript/structural-subscription.js'
--- lib/lp/registry/javascript/structural-subscription.js	2011-04-21 21:13:49 +0000
+++ lib/lp/registry/javascript/structural-subscription.js	2011-04-27 19:44:25 +0000
@@ -324,12 +324,14 @@
  * Populate the overlay element with the contents of the add/edit form.
  */
 function create_overlay(content_box_id, overlay_id, submit_button,
-                        submit_callback, success_callback) {
+                        submit_callback, success_callback, verb) {
     // Create the overlay.
+    var title = verb + ' a mail subscription for ' + LP.cache.context.title
+        + ' bugs';
     namespace._add_subscription_overlay = new Y.lazr.FormOverlay({
-        headerContent:
-            '<h2 id="subscription-overlay-title">Add a mail subscription '+
-            'for '+LP.cache.context.title + ' bugs</h2>',
+        headerContent: Y.Node.create('<h2/>')
+            .set('id', 'subscription-overlay-title')
+            .set('text', title),
         form_content: Y.one(overlay_id),
         visible: false,
         form_submit_button: submit_button,
@@ -1060,7 +1062,8 @@
     create_overlay(
         config.content_box, overlay_id, submit_button,
         function (form_data) {
-            return edit_subscription_handler(context, form_data);});
+            return edit_subscription_handler(context, form_data);},
+        'Edit');
 
     load_overlay_with_filter_data(content_node, filter_info);
     var title = subscription.target_title;
@@ -1569,7 +1572,7 @@
 
     var save_subscription = make_add_subscription_handler(success_callback);
     create_overlay(config.content_box, overlay_id, submit_button,
-                   save_subscription, success_callback);
+                   save_subscription, success_callback, 'Add');
     // We need to initialize the help links.  They may have already been
     // initialized except for the ones we added, so setupHelpTrigger
     // is idempotent.  Notice that this is old MochiKit code.