← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~thumper/launchpad/kill-bad-form-preloads into lp:launchpad/devel

 

Tim Penhey has proposed merging lp:~thumper/launchpad/kill-bad-form-preloads into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  #659050 Edit button appears but not able to edit branch status
  https://bugs.launchpad.net/bugs/659050
  #663075 Branch index page fails to load bug linking and subscription overlays when not logged in
  https://bugs.launchpad.net/bugs/663075


Several simple changes to stop lots of 404s.

Only do the javascript binding and loading of the forms if the user is logged in.

Windmill tests should be sufficient.
-- 
https://code.launchpad.net/~thumper/launchpad/kill-bad-form-preloads/+merge/38800
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~thumper/launchpad/kill-bad-form-preloads into lp:launchpad/devel.
=== modified file 'lib/lp/code/templates/branch-index.pt'
--- lib/lp/code/templates/branch-index.pt	2010-05-28 16:14:15 +0000
+++ lib/lp/code/templates/branch-index.pt	2010-10-19 03:11:44 +0000
@@ -36,15 +36,18 @@
               'lp.code.branch.subscription', function(Y) {
 
         Y.on('load', function(e) {
-            var subscription_portlet = new Y.lp.code.branch.subscription.SubscriptionWidget({
-                contentBox: '#portlet-subscribers'
-            });
-            subscription_portlet.render();
-
-            Y.lp.code.branch.status.connect_status(${view/status_config});
+            var logged_in = LP.client.links['me'] !== undefined;
+
+            if (logged_in) {
+                var subscription_portlet = new Y.lp.code.branch.subscription.SubscriptionWidget({
+                    contentBox: '#portlet-subscribers'
+                });
+                subscription_portlet.render();
+
+                Y.lp.code.branch.status.connect_status(${view/status_config});
+            }
             Y.lp.code.branchmergeproposal.diff.connect_diff_links();
-            },
-            window);
+        }, window);
     });
   "/>
 </metal:block>

=== modified file 'lib/lp/code/templates/branch-information.pt'
--- lib/lp/code/templates/branch-information.pt	2009-09-28 21:46:01 +0000
+++ lib/lp/code/templates/branch-information.pt	2010-10-19 03:11:44 +0000
@@ -26,7 +26,7 @@
         <span id="branch-details-status-value">
         <span tal:attributes="class string:value branchstatus${context/lifecycle_status/name}"
               tal:content="structure context/lifecycle_status/title" />&nbsp;
-        <a href="+edit-status">
+        <a href="+edit-status" tal:condition="context/required:launchpad.Edit">
           <img class="editicon" src="/@@/edit"/>
         </a>
         </span>

=== modified file 'lib/lp/code/templates/branch-related-bugs-specs.pt'
--- lib/lp/code/templates/branch-related-bugs-specs.pt	2010-06-10 07:54:59 +0000
+++ lib/lp/code/templates/branch-related-bugs-specs.pt	2010-10-19 03:11:44 +0000
@@ -81,7 +81,11 @@
     }
 
     Y.on('domready', function() {
-        Y.lp.code.branch.bugspeclinks.connect_branchlinks();
+        var logged_in = LP.client.links['me'] !== undefined;
+
+        if (logged_in) {
+            Y.lp.code.branch.bugspeclinks.connect_branchlinks();
+        }
     });
 
     });


Follow ups