Merge lp:~bac/launchpad/bug-421986-team-list-pages into lp:launchpad

Proposed by Brad Crittenden
Status: Merged
Approved by: Eleanor Berger
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~bac/launchpad/bug-421986-team-list-pages
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~bac/launchpad/bug-421986-team-list-pages
Reviewer Review Type Date Requested Status
Martin Albisetti (community) ui Approve
Eleanor Berger (community) Approve
Review via email: mp+11672@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :
Download full text (3.2 KiB)

= Summary =

Bug 421986 list three team pages that need mechanical updates for UI 3.0.

== Proposed fix ==

Provide changes to fulfill the new UI requirements.

== Pre-implementation notes ==

N/A

== Implementation details ==

* team-mailinglist-subscribers.pt
  * Convert to use main_only layout.
  * Move page title into the TeamMailingListSubscribersView as 'label'.
  * Leave the hand-crafted table construction in the view since it
    uses a four column presentation. I could create a
    four-column-list in the CSS if that is desired. The current
    approach works so I prefer to keep these changes minimal.

* team-mailinglist-moderate.pt
  * Convert to use main_only layout.
  * Remove page title from pagetitles.py. In
    TeamMailingListModerationView keep the existing 'label'.

* teammembership-invitation.pt
  * Convert to use main_only layout.
  * Move the pagetitle from pagetitles.py as 'label' and make
    page_title be a synonym for it. I *thought* having page_title was
    not going to be required after Barry's changes but it is for this
    view.

== Tests ==

bin/test -vvm lp.registry -t stories/mailinglists/subscriptions.txt \
     -t stories/mailinglists/moderation.txt

== Demo and Q/A ==

Screenshots are available at
http://people.canonical.com/~bac/bug-421986-team-list-pages/

* As Mark, go to https://launchpad.dev/~hwdb-team/+addmember and add
'testing-spanish-team'
  Then go to:
  https://launchpad.dev/~testing-spanish-team/+invitation/hwdb-team

* Go to https://launchpad.dev/~testing-spanish-team/+mailing-list-subscribers
  Note I for the screenshot I created a large team with lots of
  subscribers *and* hacked the dev config to use a batching size of 50
  (same as in production) rather than the normal 5 in the development
  environment. (If you'd like my script for creating the team with
  mailing list subscribers using launchpadlib let me know.)

  Also note I am unhappy that the default batch size is 50 but we're
  using four columns, so a full page will not have four full columns.
  I could do some higher math based on the default batch size and set
  a lower custom size for this view but haven't done so yet as it
  seems outside the scope of these "mechanical" changes.

* Go to
  https://launchpad.dev/~testing-spanish-team/+mailinglist-moderate
  Creating sample data was painful and done by hand based on the
  moderation.txt test.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/stories/mailinglists/moderation.txt
  lib/lp/registry/stories/mailinglists/subscriptions.txt
  lib/canonical/launchpad/pagetitles.py
  lib/lp/registry/templates/team-mailinglist-moderate.pt
  lib/lp/registry/browser/team.py
  lib/lp/registry/templates/team-mailinglist-subscribers.pt
  lib/lp/registry/templates/teammembership-invitation.pt
  lib/lp/registry/browser/person.py

== Pylint notices ==

lib/lp/registry/browser/person.py
    119: [F0401] Unable to import 'lazr.delegates' (No module named delegates)
    120: [F0401] Unable to import 'lazr.config' (No module named config)
    121: [F0401] ...

Read more...

Revision history for this message
Eleanor Berger (intellectronica) wrote :
Download full text (3.9 KiB)

  approve code ui

Nice conversion.

2009/9/14 Brad Crittenden <email address hidden>:
> Brad Crittenden has proposed merging lp:~bac/launchpad/bug-421986-team-list-pages into lp:launchpad/devel.
>
> Requested reviews:
>    Canonical Launchpad Engineering (launchpad)
>
> = Summary =
>
> Bug 421986 list three team pages that need mechanical updates for UI 3.0.
>
> == Proposed fix ==
>
> Provide changes to fulfill the new UI requirements.
>
> == Pre-implementation notes ==
>
> N/A
>
> == Implementation details ==
>
> * team-mailinglist-subscribers.pt
>  * Convert to use main_only layout.
>  * Move page title into the TeamMailingListSubscribersView as 'label'.
>  * Leave the hand-crafted table construction in the view since it
>    uses a four column presentation.  I could create a
>    four-column-list in the CSS if that is desired.  The current
>    approach works so I prefer to keep these changes minimal.
>
> * team-mailinglist-moderate.pt
>  * Convert to use main_only layout.
>  * Remove page title from pagetitles.py.  In
>    TeamMailingListModerationView keep the existing 'label'.
>
>
> * teammembership-invitation.pt
>  * Convert to use main_only layout.
>  * Move the pagetitle from pagetitles.py as 'label' and make
>    page_title be a synonym for it.  I *thought* having page_title was
>    not going to be required after Barry's changes but it is for this
>    view.
>
> == Tests ==
>
> bin/test -vvm lp.registry  -t stories/mailinglists/subscriptions.txt \
>     -t stories/mailinglists/moderation.txt
>
> == Demo and Q/A ==
>
> Screenshots are available at
> http://people.canonical.com/~bac/bug-421986-team-list-pages/
>
> * As Mark, go to https://launchpad.dev/~hwdb-team/+addmember and add
> 'testing-spanish-team'
>  Then go to:
>  https://launchpad.dev/~testing-spanish-team/+invitation/hwdb-team
>
> * Go to https://launchpad.dev/~testing-spanish-team/+mailing-list-subscribers
>  Note I for the screenshot I created a large team with lots of
>  subscribers *and* hacked the dev config to use a batching size of 50
>  (same as in production) rather than the normal 5 in the development
>  environment.  (If you'd like my script for creating the team with
>  mailing list subscribers using launchpadlib let me know.)
>
>  Also note I am unhappy that the default batch size is 50 but we're
>  using four columns, so a full page will not have four full columns.
>  I could do some higher math based on the default batch size and set
>  a lower custom size for this view but haven't done so yet as it
>  seems outside the scope of these "mechanical" changes.
>
> * Go to
>  https://launchpad.dev/~testing-spanish-team/+mailinglist-moderate
>  Creating sample data was painful and done by hand based on the
>  moderation.txt test.
>
> = Launchpad lint =
>
> Checking for conflicts. and issues in doctests and templates.
> Running jslint, xmllint, pyflakes, and pylint.
> Using normal rules.
>
> Linting changed files:
>  lib/lp/registry/stories/mailinglists/moderation.txt
>  lib/lp/registry/stories/mailinglists/subscriptions.txt
>  lib/canonical/launchpad/pagetitles.py
>  lib/lp/registry/templates/team-mailinglist-moderate.pt
>  lib/lp/registry/browser/team.py
>  lib/...

Read more...

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

r=me
ui=me

review: Approve
Revision history for this message
Martin Albisetti (beuno) wrote :

Everything looks fine and dandy for a mechanical change, although it seems there are no breadcrumbs in: http://people.canonical.com/~bac/bug-421986-team-list-pages/team+invitation.png

Is there any reason for that?

review: Needs Information (ui)
Revision history for this message
Brad Crittenden (bac) wrote :

bac - beuno: re: your question about breadcrumbs... the url https://launchpad.dev/~testing-spanish-team/+invitation/hwdb-team only has as single breadcrumb for the testing-spanish-team. the rest of the traversal does not generate any. if the breadcrumb list only has one element they are not displayed.

bac - beuno: so that's the explanation of the current behavior. what do you think the breadcrumb for that URL should be?

beuno - bac, good question. I'm in a call, waiting to go into another call, so I'd say land it for now

bac - ok, i'll answer in the MP. we can revisit as necessary.

Revision history for this message
Martin Albisetti (beuno) :
review: Approve (ui)

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-12 01:57:22 +0000
3+++ lib/canonical/launchpad/pagetitles.py 2009-09-13 18:21:02 +0000
4@@ -1046,11 +1046,6 @@
5
6 team_mailinglist = 'Configure mailing list'
7
8-team_mailinglist_moderate = 'Moderate mailing list'
9-
10-team_mailinglist_subscribers = ContextBrowsername(
11- 'Mailing list subscribers for the %s team')
12-
13 team_map = ContextBrowsername('Map of %s participants')
14
15 team_members = ContextBrowsername(smartquote('"%s" members'))
16@@ -1062,11 +1057,6 @@
17 return smartquote("%s's membership status in %s") % (
18 context.person.displayname, context.team.displayname)
19
20-def teammembership_invitation(context, view):
21- """Return the page title to invite a person to become a team member."""
22- return "Make %s a member of %s" % (
23- context.person.displayname, context.team.displayname)
24-
25 team_mentoringoffers = ContextTitle('Mentoring available for newcomers to %s')
26
27 team_newpoll = ContextTitle('New poll for team %s')
28
29=== modified file 'lib/lp/registry/browser/person.py'
30--- lib/lp/registry/browser/person.py 2009-09-12 01:57:22 +0000
31+++ lib/lp/registry/browser/person.py 2009-09-13 18:21:02 +0000
32@@ -569,12 +569,18 @@
33 implements(IBrowserPublisher)
34
35 schema = ITeamMembershipInvitationAcknowledgementForm
36- label = 'Team membership invitation'
37 field_names = ['acknowledger_comment']
38 custom_widget('acknowledger_comment', TextAreaWidget, height=5, width=60)
39 template = ViewPageTemplateFile(
40 '../templates/teammembership-invitation.pt')
41
42+ @property
43+ def label(self):
44+ return "Make %s a member of %s" % (
45+ self.context.person.displayname, self.context.team.displayname)
46+
47+ page_title = label
48+
49 def __init__(self, context, request):
50 # Only admins of the invited team can see the page in which they
51 # approve/decline invitations.
52
53=== modified file 'lib/lp/registry/browser/team.py'
54--- lib/lp/registry/browser/team.py 2009-09-01 19:43:30 +0000
55+++ lib/lp/registry/browser/team.py 2009-09-14 01:28:41 +0000
56@@ -730,6 +730,11 @@
57
58 max_columns = 4
59
60+ @property
61+ def label(self):
62+ return ('Mailing list subscribers for the %s team' %
63+ self.context.displayname)
64+
65 @cachedproperty
66 def subscribers(self):
67 return BatchNavigator(
68
69=== modified file 'lib/lp/registry/stories/mailinglists/moderation.txt'
70--- lib/lp/registry/stories/mailinglists/moderation.txt 2009-08-29 03:14:48 +0000
71+++ lib/lp/registry/stories/mailinglists/moderation.txt 2009-09-14 01:28:41 +0000
72@@ -51,9 +51,8 @@
73 >>> admin_browser.open(
74 ... 'http://launchpad.dev/~guadamen/+mailinglist-moderate')
75 >>> admin_browser.title
76- 'Moderate mailing list'
77+ '+mailinglist-moderate : \xe2\x80\x9cGuadaMen\xe2\x80\x9d team'
78 >>> print extract_text(find_tag_by_id(admin_browser.contents, 'legend'))
79- Mailing list moderation
80 There are no mailing list messages requiring your review.
81
82 Carlos is not a member of the Guadamen team, nor is he a Launchpad
83@@ -223,5 +222,4 @@
84
85 >>> admin_browser.getLink('Moderate mailing list').click()
86 >>> print extract_text(find_tag_by_id(admin_browser.contents, 'legend'))
87- Mailing list moderation
88 There are no mailing list messages requiring your review.
89
90=== modified file 'lib/lp/registry/stories/mailinglists/subscriptions.txt'
91--- lib/lp/registry/stories/mailinglists/subscriptions.txt 2009-09-03 17:20:42 +0000
92+++ lib/lp/registry/stories/mailinglists/subscriptions.txt 2009-09-14 01:28:41 +0000
93@@ -412,8 +412,9 @@
94 because his membership on Rosetta Admins hasn't been approved)
95
96 >>> browser.getLink('View subscribers').click()
97- >>> print browser.title
98- Mailing list subscribers for the Rosetta Administrators team
99+ >>> browser.title
100+ '+mailing-list-subscribers : \xe2\x80\x9cRosetta Administrators\xe2\x80\x9d team'
101+
102 >>> print extract_text(find_tag_by_id(browser.contents, 'subscribers'))
103 Nobody has subscribed to this team's mailing list yet.
104
105
106=== modified file 'lib/lp/registry/templates/team-mailinglist-moderate.pt'
107--- lib/lp/registry/templates/team-mailinglist-moderate.pt 2009-07-17 17:59:07 +0000
108+++ lib/lp/registry/templates/team-mailinglist-moderate.pt 2009-09-14 01:28:41 +0000
109@@ -1,15 +1,16 @@
110 <html
111- xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
112+ xmlns="http://www.w3.org/1999/xhtml"
113 xmlns:tal="http://xml.zope.org/namespaces/tal"
114 xmlns:metal="http://xml.zope.org/namespaces/metal"
115 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
116- lang="en"
117- metal:use-macro="context/@@main_template/master"
118- i18n:domain="launchpad">
119+ metal:use-macro="view/macro:page/main_only"
120+ i18n:domain="launchpad"
121+>
122
123 <body>
124
125 <div metal:fill-slot="main">
126+
127 <div tal:condition="view/hold_count">
128 <metal:form metal:use-macro="context/@@launchpad_form/form">
129 <div metal:fill-slot="extra_top" id="legend">
130@@ -47,7 +48,6 @@
131 </metal:form>
132 </div>
133 <span tal:condition="not: view/hold_count" id="legend">
134- <h1>Mailing list moderation</h1>
135 <p>There are no mailing list messages requiring your review.</p>
136 </span>
137 </div>
138
139=== modified file 'lib/lp/registry/templates/team-mailinglist-subscribers.pt'
140--- lib/lp/registry/templates/team-mailinglist-subscribers.pt 2009-07-17 17:59:07 +0000
141+++ lib/lp/registry/templates/team-mailinglist-subscribers.pt 2009-09-14 01:28:41 +0000
142@@ -3,10 +3,7 @@
143 xmlns:tal="http://xml.zope.org/namespaces/tal"
144 xmlns:metal="http://xml.zope.org/namespaces/metal"
145 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
146- xml:lang="en"
147- lang="en"
148- dir="ltr"
149- metal:use-macro="view/macro:page/onecolumn"
150+ metal:use-macro="view/macro:page/main_only"
151 i18n:domain="launchpad"
152 >
153
154@@ -14,8 +11,6 @@
155
156 <div metal:fill-slot="main">
157
158- <h1>Team Mailing List Subscribers</h1>
159-
160 <div id="subscribers">
161 <tal:has-mailinglist condition="context/mailing_list">
162 <tal:has-subscribers condition="view/subscribers/currentBatch">
163
164=== modified file 'lib/lp/registry/templates/teammembership-invitation.pt'
165--- lib/lp/registry/templates/teammembership-invitation.pt 2009-07-17 17:59:07 +0000
166+++ lib/lp/registry/templates/teammembership-invitation.pt 2009-09-13 18:18:33 +0000
167@@ -3,19 +3,12 @@
168 xmlns:tal="http://xml.zope.org/namespaces/tal"
169 xmlns:metal="http://xml.zope.org/namespaces/metal"
170 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
171- xml:lang="en"
172- lang="en"
173- dir="ltr"
174- metal:use-macro="context/@@main_template/master"
175+ metal:use-macro="view/macro:page/main_only"
176 i18n:domain="launchpad"
177 >
178
179 <body>
180
181-<metal:portlets fill-slot="portlets">
182- <div tal:replace="structure context/person/@@+portlet-details" />
183-</metal:portlets>
184-
185 <div metal:fill-slot="main">
186
187 <div tal:condition="context/status/enumvalue:INVITED">