Merge lp://staging/~allenap/launchpad/ui-convert-bug-tracker-3.0-bug-418155-pt3 into lp://staging/~allenap/launchpad/ui-convert-bug-tracker-3.0-bug-418155-pt2

Proposed by Gavin Panella
Status: Merged
Merge reported by: Gavin Panella
Merged at revision: not available
Proposed branch: lp://staging/~allenap/launchpad/ui-convert-bug-tracker-3.0-bug-418155-pt3
Merge into: lp://staging/~allenap/launchpad/ui-convert-bug-tracker-3.0-bug-418155-pt2
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~allenap/launchpad/ui-convert-bug-tracker-3.0-bug-418155-pt3
Reviewer Review Type Date Requested Status
Eleanor Berger (community) Approve
Review via email: mp+11067@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) wrote :

This branch has some final things that I forgot in earlier branches for the bug tracker templates. It:

 * Moves page titles into the views,

 * Makes the page titles read a little better,

 * Removes a redundant template (used generic-edit.pt instead),

 * Changes the on/off radio buttons to On/Off, which is (I think) the
   guideline.

./bin/test -vvct stories.*bugtracker 2>&1 | less -SR

No lint.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

r=me
ui=me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/pagetitles.py'
2--- lib/canonical/launchpad/pagetitles.py 2009-09-01 07:52:07 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-02 16:09:32 +0000
4@@ -293,15 +293,6 @@
5 # bugtask_macros_buglisting contains only macros
6 # bugtasks_index is a redirect
7
8-bugtracker_edit = ContextTitle(
9- smartquote('Change details for "%s" bug tracker'))
10-
11-bugtracker_index = ContextTitle(smartquote('Bug tracker "%s"'))
12-
13-bugtrackers_add = 'Register an external bug tracker'
14-
15-bugtrackers_index = 'Bug trackers registered in Launchpad'
16-
17 build_buildlog = ContextTitle('Build log for %s')
18
19 build_changes = ContextTitle('Changes in %s')
20
21=== modified file 'lib/lp/bugs/browser/bugtracker.py'
22--- lib/lp/bugs/browser/bugtracker.py 2009-09-01 15:58:46 +0000
23+++ lib/lp/bugs/browser/bugtracker.py 2009-09-02 16:25:53 +0000
24@@ -44,6 +44,7 @@
25 from canonical.launchpad.webapp.batching import BatchNavigator
26 from canonical.launchpad.webapp.breadcrumb import Breadcrumb
27 from canonical.launchpad.webapp.menu import NavigationMenu
28+from canonical.lazr.utils import smartquote
29 from canonical.widgets import DelimitedListWidget, LaunchpadRadioWidget
30
31
32@@ -78,8 +79,9 @@
33
34 class BugTrackerAddView(LaunchpadFormView):
35
36+ page_title = u"Register an external bug tracker"
37 schema = IBugTracker
38- label = "Register an external bug tracker"
39+ label = page_title
40 field_names = ['name', 'bugtrackertype', 'title', 'summary',
41 'baseurl', 'contactdetails']
42
43@@ -123,7 +125,9 @@
44
45 class BugTrackerSetView(LaunchpadView):
46 """View for actions on the bugtracker index pages."""
47- PILLAR_LIMIT = 3
48+
49+ page_title = u"Bug trackers registered in Launchpad"
50+ pillar_limit = 3
51
52 def initialize(self):
53 # Sort the bug trackers into active and inactive lists so that
54@@ -147,19 +151,19 @@
55
56 In more detail, the dictionary holds a list of products/projects
57 and a boolean determining whether or not there we omitted
58- pillars by truncating to PILLAR_LIMIT.
59+ pillars by truncating to pillar_limit.
60
61 If no pillars are mapped to this bugtracker, returns {}.
62 """
63 if bugtracker not in self._pillar_cache:
64 return {}
65 pillars = self._pillar_cache[bugtracker]
66- if len(pillars) > self.PILLAR_LIMIT:
67+ if len(pillars) > self.pillar_limit:
68 has_more_pillars = True
69 else:
70 has_more_pillars = False
71 return {
72- 'pillars': pillars[:self.PILLAR_LIMIT],
73+ 'pillars': pillars[:self.pillar_limit],
74 'has_more_pillars': has_more_pillars
75 }
76
77@@ -168,6 +172,11 @@
78
79 usedfor = IBugTracker
80
81+ @property
82+ def page_title(self):
83+ return smartquote(
84+ u'The "%s" bug tracker in Launchpad' % self.context.title)
85+
86 def initialize(self):
87 self.batchnav = BatchNavigator(self.context.watches, self.request)
88
89@@ -183,7 +192,7 @@
90
91
92 BUG_TRACKER_ACTIVE_VOCABULARY = SimpleVocabulary.fromItems(
93- [('on', True), ('off', False)])
94+ [('On', True), ('Off', False)])
95
96
97 class BugTrackerEditView(LaunchpadEditFormView):
98@@ -194,6 +203,11 @@
99 custom_widget('aliases', DelimitedListWidget, height=3)
100 custom_widget('active', LaunchpadRadioWidget, orientation='vertical')
101
102+ @property
103+ def page_title(self):
104+ return smartquote(
105+ u'Change details for the "%s" bug tracker' % self.context.title)
106+
107 @cachedproperty
108 def field_names(self):
109 field_names = [
110
111=== modified file 'lib/lp/bugs/browser/configure.zcml'
112--- lib/lp/bugs/browser/configure.zcml 2009-09-01 15:34:12 +0000
113+++ lib/lp/bugs/browser/configure.zcml 2009-09-02 16:29:47 +0000
114@@ -771,7 +771,7 @@
115 for="lp.bugs.interfaces.bugtracker.IBugTrackerSet"
116 class="lp.bugs.browser.bugtracker.BugTrackerAddView"
117 permission="launchpad.AnyPerson"
118- template="../templates/bugtrackers-add.pt"/>
119+ template="../../app/templates/generic-edit.pt"/>
120 <browser:url
121 for="lp.bugs.interfaces.bugtracker.IRemoteBug"
122 path_expression="string:${remotebug}"
123
124=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt'
125--- lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2009-09-02 10:37:36 +0000
126+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2009-09-02 16:25:53 +0000
127@@ -106,7 +106,7 @@
128 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis'
129
130 >>> user_browser.title
131- 'Bug tracker \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d'
132+ 'The \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker in Launchpad'
133
134 >>> 'Test Mantis Tracker' in user_browser.contents
135 True
136@@ -176,7 +176,7 @@
137 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis/+edit'
138
139 >>> user_browser.title
140- 'Change details for \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker'
141+ 'Change details for the \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker'
142
143 >>> user_browser.getControl('Name').value = 'testbugzilla'
144 >>> user_browser.getControl('Title').value = 'A test Bugzilla Tracker'
145@@ -465,7 +465,7 @@
146
147 >>> admin_browser.open(
148 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')
149- >>> admin_browser.getControl(name='field.active').value = ['off']
150+ >>> admin_browser.getControl(name='field.active').value = ['Off']
151 >>> admin_browser.getControl('Change').click()
152
153 >>> message = find_tag_by_id(admin_browser.contents, 'inactive-message')
154@@ -503,7 +503,7 @@
155
156 >>> admin_browser.open(
157 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')
158- >>> admin_browser.getControl(name='field.active').value = ['on']
159+ >>> admin_browser.getControl(name='field.active').value = ['On']
160 >>> admin_browser.getControl('Change').click()
161
162 >>> message = find_tag_by_id(user_browser.contents, 'inactive-message')
163
164=== removed file 'lib/lp/bugs/templates/bugtrackers-add.pt'
165--- lib/lp/bugs/templates/bugtrackers-add.pt 2009-08-25 11:20:11 +0000
166+++ lib/lp/bugs/templates/bugtrackers-add.pt 1970-01-01 00:00:00 +0000
167@@ -1,10 +0,0 @@
168-<bug-trackers-add
169- xmlns="http://www.w3.org/1999/xhtml"
170- xmlns:tal="http://xml.zope.org/namespaces/tal"
171- xmlns:metal="http://xml.zope.org/namespaces/metal"
172- xmlns:i18n="http://xml.zope.org/namespaces/i18n"
173- metal:use-macro="view/macro:page/main_only">
174- <div metal:fill-slot="main">
175- <div metal:use-macro="context/@@launchpad_form/form" />
176- </div>
177-</bug-trackers-add>

Subscribers

People subscribed via source and target branches

to all changes: