Code review comment for lp:~edwin-grubbs/launchpad/bug-652232-person-code-action-links

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Curtis explained where the ideas for the new format came from, but I'll send out an email so that it becomes more widely known and agreed upon. I have added the directions for pushing a personal branch that Curtis asked for.

Here is the incremental diff.

=== modified file 'lib/lp/code/browser/branchlisting.py'
--- lib/lp/code/browser/branchlisting.py 2010-10-15 01:48:05 +0000
+++ lib/lp/code/browser/branchlisting.py 2010-10-18 19:57:05 +0000
@@ -977,7 +977,11 @@

     @property
     def show_action_menu(self):
- return check_permission('launchpad.Edit', self.context)
+ return self.user.inTeam(self.context)
+
+ @property
+ def show_junk_directions(self):
+ return self.user == self.context

     @property
     def initial_values(self):

=== modified file 'lib/lp/code/stories/branches/xx-person-branches.txt'
--- lib/lp/code/stories/branches/xx-person-branches.txt 2010-10-15 14:19:41 +0000
+++ lib/lp/code/stories/branches/xx-person-branches.txt 2010-10-18 20:28:35 +0000
@@ -33,6 +33,19 @@
     There are no branches related to Daniel Silverstone in Launchpad today.

+Junk branches
+=============
+
+On the user's own code page, they will see directions on pushing a branch.
+
+ >>> browser.open('http://code.launchpad.dev/~name12')
+ >>> print extract_text(
+ ... find_tag_by_id(browser.contents, 'junk-branch-directions'))
+ You can push (upload) personal branches
+ (those not related to a project) with the following command:
+ bzr push lp:~name12/+junk/BRANCHNAME
+
+
 Owned Branches
 ==============

=== modified file 'lib/lp/code/templates/person-branches.pt'
--- lib/lp/code/templates/person-branches.pt 2010-10-15 01:48:05 +0000
+++ lib/lp/code/templates/person-branches.pt 2010-10-18 20:28:33 +0000
@@ -25,6 +25,14 @@
 <div metal:fill-slot="main"
      tal:define="branches view/branches">

+ <p id="junk-branch-directions" tal:condition="view/show_junk_directions">
+ You can push (upload) personal branches
+ (those not related to a project) with the following command:
+ <br/>
+ <tt>bzr push lp:~<tal:name
+ replace="view/user/name"/>/+junk/<em>BRANCHNAME</em></tt>
+ </p>
+
   <div id="no-branch-message" tal:condition="not: view/branch_count">
     <p tal:content="view/no_branch_message">
       There are no branches related to Eric the Viking today.

« Back to merge proposal