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
=== modified file 'lib/canonical/launchpad/pagetitles.py'
--- lib/canonical/launchpad/pagetitles.py 2009-09-01 07:52:07 +0000
+++ lib/canonical/launchpad/pagetitles.py 2009-09-02 16:09:32 +0000
@@ -293,15 +293,6 @@
293# bugtask_macros_buglisting contains only macros293# bugtask_macros_buglisting contains only macros
294# bugtasks_index is a redirect294# bugtasks_index is a redirect
295295
296bugtracker_edit = ContextTitle(
297 smartquote('Change details for "%s" bug tracker'))
298
299bugtracker_index = ContextTitle(smartquote('Bug tracker "%s"'))
300
301bugtrackers_add = 'Register an external bug tracker'
302
303bugtrackers_index = 'Bug trackers registered in Launchpad'
304
305build_buildlog = ContextTitle('Build log for %s')296build_buildlog = ContextTitle('Build log for %s')
306297
307build_changes = ContextTitle('Changes in %s')298build_changes = ContextTitle('Changes in %s')
308299
=== modified file 'lib/lp/bugs/browser/bugtracker.py'
--- lib/lp/bugs/browser/bugtracker.py 2009-09-01 15:58:46 +0000
+++ lib/lp/bugs/browser/bugtracker.py 2009-09-02 16:25:53 +0000
@@ -44,6 +44,7 @@
44from canonical.launchpad.webapp.batching import BatchNavigator44from canonical.launchpad.webapp.batching import BatchNavigator
45from canonical.launchpad.webapp.breadcrumb import Breadcrumb45from canonical.launchpad.webapp.breadcrumb import Breadcrumb
46from canonical.launchpad.webapp.menu import NavigationMenu46from canonical.launchpad.webapp.menu import NavigationMenu
47from canonical.lazr.utils import smartquote
47from canonical.widgets import DelimitedListWidget, LaunchpadRadioWidget48from canonical.widgets import DelimitedListWidget, LaunchpadRadioWidget
4849
4950
@@ -78,8 +79,9 @@
7879
79class BugTrackerAddView(LaunchpadFormView):80class BugTrackerAddView(LaunchpadFormView):
8081
82 page_title = u"Register an external bug tracker"
81 schema = IBugTracker83 schema = IBugTracker
82 label = "Register an external bug tracker"84 label = page_title
83 field_names = ['name', 'bugtrackertype', 'title', 'summary',85 field_names = ['name', 'bugtrackertype', 'title', 'summary',
84 'baseurl', 'contactdetails']86 'baseurl', 'contactdetails']
8587
@@ -123,7 +125,9 @@
123125
124class BugTrackerSetView(LaunchpadView):126class BugTrackerSetView(LaunchpadView):
125 """View for actions on the bugtracker index pages."""127 """View for actions on the bugtracker index pages."""
126 PILLAR_LIMIT = 3128
129 page_title = u"Bug trackers registered in Launchpad"
130 pillar_limit = 3
127131
128 def initialize(self):132 def initialize(self):
129 # Sort the bug trackers into active and inactive lists so that133 # Sort the bug trackers into active and inactive lists so that
@@ -147,19 +151,19 @@
147151
148 In more detail, the dictionary holds a list of products/projects152 In more detail, the dictionary holds a list of products/projects
149 and a boolean determining whether or not there we omitted153 and a boolean determining whether or not there we omitted
150 pillars by truncating to PILLAR_LIMIT.154 pillars by truncating to pillar_limit.
151155
152 If no pillars are mapped to this bugtracker, returns {}.156 If no pillars are mapped to this bugtracker, returns {}.
153 """157 """
154 if bugtracker not in self._pillar_cache:158 if bugtracker not in self._pillar_cache:
155 return {}159 return {}
156 pillars = self._pillar_cache[bugtracker]160 pillars = self._pillar_cache[bugtracker]
157 if len(pillars) > self.PILLAR_LIMIT:161 if len(pillars) > self.pillar_limit:
158 has_more_pillars = True162 has_more_pillars = True
159 else:163 else:
160 has_more_pillars = False164 has_more_pillars = False
161 return {165 return {
162 'pillars': pillars[:self.PILLAR_LIMIT],166 'pillars': pillars[:self.pillar_limit],
163 'has_more_pillars': has_more_pillars167 'has_more_pillars': has_more_pillars
164 }168 }
165169
@@ -168,6 +172,11 @@
168172
169 usedfor = IBugTracker173 usedfor = IBugTracker
170174
175 @property
176 def page_title(self):
177 return smartquote(
178 u'The "%s" bug tracker in Launchpad' % self.context.title)
179
171 def initialize(self):180 def initialize(self):
172 self.batchnav = BatchNavigator(self.context.watches, self.request)181 self.batchnav = BatchNavigator(self.context.watches, self.request)
173182
@@ -183,7 +192,7 @@
183192
184193
185BUG_TRACKER_ACTIVE_VOCABULARY = SimpleVocabulary.fromItems(194BUG_TRACKER_ACTIVE_VOCABULARY = SimpleVocabulary.fromItems(
186 [('on', True), ('off', False)])195 [('On', True), ('Off', False)])
187196
188197
189class BugTrackerEditView(LaunchpadEditFormView):198class BugTrackerEditView(LaunchpadEditFormView):
@@ -194,6 +203,11 @@
194 custom_widget('aliases', DelimitedListWidget, height=3)203 custom_widget('aliases', DelimitedListWidget, height=3)
195 custom_widget('active', LaunchpadRadioWidget, orientation='vertical')204 custom_widget('active', LaunchpadRadioWidget, orientation='vertical')
196205
206 @property
207 def page_title(self):
208 return smartquote(
209 u'Change details for the "%s" bug tracker' % self.context.title)
210
197 @cachedproperty211 @cachedproperty
198 def field_names(self):212 def field_names(self):
199 field_names = [213 field_names = [
200214
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2009-09-01 15:34:12 +0000
+++ lib/lp/bugs/browser/configure.zcml 2009-09-02 16:29:47 +0000
@@ -771,7 +771,7 @@
771 for="lp.bugs.interfaces.bugtracker.IBugTrackerSet"771 for="lp.bugs.interfaces.bugtracker.IBugTrackerSet"
772 class="lp.bugs.browser.bugtracker.BugTrackerAddView"772 class="lp.bugs.browser.bugtracker.BugTrackerAddView"
773 permission="launchpad.AnyPerson"773 permission="launchpad.AnyPerson"
774 template="../templates/bugtrackers-add.pt"/>774 template="../../app/templates/generic-edit.pt"/>
775 <browser:url775 <browser:url
776 for="lp.bugs.interfaces.bugtracker.IRemoteBug"776 for="lp.bugs.interfaces.bugtracker.IRemoteBug"
777 path_expression="string:${remotebug}"777 path_expression="string:${remotebug}"
778778
=== modified file 'lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt'
--- lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2009-09-02 10:37:36 +0000
+++ lib/lp/bugs/stories/bugtracker/xx-bugtracker.txt 2009-09-02 16:25:53 +0000
@@ -106,7 +106,7 @@
106 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis'106 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis'
107107
108 >>> user_browser.title108 >>> user_browser.title
109 'Bug tracker \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d'109 'The \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker in Launchpad'
110110
111 >>> 'Test Mantis Tracker' in user_browser.contents111 >>> 'Test Mantis Tracker' in user_browser.contents
112 True112 True
@@ -176,7 +176,7 @@
176 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis/+edit'176 'http://bugs.launchpad.dev/bugs/bugtrackers/testmantis/+edit'
177177
178 >>> user_browser.title178 >>> user_browser.title
179 'Change details for \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker'179 'Change details for the \xe2\x80\x9cTest Mantis Tracker\xe2\x80\x9d bug tracker'
180180
181 >>> user_browser.getControl('Name').value = 'testbugzilla'181 >>> user_browser.getControl('Name').value = 'testbugzilla'
182 >>> user_browser.getControl('Title').value = 'A test Bugzilla Tracker'182 >>> user_browser.getControl('Title').value = 'A test Bugzilla Tracker'
@@ -465,7 +465,7 @@
465465
466 >>> admin_browser.open(466 >>> admin_browser.open(
467 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')467 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')
468 >>> admin_browser.getControl(name='field.active').value = ['off']468 >>> admin_browser.getControl(name='field.active').value = ['Off']
469 >>> admin_browser.getControl('Change').click()469 >>> admin_browser.getControl('Change').click()
470470
471 >>> message = find_tag_by_id(admin_browser.contents, 'inactive-message')471 >>> message = find_tag_by_id(admin_browser.contents, 'inactive-message')
@@ -503,7 +503,7 @@
503503
504 >>> admin_browser.open(504 >>> admin_browser.open(
505 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')505 ... 'http://launchpad.dev/bugs/bugtrackers/debbugs/+edit')
506 >>> admin_browser.getControl(name='field.active').value = ['on']506 >>> admin_browser.getControl(name='field.active').value = ['On']
507 >>> admin_browser.getControl('Change').click()507 >>> admin_browser.getControl('Change').click()
508508
509 >>> message = find_tag_by_id(user_browser.contents, 'inactive-message')509 >>> message = find_tag_by_id(user_browser.contents, 'inactive-message')
510510
=== removed file 'lib/lp/bugs/templates/bugtrackers-add.pt'
--- lib/lp/bugs/templates/bugtrackers-add.pt 2009-08-25 11:20:11 +0000
+++ lib/lp/bugs/templates/bugtrackers-add.pt 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1<bug-trackers-add
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 metal:use-macro="view/macro:page/main_only">
7 <div metal:fill-slot="main">
8 <div metal:use-macro="context/@@launchpad_form/form" />
9 </div>
10</bug-trackers-add>

Subscribers

People subscribed via source and target branches

to all changes: