Merge lp:~bac/launchpad/lp3-announcements into lp:launchpad
- lp3-announcements
- Merge into devel
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||||||||||||||
Approved revision: | no longer in the source branch. | ||||||||||||||||
Merged at revision: | not available | ||||||||||||||||
Proposed branch: | lp:~bac/launchpad/lp3-announcements | ||||||||||||||||
Merge into: | lp:launchpad | ||||||||||||||||
Diff against target: | None lines | ||||||||||||||||
To merge this branch: | bzr merge lp:~bac/launchpad/lp3-announcements | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | ui | Approve | |
Curtis Hovey (community) | code | Approve | |
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+10275@code.launchpad.net |
Commit message
Description of the change
Brad Crittenden (bac) wrote : | # |
Curtis Hovey (sinzui) wrote : | # |
Hi Brad.
This is very nice. I think we should tweak the layout a bit before
landing this. I explain XMLLint's spazzing below.
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
...
> @@ -581,6 +581,10 @@
> border-top: 1px solid #d0d0d0;
> border-bottom: 1px solid #d0d0d0;
> }
> +.announcement .registered {
> + font-size: 95%;
This is not a support font-size you must use one of the percentages
from the table to guarantee that they display the same on all platforms.
font-size: 93%;
is official.
> + margin-top: -2px
Missing semi-colon.
+ }
...
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
...
> @@ -70,6 +69,12 @@
> text = 'Delete announcement'
> return Link('+delete', text, icon='trash-icon')
>
> + @enabled_
> + def announce(self):
> + text = 'Make announcement'
> + summary = 'Publish an item of news for this project'
> + return Link('+announce', text, summary, icon='add')
We use publish to describe the act of making public, not creating.
...
> @@ -100,6 +105,19 @@
> self.context = context
>
>
> +class IAnnouncementCr
> + """A marker interface for creation announcement navigation menu."""
> +
> +
> +class AnnouncementCre
> + """A sub-menu for different aspects of modifying an announcement."""
> +
> + usedfor = IAnnouncementCr
> + facet = 'overview'
> + title = 'Create announcement'
> + links = ('announce', )xmlns:tal="http://
Menus assume that links are a mutable list. This works, but may lead to
cryptic errors if someone extends the menu,
...
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
...
> @@ -418,47 +419,16 @@
> Editing announcements
> -------
...
> -If you have the necessary privileges you will see links to edit the
> -announcements.
> +To edit an announcement you must go to the individual announcement
> +page and then follow the proper links.
Me? I am not doing anything. I think No Privileges Person is doing this.
> >>> priv_browser.open('http://
> - >>> listed_
> - ... priv_browser.
> - >>> edit_links = listed_
> - >>> len(edit_links)
> - 2
> -
> -Following a link takes you to a form where you can change the headline,
> -summary and URL of the announcement:
> -
> - >>> 'Modified headline' not in announcements(
> - True
> - ...
Brad Crittenden (bac) wrote : | # |
Thanks for the review Curtis.
On Aug 18, 2009, at 11:37 , Curtis Hovey wrote:
> Review: Needs Fixing code
> Hi Brad.
>
> This is very nice. I think we should tweak the layout a bit before
> landing this. I explain XMLLint's spazzing below.
Great.
>
>> === modified file 'lib/canonical/
>> --- lib/canonical/
>> +0000
>> +++ lib/canonical/
>> +0000
> ...
>
>> @@ -581,6 +581,10 @@
>> border-top: 1px solid #d0d0d0;
>> border-bottom: 1px solid #d0d0d0;
>> }
>> +.announcement .registered {
>> + font-size: 95%;
>
> This is not a support font-size you must use one of the percentages
> from the table to guarantee that they display the same on all
> platforms.
>
> font-size: 93%;
>
> is official.
Didn't see that comment in the CSS. Thanks for catching it.
>
>> + margin-top: -2px
>
> Missing semi-colon.
>
Duh.
> + }
>
> ...
>
>> === modified file 'lib/lp/
>> --- lib/lp/
>> +++ lib/lp/
>
> ...
>
>> @@ -70,6 +69,12 @@
>> text = 'Delete announcement'
>> return Link('+delete', text, icon='trash-icon')
>>
>> + @enabled_
>> + def announce(self):
>> + text = 'Make announcement'
>> + summary = 'Publish an item of news for this project'
>> + return Link('+announce', text, summary, icon='add')
>
> We use publish to describe the act of making public, not creating.
'Create an item...'
>
> ...
>
>> @@ -100,6 +105,19 @@
>> self.context = context
>>
>>
>> +class IAnnouncementCr
>> + """A marker interface for creation announcement navigation
>> menu."""
>> +
>> +
>> +class AnnouncementCre
>> AnnouncementMen
>> + """A sub-menu for different aspects of modifying an
>> announcement."""
>> +
>> + usedfor = IAnnouncementCr
>> + facet = 'overview'
>> + title = 'Create announcement'
>> + links = ('announce', )xmlns:tal="http://
>> "
>
> Menus assume that links are a mutable list. This works, but may lead
> to
> cryptic errors if someone extends the menu,
Really? From webapp/menu.py:
assert isinstance(
Just grepping through registry/
of links being tuples. I've changed this one and the others in this
module.
>
> ...
>
>> === modified file 'lib/lp/
>> announcements.txt'
>> --- lib/lp/
>> 2009-08-13 18:10:15 +0000
>> +++ lib/lp/
>> 2009-08-17 20:36:01 +0000
>
> ...
>
>> @@ -418,47 +419,16 @@
>> Editing announcements
>> -------
> ...
>
>> -If you have the necessary privileges you will see links to edit the
>> -announcements.
>> +To edit an announcement you must go to the i...
Brad Crittenden (bac) wrote : | # |
=== modified file 'lib/canonical/
--- lib/canonical/
+++ lib/canonical/
@@ -582,8 +582,8 @@
border-bottom: 1px solid #d0d0d0;
}
.announcement .registered {
- font-size: 95%;
- margin-top: -2px
+ font-size: 93%;
+ margin-top: -2px;
}
/* From nice_pre in tales.py */
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -72,14 +72,14 @@
@enabled_
def announce(self):
text = 'Make announcement'
- summary = 'Publish an item of news for this project'
+ summary = 'Create an item of news for this project'
return Link('+announce', text, summary, icon='add')
class AnnouncementCon
"""The menu for working with an Announcement."""
usedfor = IAnnouncement
- links = ('edit', 'retarget', 'publish', 'retract', 'delete')
+ links = ['edit', 'retarget', 'publish', 'retract', 'delete']
class IAnnouncementEd
@@ -92,7 +92,7 @@
usedfor = IAnnouncementEd
facet = 'overview'
title = 'Change announcement'
- links = ('edit', 'retarget', 'publish', 'retract', 'delete')
+ links = ['edit', 'retarget', 'publish', 'retract', 'delete']
def __init__(self, context):
@@ -115,7 +115,7 @@
usedfor = IAnnouncementCr
facet = 'overview'
title = 'Create announcement'
- links = ('announce', )
+ links = ['announce']
class AnnouncementFor
=== modified file 'lib/lp/
--- lib/lp/
+++ lib/lp/
@@ -75,6 +75,8 @@
>>> print priv_browser.url
http://
+ >>> print priv_browser.title
+ Apache in Launchpad
We'll repeat the process for Tomcat, an IProduct that is part of the
Apache project, but this time we won't specify a URL, and we will
@@ -107,8 +109,8 @@
... name='field.
... '2007-11-24 09:00:00')
>>> priv_browser.
- >>> print priv_browser.url
- http://
+ >>> print priv_browser.title
+ Tomcat in Launchpad
And check out the results:
@@ -138,8 +140,8 @@
>>> priv_browser.
... 'Derby announcement summary')
>>> priv_browser.
- >>> print priv_browser.url
- http://
+ >>> print priv_browser.title
+ Derby - Java Database in Launchpad
>>> 'Derby announcement' in latest_
True
@@ -158,8 +160,8 @@
... name='field.
Curtis Hovey (sinzui) wrote : | # |
Hi Brad.
This looks good. I have a few remarks. Since we are adding the index
page to this I am marking this
review needs_fixing
On Wed, 2009-08-19 at 00:45 +0000, Brad Crittenden wrote:
> Thanks for the review Curtis.
...
> class AnnouncementCre
> >> AnnouncementMen
> >> + """A sub-menu for different aspects of modifying an
> >> announcement."""
> >> +
> >> + usedfor = IAnnouncementCr
> >> + facet = 'overview'
> >> + title = 'Create announcement'
> >> + links = ('announce', )xmlns:tal="http://
> >> "
> >
> > Menus assume that links are a mutable list. This works, but may lead
> > to
> > cryptic errors if someone extends the menu,
>
> Really? From webapp/menu.py:
>
> assert isinstance(
> "self.links must be a tuple or list.")
>
> Just grepping through registry/
> of links being tuples. I've changed this one and the others in this
> module.
Ah! Thank you for showing me this. I am now understand the problem was
not the use if a tuple, but that the engineer assumed the menu he was
extending was a mutable list. You can use a list or a tuple as you want.
...
> > + <a tal:condition=
> > + tal:attributes=
> > + <img src="/@@/link" alt="Link" /> Read more</a>
> >
> > This does not look right. We use sprites. The icon used is for
> > offsite links
> > which these announcements are not. Maybe we need an new sprite for
> > announcement. I think we should report a bug and assign it to Martin.
>
> It is an off-site link. There is no sprite for an off-site link.
> Should we go that route or just leave this as is?
Yes, there is a sprite. The external links on the project page use it.
'external-link' which is the globe the link us showing now.
...
...
> class AnnouncementCon
> """The menu for working with an Announcement."""
> usedfor = IAnnouncement
> - links = ('edit', 'retarget', 'publish', 'retract', 'delete')
> + links = ['edit', 'retarget', 'publish', 'retract', 'delete']
I think we can delete this class. I do not think it will be used since
we have converted all the pages that use this with the index page
...
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -17,6 +17,7 @@
> <h1>News and announcements</h1>
> </tal:heading>
> <div metal:fill-
> + <br />
This looks wrong. <br> are not meant to create blank lines. They so not
belong between block elements because block elements define margins and
padding.
I think you want the op content, or all the content wrapped in a
<div class="
--
__C U R T I S C. H O V E Y_______
Guilty of stealing everything I am.
Brad Crittenden (bac) wrote : | # |
On Aug 19, 2009, at 16:30 , Curtis Hovey wrote:
> Review: Needs Fixing
> Hi Brad.
>
> This looks good. I have a few remarks. Since we are adding the index
> page to this I am marking this
>
> review needs_fixing
Sure, that work is included in the diff I've got now.
>
> On Wed, 2009-08-19 at 00:45 +0000, Brad Crittenden wrote:
>
>>> + <a tal:condition=
>>> + tal:attributes=
>>> + <img src="/@@/link" alt="Link" /> Read more</a>
>>>
>>> This does not look right. We use sprites. The icon used is for
>>> offsite links
>>> which these announcements are not. Maybe we need an new sprite for
>>> announcement. I think we should report a bug and assign it to
>>> Martin.
>>
>> It is an off-site link. There is no sprite for an off-site link.
>> Should we go that route or just leave this as is?
>
> Yes, there is a sprite. The external links on the project page use it.
> 'external-link' which is the globe the link us showing now.
Thanks for the pointer. I see it uses 'no-follow' too, which I
definitely should have here.
>
> ...
> ...
>
>> class AnnouncementCon
>> """The menu for working with an Announcement."""
>> usedfor = IAnnouncement
>> - links = ('edit', 'retarget', 'publish', 'retract', 'delete')
>> + links = ['edit', 'retarget', 'publish', 'retract', 'delete']
>
> I think we can delete this class. I do not think it will be used since
> we have converted all the pages that use this with the index page
Good call
>
> ...
>
>> === modified file 'lib/lp/
>> index.pt'
>> --- lib/lp/
>> 20:36:01 +0000
>> +++ lib/lp/
>> 00:43:48 +0000
>> @@ -17,6 +17,7 @@
>> <h1>News and announcements</h1>
>> </tal:heading>
>> <div metal:fill-
>> + <br />
>
> This looks wrong. <br> are not meant to create blank lines. They so
> not
> belong between block elements because block elements define margins
> and
> padding.
>
> I think you want the op content, or all the content wrapped in a
> <div class="
I inserted <div class="top-portlet" style="margin-top: 0.5em;"> which
seems to give a reasonable amount of spacing.
In the update I've also updated announcement-
where the index page for a distribution was getting messed up due to
changes to HasAnnouncement
to be removed when the update to distribution happens).
Brad Crittenden (bac) wrote : | # |
The diff is at:
Brad Crittenden (bac) wrote : | # |
> The diff is at:
>
> http://
Wrong diff. The real one is at: http://
Curtis Hovey (sinzui) wrote : | # |
Thanks for the fixes and leaving me a XXX to complete my part of task. This is good to land.
Brad Crittenden (bac) wrote : | # |
There were additional test problems caused by the fact the distribution page has not been updated. The fixes here are temporary as the tests will be reworked in that effort, especially the distribution navigation tests.
Brad Crittenden (bac) wrote : | # |
Screenshots for UI review may be found at: https:/
Paul Hummer (rockstar) wrote : | # |
So, you noticed that the bylines are styled wrong. If the problem is invasive, please file a bug a fix it soon. If it's not, please fix before landing. Otherwise, this looks really good.
Preview Diff
1 | === modified file 'lib/canonical/launchpad/icing/style-3-0.css' |
2 | --- lib/canonical/launchpad/icing/style-3-0.css 2009-08-17 11:22:39 +0000 |
3 | +++ lib/canonical/launchpad/icing/style-3-0.css 2009-08-17 20:36:01 +0000 |
4 | @@ -292,11 +292,11 @@ |
5 | font-size: 116%; |
6 | } |
7 | ol { |
8 | - margin-left: 1.8em; |
9 | + margin-left: 1.8em; |
10 | } |
11 | ol li { |
12 | - list-style: decimal outside; |
13 | - } |
14 | + list-style: decimal outside; |
15 | + } |
16 | li { |
17 | padding-bottom: .3em; |
18 | } |
19 | @@ -581,6 +581,10 @@ |
20 | border-top: 1px solid #d0d0d0; |
21 | border-bottom: 1px solid #d0d0d0; |
22 | } |
23 | +.announcement .registered { |
24 | + font-size: 95%; |
25 | + margin-top: -2px |
26 | + } |
27 | |
28 | /* From nice_pre in tales.py */ |
29 | pre.wrap { |
30 | @@ -589,4 +593,3 @@ |
31 | white-space: pre-wrap; |
32 | word-wrap: break-word; |
33 | } |
34 | - |
35 | |
36 | === modified file 'lib/lp/registry/browser/announcement.py' |
37 | --- lib/lp/registry/browser/announcement.py 2009-08-11 04:00:47 +0000 |
38 | +++ lib/lp/registry/browser/announcement.py 2009-08-17 20:36:01 +0000 |
39 | @@ -21,7 +21,6 @@ |
40 | from zope.schema import Choice, TextLine |
41 | |
42 | from canonical.cachedproperty import cachedproperty |
43 | -from canonical.config import config |
44 | |
45 | from lp.registry.interfaces.announcement import IAnnouncement |
46 | |
47 | @@ -70,6 +69,12 @@ |
48 | text = 'Delete announcement' |
49 | return Link('+delete', text, icon='trash-icon') |
50 | |
51 | + @enabled_with_permission('launchpad.Edit') |
52 | + def announce(self): |
53 | + text = 'Make announcement' |
54 | + summary = 'Publish an item of news for this project' |
55 | + return Link('+announce', text, summary, icon='add') |
56 | + |
57 | |
58 | class AnnouncementContextMenu(ContextMenu, AnnouncementMenuMixin): |
59 | """The menu for working with an Announcement.""" |
60 | @@ -100,6 +105,19 @@ |
61 | self.context = context |
62 | |
63 | |
64 | +class IAnnouncementCreateMenu(Interface): |
65 | + """A marker interface for creation announcement navigation menu.""" |
66 | + |
67 | + |
68 | +class AnnouncementCreateNavigationMenu(NavigationMenu, AnnouncementMenuMixin): |
69 | + """A sub-menu for different aspects of modifying an announcement.""" |
70 | + |
71 | + usedfor = IAnnouncementCreateMenu |
72 | + facet = 'overview' |
73 | + title = 'Create announcement' |
74 | + links = ('announce', ) |
75 | + |
76 | + |
77 | class AnnouncementFormMixin: |
78 | """A mixin to provide the common form features.""" |
79 | |
80 | @@ -268,6 +286,9 @@ |
81 | |
82 | class HasAnnouncementsView(LaunchpadView, FeedsMixin): |
83 | """A view class for pillars which have announcements.""" |
84 | + implements(IAnnouncementCreateMenu) |
85 | + |
86 | + batch_size = 5 |
87 | |
88 | @cachedproperty |
89 | def feed_url(self): |
90 | @@ -299,7 +320,7 @@ |
91 | def announcement_nav(self): |
92 | return BatchNavigator( |
93 | self.announcements, self.request, |
94 | - size=config.launchpad.default_batch_size) |
95 | + size=self.batch_size) |
96 | |
97 | |
98 | class AnnouncementSetView(HasAnnouncementsView): |
99 | |
100 | === modified file 'lib/lp/registry/browser/configure.zcml' |
101 | --- lib/lp/registry/browser/configure.zcml 2009-08-16 21:14:53 +0000 |
102 | +++ lib/lp/registry/browser/configure.zcml 2009-08-17 20:36:01 +0000 |
103 | @@ -774,6 +774,7 @@ |
104 | module="lp.registry.browser.announcement" |
105 | classes=" |
106 | AnnouncementContextMenu |
107 | + AnnouncementCreateNavigationMenu |
108 | AnnouncementEditNavigationMenu"/> |
109 | <facet |
110 | facet="overview"> |
111 | |
112 | === modified file 'lib/lp/registry/stories/announcements/xx-announcements.txt' |
113 | --- lib/lp/registry/stories/announcements/xx-announcements.txt 2009-08-13 18:10:15 +0000 |
114 | +++ lib/lp/registry/stories/announcements/xx-announcements.txt 2009-08-17 20:36:01 +0000 |
115 | @@ -205,7 +205,7 @@ |
116 | anon_browser. |
117 | |
118 | >>> priv_browser.open('http://launchpad.dev/kubuntu/+announcements') |
119 | - >>> priv_browser.getLink('Permalink').click() |
120 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
121 | >>> link_url = priv_browser.url |
122 | >>> anon_browser.open(link_url) |
123 | Traceback (most recent call last): |
124 | @@ -216,7 +216,7 @@ |
125 | published: |
126 | |
127 | >>> anon_browser.open('http://launchpad.dev/apache/+announcements') |
128 | - >>> anon_browser.getLink('Permalink').click() |
129 | + >>> anon_browser.getLink('Derby announcement headline').click() |
130 | >>> print anon_browser.title |
131 | Derby announcement |
132 | |
133 | @@ -317,7 +317,8 @@ |
134 | |
135 | We can publish this announcement immediately. |
136 | |
137 | - >>> priv_browser.getLink('Publish now').click() |
138 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
139 | + >>> priv_browser.getLink('Publish announcement').click() |
140 | >>> priv_browser.url |
141 | 'http://launchpad.dev/kubuntu/+announceme.../+publish' |
142 | >>> radio = priv_browser.getControl(name="field.publication_date.action") |
143 | @@ -418,47 +419,16 @@ |
144 | Editing announcements |
145 | --------------------- |
146 | |
147 | -The page to edit that announcement is linked from the announcement |
148 | -listing. If you are anonymous or don't have the right privileges then |
149 | -you cannot see any edit links: |
150 | - |
151 | - >>> anon_browser.open('http://launchpad.dev/tomcat/+announcements') |
152 | - >>> listed_announcements = find_tag_by_id( |
153 | - ... anon_browser.contents, 'announcements') |
154 | - >>> edit_link_text = 'Edit this announcement.' |
155 | - >>> edit_links = listed_announcements.fetch('a', text=edit_link_text) |
156 | - >>> len(edit_links) |
157 | - 0 |
158 | - |
159 | - >>> nopriv_browser.open('http://launchpad.dev/tomcat/+announcements') |
160 | - >>> listed_announcements = find_tag_by_id( |
161 | - ... nopriv_browser.contents, 'announcements') |
162 | - >>> edit_links = listed_announcements.fetch('a', text=edit_link_text) |
163 | - >>> len(edit_links) |
164 | - 0 |
165 | - |
166 | -If you have the necessary privileges you will see links to edit the |
167 | -announcements. |
168 | +To edit an announcement you must go to the individual announcement |
169 | +page and then follow the proper links. |
170 | |
171 | >>> priv_browser.open('http://launchpad.dev/tomcat/+announcements') |
172 | - >>> listed_announcements = find_tag_by_id( |
173 | - ... priv_browser.contents, 'announcements') |
174 | - >>> edit_links = listed_announcements.fetch('a', text=edit_link_text) |
175 | - >>> len(edit_links) |
176 | - 2 |
177 | - |
178 | -Following a link takes you to a form where you can change the headline, |
179 | -summary and URL of the announcement: |
180 | - |
181 | - >>> 'Modified headline' not in announcements(priv_browser.contents) |
182 | - True |
183 | - >>> 'Modified summary' not in announcements(priv_browser.contents) |
184 | - True |
185 | >>> print priv_browser.getLink('Read more').url |
186 | http://apache.org/announcement/rocking/ |
187 | - >>> priv_browser.getLink(edit_link_text).click() |
188 | + >>> priv_browser.getLink('Apache announcement headline').click() |
189 | + >>> priv_browser.getLink('Modify announcement').click() |
190 | >>> print priv_browser.url |
191 | - http://launchpad.dev/apache/+announcement/... |
192 | + http://launchpad.dev/apache/+announcement/.../+edit |
193 | >>> headline = priv_browser.getControl('Headline') |
194 | >>> print headline.value |
195 | Apache announcement headline |
196 | @@ -494,7 +464,9 @@ |
197 | True |
198 | >>> 'Retracted' in announcements(priv_browser.contents) |
199 | False |
200 | - >>> priv_browser.getLink('Retract').click() |
201 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
202 | + >>> priv_browser.getLink('Delete announcement').click() |
203 | + >>> priv_browser.getLink('retracting the announcement').click() |
204 | >>> priv_browser.url |
205 | 'http://launchpad.dev/kubuntu/+announcement/.../+retract' |
206 | |
207 | @@ -525,7 +497,8 @@ |
208 | |
209 | Once something has been retracted, it can be published again. |
210 | |
211 | - >>> priv_browser.getLink('Publish now').click() |
212 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
213 | + >>> priv_browser.getLink('Publish announcement').click() |
214 | >>> priv_browser.url |
215 | 'http://launchpad.dev/kubuntu/+announceme.../+publish' |
216 | >>> radio = priv_browser.getControl(name="field.publication_date.action") |
217 | @@ -553,7 +526,7 @@ |
218 | it. |
219 | |
220 | >>> priv_browser.open('http://launchpad.dev/kubuntu/+announcements') |
221 | - >>> priv_browser.getLink(edit_link_text).click() |
222 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
223 | >>> priv_browser.getLink('Move announcement').click() |
224 | >>> print priv_browser.url |
225 | http://launchpad.dev/kubuntu/+announcement/.../+retarget |
226 | @@ -570,7 +543,7 @@ |
227 | >>> kamion_browser = \ |
228 | ... setupBrowser(auth="Basic colin.watson@ubuntulinux.com:test") |
229 | >>> kamion_browser.open('http://launchpad.dev/guadalinex/+announcements') |
230 | - >>> kamion_browser.getLink(edit_link_text).click() |
231 | + >>> kamion_browser.getLink('Kubuntu announcement headline').click() |
232 | >>> kamion_browser.getLink('Move announcement').click() |
233 | >>> print kamion_browser.url |
234 | http://launchpad.dev/guadalinex/+announcement/.../+retarget |
235 | @@ -641,8 +614,9 @@ |
236 | >>> priv_browser.open('http://launchpad.dev/guadalinex/+announcements') |
237 | >>> 'Kubuntu announcement headline' in announcements(priv_browser.contents) |
238 | True |
239 | - |
240 | - >>> priv_browser.getLink('Retract').click() |
241 | + >>> priv_browser.getLink('Kubuntu announcement headline').click() |
242 | + >>> priv_browser.getLink('Delete announcement').click() |
243 | + >>> priv_browser.getLink('retracting the announcement').click() |
244 | >>> priv_browser.url |
245 | 'http://launchpad.dev/guadalinex/+announcement/.../+retract' |
246 | >>> priv_browser.getControl('Retract').click() |
247 | @@ -734,7 +708,8 @@ |
248 | >>> kamion_browser.open('http://launchpad.dev/guadalinex/+announcements') |
249 | >>> no_announcements(kamion_browser.contents) |
250 | False |
251 | - >>> kamion_browser.getLink('Permanently delete').click() |
252 | + >>> kamion_browser.getLink('Kubuntu announcement headline').click() |
253 | + >>> kamion_browser.getLink('Delete announcement').click() |
254 | >>> print kamion_browser.url |
255 | http://launchpad.dev/guadalinex/+announcement/.../+delete |
256 | >>> kamion_browser.getControl('Delete').click() |
257 | |
258 | === modified file 'lib/lp/registry/templates/announcement-edit.pt' |
259 | --- lib/lp/registry/templates/announcement-edit.pt 2009-08-01 02:04:55 +0000 |
260 | +++ lib/lp/registry/templates/announcement-edit.pt 2009-08-17 20:36:01 +0000 |
261 | @@ -5,10 +5,6 @@ |
262 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
263 | metal:use-macro="view/macro:page/main_only" |
264 | i18n:domain="launchpad"> |
265 | - <metal:block fill-slot="head_epilogue"> |
266 | - <metal:yui-dependencies |
267 | - use-macro="context/@@launchpad_widget_macros/yui2calendar-dependencies" /> |
268 | - </metal:block> |
269 | <body> |
270 | <div metal:fill-slot="main"> |
271 | <div class="top-portlet"> |
272 | |
273 | === modified file 'lib/lp/registry/templates/announcement-listing-detailed.pt' |
274 | --- lib/lp/registry/templates/announcement-listing-detailed.pt 2009-07-17 17:59:07 +0000 |
275 | +++ lib/lp/registry/templates/announcement-listing-detailed.pt 2009-08-17 20:36:01 +0000 |
276 | @@ -1,59 +1,47 @@ |
277 | -<h2> |
278 | - <tal:date tal:condition="context/date_announced"> |
279 | - <span tal:replace="context/date_announced/fmt:date"> |
280 | - 22 Oct 2008 |
281 | - </span>: |
282 | - </tal:date> |
283 | - <tal:title content="context/title">News item title</tal:title> |
284 | -</h2> |
285 | - |
286 | -<tal:summary condition="context/summary" |
287 | - tal:replace="structure context/summary/fmt:text-to-html" /> |
288 | -<p> |
289 | - <a tal:attributes="href string:${context/fmt:url}" |
290 | - >Permalink.</a> |
291 | - <tal:future condition="context/future"> |
292 | - <img src="/@@/warning" title="Announcement is not yet public" /> |
293 | - <strong tal:condition="context/active"> |
294 | - <tal:date_set condition="context/date_announced"> |
295 | - This will be published on |
296 | - <span tal:replace="context/date_announced/fmt:datetime" /> |
297 | - </tal:date_set> |
298 | - </strong> |
299 | - </tal:future> |
300 | - <strong tal:condition="not: context/active"> |
301 | - [Retracted] |
302 | - </strong> |
303 | - <strong tal:condition="not: context/date_announced"> |
304 | - No publishing date set. |
305 | - </strong> |
306 | - <strong tal:condition="context/date_last_modified"> |
307 | - Updated |
308 | - <span tal:replace="context/date_last_modified/fmt:displaydate" />. |
309 | - </strong> |
310 | - <a tal:condition="context/url" |
311 | - tal:attributes="href context/url"> |
312 | - <img src="/@@/link" alt="Link" /> Read more...</a> |
313 | -</p> |
314 | -<p> |
315 | - <tal:editor condition="context/required:launchpad.Edit"> |
316 | - <img src="/@@/edit" alt="[Edit]" /> |
317 | - <a tal:attributes="href string:${context/fmt:url}/+edit" |
318 | - >Edit this announcement.</a> |
319 | - <a tal:condition="not: context/published" |
320 | - tal:attributes="href string:${context/fmt:url}/+publish" |
321 | - >Publish now.</a> |
322 | - <a tal:condition="context/active" |
323 | - tal:attributes="href string:${context/fmt:url}/+retract" |
324 | - >Retract this announcement.</a> |
325 | - <a tal:condition="not: context/active" |
326 | - tal:attributes="href string:${context/fmt:url}/+delete" |
327 | - >Permanently delete this announcement.</a> |
328 | - <br /> |
329 | - </tal:editor> |
330 | - Created for |
331 | - <tal:pillar replace="structure context/target/fmt:link" /> |
332 | - <tal:date_created replace="context/date_created/fmt:displaydate" /> |
333 | - by |
334 | - <tal:registrant replace="structure context/registrant/fmt:link" /> |
335 | -</p> |
336 | +<div class="portlet" tal:attributes="id string:${context/id}"> |
337 | + <div class="announcement"> |
338 | + <a tal:attributes="href string:${context/fmt:url}"> |
339 | + <h2> |
340 | + <tal:date tal:condition="context/date_announced"> |
341 | + <span tal:replace="context/date_announced/fmt:date"/>: |
342 | + </tal:date> |
343 | + <tal:title content="context/title">News item title</tal:title> |
344 | + </h2> |
345 | + </a> |
346 | + |
347 | + <p class="registered"> |
348 | + Written for |
349 | + <tal:pillar replace="structure context/target/fmt:link" /> |
350 | + by |
351 | + <tal:registrant replace="structure context/registrant/fmt:link" />. |
352 | + </p> |
353 | + |
354 | + <tal:summary condition="context/summary" |
355 | + tal:replace="structure context/summary/fmt:text-to-html" /> |
356 | + <p> |
357 | + <tal:future condition="context/future"> |
358 | + <img src="/@@/warning" title="Announcement is not yet public." /> |
359 | + <strong tal:condition="context/active"> |
360 | + <tal:date_set condition="context/date_announced"> |
361 | + This announcement will be published on |
362 | + <span tal:replace="context/date_announced/fmt:datetime" />. |
363 | + </tal:date_set> |
364 | + </strong> |
365 | + </tal:future> |
366 | + <strong tal:condition="not: context/active"> |
367 | + <img src="/@@/info" title="Announcement has been retracted." /> |
368 | + Retracted. |
369 | + </strong> |
370 | + <strong tal:condition="not: context/date_announced"> |
371 | + No publishing date set. |
372 | + </strong> |
373 | + <strong tal:condition="context/date_last_modified"> |
374 | + Updated |
375 | + <span tal:replace="context/date_last_modified/fmt:displaydate" />. |
376 | + </strong> |
377 | + <a tal:condition="context/url" |
378 | + tal:attributes="href context/url"> |
379 | + <img src="/@@/link" alt="Link" /> Read more</a> |
380 | + </p> |
381 | + </div> |
382 | +</div> |
383 | |
384 | === modified file 'lib/lp/registry/templates/hasannouncements-index.pt' |
385 | --- lib/lp/registry/templates/hasannouncements-index.pt 2009-07-17 17:59:07 +0000 |
386 | +++ lib/lp/registry/templates/hasannouncements-index.pt 2009-08-17 20:36:01 +0000 |
387 | @@ -3,53 +3,73 @@ |
388 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
389 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
390 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
391 | - xml:lang="en" |
392 | - lang="en" |
393 | - dir="ltr" |
394 | - metal:use-macro="view/macro:page/onecolumn" |
395 | - i18n:domain="launchpad" |
396 | -> |
397 | - |
398 | -<body> |
399 | - |
400 | -<metal:portlets fill-slot="portlets"> |
401 | -</metal:portlets> |
402 | - |
403 | -<metal:atom fill-slot="head_epilogue"> |
404 | - <link rel="alternate" type="application/atom+xml" tal:attributes=" |
405 | - href view/feed_url; |
406 | - title string:Announcements for ${context/displayname}" /> |
407 | -</metal:atom> |
408 | - |
409 | -<p metal:fill-slot="help"> |
410 | - Project administrators can publish additional announcements, edit these |
411 | - announcements or retract them. |
412 | -</p> |
413 | - |
414 | -<div metal:fill-slot="main"> |
415 | - |
416 | - <h1>News and announcements</h1> |
417 | - |
418 | - <p tal:condition="view/announcement_nav/batch/listlength"> |
419 | - These announcements are available as an |
420 | - <a tal:attributes="href view/feed_url"> |
421 | - <img src="/@@/rss" alt="" /> Atom/RSS feed</a>. |
422 | - </p> |
423 | - |
424 | - <p tal:condition="not: view/announcement_nav/batch/listlength"> |
425 | - There are no announcements for this project. |
426 | - </p> |
427 | - |
428 | - <div tal:condition="view/announcement_nav/batch/listlength" id="announcements"> |
429 | - <tal:per_announcement |
430 | - repeat="announcement view/announcement_nav/currentBatch" |
431 | - replace="structure announcement/@@+listing-detailed" /> |
432 | - </div> |
433 | - |
434 | - <div class="lesser" |
435 | - tal:content="structure view/announcement_nav/@@+navigation-links-lower" |
436 | - /> |
437 | - |
438 | -</div> |
439 | -</body> |
440 | + metal:use-macro="view/macro:page/main_side" |
441 | + i18n:domain="launchpad"> |
442 | + |
443 | + <metal:atom fill-slot="head_epilogue"> |
444 | + <link rel="alternate" type="application/atom+xml" tal:attributes=" |
445 | + href view/feed_url; |
446 | + title string:Announcements for ${context/displayname}" /> |
447 | + </metal:atom> |
448 | + |
449 | + <body> |
450 | + <tal:heading metal:fill-slot="heading"> |
451 | + <h1>News and announcements</h1> |
452 | + </tal:heading> |
453 | + <div metal:fill-slot="main"> |
454 | + <p tal:condition="not: view/announcement_nav/batch/listlength"> |
455 | + There are no announcements for this project. |
456 | + </p> |
457 | + |
458 | + <div tal:condition="view/announcement_nav/batch/listlength" |
459 | + id="announcements"> |
460 | + <tal:per_announcement |
461 | + repeat="announcement view/announcement_nav/currentBatch" |
462 | + replace="structure announcement/@@+listing-detailed" /> |
463 | + </div> |
464 | + <div class="lesser" |
465 | + tal:content="structure view/announcement_nav/@@+navigation-links-lower" |
466 | + /> |
467 | + </div> |
468 | + |
469 | + <tal:side metal:fill-slot="side" |
470 | + define="announcements view/announcement_nav/currentBatch; |
471 | + overview_menu context/menu:overview"> |
472 | + |
473 | + <tal:menu replace="structure view/@@+global-actions" /> |
474 | + |
475 | + <div class="portlet"> |
476 | + <h2> |
477 | + <span style="float: right;"> |
478 | + <a title="Atom 1.0 feed" |
479 | + tal:attributes="href view/feed_url"><img src="/@@/rss.png"/></a> |
480 | + </span> |
481 | + Announcements |
482 | + </h2> |
483 | + |
484 | + <p tal:condition="not: view/announcement_nav/batch/listlength"> |
485 | + <tal:name replace="context/displayname" /> has no announcements. |
486 | + </p> |
487 | + |
488 | + <tal:announcements tal:condition="view/announcement_nav/batch/listlength"> |
489 | + <ul> |
490 | + <li tal:repeat="announcement announcements"> |
491 | + <img src="/@@/warning" alt="[Not published]" |
492 | + title="This is not yet a public announcement" |
493 | + tal:condition="not: announcement/published" /> |
494 | + <a tal:attributes="href string:#${announcement/id}" |
495 | + tal:content="announcement/title"> |
496 | + Announcement title |
497 | + </a> |
498 | + <strong |
499 | + tal:condition="announcement/date_announced" |
500 | + tal:content="announcement/date_announced/fmt:displaydate" /> |
501 | + <br /> |
502 | + <br /> |
503 | + </li> |
504 | + </ul> |
505 | + </tal:announcements> |
506 | + </div> |
507 | + </tal:side> |
508 | + </body> |
509 | </html> |
= Summary =
Update the <project> /+announcements page for 3.0 goodness, which is bug 414836.
Also solves:
Bug #175936: Announcements action (edit, publish & delete) links too close
Remedy: links removed
Bug #253920: Project +announcements page should have a "Make announcement" link on it
Remedy: add link in portlet
Bug #297518: "Created" doesn't make sense for announcements
Remedy: reworded to 'written by'
== Proposed fix ==
Redesign the page to make individual announcements stand-out more. Removed editing
links which were problematic.
== Pre-implementation notes ==
Lots of helpful discussions with Curtis.
== Implementation details ==
As above.
== Tests ==
bin/test --vvm lp.registry -t announcement
== Demo and Q/A ==
Go to the following and ensure all looks right: /launchpad. dev/mozilla/ +announcements /launchpad. dev/firefox/ +announcements /launchpad. dev/kubuntu/ +announcements
https:/
https:/
https:/
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: registry/ browser/ configure. zcml registry/ templates/ hasannouncement s-index. pt registry/ stories/ announcements/ xx-announcement s.txt registry/ browser/ announcement. py registry/ templates/ announcement- edit.pt /launchpad/ icing/style- 3-0.css registry/ templates/ announcement- listing- detailed. pt
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/canonical
lib/lp/
== XmlLint notices ==
lib/lp/ registry/ templates/ announcement- listing- detailed. pt ${context/ id}"> "href string: ${context/ fmt:url} "> "context/ date_announced" > "context/ date_announced" > "context/ date_announced/ fmt:date" />: "context/ title"> News item title</tal:title> target/ fmt:link" /> registrant/ fmt:link" />. replace= "structure context/ summary/ fmt:text- to-html" /> replace= "structure context/ summary/ fmt:text- to-html" /> "context/ future" >
1: namespace error : Namespace prefix tal for attributes on div is not defined
<div class="portlet" tal:attributes="id string:
^
3: namespace error : Namespace prefix tal for attributes on a is not defined
<a tal:attributes=
^
5: namespace error : Namespace prefix tal for condition on date is not defined
<tal:date tal:condition=
^
5: namespace error : Namespace prefix tal on date is not defined
<tal:date tal:condition=
^
6: namespace error : Namespace prefix tal for replace on span is not defined
<span tal:replace=
^
8: namespace error : Namespace prefix tal on title is not defined
<tal:title content=
^
14: namespace error : Namespace prefix tal on pillar is not defined
<tal:pillar replace="structure context/
^
16: namespace error : Namespace prefix tal on registrant is not defined
<tal:registrant replace="structure context/
^
20: namespace error : Namespace prefix tal for replace on summary is not defined
tal:
^
20: namespace error : Namespace prefix tal on summary is not defined
tal:
^
22: namespace error : Namespace prefix tal on future is not defined
<tal:future condition=
^
24: namespace error : Namespace prefix tal for condition on strong is not define...