Merge lp:~rockstar/launchpad/pedantry-round2 into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/pedantry-round2
Merge into: lp:launchpad
Prerequisite: lp:~rockstar/launchpad/pedantry-round1
Diff against target: 110 lines (+26/-10)
3 files modified
lib/lp/code/browser/branch.py (+11/-10)
lib/lp/code/stories/codeimport/xx-admin-codeimport.txt (+4/-0)
lib/lp/code/templates/branch-import-details.pt (+11/-0)
To merge this branch: bzr merge lp:~rockstar/launchpad/pedantry-round2
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code Approve
Review via email: mp+17705@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hi there-

  This branch fixes bug #465247 - Basically, I just needed to move the "Edit
import" back into the page (as opposed to the navigation menu). Technically,
this shouldn't break any tests, but I'll obviously run it through ec2 and have
it land it for me.

Cheers,
Paul

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

Hi Paul,

Looks good.

merge-approved

-Edwin

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/browser/branch.py'
2--- lib/lp/code/browser/branch.py 2010-01-20 03:37:27 +0000
3+++ lib/lp/code/browser/branch.py 2010-01-21 08:40:27 +0000
4@@ -188,7 +188,7 @@
5 facet = 'branches'
6 title = 'Edit branch'
7 links = (
8- 'edit', 'reviewer', 'edit_import', 'edit_whiteboard', 'delete')
9+ 'edit', 'reviewer', 'edit_whiteboard', 'delete')
10
11 def branch_is_import(self):
12 return self.context.branch_type == BranchType.IMPORTED
13@@ -210,14 +210,6 @@
14 return Link(
15 '+whiteboard', text, icon='edit', enabled=enabled)
16
17- def edit_import(self):
18- text = 'Edit import source or review import'
19- enabled = (
20- self.branch_is_import() and
21- check_permission('launchpad.Edit', self.context.code_import))
22- return Link(
23- '+edit-import', text, icon='edit', enabled=enabled)
24-
25 @enabled_with_permission('launchpad.Edit')
26 def reviewer(self):
27 text = 'Set branch reviewer'
28@@ -232,7 +224,7 @@
29 links = [
30 'add_subscriber', 'browse_revisions', 'link_bug',
31 'link_blueprint', 'register_merge', 'source', 'subscription',
32- 'edit_status', 'upgrade_branch']
33+ 'edit_status', 'edit_import', 'upgrade_branch']
34
35 @enabled_with_permission('launchpad.Edit')
36 def edit_status(self):
37@@ -299,6 +291,15 @@
38 url = self.context.codebrowse_url('files')
39 return Link(url, text, icon='info', enabled=enabled)
40
41+ def edit_import(self):
42+ text = 'Edit import source or review import'
43+ enabled = True
44+ enabled = (
45+ self.context.branch_type == BranchType.IMPORTED and
46+ check_permission('launchpad.Edit', self.context.code_import))
47+ return Link(
48+ '+edit-import', text, icon='edit', enabled=enabled)
49+
50 @enabled_with_permission('launchpad.Edit')
51 def upgrade_branch(self):
52 enabled = False
53
54=== modified file 'lib/lp/code/stories/codeimport/xx-admin-codeimport.txt'
55--- lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2009-12-08 04:31:34 +0000
56+++ lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2010-01-21 08:40:27 +0000
57@@ -53,6 +53,7 @@
58 Import Status: Pending Review
59 This branch is an import of the Subversion branch
60 from svn://svn.example.com/fooix/trunk.
61+ Edit import source or review import
62
63
64 Editing details
65@@ -157,6 +158,7 @@
66 Import Status: Reviewed
67 ...
68 The next import is scheduled to run as soon as possible.
69+ Edit import source or review import
70
71 >>> for message in get_feedback_messages(import_browser.contents):
72 ... print extract_text(message)
73@@ -214,6 +216,7 @@
74 Import Status: Reviewed
75 ...
76 The next import is scheduled to run as soon as possible.
77+ Edit import source or review import
78
79 Now set the job as running.
80
81@@ -242,6 +245,7 @@
82 ago. The last few lines of the job's output were:
83 Changeset 1
84 Changeset 2
85+ Edit import source or review import
86
87
88 Import details for a import that has been imported successfully
89
90=== modified file 'lib/lp/code/templates/branch-import-details.pt'
91--- lib/lp/code/templates/branch-import-details.pt 2009-12-08 22:40:31 +0000
92+++ lib/lp/code/templates/branch-import-details.pt 2010-01-21 08:40:27 +0000
93@@ -130,6 +130,17 @@
94 </tal:result>
95 </div>
96
97+ <div class="actions">
98+ <div
99+ tal:define="link context_menu/edit_import"
100+ tal:condition="link/enabled"
101+ >
102+ <a id="linkbug"
103+ class="sprite add"
104+ tal:attributes="href link/url"
105+ tal:content="link/text" />
106+ </div>
107+ </div>
108 </tal:has-codeimport>
109 </div>
110 </tal:imported-branch>