Merge lp:~sinzui/launchpad/answers-portlets into lp:launchpad
- answers-portlets
- Merge into devel
Proposed by
Curtis Hovey
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~sinzui/launchpad/answers-portlets | ||||
Merge into: | lp:launchpad | ||||
Diff against target: | None lines | ||||
To merge this branch: | bzr merge lp:~sinzui/launchpad/answers-portlets | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eleanor Berger (community) | Approve | ||
Review via email: mp+9862@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote : | # |
Revision history for this message
Eleanor Berger (intellectronica) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/answers/browser/configure.zcml' |
2 | --- lib/lp/answers/browser/configure.zcml 2009-07-13 18:15:02 +0000 |
3 | +++ lib/lp/answers/browser/configure.zcml 2009-08-07 15:27:51 +0000 |
4 | @@ -281,7 +281,13 @@ |
5 | permission="zope.Public" |
6 | template="../templates/faq-listing.pt" |
7 | /> |
8 | - |
9 | + <browser:page |
10 | + for="lp.answers.interfaces.faqcollection.IFAQCollection" |
11 | + class=".faqcollection.SearchFAQsView" |
12 | + name="+portlet-listfaqs" |
13 | + permission="zope.Public" |
14 | + template="../templates/faqcollection-portlet-faqs.pt" |
15 | + /> |
16 | <browser:page |
17 | name="+createfaq" |
18 | for="lp.answers.interfaces.faqtarget.IFAQTarget" |
19 | |
20 | === modified file 'lib/lp/answers/browser/faqcollection.py' |
21 | --- lib/lp/answers/browser/faqcollection.py 2009-06-24 23:10:46 +0000 |
22 | +++ lib/lp/answers/browser/faqcollection.py 2009-08-07 21:43:36 +0000 |
23 | @@ -12,14 +12,18 @@ |
24 | |
25 | from urllib import urlencode |
26 | |
27 | +from canonical.cachedproperty import cachedproperty |
28 | from canonical.launchpad import _ |
29 | -from canonical.launchpad.interfaces import ( |
30 | - IFAQCollection, ISearchFAQsForm, QUESTION_STATUS_DEFAULT_SEARCH, |
31 | - QuestionSort) |
32 | +from lp.answers.interfaces.faqcollection import ( |
33 | + IFAQCollection, ISearchFAQsForm, FAQSort) |
34 | +from lp.answers.interfaces.questionenums import QuestionSort |
35 | +from lp.answers.interfaces.questioncollection import ( |
36 | + QUESTION_STATUS_DEFAULT_SEARCH) |
37 | from canonical.launchpad.webapp import ( |
38 | action, ApplicationMenu, canonical_url, LaunchpadFormView, Link, |
39 | safe_action) |
40 | from canonical.launchpad.webapp.batching import BatchNavigator |
41 | +from canonical.launchpad.webapp.menu import enabled_with_permission |
42 | |
43 | |
44 | class FAQCollectionMenu(ApplicationMenu): |
45 | @@ -27,7 +31,7 @@ |
46 | |
47 | usedfor = IFAQCollection |
48 | facet = 'answers' |
49 | - links = ['list_all'] |
50 | + links = ['list_all', 'create_faq'] |
51 | |
52 | def list_all(self): |
53 | """Return a Link to list all FAQs.""" |
54 | @@ -36,7 +40,14 @@ |
55 | # which an adapter exists that gives the proper context. |
56 | collection = IFAQCollection(self.context) |
57 | url = canonical_url(collection, rootsite='answers') + '/+faqs' |
58 | - return Link(url, 'List all FAQs') |
59 | + return Link(url, 'List all FAQs', icon='info') |
60 | + |
61 | + @enabled_with_permission('launchpad.Moderate') |
62 | + def create_faq(self): |
63 | + """Return a Link to create a new FAQ.""" |
64 | + collection = IFAQCollection(self.context) |
65 | + url = canonical_url(collection, rootsite='answers') + '/+createfaq' |
66 | + return Link(url, 'Create a new FAQ', icon='add') |
67 | |
68 | |
69 | class SearchFAQsView(LaunchpadFormView): |
70 | @@ -81,6 +92,23 @@ |
71 | faqs = self.context.searchFAQs(search_text=self.search_text) |
72 | return BatchNavigator(faqs, self.request) |
73 | |
74 | + @property |
75 | + def portlet_action(self): |
76 | + """The action URL of the portlet form.""" |
77 | + return canonical_url( |
78 | + self.context, view_name='+faqs', rootsite='answers') |
79 | + |
80 | + @cachedproperty |
81 | + def latest_faqs(self): |
82 | + """Return the latest faqs created for this target. |
83 | + |
84 | + This is used by the +portlet-listfaqs view. |
85 | + """ |
86 | + quantity = 5 |
87 | + faqs = self.context.searchFAQs( |
88 | + search_text=self.search_text, sort=FAQSort.NEWEST_FIRST) |
89 | + return faqs[:quantity] |
90 | + |
91 | @safe_action |
92 | @action(_('Search'), name='search') |
93 | def search_action(self, action, data): |
94 | |
95 | === modified file 'lib/lp/answers/browser/questiontarget.py' |
96 | --- lib/lp/answers/browser/questiontarget.py 2009-06-24 23:10:46 +0000 |
97 | +++ lib/lp/answers/browser/questiontarget.py 2009-08-07 15:27:51 +0000 |
98 | @@ -108,6 +108,11 @@ |
99 | """View used to display the latest questions on a question target.""" |
100 | |
101 | @cachedproperty |
102 | + def latest_questions_url(self): |
103 | + """The link to the latest questions.""" |
104 | + return canonical_url(self.context, rootsite='answers') |
105 | + |
106 | + @cachedproperty |
107 | def getLatestQuestions(self, quantity=5): |
108 | """Return <quantity> latest questions created for this target. This |
109 | is used by the +portlet-latestquestions view. |
110 | |
111 | === modified file 'lib/lp/answers/browser/tests/faq-views.txt' |
112 | --- lib/lp/answers/browser/tests/faq-views.txt 2009-03-24 12:43:49 +0000 |
113 | +++ lib/lp/answers/browser/tests/faq-views.txt 2009-08-07 21:43:36 +0000 |
114 | @@ -1,10 +1,67 @@ |
115 | -= Answer Tracker FAQ Pages = |
116 | - |
117 | - >>> from canonical.launchpad.interfaces import ILaunchBag, IProductSet |
118 | +Answer Tracker FAQ Pages |
119 | +======================== |
120 | + |
121 | + >>> from lp.registry.interfaces.product import IProductSet |
122 | + |
123 | >>> firefox = getUtility(IProductSet).getByName('firefox') |
124 | - |
125 | - >>> login('foo.bar@canonical.com') |
126 | - >>> foo_bar = getUtility(ILaunchBag).user |
127 | + >>> login_person(firefox.owner) |
128 | >>> firefox_faq = firefox.newFAQ( |
129 | - ... foo_bar, 'A FAQ', 'FAQ for test purpose') |
130 | - |
131 | + ... firefox.owner, 'A FAQ', 'FAQ for test purpose') |
132 | + |
133 | + |
134 | +Latest FAQs portlet |
135 | +------------------- |
136 | + |
137 | +The latest FAQs portlet allows an `IFAQTarget` to show the latest FAQs. |
138 | +It's view provided latest_faqs to get the FAQs to display. |
139 | + |
140 | + >>> from canonical.launchpad.testing.pages import ( |
141 | + ... extract_text, find_tag_by_id) |
142 | + |
143 | + >>> view = create_initialized_view( |
144 | + ... firefox, '+portlet-listfaqs', principal=firefox.owner) |
145 | + >>> for faq in view.latest_faqs: |
146 | + ... print faq.title |
147 | + A FAQ |
148 | + What's the keyboard shortcut for [random feature]? |
149 | + How do I install plugins (Shockwave, QuickTime, etc.)? |
150 | + How do I troubleshoot problems with extensions/themes? |
151 | + How do I install Extensions? |
152 | + |
153 | + >>> content = find_tag_by_id(view.render(), 'portlet-latest-faqs') |
154 | + >>> print content.h2 |
155 | + <h2>...FAQs for Mozilla Firefox </h2> |
156 | + |
157 | + >>> print extract_text(content.ul) |
158 | + A FAQ |
159 | + What's the keyboard shortcut for [random feature]?... |
160 | + |
161 | +Each FAQ is linked. |
162 | + |
163 | + >>> print content.find('a', {'class': 'sprite question'}) |
164 | + <a class="..." href="http://answers.../firefox/+faq/...">A FAQ</a> |
165 | + |
166 | +The portlet has a form to search FAQs. The view provides the action URL so |
167 | +that the form works from any page. |
168 | + |
169 | + >>> print view.portlet_action |
170 | + http://answers.launchpad.dev/firefox/+faqs |
171 | + |
172 | + >>> print content.form['action'] |
173 | + http://answers.launchpad.dev/firefox/+faqs |
174 | + |
175 | +The portlet provides a link to create a faq when the user that has moderate |
176 | +permission such as the project owner. |
177 | + |
178 | + >>> print content.find('a', {'class': 'menu-link-create_faq sprite add'}) |
179 | + <a href=".../firefox/+createfaq" class="...">Create a new FAQ</a> |
180 | + |
181 | +Other users do not see the link. |
182 | + |
183 | + >>> user = factory.makePerson(name='a-user') |
184 | + >>> login_person(user) |
185 | + >>> view = create_initialized_view( |
186 | + ... firefox, '+portlet-listfaqs', principal=user) |
187 | + >>> content = find_tag_by_id(view.render(), 'portlet-latest-faqs') |
188 | + >>> print content.find('a', {'class': 'menu-link-create_faq sprite add'}) |
189 | + None |
190 | |
191 | === modified file 'lib/lp/answers/stories/question-overview.txt' |
192 | --- lib/lp/answers/stories/question-overview.txt 2009-06-02 08:20:49 +0000 |
193 | +++ lib/lp/answers/stories/question-overview.txt 2009-08-07 18:20:14 +0000 |
194 | @@ -165,14 +165,15 @@ |
195 | |
196 | >>> user_browser.open('http://launchpad.dev/mozilla') |
197 | |
198 | - >>> questions = find_portlet(user_browser.contents, 'Latest questions') |
199 | - >>> print extract_text( |
200 | - ... questions.find('div')).encode('ASCII', 'backslashreplace') |
201 | - [Open] Problemas de Impress\xe3o no Firefox |
202 | - [Answered] Newly installed plug-in doesn't seem to be used |
203 | - [Open] Firefox loses focus and gets stuck |
204 | - [Open] Problem showing the SVG demo on W3C site |
205 | - [Open] Firefox cannot render Bank Site |
206 | + >>> questions = find_tag_by_id( |
207 | + ... user_browser.contents, 'portlet-latest-questions') |
208 | + >>> print extract_text(questions).encode('ASCII', 'backslashreplace') |
209 | + Latest questions |
210 | + Problemas de Impress\xe3o no Firefox ... |
211 | + Newly installed plug-in doesn't seem to be used ... |
212 | + Firefox loses focus and gets stuck ... |
213 | + Problem showing the SVG demo on W3C site ... |
214 | + Firefox cannot render Bank Site ... |
215 | |
216 | >>> user_browser.getLink('Ask a question').click() |
217 | >>> print user_browser.title |
218 | |
219 | === added file 'lib/lp/answers/templates/faqcollection-portlet-faqs.pt' |
220 | --- lib/lp/answers/templates/faqcollection-portlet-faqs.pt 1970-01-01 00:00:00 +0000 |
221 | +++ lib/lp/answers/templates/faqcollection-portlet-faqs.pt 2009-08-07 21:43:36 +0000 |
222 | @@ -0,0 +1,34 @@ |
223 | +<div |
224 | + xmlns:tal="http://xml.zope.org/namespaces/tal" |
225 | + class="portlet" id="portlet-latest-faqs" |
226 | + tal:define="faqs view/latest_faqs" |
227 | + tal:condition="faqs"> |
228 | + <h2> |
229 | + <span class="see-all"><a |
230 | + tal:replace="structure view/menu:answers/list_all/fmt:link" /></span> |
231 | + FAQs for <tal:name replace="context/displayname" /> |
232 | + </h2> |
233 | + |
234 | + <form id="question-search-form" method="get" accept-charset="UTF-8" |
235 | + tal:attributes="action view/portlet_action"> |
236 | + <p> |
237 | + <tal:searchbox replace="structure view/widgets/search_text" /> |
238 | + <input tal:replace="structure view/search_action/render" /> |
239 | + </p> |
240 | + </form> |
241 | + |
242 | + <ul tal:condition="faqs"> |
243 | + <li tal:repeat="faq faqs"> |
244 | + <a class="sprite question" |
245 | + tal:attributes="href faq/fmt:url" |
246 | + tal:content="faq/title">How do I do this?</a> |
247 | + </li> |
248 | + </ul> |
249 | + |
250 | + <ul class="horizontal" |
251 | + tal:condition="context/required:launchpad.Moderate"> |
252 | + <li> |
253 | + <a tal:replace="structure view/menu:answers/create_faq/fmt:link" /> |
254 | + </li> |
255 | + </ul> |
256 | +</div> |
257 | |
258 | === modified file 'lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt' |
259 | --- lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt 2009-07-17 17:59:07 +0000 |
260 | +++ lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt 2009-08-07 22:14:06 +0000 |
261 | @@ -1,15 +1,27 @@ |
262 | -<div class="portlet" id="portlet-latest-questions" |
263 | - tal:condition="view/getLatestQuestions"> |
264 | - <h2>Latest questions</h2> |
265 | - <div class="portletBody portletContent"> |
266 | - |
267 | - <ul> |
268 | - <li tal:repeat="question view/getLatestQuestions"> |
269 | - <span tal:attributes="class string:questionstatus${question/status/name} ${question/image:sprite_css}" |
270 | - >[<tal:block tal:replace="structure question/status/title" />]</span> |
271 | - <a tal:content="question/title/fmt:shorten/80" |
272 | - tal:attributes="href question/fmt:url">question title</a> |
273 | - </li> |
274 | - </ul> |
275 | - </div> |
276 | +<div |
277 | + xmlns:tal="http://xml.zope.org/namespaces/tal" |
278 | + class="portlet" id="portlet-latest-questions" |
279 | + tal:define="questions view/getLatestQuestions" |
280 | + tal:condition="questions"> |
281 | + <h2> |
282 | + <span class="see-all" tal:condition="nothing"><a |
283 | + tal:attributes="href view/latest_questions_url">All questions</a></span> |
284 | + Latest questions |
285 | + </h2> |
286 | + |
287 | + <ul tal:condition="questions"> |
288 | + <li tal:repeat="question questions"> |
289 | + <a |
290 | + tal:attributes="class string: ${question/image:sprite_css}; |
291 | + href question/fmt:url;" |
292 | + tal:content="question/title/fmt:shorten/80">question title</a> |
293 | + <br />Posted <tal:when replace="question/datecreated/fmt:displaydate" /> |
294 | + </li> |
295 | + </ul> |
296 | + |
297 | + <tal:comment condition="nothing"> |
298 | + # XXX sinzui 2009-08-07 bug=410501: Remove this link and enable the |
299 | + # see all link when the distribution source package index page is 3.0. |
300 | + </tal:comment> |
301 | + <a tal:attributes="href view/latest_questions_url">All questions</a> |
302 | </div> |
303 | |
304 | === modified file 'lib/lp/registry/stories/announcements/xx-announcements.txt' |
305 | --- lib/lp/registry/stories/announcements/xx-announcements.txt 2009-08-01 02:04:55 +0000 |
306 | +++ lib/lp/registry/stories/announcements/xx-announcements.txt 2009-08-07 17:29:08 +0000 |
307 | @@ -90,8 +90,8 @@ |
308 | >>> print latest_news(priv_browser.contents).encode( |
309 | ... 'ascii', 'backslashreplace') |
310 | Announcements |
311 | - 20...: Apache announcement headline |
312 | - ...More announcements |
313 | + Apache announcement headline... |
314 | + More announcements |
315 | Make announcement |
316 | |
317 | Add another one, this time specifying a date in the past, which should |
318 | @@ -115,9 +115,9 @@ |
319 | >>> print latest_news(priv_browser.contents).encode( |
320 | ... 'ascii', 'backslashreplace') |
321 | Announcements |
322 | - 20...: Apache announcement headline |
323 | - 2007-11-24: Tomcat announcement headline |
324 | - ...More announcements |
325 | + Apache announcement headline ... |
326 | + Tomcat announcement headline on 2007-11-24 ... |
327 | + More announcements |
328 | Make announcement |
329 | |
330 | Let's make sure that the announcement is presented as a link. |
331 | |
332 | === modified file 'lib/lp/registry/stories/standalone/xx-karmacontext-topcontributors.txt' |
333 | --- lib/lp/registry/stories/standalone/xx-karmacontext-topcontributors.txt 2009-04-17 10:32:16 +0000 |
334 | +++ lib/lp/registry/stories/standalone/xx-karmacontext-topcontributors.txt 2009-08-07 15:47:52 +0000 |
335 | @@ -56,7 +56,7 @@ |
336 | >>> print find_portlet( |
337 | ... anon_browser.contents, 'Top contributors').renderContents() |
338 | <BLANKLINE> |
339 | - <h2>Top contributors</h2> |
340 | + <h2> Top contributors </h2> |
341 | ...Sample Person... |
342 | ...Mark Shuttleworth... |
343 | ...Foo Bar... |
344 | @@ -92,7 +92,7 @@ |
345 | >>> print find_portlet( |
346 | ... anon_browser.contents, 'Top contributors').renderContents() |
347 | <BLANKLINE> |
348 | - <h2>Top contributors</h2> |
349 | + <h2> Top contributors </h2> |
350 | ...Sample Person... |
351 | ...Mark Shuttleworth... |
352 | ...Foo Bar... |
353 | |
354 | === modified file 'lib/lp/registry/templates/hasannouncements-portlet-latest.pt' |
355 | --- lib/lp/registry/templates/hasannouncements-portlet-latest.pt 2009-07-17 17:59:07 +0000 |
356 | +++ lib/lp/registry/templates/hasannouncements-portlet-latest.pt 2009-08-07 22:14:06 +0000 |
357 | @@ -4,36 +4,43 @@ |
358 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
359 | omit-tag=""> |
360 | <tal:news define="announcements view/latest_announcements; |
361 | + has_announcements announcements/count; |
362 | overview_menu context/menu:overview"> |
363 | -<div |
364 | - class="portlet" |
365 | - id="portlet-latest-announcements"> |
366 | - <h2>Announcements</h2> |
367 | - <div class="portletBody portletContent"> |
368 | - <a title="Atom 1.0 feed" |
369 | - tal:attributes="href view/feed_url"> |
370 | - </a> |
371 | +<div id="portlet-latest-announcements" class="portlet announcements"> |
372 | + <h2> |
373 | + <span style="float: right;"><a title="Atom 1.0 feed" |
374 | + tal:attributes="href view/feed_url"><img src="/@@/rss.png"/></a></span> |
375 | + Announcements |
376 | + </h2> |
377 | + |
378 | + <p tal:condition="not: has_announcements"> |
379 | + <tal:name replace="context/displayname" /> has no announcements. |
380 | + </p> |
381 | + |
382 | + <tal:announcements condition="has_announcements"> |
383 | <ul> |
384 | - <li tal:repeat="announcement announcements" class="news"> |
385 | - <img src="/@@/warning" alt="[Not published]" |
386 | - title="This is not yet a public announcement" |
387 | - tal:condition="not: announcement/published" /> |
388 | - <a tal:attributes="href announcement/fmt:url"> |
389 | - <span |
390 | + <li tal:repeat="announcement announcements"> |
391 | + <div class="latest-announcement" |
392 | + tal:omit-tag="not: repeat/announcement/start"> |
393 | + <img src="/@@/warning" alt="[Not published]" |
394 | + title="This is not yet a public announcement" |
395 | + tal:condition="not: announcement/published" /> |
396 | + <a tal:attributes="href announcement/fmt:url" |
397 | + tal:content="announcement/title" /> |
398 | + <strong |
399 | tal:condition="announcement/date_announced" |
400 | - tal:replace="string:${announcement/date_announced/fmt:date}:" /> |
401 | - <span tal:replace="announcement/title" /> |
402 | - </a> |
403 | + tal:content="announcement/date_announced/fmt:displaydate" /> |
404 | + <br /> <tal:extract replace="announcement/summary/fmt:shorten/80" /> |
405 | + </div> |
406 | </li> |
407 | </ul> |
408 | - <div |
409 | - tal:content="structure overview_menu/announcements/render" |
410 | - /> |
411 | - <div |
412 | - class="actions" |
413 | - tal:content="structure overview_menu/announce/render" |
414 | - /> |
415 | - </div> |
416 | + |
417 | + <div class="see-all" |
418 | + tal:content="structure overview_menu/announcements/render" /> |
419 | + </tal:announcements> |
420 | + |
421 | + <div class="actions" |
422 | + tal:content="structure overview_menu/announce/render" /> |
423 | </div> |
424 | </tal:news> |
425 | </tal:root> |
426 | |
427 | === modified file 'lib/lp/registry/templates/karmacontext-portlet-top-contributors.pt' |
428 | --- lib/lp/registry/templates/karmacontext-portlet-top-contributors.pt 2009-07-17 17:59:07 +0000 |
429 | +++ lib/lp/registry/templates/karmacontext-portlet-top-contributors.pt 2009-08-07 22:14:06 +0000 |
430 | @@ -1,27 +1,30 @@ |
431 | <div |
432 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
433 | - xmlns:metal="http://xml.zope.org/namespaces/metal" |
434 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
435 | class="portlet" id="portlet-top-contributors" |
436 | - tal:condition="view/getTopFiveContributors"> |
437 | - <h2>Top contributors</h2> |
438 | - |
439 | - <table> |
440 | - <tr tal:repeat="contributor view/getTopFiveContributors"> |
441 | - <td> |
442 | - <a tal:replace="structure contributor/person/fmt:link"> |
443 | - Guilherme Salgado |
444 | - </a> |
445 | - </td> |
446 | - <td align="right"> |
447 | - <span tal:replace="contributor/karmavalue" /> points |
448 | - </td> |
449 | - </tr> |
450 | - </table> |
451 | - |
452 | - <div |
453 | - tal:define="link context/menu:overview/top_contributors" |
454 | - tal:content="structure link/render" |
455 | - class="actions" |
456 | - /> |
457 | + tal:define="contributors view/getTopFiveContributors" |
458 | + tal:condition="contributors"> |
459 | + <h2> |
460 | + <span class="see-all" tal:condition="nothing"><a |
461 | + tal:replace="structure context/menu:overview/top_contributors/fmt:link" /></span> |
462 | + Top contributors |
463 | + </h2> |
464 | + |
465 | + <dl> |
466 | + <tal:contributor tal:repeat="contributor contributors"> |
467 | + <dt> |
468 | + <a tal:replace="structure contributor/person/fmt:link"> |
469 | + Guilherme Salgado</a> |
470 | + <strong> |
471 | + <tal:karma replace="contributor/karmavalue" /> points |
472 | + </strong> |
473 | + </dt> |
474 | + </tal:contributor> |
475 | + </dl> |
476 | + |
477 | + <tal:comment condition="nothing"> |
478 | + # XXX sinzui 2009-08-07 bug=410491: Remove this link and enable the |
479 | + # see all link when the distribution index page is 3.0. |
480 | + </tal:comment> |
481 | + <a tal:replace="structure context/menu:overview/top_contributors/fmt:link" /> |
482 | </div> |
483 | |
484 | === modified file 'lib/lp/registry/templates/sourcepackage-index.pt' |
485 | --- lib/lp/registry/templates/sourcepackage-index.pt 2009-07-17 17:59:07 +0000 |
486 | +++ lib/lp/registry/templates/sourcepackage-index.pt 2009-08-07 22:14:06 +0000 |
487 | @@ -19,7 +19,6 @@ |
488 | </metal:leftportlets> |
489 | |
490 | <metal:rightportlets fill-slot="portlets_two"> |
491 | - <div tal:replace="structure context/@@+portlet-latestquestions" /> |
492 | <div tal:replace="structure context/@@+portlet-releases" /> |
493 | <div tal:replace="structure context/@@+portlet-upstream" /> |
494 | </metal:rightportlets> |
495 | |
496 | === modified file 'lib/lp/registry/templates/team-index.pt' |
497 | --- lib/lp/registry/templates/team-index.pt 2009-07-17 17:59:07 +0000 |
498 | +++ lib/lp/registry/templates/team-index.pt 2009-08-07 15:29:15 +0000 |
499 | @@ -328,8 +328,6 @@ |
500 | replace="structure overview_menu/received_invitations/fmt:link" /> |
501 | </p> |
502 | </div> |
503 | - |
504 | - <div tal:replace="structure context/@@+portlet-latestquestions" /> |
505 | </div> |
506 | </body> |
507 | </html> |
508 |
This is my branch to update portlets used by pillars to UI 3.0.
lp:~sinzui/launchpad/answers-portlets /bugs.launchpad .net/bugs/ answers- portlets question- overview| xx-announcement s|xx-karmaconte xt-topcontribut ors" implementation: beuno
Diff size: 508
Launchpad bug: https:/
Test command: ./bin/test -vv \
-t "faq-views|
Pre-
Target release: 2.2.8
= Update portlets used by pillars to UI 3.0 =
There are several portlets that need updating to the new project UI.
These portlets will also be used by Distributions and ProjectGroups: top
contributors, announcements, and latest questions. They also need a new
portlet to show the latest FAQs.
== Rules ==
* Create an FAQ portlet. rcePackage.
* Update the latest questions portlet.
* Remove it from teams, they cannot ask questions.
* Remove it from SourcePackages, the questions really belong
to the DistributionSou
* Update the top contributors portlet.
* Update the announcements portlet.
== QA ==
Describe the steps to verify that the project behaves correctly
== Lint ==
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: answers/ browser/ configure. zcml answers/ browser/ faqcollection. py answers/ browser/ questiontarget. py answers/ browser/ tests/faq- views.txt answers/ stories/ question- overview. txt answers/ templates/ faqcollection- portlet- faqs.pt answers/ templates/ questiontarget- portlet- latestquestions .pt registry/ stories/ announcements/ xx-announcement s.txt registry/ stories/ standalone/ xx-karmacontext -topcontributor s.txt registry/ templates/ hasannouncement s-portlet- latest. pt registry/ templates/ karmacontext- portlet- top-contributor s.pt registry/ templates/ sourcepackage- index.pt registry/ templates/ team-index. pt
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Test ==
* lib/lp/ answers/ browser/ tests/faq- views.txt answers/ stories/ question- overview. txt registry/ stories/ announcements/ xx-announcement s.txt registry/ stories/ standalone/ xx-karmacontext -topcontributor s.txt
* Added a test to verify that latest faqs portlet works.
* The original test did not make sense. There are already model
tests for creating an FAQ. I think this was an incomplete test
that was committed. I repurposed it to do a real view test.
* lib/lp/
* Updated the test to verify the information presented in the
latest questions portlet.
* lib/lp/
* Revised the test to verify the layout of the links.
* lib/lp/
* Revised the test because the headings changed for 3.0.
== Implementation ==
* lib/lp/ answers/ browser/ configure. zcml answers/ browser/ faqcollection. py answers/ browser/ questiontarget. py
* Registered +portlet-listfaqs on the existing SearchFAQsView.
* lib/lp/
* Added a create_faq link. The templates were/are making this link.
They can be updated when they are converted to 3.0
* Added 2 properties to SearchFAQsView to support it's reuse as a
portlet.
* lib/lp/
* Added a property to the LatestQuestio...