← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/unmute-tooltip into lp:launchpad

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/unmute-tooltip into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #795195 in Launchpad itself: "Tooltip for "Unmute bug mail" says "Mute this bug...""
  https://bugs.launchpad.net/launchpad/+bug/795195

For more details, see:
https://code.launchpad.net/~stevenk/launchpad/unmute-tooltip/+merge/190857

Fix the tooltip when muting or unmuting a bug subscription. I am unhappy that the text is duplicated in the python and the JS, but I can not think of a clean way to remove the duplication.
-- 
https://code.launchpad.net/~stevenk/launchpad/unmute-tooltip/+merge/190857
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/unmute-tooltip into lp:launchpad.
=== modified file 'lib/lp/bugs/browser/bug.py'
--- lib/lp/bugs/browser/bug.py	2013-04-11 04:54:27 +0000
+++ lib/lp/bugs/browser/bug.py	2013-10-14 05:34:57 +0000
@@ -305,14 +305,15 @@
         if self.context.bug.isMuted(user):
             text = "Unmute bug mail"
             icon = 'unmute'
+            summary = (
+                'Unmute this bug so that you will receive emails about it.')
         else:
             text = "Mute bug mail"
             icon = 'mute'
+            summary = (
+                'Mute this bug so that you will not receive emails about it.')
 
-        return Link(
-            '+mute', text, icon=icon, summary=(
-                "Mute this bug so that you will not receive emails "
-                "about it."))
+        return Link('+mute', text, icon=icon, summary=summary)
 
     def nominate(self):
         """Return the 'Target/Nominate for series' Link."""

=== modified file 'lib/lp/bugs/javascript/bug_subscription_portlet.js'
--- lib/lp/bugs/javascript/bug_subscription_portlet.js	2012-09-11 14:30:45 +0000
+++ lib/lp/bugs/javascript/bug_subscription_portlet.js	2013-10-14 05:34:57 +0000
@@ -138,16 +138,19 @@
         }
         var is_muted = link.hasClass(MUTED_CLASS);
         var method_name, current_class, destination_class, destination_text;
+        var destination_title;
         if (is_muted) {
             method_name = 'unmute';
             current_class = MUTED_CLASS;
             destination_class = UNMUTED_CLASS;
             destination_text = 'Mute bug mail';
+            destination_title = 'Mute this bug so that you will not receive emails about it.';
         } else {
             method_name = 'mute';
             current_class = UNMUTED_CLASS;
             destination_class = MUTED_CLASS;
             destination_text = 'Unmute bug mail';
+            destination_title = 'Unmute this bug so that you will receive emails about it.';
         }
         link.replaceClass(current_class, 'spinner');
         var handler = new Y.lp.client.ErrorHandler();
@@ -162,6 +165,7 @@
                 success: function(response) {
                     link.replaceClass('spinner', destination_class);
                     link.set('text', destination_text);
+                    link.set('title', destination_title);
                     update_subscription_status();
                     Y.lp.anim.green_flash(
                         { node: link.get('parentNode') }).run();


Follow ups