Merge lp:~sinzui/launchpad/something-and-nothing into lp:launchpad

Proposed by Curtis Hovey on 2010-02-26
Status: Merged
Merged at revision: not available
Proposed branch: lp:~sinzui/launchpad/something-and-nothing
Merge into: lp:launchpad
Diff against target: 136 lines (+36/-25)
6 files modified
lib/lp/app/templates/launchpad-search.pt (+4/-8)
lib/lp/registry/browser/person.py (+1/-1)
lib/lp/registry/stories/mailinglists/subscriptions.txt (+15/-1)
lib/lp/registry/stories/team/xx-team-home.txt (+0/-1)
lib/lp/registry/templates/team-portlet-mailinglist.pt (+15/-13)
lib/lp/registry/templates/team-portlet-membership.pt (+1/-1)
To merge this branch: bzr merge lp:~sinzui/launchpad/something-and-nothing
Reviewer Review Type Date Requested Status
Paul Hummer (community) code 2010-02-26 Approve on 2010-02-26
Review via email: mp+20191@code.launchpad.net
To post a comment you must log in.
Curtis Hovey (sinzui) wrote :
Download full text (3.9 KiB)

This is my branch to fix some trivial issues in pages.

    lp:~sinzui/launchpad/something-and-nothing
    Diff size: 145
    Launchpad bug: https://bugs.launchpad.net/bugs/518217
                   https://bugs.launchpad.net/bugs/525566
                   https://bugs.launchpad.net/bugs/429216
    Test command: ./bin/test -vv \
        -t site-search
        -t stories/mailinglists/subscriptions
        -t xx-team-home
    Pre-implementation: no-one
    Target release: 10.02

Fix some trivial issues
------------------------

Bug #518217 [search navigation has two blue bars]
    Recent changes to CSS or markup has created an extra blue bar above the
    BatchNavigation on https://edge.launchpad.net/+search

Bug #525566 ["Subscribe to mailing list" link shown when I am not a member]
    Like the title says. The problem was caused by the use of an ambiguous
    method.

Bug #429216 ["You are not a member of this team. You are an indirect member
of this team" is confusing]
    When you're an indirect member of a team, it tells you that you're not a
    member, but you are. The template is missing "tal:" in front of the
    condition, so the non-member rule is always shown even though the template
    does not intend to show it.

Rules
-----

Bug #518217 [search navigation has two blue bars]
    The extra blue bars are created by redundant markup. The markup was moved
    to @@+navigation-links-upper and @@+navigation-links-lower, so the markup
    in the template can be deleted.

Bug #525566 ["Subscribe to mailing list" link shown when I am not a member]
    The template assumes the user is a member for the subscribe/unsubscribe
    actions. Wrap the two actions in a guard to ensure the user is a member.
    Update the the doc for user_can_subscribe_to_list() to make it clear
    that is is for joining a team.

Bug #429216 ["You are not a member of this team. You are an indirect member
of this team" is confusing]
    Add "tal:" in front of the condition in the template.

QA
--

Bug #518217 [search navigation has two blue bars]
    Search for 'gedit' in launchpad, verify that the batch navigation is
    not preceed by an extra blue bar.

Bug #525566 ["Subscribe to mailing list" link shown when I am not a member]
    * Visit https://edge.launchpad.net/~drizzle-discuss
    * Verify you are not shown (+) Subscribe to mailing list

Bug #429216 ["You are not a member of this team. You are an indirect member
of this team" is confusing]
    * Visit https://edge.launchpad.net/~launchpad-bugs
    * Verify you do not see "You are not a member of this team."

Lint
----

Linting changed files:
  lib/lp/app/templates/launchpad-search.pt
  lib/lp/registry/browser/person.py
  lib/lp/registry/stories/mailinglists/subscriptions.txt
  lib/lp/registry/stories/team/xx-team-home.txt
  lib/lp/registry/templates/team-portlet-mailinglist.pt
  lib/lp/registry/templates/team-portlet-membership.pt

Test
----

    * lib/lp/registry/stories/mailinglists/subscriptions.txt
      * Clarified what a member sees on the team page.
      * Added a test to verify what a non-member sees.
    * lib/lp/registry/stories/team/xx-team-home.txt
      * Corrected the test to not look f...

Read more...

Paul Hummer (rockstar) wrote :

This looks good.

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/app/templates/launchpad-search.pt'
2--- lib/lp/app/templates/launchpad-search.pt 2010-01-08 21:23:15 +0000
3+++ lib/lp/app/templates/launchpad-search.pt 2010-02-26 00:10:33 +0000
4@@ -152,10 +152,8 @@
5 condition="view/pages"
6 define="batch view/pages/currentBatch|nothing">
7
8- <div class="upper-batch-nav search-batch">
9- <tal:navigation
10- replace="structure view/pages/@@+navigation-links-upper"/>
11- </div>
12+ <tal:navigation
13+ replace="structure view/pages/@@+navigation-links-upper"/>
14
15 <ul class="site-matches" tal:condition="batch">
16 <li class="pagematch" tal:repeat="page batch">
17@@ -172,10 +170,8 @@
18 </li>
19 </ul>
20
21- <div class="lower-batch-nav search-batch">
22- <tal:navigation
23- replace="structure view/pages/@@+navigation-links-lower" />
24- </div>
25+ <tal:navigation
26+ replace="structure view/pages/@@+navigation-links-lower" />
27
28 <form tal:replace="structure view/@@+search-form" />
29 </tal:batch>
30
31=== modified file 'lib/lp/registry/browser/person.py'
32--- lib/lp/registry/browser/person.py 2010-02-16 20:36:48 +0000
33+++ lib/lp/registry/browser/person.py 2010-02-26 00:10:33 +0000
34@@ -2581,7 +2581,7 @@
35
36 @property
37 def user_can_subscribe_to_list(self):
38- """Can the user subscribe to this team's mailing list?
39+ """Can the prospective member subscribe to this team's mailing list?
40
41 A user can subscribe to the list if the team has an active
42 mailing list, and if they do not already have a subscription.
43
44=== modified file 'lib/lp/registry/stories/mailinglists/subscriptions.txt'
45--- lib/lp/registry/stories/mailinglists/subscriptions.txt 2009-12-24 01:41:54 +0000
46+++ lib/lp/registry/stories/mailinglists/subscriptions.txt 2010-02-26 00:10:33 +0000
47@@ -396,10 +396,24 @@
48 >>> browser.open('http://launchpad.dev/~rosetta-admins')
49 >>> print extract_text(
50 ... find_portlet(browser.contents, 'Mailing list'))
51- Mailing list...
52+ Mailing list
53+ rosetta-admins@lists.launchpad.dev
54+ Policy: You must be a team member to subscribe to the team mailing list.
55+ Subscribe to mailing list
56 View archive
57 View subscribers...
58
59+Non-members are not shown links to subscribe or unsubscribe.
60+
61+ >>> user_browser.open('http://launchpad.dev/~rosetta-admins')
62+ >>> print extract_text(
63+ ... find_portlet(user_browser.contents, 'Mailing list'))
64+ Mailing list
65+ rosetta-admins@lists.launchpad.dev
66+ Policy: You must be a team member to subscribe to the team mailing list.
67+ View archive
68+ View subscribers
69+
70 The mailing list for Rosetta Admins has no subscribers.
71 (Jeff Waugh has asked to subscribe but he's not considered a subscriber
72 because his membership on Rosetta Admins hasn't been approved)
73
74=== modified file 'lib/lp/registry/stories/team/xx-team-home.txt'
75--- lib/lp/registry/stories/team/xx-team-home.txt 2009-12-22 04:28:58 +0000
76+++ lib/lp/registry/stories/team/xx-team-home.txt 2010-02-26 00:10:33 +0000
77@@ -173,7 +173,6 @@
78 >>> sample_browser.open('http://launchpad.dev/~name18')
79 >>> print extract_text(
80 ... find_tag_by_id(sample_browser.contents, 'your-involvement'))
81- Join...
82 You are an indirect member of this team:
83 Sample Person &rarr; Warty Security Team &rarr; Ubuntu Gnome Team...
84
85
86=== modified file 'lib/lp/registry/templates/team-portlet-mailinglist.pt'
87--- lib/lp/registry/templates/team-portlet-mailinglist.pt 2009-08-28 00:57:32 +0000
88+++ lib/lp/registry/templates/team-portlet-mailinglist.pt 2010-02-26 00:10:33 +0000
89@@ -19,19 +19,21 @@
90 <strong>Policy:</strong>
91 You must be a team member to subscribe to the team mailing list.
92 <br/>
93- <tal:can-subscribe-to-list
94- condition="view/user_can_subscribe_to_list">
95- <a class="sprite add"
96- href="/people/+me/+editemails">Subscribe to mailing list</a>
97- <br />
98- </tal:can-subscribe-to-list>
99- <tal:subscribed-to-list
100- condition="view/user_is_subscribed_to_list">
101- <form id="form.list.unsubscribe" name="unsubscribe"
102- action="" method="post">
103- <input type="submit" name="unsubscribe" value="Unsubscribe" />
104- </form>
105- </tal:subscribed-to-list>
106+ <tal:member condition="view/user_is_active_member">
107+ <tal:can-subscribe-to-list
108+ condition="view/user_can_subscribe_to_list">
109+ <a class="sprite add"
110+ href="/people/+me/+editemails">Subscribe to mailing list</a>
111+ <br />
112+ </tal:can-subscribe-to-list>
113+ <tal:subscribed-to-list
114+ condition="view/user_is_subscribed_to_list">
115+ <form id="form.list.unsubscribe" name="unsubscribe"
116+ action="" method="post">
117+ <input type="submit" name="unsubscribe" value="Unsubscribe" />
118+ </form>
119+ </tal:subscribed-to-list>
120+ </tal:member>
121 <img src="/@@/mail" alt="email" /> <a id="mailing-list-archive"
122 tal:attributes="href archive_url">View archive</a>
123 <br /><img src="/@@/team" alt="team" /> <a id="mailing-list-subscribers"
124
125=== modified file 'lib/lp/registry/templates/team-portlet-membership.pt'
126--- lib/lp/registry/templates/team-portlet-membership.pt 2010-02-04 19:51:17 +0000
127+++ lib/lp/registry/templates/team-portlet-membership.pt 2010-02-26 00:10:33 +0000
128@@ -66,7 +66,7 @@
129 </tal:can-leave>
130 </tal:active-member>
131 <tal:not-active-member tal:condition="not: view/user_is_active_member">
132- <div condition="not: view/userIsParticipant"
133+ <div tal:condition="not: view/userIsParticipant"
134 style="margin-top: 1.5em">
135 <a tal:define="link context/menu:overview/join"
136 tal:condition="link/enabled"