Merge lp:~sinzui/launchpad/answers-ui into lp:launchpad
- answers-ui
- Merge into devel
Proposed by
Curtis Hovey
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | not available | ||||
Proposed branch: | lp:~sinzui/launchpad/answers-ui | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
1230 lines (+377/-317) 24 files modified
lib/lp/answers/browser/question.py (+21/-16) lib/lp/answers/browser/tests/test_menus.py (+58/-0) lib/lp/answers/stories/faq-add.txt (+2/-2) lib/lp/answers/stories/faq-edit.txt (+2/-7) lib/lp/answers/stories/question-add-in-other-languages.txt (+2/-2) lib/lp/answers/stories/question-add.txt (+1/-1) lib/lp/answers/stories/question-answer-contact.txt (+2/-2) lib/lp/answers/stories/question-confirm-url.txt (+2/-2) lib/lp/answers/stories/question-edit.txt (+4/-4) lib/lp/answers/stories/question-reject-and-change-status.txt (+3/-3) lib/lp/answers/stories/question-workflow.txt (+17/-16) lib/lp/answers/stories/this-is-a-faq.txt (+13/-14) lib/lp/answers/templates/faq-index.pt (+38/-17) lib/lp/answers/templates/faq-listing.pt (+0/-1) lib/lp/answers/templates/question-history.pt (+1/-9) lib/lp/answers/templates/question-index.pt (+65/-71) lib/lp/answers/templates/question-portlet-details.pt (+89/-71) lib/lp/answers/templates/question-portlet-reopenings.pt (+4/-9) lib/lp/bugs/stories/bugs/xx-bug-create-question.txt (+2/-6) lib/lp/bugs/stories/cve/cve-linking.txt (+13/-16) lib/lp/bugs/templates/buglinktarget-portlet-bugs.pt (+11/-18) lib/lp/bugs/templates/cve-index.pt (+9/-11) lib/lp/bugs/templates/cve-portlet-bugs2.pt (+1/-1) lib/lp/coop/answersbugs/stories/question-buglink.txt (+17/-18) |
||||
To merge this branch: | bzr merge lp:~sinzui/launchpad/answers-ui | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Canonical Launchpad Engineering | ui | Pending | |
Review via email: mp+14761@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
Abel Deuring (adeuring) : | # |
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/answers/browser/question.py' |
2 | --- lib/lp/answers/browser/question.py 2009-11-01 05:02:04 +0000 |
3 | +++ lib/lp/answers/browser/question.py 2009-11-14 22:08:12 +0000 |
4 | @@ -89,24 +89,19 @@ |
5 | icon = 'mail' |
6 | return Link('+subscribe', text, icon=icon) |
7 | |
8 | - |
9 | -class QuestionEditMenu(NavigationMenu, QuestionLinksMixin): |
10 | - """A menu for different aspects of editing a object.""" |
11 | - |
12 | - usedfor = IQuestion |
13 | - facet = 'answers' |
14 | - title = 'Edit question' |
15 | - links = ['edit', 'changestatus', 'reject', 'subscription'] |
16 | - |
17 | def edit(self): |
18 | """Return a Link to the edit view.""" |
19 | text = 'Edit question' |
20 | return Link('+edit', text, icon='edit') |
21 | |
22 | - @enabled_with_permission('launchpad.Admin') |
23 | - def changestatus(self): |
24 | - """Return a Link to the change status view.""" |
25 | - return Link('+change-status', _('Change status'), icon='edit') |
26 | + |
27 | +class QuestionEditMenu(NavigationMenu, QuestionLinksMixin): |
28 | + """A menu for different aspects of editing a object.""" |
29 | + |
30 | + usedfor = IQuestion |
31 | + facet = 'answers' |
32 | + title = 'Edit question' |
33 | + links = ['edit', 'reject', 'subscription'] |
34 | |
35 | def reject(self): |
36 | """Return a Link to the reject view.""" |
37 | @@ -119,13 +114,19 @@ |
38 | """Context menu of actions that can be performed upon a Question.""" |
39 | usedfor = IQuestion |
40 | facet = 'answers' |
41 | - links = ['history', 'linkbug', 'unlinkbug', 'makebug', 'linkfaq', |
42 | - 'createfaq'] |
43 | + links = [ |
44 | + 'history', 'linkbug', 'unlinkbug', 'makebug', 'linkfaq', |
45 | + 'createfaq', 'edit', 'changestatus'] |
46 | |
47 | def initialize(self): |
48 | """Initialize the menu from the Question's state.""" |
49 | self.has_bugs = bool(self.context.bugs) |
50 | |
51 | + @enabled_with_permission('launchpad.Admin') |
52 | + def changestatus(self): |
53 | + """Return a Link to the change status view.""" |
54 | + return Link('+change-status', _('Change status'), icon='edit') |
55 | + |
56 | def history(self): |
57 | """Return a Link to the history view.""" |
58 | text = 'History' |
59 | @@ -153,7 +154,11 @@ |
60 | """Link for linking to a FAQ.""" |
61 | text = 'Link to a FAQ' |
62 | summary = 'Link this question to a FAQ.' |
63 | - return Link('+linkfaq', text, summary, icon='add') |
64 | + if self.context.faq is None: |
65 | + icon = 'add' |
66 | + else: |
67 | + icon = 'edit' |
68 | + return Link('+linkfaq', text, summary, icon=icon) |
69 | |
70 | def createfaq(self): |
71 | """LInk for creating a FAQ.""" |
72 | |
73 | === added file 'lib/lp/answers/browser/tests/test_menus.py' |
74 | --- lib/lp/answers/browser/tests/test_menus.py 1970-01-01 00:00:00 +0000 |
75 | +++ lib/lp/answers/browser/tests/test_menus.py 2009-11-14 22:08:12 +0000 |
76 | @@ -0,0 +1,58 @@ |
77 | +# Copyright 2009 Canonical Ltd. This software is licensed under the |
78 | +# GNU Affero General Public License version 3 (see the file LICENSE). |
79 | + |
80 | +__metaclass__ = type |
81 | + |
82 | +import unittest |
83 | + |
84 | +from zope.component import getUtility |
85 | + |
86 | +from canonical.testing.layers import DatabaseFunctionalLayer |
87 | + |
88 | +from lp.answers.browser.question import QuestionEditMenu, QuestionExtrasMenu |
89 | +from lp.services.worlddata.interfaces.language import ILanguageSet |
90 | +from lp.testing import login_person, TestCaseWithFactory |
91 | +from lp.testing.menu import check_menu_links |
92 | + |
93 | + |
94 | +class TestQuestionMenus(TestCaseWithFactory): |
95 | + """Test specification menus links.""" |
96 | + layer = DatabaseFunctionalLayer |
97 | + |
98 | + def setUp(self): |
99 | + TestCaseWithFactory.setUp(self) |
100 | + self.person = self.factory.makePerson() |
101 | + login_person(self.person) |
102 | + self.question = self.factory.makeQuestion() |
103 | + |
104 | + def test_QuestionEditMenu(self): |
105 | + menu = QuestionEditMenu(self.question) |
106 | + self.assertTrue(check_menu_links(menu)) |
107 | + |
108 | + def test_QuestionExtrasMenu(self): |
109 | + menu = QuestionExtrasMenu(self.question) |
110 | + self.assertTrue(check_menu_links(menu)) |
111 | + |
112 | + def test_link_linkfaq(self): |
113 | + # A question without a linked FAQ has an 'add' icon. |
114 | + menu = QuestionExtrasMenu(self.question) |
115 | + link = menu.linkfaq() |
116 | + self.assertEqual('add', link.icon) |
117 | + # A question with a linked FAQ has an 'edit' icon. |
118 | + self.person.addLanguage(getUtility(ILanguageSet)['en']) |
119 | + target = self.question.target |
120 | + target.addAnswerContact(self.person) |
121 | + faq = self.factory.makeFAQ(target=target) |
122 | + self.question.linkFAQ(self.person, faq, 'message') |
123 | + link = menu.linkfaq() |
124 | + self.assertEqual('edit', link.icon) |
125 | + |
126 | + |
127 | +def test_suite(): |
128 | + suite = unittest.TestSuite() |
129 | + suite.addTest(unittest.TestLoader().loadTestsFromName(__name__)) |
130 | + return suite |
131 | + |
132 | + |
133 | +if __name__ == '__main__': |
134 | + unittest.TextTestRunner().run(test_suite()) |
135 | |
136 | === modified file 'lib/lp/answers/stories/faq-add.txt' |
137 | --- lib/lp/answers/stories/faq-add.txt 2009-10-31 15:04:48 +0000 |
138 | +++ lib/lp/answers/stories/faq-add.txt 2009-11-14 22:08:12 +0000 |
139 | @@ -70,9 +70,9 @@ |
140 | FAQ #12 : Questions : Mozilla Firefox |
141 | |
142 | >>> content = find_main_content(owner_browser.contents) |
143 | - >>> extract_text(content.find('div', {'id' : 'faq-keywords'})) |
144 | + >>> extract_text(find_tag_by_id(content, 'faq-keywords')) |
145 | u'Keywords:...RSS bookmark' |
146 | - >>> extract_text(content.find('div', {'id' : 'faq-content'})) |
147 | + >>> extract_text(find_tag_by_id(content, 'faq-content')) |
148 | u'Use the bookmark bar.' |
149 | |
150 | He returns to the projects list of FAQs to verify that the newest |
151 | |
152 | === modified file 'lib/lp/answers/stories/faq-edit.txt' |
153 | --- lib/lp/answers/stories/faq-edit.txt 2009-10-31 15:04:48 +0000 |
154 | +++ lib/lp/answers/stories/faq-edit.txt 2009-11-14 22:08:12 +0000 |
155 | @@ -82,10 +82,5 @@ |
156 | The 'Last updated by' field in the 'Lifecycle' portlet is updated |
157 | with the name of the user who made the last modification: |
158 | |
159 | - >>> print extract_text(find_portlet(browser.contents, 'Lifecycle')) |
160 | - Lifecycle |
161 | - Created by: Sample Person |
162 | - When: ... |
163 | - Last updated by: Sample Person |
164 | - When: ... |
165 | - |
166 | + >>> print extract_text(find_tag_by_id(browser.contents, 'faq-updated')) |
167 | + Last updated by: Sample Person on ... |
168 | |
169 | === modified file 'lib/lp/answers/stories/question-add-in-other-languages.txt' |
170 | --- lib/lp/answers/stories/question-add-in-other-languages.txt 2009-11-01 04:47:40 +0000 |
171 | +++ lib/lp/answers/stories/question-add-in-other-languages.txt 2009-11-14 22:08:12 +0000 |
172 | @@ -91,8 +91,8 @@ |
173 | pt-BR |
174 | >>> print soup.html['dir'] |
175 | ltr |
176 | - >>> print soup.find('b', text='Language:').next.strip() |
177 | - Portuguese (Brazil) |
178 | + >>> print extract_text(find_tag_by_id(soup, 'question-lang')) |
179 | + Language: Portuguese (Brazil) ... |
180 | |
181 | It's also possible that the user chose English in the first page but |
182 | then changed his mind on the second page. |
183 | |
184 | === modified file 'lib/lp/answers/stories/question-add.txt' |
185 | --- lib/lp/answers/stories/question-add.txt 2009-11-12 00:41:43 +0000 |
186 | +++ lib/lp/answers/stories/question-add.txt 2009-11-14 22:08:12 +0000 |
187 | @@ -165,7 +165,7 @@ |
188 | |
189 | >>> print extract_text( |
190 | ... find_tag_by_id(user_browser.contents, 'registration')) |
191 | - Open... Question #..., asked...by...No Privileges Person... |
192 | + Asked by No Privileges Person on ... |
193 | >>> contents = find_main_content(user_browser.contents) |
194 | >>> print extract_text(contents.find('div', 'report')) |
195 | I use Ubuntu on AMD64 ... |
196 | |
197 | === modified file 'lib/lp/answers/stories/question-answer-contact.txt' |
198 | --- lib/lp/answers/stories/question-answer-contact.txt 2009-10-31 15:42:37 +0000 |
199 | +++ lib/lp/answers/stories/question-answer-contact.txt 2009-11-14 22:08:12 +0000 |
200 | @@ -196,7 +196,7 @@ |
201 | Question #10 : ... |
202 | |
203 | >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang')) |
204 | - Language: English |
205 | + Language: English ... |
206 | |
207 | >>> portlet = find_tag_by_id(browser.contents, 'subscribers') |
208 | >>> print extract_text(portlet) |
209 | @@ -213,7 +213,7 @@ |
210 | Question #12 : ... |
211 | |
212 | >>> print extract_text(find_tag_by_id(browser.contents, 'question-lang')) |
213 | - Language: Spanish |
214 | + Language: Spanish ... |
215 | |
216 | >>> portlet = find_tag_by_id(browser.contents, 'subscribers') |
217 | >>> print extract_text(portlet).encode('ASCII', 'backslashreplace') |
218 | |
219 | === modified file 'lib/lp/answers/stories/question-confirm-url.txt' |
220 | --- lib/lp/answers/stories/question-confirm-url.txt 2009-09-28 09:11:17 +0000 |
221 | +++ lib/lp/answers/stories/question-confirm-url.txt 2009-11-14 22:08:12 +0000 |
222 | @@ -96,8 +96,8 @@ |
223 | This adds his comment to the question and mark it as 'Solved.' |
224 | |
225 | >>> print extract_text( |
226 | - ... find_tag_by_id(owner_browser.contents, 'registration')) |
227 | - Solved ... |
228 | + ... find_tag_by_id(owner_browser.contents, 'question-status')) |
229 | + Status: Solved ... |
230 | >>> print find_tags_by_class( |
231 | ... owner_browser.contents, 'boardCommentBody')[-1].renderContents() |
232 | <p>Thanks! This indeed solved the problem.</p> |
233 | |
234 | === modified file 'lib/lp/answers/stories/question-edit.txt' |
235 | --- lib/lp/answers/stories/question-edit.txt 2009-09-28 09:11:17 +0000 |
236 | +++ lib/lp/answers/stories/question-edit.txt 2009-11-14 22:08:12 +0000 |
237 | @@ -46,11 +46,11 @@ |
238 | |
239 | >>> def print_question_status(browser): |
240 | ... print extract_text( |
241 | - ... find_tag_by_id(browser.contents, 'registration')) |
242 | + ... find_tag_by_id(browser.contents, 'question-status')) |
243 | |
244 | >>> user_browser.open('http://launchpad.dev/ubuntu/+question/3') |
245 | >>> print_question_status(user_browser) |
246 | - Invalid ... |
247 | + Status: Invalid |
248 | |
249 | >>> user_browser.getLink('Edit question') |
250 | <Link...> |
251 | @@ -93,8 +93,8 @@ |
252 | >>> browser.getControl('Save Changes').click() |
253 | |
254 | >>> soup = find_main_content(browser.contents) |
255 | - >>> print soup.first('b', text='Whiteboard:').findNext('td').renderContents() |
256 | - Some note |
257 | + >>> print extract_text(find_tag_by_id(soup, 'question-whiteboard')) |
258 | + Whiteboard: Some note |
259 | >>> portlet_details = find_tag_by_id(browser.contents, 'portlet-details') |
260 | |
261 | Since the assignee is notified of changes to the question, his name also |
262 | |
263 | === modified file 'lib/lp/answers/stories/question-reject-and-change-status.txt' |
264 | --- lib/lp/answers/stories/question-reject-and-change-status.txt 2009-09-28 09:11:17 +0000 |
265 | +++ lib/lp/answers/stories/question-reject-and-change-status.txt 2009-11-14 22:08:12 +0000 |
266 | @@ -58,10 +58,10 @@ |
267 | |
268 | >>> def print_question_status(browser): |
269 | ... print extract_text( |
270 | - ... find_tag_by_id(browser.contents, 'registration')) |
271 | + ... find_tag_by_id(browser.contents, 'question-status')) |
272 | |
273 | >>> print_question_status(admin_browser) |
274 | - Invalid ... |
275 | + Status: Invalid ... |
276 | |
277 | and the rejection message is added to the question board. |
278 | |
279 | @@ -147,7 +147,7 @@ |
280 | its status is updated; |
281 | |
282 | >>> print_question_status(admin_browser) |
283 | - Open ... |
284 | + Status: Open ... |
285 | |
286 | and the explanation message is added to the question discussion: |
287 | |
288 | |
289 | === modified file 'lib/lp/answers/stories/question-workflow.txt' |
290 | --- lib/lp/answers/stories/question-workflow.txt 2009-10-05 15:32:50 +0000 |
291 | +++ lib/lp/answers/stories/question-workflow.txt 2009-11-14 22:08:12 +0000 |
292 | @@ -15,7 +15,7 @@ |
293 | # added and the status of the question. |
294 | >>> def find_request_status(contents): |
295 | ... print extract_text( |
296 | - ... find_tag_by_id(contents, 'registration')) |
297 | + ... find_tag_by_id(contents, 'question-status')) |
298 | |
299 | >>> def find_last_comment(contents): |
300 | ... soup = find_main_content(contents) |
301 | @@ -61,6 +61,7 @@ |
302 | Link existing bug |
303 | Create bug report |
304 | Link to a FAQ |
305 | + Create a new FAQ |
306 | |
307 | >>> support_browser.getControl('Message').value = ( |
308 | ... "Can you provide an example of an URL displaying the problem?") |
309 | @@ -70,7 +71,7 @@ |
310 | 'Needs information': |
311 | |
312 | >>> find_request_status(support_browser.contents) |
313 | - Needs information... |
314 | + Status: Needs information |
315 | >>> print_last_comment(support_browser.contents) |
316 | Can you provide an example of an URL displaying the problem? |
317 | |
318 | @@ -97,7 +98,7 @@ |
319 | status: |
320 | |
321 | >>> print find_request_status(support_browser.contents) |
322 | - Needs information... |
323 | + Status: Needs information ... |
324 | >>> print_last_comment(support_browser.contents) |
325 | I forgot to mention, in the meantime here is a workaround... |
326 | |
327 | @@ -128,7 +129,7 @@ |
328 | discussion. |
329 | |
330 | >>> print find_request_status(owner_browser.contents) |
331 | - Open... |
332 | + Status: Open ... |
333 | >>> print_last_comment(owner_browser.contents) |
334 | The following SVG doesn't display properly: |
335 | http://www.w3.org/2001/08/rdfweb/rdfweb-chaals-and-dan.svg |
336 | @@ -151,7 +152,7 @@ |
337 | answer to the end of the discussion: |
338 | |
339 | >>> print find_request_status(support_browser.contents) |
340 | - Answered... |
341 | + Status: Answered ... |
342 | >>> print_last_comment(support_browser.contents) |
343 | New version of the firefox package are available with SVG support |
344 | enabled. You can use apt-get or adept to upgrade. |
345 | @@ -189,7 +190,7 @@ |
346 | 'No Privileges Person' as the solver. |
347 | |
348 | >>> print find_request_status(owner_browser.contents) |
349 | - Solved Question #2, solved on ... by No Privileges Person... |
350 | + Status: Solved ... |
351 | |
352 | Since no message can be provided when that button is clicked. A default |
353 | confirmation message was appended to the question discussion: |
354 | @@ -216,6 +217,7 @@ |
355 | Link existing bug |
356 | Create bug report |
357 | Link to a FAQ |
358 | + Create a new FAQ |
359 | |
360 | |
361 | == Adding another Comment == |
362 | @@ -232,7 +234,7 @@ |
363 | status: |
364 | |
365 | >>> print find_request_status(owner_browser.contents) |
366 | - Solved... |
367 | + Status: Solved ... |
368 | >>> print_last_comment(owner_browser.contents) |
369 | The example now displays correctly. Thanks. |
370 | |
371 | @@ -255,7 +257,7 @@ |
372 | its status back to 'Open'. |
373 | |
374 | >>> print find_request_status(owner_browser.contents) |
375 | - Open... |
376 | + Status: Open ... |
377 | >>> print_last_comment(owner_browser.contents) |
378 | Actually, there are still SVGs that do not display correctly. |
379 | For example, the following |
380 | @@ -277,10 +279,9 @@ |
381 | In addition, this creates a reopening record that is displayed in the |
382 | reopening portlet. |
383 | |
384 | - >>> portlet = find_portlet( |
385 | - ... owner_browser.contents, 'This question was reopened') |
386 | - >>> 'Sample Person' in extract_text(portlet.fetch('a')[-1]) |
387 | - True |
388 | + >>> print extract_text( |
389 | + ... find_tag_by_id(owner_browser.contents, 'portlet-reopenings')) |
390 | + This question was reopened ... Sample Person |
391 | |
392 | |
393 | == Self-Answer == |
394 | @@ -299,7 +300,7 @@ |
395 | message as the "Best answer". |
396 | |
397 | >>> find_request_status(owner_browser.contents) |
398 | - Solved Question #2, solved on ... by Sample Person... |
399 | + Status: Solved ... |
400 | >>> soup = find_tag_by_id(owner_browser.contents, 'portlet-details') |
401 | >>> soup = find_main_content(owner_browser.contents) |
402 | >>> bestAnswer = soup.first('img', {'title': 'Marked as best answer'}) |
403 | @@ -320,7 +321,7 @@ |
404 | |
405 | >>> owner_browser.getControl('This Solved My Problem').click() |
406 | >>> find_request_status(owner_browser.contents) |
407 | - Solved Question #2, solved on ... by No Privileges Person... |
408 | + Status: Solved ... |
409 | |
410 | The answer's message is also highlighted as the best answer. |
411 | |
412 | @@ -389,7 +390,7 @@ |
413 | >>> carlos_browser = setupBrowser(auth='Basic carlos@canonical.com:test') |
414 | >>> carlos_browser.open('http://launchpad.dev/firefox/+question/12') |
415 | >>> print find_request_status(carlos_browser.contents) |
416 | - Open... |
417 | + Status: Open ... |
418 | |
419 | >>> answer_button_paragraph = find_tag_by_id( |
420 | ... carlos_browser.contents, 'answer-button-hint') |
421 | @@ -400,7 +401,7 @@ |
422 | ... "There is a bug in that version. SMP is fine after upgrading.") |
423 | >>> carlos_browser.getControl("Problem Solved").click() |
424 | >>> print find_request_status(carlos_browser.contents) |
425 | - Solved... |
426 | + Status: Solved ... |
427 | |
428 | >>> content = find_main_content(carlos_browser.contents) |
429 | >>> messages = content.findAll('div', 'informational message') |
430 | |
431 | === modified file 'lib/lp/answers/stories/this-is-a-faq.txt' |
432 | --- lib/lp/answers/stories/this-is-a-faq.txt 2009-10-31 15:42:37 +0000 |
433 | +++ lib/lp/answers/stories/this-is-a-faq.txt 2009-11-14 22:08:12 +0000 |
434 | @@ -104,16 +104,16 @@ |
435 | |
436 | >>> def print_question_status(browser): |
437 | ... print extract_text( |
438 | - ... find_tag_by_id(browser.contents, 'registration')) |
439 | + ... find_tag_by_id(browser.contents, 'question-status')) |
440 | |
441 | >>> print_question_status(user_browser) |
442 | - Answered ... |
443 | + Status: Answered |
444 | |
445 | A link to the FAQ appears under the question's description: |
446 | |
447 | >>> print extract_text( |
448 | ... find_tag_by_id(user_browser.contents, 'related-faq')) |
449 | - Related FAQ: How do I install plugins (Shockwave, QuickTime, etc.)? |
450 | + Related FAQ: How do I install plugins (Shockwave, QuickTime, etc.)? ... |
451 | >>> print user_browser.getLink('How do I install plugins').url |
452 | http://answers.launchpad.dev/firefox/+faq/10 |
453 | |
454 | @@ -176,8 +176,9 @@ |
455 | |
456 | The link was also removed from the details portlet: |
457 | |
458 | - >>> print find_tag_by_id(user_browser.contents, 'related-faq') |
459 | - None |
460 | + >>> print extract_text( |
461 | + ... find_tag_by_id(user_browser.contents, 'related-faq')) |
462 | + Related FAQ: None ... |
463 | |
464 | |
465 | == Creating a new FAQ == |
466 | @@ -267,7 +268,7 @@ |
467 | |
468 | >>> print extract_text( |
469 | ... find_tag_by_id(owner_browser.contents, 'related-faq')) |
470 | - Related FAQ: Displaying SVG in Firefox |
471 | + Related FAQ: Displaying SVG in Firefox ... |
472 | |
473 | |
474 | == Viewing a FAQ == |
475 | @@ -291,13 +292,11 @@ |
476 | ... owner_browser.contents, 'faq-content')) |
477 | Upgrade your browser to Firefox 2.0. |
478 | |
479 | -The FAQ's original author and creation date appears in the the |
480 | -'Lifecycle' portlet: |
481 | +The FAQ's original author and creation date appears in the header: |
482 | |
483 | - >>> print extract_text(find_portlet(owner_browser.contents, 'Lifecycle')) |
484 | - Lifecycle |
485 | - Created by: Sample Person |
486 | - When: ... |
487 | + >>> print extract_text( |
488 | + ... find_tag_by_id(owner_browser.contents, 'registration')) |
489 | + Created by Sample Person on ... |
490 | |
491 | A 'Related questions' portlet contains links to the question answered by |
492 | the FAQ: |
493 | @@ -350,7 +349,7 @@ |
494 | >>> details_portlet = find_portlet( |
495 | ... user_browser.contents, 'mozilla-firefox in ubuntu question #9') |
496 | >>> print_question_status(user_browser) |
497 | - Solved... |
498 | + Status: Solved |
499 | >>> user_browser.getLink('Link to a FAQ').click() |
500 | |
501 | >>> print user_browser.title |
502 | @@ -368,7 +367,7 @@ |
503 | >>> print user_browser.title |
504 | Question #9 : ... |
505 | >>> print_question_status(user_browser) |
506 | - Solved... |
507 | + Status: Solved |
508 | |
509 | >>> print extract_text( |
510 | ... find_tag_by_id(user_browser.contents, 'related-faq')) |
511 | |
512 | === modified file 'lib/lp/answers/templates/faq-index.pt' |
513 | --- lib/lp/answers/templates/faq-index.pt 2009-08-31 20:07:35 +0000 |
514 | +++ lib/lp/answers/templates/faq-index.pt 2009-11-14 22:08:12 +0000 |
515 | @@ -7,24 +7,45 @@ |
516 | i18n:domain="launchpad" |
517 | > |
518 | <body> |
519 | - |
520 | -<metal:portlets fill-slot="side"> |
521 | - <tal:menu replace="structure context/@@+global-actions" /> |
522 | - <tal:lifecycle replace="structure context/@@+portlet-lifecycle" /> |
523 | - <tal:related replace="structure context/@@+portlet-related-questions" /> |
524 | -</metal:portlets> |
525 | - |
526 | -<div metal:fill-slot="main"> |
527 | - |
528 | - <div id="faq-keywords"><b>Keywords: </b> |
529 | - <tal:keywords content="context/keywords">keywords</tal:keywords> |
530 | - </div> |
531 | - |
532 | - <div id="faq-content" |
533 | + <metal:registering fill-slot="registering"> |
534 | + Created by <a tal:replace="structure context/owner/fmt:link" /> |
535 | + on |
536 | + <span |
537 | + tal:attributes="title context/date_created/fmt:datetime" |
538 | + tal:content="context/date_created/fmt:displaydate">2005-10-05</span> |
539 | + </metal:registering> |
540 | + |
541 | + <metal:portlets fill-slot="side"> |
542 | + <tal:menu replace="structure context/@@+global-actions" /> |
543 | + <tal:related replace="structure context/@@+portlet-related-questions" /> |
544 | + </metal:portlets> |
545 | + |
546 | + <div metal:fill-slot="main"> |
547 | + <div class="top-portlet"> |
548 | + <dl id="faq-keywords"> |
549 | + <dt>Keywords:</dt> |
550 | + <dd tal:content="context/keywords">keywords</dd> |
551 | + </dl> |
552 | + |
553 | + <tal:last_updated_by condition="context/last_updated_by"> |
554 | + <dl id="faq-updated" style="clear: both"> |
555 | + <dt>Last updated by:</dt> |
556 | + <dd> |
557 | + <a tal:replace="structure context/last_updated_by/fmt:link" /> |
558 | + on |
559 | + <span tal:attributes="title context/date_last_updated/fmt:datetime" |
560 | + tal:content="context/date_last_updated/fmt:displaydate" |
561 | + >2005-10-05</span> |
562 | + </dd> |
563 | + </dl> |
564 | + </tal:last_updated_by> |
565 | + </div> |
566 | + |
567 | + |
568 | + <div id="faq-content" class="portlet" |
569 | tal:condition="context/content" |
570 | tal:content="structure context/content/fmt:text-to-html">Content</div> |
571 | -</div> |
572 | - |
573 | -</body> |
574 | + </div> |
575 | + </body> |
576 | </html> |
577 | |
578 | |
579 | === modified file 'lib/lp/answers/templates/faq-listing.pt' |
580 | --- lib/lp/answers/templates/faq-listing.pt 2009-09-18 19:48:21 +0000 |
581 | +++ lib/lp/answers/templates/faq-listing.pt 2009-11-14 22:08:12 +0000 |
582 | @@ -12,7 +12,6 @@ |
583 | <metal:side fill-slot="side"> |
584 | <div tal:replace="structure context/@@+global-actions" /> |
585 | <div tal:replace="structure context/@@+portlet-answercontacts|nothing" /> |
586 | - <div tal:replace="structure context/@@+portlet-details|nothing" /> |
587 | </metal:side> |
588 | |
589 | |
590 | |
591 | === modified file 'lib/lp/answers/templates/question-history.pt' |
592 | --- lib/lp/answers/templates/question-history.pt 2009-08-24 18:31:06 +0000 |
593 | +++ lib/lp/answers/templates/question-history.pt 2009-11-14 22:08:12 +0000 |
594 | @@ -3,7 +3,7 @@ |
595 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
596 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
597 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
598 | - metal:use-macro="view/macro:page/main_side" |
599 | + metal:use-macro="view/macro:page/main_only" |
600 | i18n:domain="launchpad" |
601 | > |
602 | |
603 | @@ -13,14 +13,6 @@ |
604 | <h2><tal:heading replace="view/label" /></h2> |
605 | </metal:heading> |
606 | |
607 | -<metal:portlets fill-slot="side"> |
608 | - <div tal:replace="structure context/@@+global-actions" /> |
609 | - <div tal:condition="context/reopenings" |
610 | - tal:replace="structure context/@@+portlet-reopenings" /> |
611 | - <div tal:replace="structure context/@@+portlet-subscribers" /> |
612 | - <div tal:replace="structure context/@@+portlet-bugs" /> |
613 | -</metal:portlets> |
614 | - |
615 | <div metal:fill-slot="main"> |
616 | |
617 | <table class="listing"> |
618 | |
619 | === modified file 'lib/lp/answers/templates/question-index.pt' |
620 | --- lib/lp/answers/templates/question-index.pt 2009-09-28 09:11:17 +0000 |
621 | +++ lib/lp/answers/templates/question-index.pt 2009-11-14 22:08:12 +0000 |
622 | @@ -19,72 +19,76 @@ |
623 | </head> |
624 | <body> |
625 | <metal:registering fill-slot="registering"> |
626 | - <span class="questionstatusOPEN" |
627 | - tal:attributes="class string:questionstatus${context/status/name}" |
628 | - tal:content="context/status/title">Open</span> |
629 | - Question #<span tal:replace="context/id">4</span>, |
630 | - |
631 | - <tal:answerer condition="context/answerer"> |
632 | - solved |
633 | - <span |
634 | - tal:attributes="title context/datecreated/fmt:datetime" |
635 | - tal:content="context/datecreated/fmt:displaydate">2005-10-05</span> |
636 | - by |
637 | - <a tal:replace="structure context/answerer/fmt:link"> |
638 | - Foo Bar |
639 | - </a>, |
640 | - </tal:answerer> |
641 | - |
642 | - asked |
643 | - <span |
644 | + Asked by |
645 | + <a tal:replace="structure context/owner/fmt:link" /> |
646 | + on <span |
647 | tal:attributes="title context/datecreated/fmt:datetime" |
648 | tal:content="context/datecreated/fmt:displaydate">2005-10-05</span> |
649 | - by |
650 | - <a |
651 | - tal:attributes="href context/owner/fmt:url" |
652 | - tal:content="context/owner/displayname">Foo Bar</a> |
653 | + |
654 | </metal:registering> |
655 | |
656 | |
657 | <metal:portlets fill-slot="side"> |
658 | <div tal:replace="structure context/@@+global-actions" /> |
659 | - <div tal:condition="context/reopenings" |
660 | - tal:replace="structure context/@@+portlet-reopenings" /> |
661 | <div tal:replace="structure context/@@+portlet-subscribers" /> |
662 | - <div tal:replace="structure context/@@+portlet-bugs" /> |
663 | </metal:portlets> |
664 | |
665 | <div metal:fill-slot="main"> |
666 | - |
667 | - <div id="question-lang" style="margin-bottom: 1em"> |
668 | - <b>Language:</b> |
669 | - <span tal:replace="context/language/englishname">English</span><br /> |
670 | - </div> |
671 | - |
672 | <tal:description |
673 | define="global description context/description/fmt:obfuscate-email/fmt:text-to-html" /> |
674 | |
675 | - <p id="original-bug" |
676 | - tal:define="bug view/original_bug" |
677 | - tal:condition="bug"> |
678 | - This question was originally filed as |
679 | - <a href="#" |
680 | - tal:attributes="href bug/fmt:url">bug |
681 | - #<tal:num replace="bug/id" /></a>. |
682 | - </p> |
683 | - |
684 | - <div |
685 | - class="report" |
686 | - tal:content="structure description" |
687 | - /> |
688 | - |
689 | - <div id="related-faq" tal:condition="context/faq"> |
690 | - <b>Related FAQ:</b> |
691 | - <a href="#" |
692 | - tal:attributes="href context/faq/fmt:url" |
693 | - tal:content="context/faq/title">FAQ Title</a> |
694 | + <div class="report" |
695 | + tal:content="structure description"/> |
696 | + |
697 | + <div class="yui-g"> |
698 | + <div class="yui-u first"> |
699 | + <tal:distro-information content="structure context/@@+portlet-details" /> |
700 | + </div> |
701 | + |
702 | + <div class="yui-u"> |
703 | + <div class="portlet"> |
704 | + <div tal:replace="structure context/@@+portlet-bugs" /> |
705 | + |
706 | + <p id="original-bug" |
707 | + tal:define="bug view/original_bug" |
708 | + tal:condition="bug"> |
709 | + This question was originally filed as |
710 | + <a href="#" |
711 | + tal:attributes="href bug/fmt:url">bug |
712 | + #<tal:num replace="bug/id" /></a>. |
713 | + </p> |
714 | + |
715 | + <ul class="horizontal"> |
716 | + <li |
717 | + tal:define="link context/menu:answers/linkbug" |
718 | + tal:content="structure link/fmt:link" /> |
719 | + <li tal:condition="context/bugs" |
720 | + tal:define="link context/menu:answers/unlinkbug" |
721 | + tal:content="structure link/fmt:link" /> |
722 | + </ul> |
723 | + |
724 | + <div id="related-faq" style="margin-top: 1em;"> |
725 | + <h2>Related FAQ:</h2> |
726 | + |
727 | + <p> |
728 | + <a class="sprite question" |
729 | + tal:condition="context/faq" |
730 | + tal:attributes="href context/faq/fmt:url" |
731 | + tal:content="context/faq/title">FAQ Title</a> |
732 | + <tal:none tal:condition="not: context/faq"> |
733 | + None |
734 | + </tal:none> |
735 | + <a tal:replace="structure context/menu:answers/linkfaq/fmt:icon" /> |
736 | + </p> |
737 | + </div> |
738 | + |
739 | + <div tal:condition="context/reopenings" |
740 | + tal:replace="structure context/@@+portlet-reopenings" /> |
741 | + </div> |
742 | + </div> |
743 | </div> |
744 | |
745 | + |
746 | <tal:message repeat="message context/messages"> |
747 | <div tal:replace="structure message/@@+display" /> |
748 | </tal:message> |
749 | @@ -106,33 +110,23 @@ |
750 | <div class="yui-g"> |
751 | <ul class="horizontal" id="horizontal-menu"> |
752 | <li tal:define="link context/menu:answers/history" |
753 | - tal:content="structure link/render" /> |
754 | + tal:condition="link/enabled" |
755 | + tal:content="structure link/fmt:link" /> |
756 | <li tal:define="link context/menu:answers/linkbug" |
757 | - tal:content="structure link/render" /> |
758 | - <li tal:define="link context/menu:answers/unlinkbug" |
759 | - tal:content="structure link/render" /> |
760 | + tal:condition="link/enabled" |
761 | + tal:content="structure link/fmt:link" /> |
762 | <li tal:define="link context/menu:answers/makebug" |
763 | - tal:content="structure link/render" /> |
764 | + tal:condition="link/enabled" |
765 | + tal:content="structure link/fmt:link" /> |
766 | <li tal:define="link context/menu:answers/linkfaq" |
767 | - tal:content="structure link/render" /> |
768 | - <li tal:condition="view/faq_target/required:launchpad.Moderate" |
769 | - tal:define="link context/menu:answers/createfaq" |
770 | - tal:content="structure link/render" /> |
771 | + tal:condition="link/enabled" |
772 | + tal:content="structure link/fmt:link" /> |
773 | + <li tal:define="link context/menu:answers/createfaq" |
774 | + tal:condition="link/enabled" |
775 | + tal:content="structure link/fmt:link" /> |
776 | </ul> |
777 | </div> |
778 | |
779 | - <table class="listing" xml:lang="en" lang="en" dir="ltr" |
780 | - tal:condition="context/whiteboard"> |
781 | - <tbody> |
782 | - <tr> |
783 | - <td><b>Whiteboard:</b></td> |
784 | - <td tal:content="context/whiteboard"> |
785 | - whiteboard contents |
786 | - </td> |
787 | - </tr> |
788 | - </tbody> |
789 | - </table> |
790 | - |
791 | <div tal:condition="view/hasActions"> |
792 | <div metal:use-macro="context/@@launchpad_form/form"> |
793 | <metal:no-heading fill-slot="heading" /> |
794 | |
795 | === modified file 'lib/lp/answers/templates/question-portlet-details.pt' |
796 | --- lib/lp/answers/templates/question-portlet-details.pt 2009-07-17 17:59:07 +0000 |
797 | +++ lib/lp/answers/templates/question-portlet-details.pt 2009-11-14 22:08:12 +0000 |
798 | @@ -4,78 +4,96 @@ |
799 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
800 | omit-tag=""> |
801 | |
802 | -<div class="portlet" id="portlet-details"> |
803 | - |
804 | - <h2><span tal:replace="context/target/displayname">Ubuntu</span> question |
805 | - #<span tal:replace="context/id">234</span></h2> |
806 | - |
807 | - <div class="portletBody portletContent"> |
808 | - |
809 | - <b>Question from:</b><br /> |
810 | - <a tal:replace="structure context/owner/fmt:link">Foo Bar</a><br /> |
811 | - |
812 | - <b>Language:</b> |
813 | - <span tal:replace="context/language/englishname">English</span><br /> |
814 | - |
815 | - <b>Status:</b> |
816 | - <span tal:replace="context/status/title">Open</span><br /> |
817 | - |
818 | - <b>For:</b> |
819 | - <span tal:condition="context/product" |
820 | - tal:replace="context/product/name">Firefox</span> |
821 | - <span tal:condition="context/distribution" |
822 | - tal:replace="context/distribution/name">ubuntu</span> |
823 | - <span tal:condition="context/sourcepackagename" |
824 | - tal:replace="context/sourcepackagename/name">moz-ff</span> |
825 | - <br /> |
826 | - |
827 | - <tal:block condition="context/datedue"> |
828 | - <b>Due:</b> |
829 | - <span |
830 | - tal:attributes="title context/datedue/fmt:datetime" |
831 | - tal:content="context/datedue/fmt:approximatedate" /><br /> |
832 | - </tal:block> |
833 | - |
834 | - <b>Created:</b> |
835 | - <span |
836 | - tal:attributes="title context/datecreated/fmt:datetime" |
837 | - tal:content="context/datecreated/fmt:approximatedate" /><br /> |
838 | - |
839 | - <b>Assignee:</b><br /> |
840 | - <tal:block condition="context/assignee"> |
841 | - <a tal:replace="structure context/assignee/fmt:link">Foo Bar</a> |
842 | - </tal:block> |
843 | - <tal:block condition="not: context/assignee"> |
844 | - <i>No assignee</i> |
845 | - </tal:block> |
846 | - <br /> |
847 | - |
848 | - <tal:block condition="context/answerer"> |
849 | - <b>Solved by:</b><br /> |
850 | - <a tal:replace="structure context/answerer/fmt:link">Foo Bar</a> |
851 | - <br /> |
852 | - </tal:block> |
853 | - |
854 | - <b>Last query:</b> |
855 | - <span |
856 | - tal:attributes="title context/datelastquery/fmt:datetime" |
857 | - tal:content="context/datelastquery/fmt:approximatedate" /><br /> |
858 | - |
859 | - <tal:block condition="context/datelastresponse"> |
860 | - <b>Last reply:</b> |
861 | - <span |
862 | - tal:attributes="title context/datelastresponse/fmt:datetime" |
863 | - tal:content="context/datelastresponse/fmt:approximatedate" /><br /> |
864 | - </tal:block> |
865 | - |
866 | - <tal:block condition="context/date_solved"> |
867 | - <b>Solved:</b> |
868 | - <span |
869 | - tal:attributes="title context/date_solved/fmt:datetime" |
870 | - tal:content="context/date_solved/fmt:approximatedate" /><br /> |
871 | - </tal:block> |
872 | - |
873 | +<div class="portlet" id="portlet-details" xml:lang="en" lang="en" dir="ltr"> |
874 | + |
875 | + <h2>Question information</h2> |
876 | + |
877 | + <div class="two-column-list"> |
878 | + <dl id="question-lang"> |
879 | + <dt>Language:</dt> |
880 | + <dd> |
881 | + <tal:language content="context/language/englishname" /> |
882 | + <a tal:replace="structure context/menu:answers/edit/fmt:icon" /> |
883 | + </dd> |
884 | + </dl> |
885 | + |
886 | + <dl id="question-status"> |
887 | + <dt>Status:</dt> |
888 | + <dd> |
889 | + <span class="questionstatusOPEN" |
890 | + tal:attributes="class string:questionstatus${context/status/name}" |
891 | + tal:content="context/status/title">Open</span> |
892 | + <a tal:replace="structure context/menu:answers/changestatus/fmt:icon" /> |
893 | + </dd> |
894 | + </dl> |
895 | + |
896 | + <dl> |
897 | + <dt>For:</dt> |
898 | + <dd> |
899 | + <a tal:condition="context/product" |
900 | + tal:replace="structure context/product/fmt:link">Firefox</a> |
901 | + <a tal:condition="context/distribution" |
902 | + tal:replace="structure context/distribution/fmt:link">ubuntu</a> |
903 | + <a tal:condition="context/sourcepackagename" |
904 | + tal:attributes="href |
905 | + string:${context/distribution/fmt:url}/+source/${context/sourcepackagename/name}"> |
906 | + mozilla-firefox</a> |
907 | + <a tal:replace="structure context/menu:answers/edit/fmt:icon" /> |
908 | + </dd> |
909 | + </dl> |
910 | + |
911 | + <dl> |
912 | + <dt>Assignee:</dt> |
913 | + <dd> |
914 | + <tal:block condition="context/assignee"> |
915 | + <a tal:replace="structure context/assignee/fmt:link">Foo Bar</a> |
916 | + </tal:block> |
917 | + <tal:block condition="not: context/assignee"> |
918 | + No assignee |
919 | + </tal:block> |
920 | + <a tal:replace="structure context/menu:answers/edit/fmt:icon" /> |
921 | + </dd> |
922 | + </dl> |
923 | + |
924 | + <dl tal:condition="context/answerer"> |
925 | + <dt>Solved by:</dt> |
926 | + <dd> |
927 | + <a tal:replace="structure context/answerer/fmt:link">Foo Bar</a> |
928 | + </dd> |
929 | + </dl> |
930 | + |
931 | + <dl tal:condition="context/answerer"> |
932 | + <dt>Solved:</dt> |
933 | + <dd> |
934 | + <span |
935 | + tal:attributes="title context/date_solved/fmt:datetime" |
936 | + tal:content="context/date_solved/fmt:approximatedate" /> |
937 | + </dd> |
938 | + </dl> |
939 | + |
940 | + <dl style="clear: both;"> |
941 | + <dt>Last query:</dt> |
942 | + <dd> |
943 | + <span |
944 | + tal:attributes="title context/datelastquery/fmt:datetime" |
945 | + tal:content="context/datelastquery/fmt:approximatedate" /> |
946 | + </dd> |
947 | + </dl> |
948 | + |
949 | + <dl> |
950 | + <dt>Last reply:</dt> |
951 | + <dd> |
952 | + <span |
953 | + tal:attributes="title context/datelastresponse/fmt:datetime" |
954 | + tal:content="context/datelastresponse/fmt:approximatedate" /> |
955 | + </dd> |
956 | + </dl> |
957 | </div> |
958 | |
959 | + <dl id="question-whiteboard" |
960 | + tal:condition="context/whiteboard"> |
961 | + <dt>Whiteboard:</dt> |
962 | + <dd tal:content="context/whiteboard">contents</dd> |
963 | + </dl> |
964 | </div> |
965 | </tal:root> |
966 | |
967 | === modified file 'lib/lp/answers/templates/question-portlet-reopenings.pt' |
968 | --- lib/lp/answers/templates/question-portlet-reopenings.pt 2009-07-17 17:59:07 +0000 |
969 | +++ lib/lp/answers/templates/question-portlet-reopenings.pt 2009-11-14 22:08:12 +0000 |
970 | @@ -3,15 +3,12 @@ |
971 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
972 | xmlns:i18n="http://xml.zope.org/namespaces/i18n" |
973 | omit-tag=""> |
974 | - |
975 | -<div class="portlet" id="portlet-reopenings" |
976 | - tal:condition="context/reopenings"> |
977 | - <h2>This question was reopened</h2> |
978 | - |
979 | - <div class="portletBody portletContent"> |
980 | + <div id="portlet-reopenings" |
981 | + tal:condition="context/reopenings"> |
982 | + <h2>This question was reopened</h2> |
983 | |
984 | <ul> |
985 | - <li class="question" tal:repeat="reop context/reopenings"> |
986 | + <li tal:repeat="reop context/reopenings"> |
987 | <span |
988 | tal:attributes="title reop/datecreated/fmt:datetime" |
989 | tal:content="reop/datecreated/fmt:approximatedate"> |
990 | @@ -20,7 +17,5 @@ |
991 | <a tal:replace="structure reop/reopener/fmt:link">Foo Bar</a> |
992 | </li> |
993 | </ul> |
994 | - |
995 | </div> |
996 | -</div> |
997 | </tal:root> |
998 | |
999 | === modified file 'lib/lp/bugs/stories/bugs/xx-bug-create-question.txt' |
1000 | --- lib/lp/bugs/stories/bugs/xx-bug-create-question.txt 2009-11-07 04:45:18 +0000 |
1001 | +++ lib/lp/bugs/stories/bugs/xx-bug-create-question.txt 2009-11-14 22:08:12 +0000 |
1002 | @@ -109,10 +109,6 @@ |
1003 | ... find_tag_by_id(user_browser.contents, 'original-bug')) |
1004 | This question was originally filed as bug #10. |
1005 | |
1006 | - >>> portlet = find_portlet(user_browser.contents, 'Related bugs') |
1007 | - >>> portlet.a |
1008 | - <a class="sprite bug" href="http://bugs.launchpad.dev/bugs/10">Bug #10: another test bug</a> |
1009 | - |
1010 | >>> user_browser.getLink('#10: another test bug').click() |
1011 | >>> user_browser.title |
1012 | 'Bug #10 in linux-source-2.6.15 (Ubuntu): ...another test bug...' |
1013 | @@ -242,8 +238,8 @@ |
1014 | Question #... : Questions : Jokosher |
1015 | |
1016 | >>> print extract_text( |
1017 | - ... find_tag_by_id(user_browser.contents, 'registration')) |
1018 | - Open Question #..., asked ... by Foo Bar |
1019 | + ... find_tag_by_id(user_browser.contents, 'question-status')) |
1020 | + Status: Open |
1021 | |
1022 | No Privileges Person uses his browser's back button to view the bug |
1023 | again. The bug status is sill Invalid for Jokosher, but he can edit it. |
1024 | |
1025 | === modified file 'lib/lp/bugs/stories/cve/cve-linking.txt' |
1026 | --- lib/lp/bugs/stories/cve/cve-linking.txt 2009-06-12 16:36:02 +0000 |
1027 | +++ lib/lp/bugs/stories/cve/cve-linking.txt 2009-11-14 22:08:12 +0000 |
1028 | @@ -29,10 +29,10 @@ |
1029 | |
1030 | The bug is now listed under the 'Related Bugs' heading: |
1031 | |
1032 | - >>> soup = find_main_content(user_browser.contents) |
1033 | - >>> header = soup.first('h2') |
1034 | - >>> header.findNext('b') |
1035 | - <b>Bug #5:...Firefox install instructions should be complete</b> |
1036 | + >>> print extract_text( |
1037 | + ... find_tag_by_id(user_browser.contents, 'related-bugs')) |
1038 | + Related bugs and status ... |
1039 | + Bug #5:...Firefox install instructions should be complete ... |
1040 | |
1041 | It is also possible to link a bug using its nickname. For example, |
1042 | bug #2 has 'blackhole' as its nickname: |
1043 | @@ -130,23 +130,20 @@ |
1044 | |
1045 | The user will see that linked private bug: |
1046 | |
1047 | - >>> soup = find_main_content(admin_browser.contents) |
1048 | - >>> soup.first('div', 'bug') |
1049 | - <div class="bug"> |
1050 | - <b>Bug #6: Firefox crashes when Save As dialog |
1051 | - for a nonexistent window is closed</b> |
1052 | - ... |
1053 | - <table id="affected-software" class="duplicate listing"...</div> |
1054 | + >>> print extract_text( |
1055 | + ... find_tag_by_id(admin_browser.contents, 'related-bugs')) |
1056 | + Related bugs and status ... |
1057 | + Bug #6: Firefox crashes when Save As dialog |
1058 | + for a nonexistent window is closed ... |
1059 | |
1060 | But anonymous users (or users which don't have access to the private |
1061 | bug) will only see that a private bug is linked to the CVE: |
1062 | |
1063 | >>> anon_browser.open('http://launchpad.dev/bugs/cve/2005-2737') |
1064 | - >>> soup = find_main_content(anon_browser.contents) |
1065 | - >>> soup.first('div', 'bug') |
1066 | - <div class="bug"> |
1067 | - <b>Bug #6: private bug</b> |
1068 | - </div> |
1069 | + >>> print extract_text( |
1070 | + ... find_tag_by_id(anon_browser.contents, 'related-bugs')) |
1071 | + Related bugs and status ... |
1072 | + Bug #6: private bug |
1073 | |
1074 | |
1075 | == Linking CVEs to bug reports == |
1076 | |
1077 | === modified file 'lib/lp/bugs/templates/buglinktarget-portlet-bugs.pt' |
1078 | --- lib/lp/bugs/templates/buglinktarget-portlet-bugs.pt 2009-07-17 17:59:07 +0000 |
1079 | +++ lib/lp/bugs/templates/buglinktarget-portlet-bugs.pt 2009-11-14 22:08:12 +0000 |
1080 | @@ -1,22 +1,15 @@ |
1081 | <div |
1082 | xmlns:tal="http://xml.zope.org/namespaces/tal" |
1083 | xmlns:metal="http://xml.zope.org/namespaces/metal" |
1084 | - class="portlet" id="portlet-related-bugs" |
1085 | - tal:define="links view/buglinks" |
1086 | - tal:condition="links" > |
1087 | - |
1088 | - <h2>Related bugs</h2> |
1089 | - |
1090 | - <div class="portletBody portletContent"> |
1091 | - |
1092 | - <ul> |
1093 | - <li tal:repeat="link links" class="bug-row"> |
1094 | - <a tal:attributes="href link/bug/fmt:url" class="sprite bug">Bug #<span |
1095 | - tal:replace="link/bug/id">122</span>: |
1096 | - <span tal:replace="link/title">foo bar baz</span></a> |
1097 | - </li> |
1098 | - </ul> |
1099 | - |
1100 | - </div> |
1101 | - |
1102 | + id="related-bugs" |
1103 | + tal:define="links view/buglinks" > |
1104 | + <h2>Related bugs</h2> |
1105 | + |
1106 | + <ul> |
1107 | + <li tal:repeat="link links"> |
1108 | + <a tal:attributes="href link/bug/fmt:url" class="sprite bug">Bug #<span |
1109 | + tal:replace="link/bug/id">122</span>: |
1110 | + <span tal:replace="link/title">foo bar baz</span></a> |
1111 | + </li> |
1112 | + </ul> |
1113 | </div> |
1114 | |
1115 | === modified file 'lib/lp/bugs/templates/cve-index.pt' |
1116 | --- lib/lp/bugs/templates/cve-index.pt 2009-09-10 13:02:28 +0000 |
1117 | +++ lib/lp/bugs/templates/cve-index.pt 2009-11-14 22:08:12 +0000 |
1118 | @@ -22,25 +22,23 @@ |
1119 | $CVE.description |
1120 | </tal:desc> |
1121 | |
1122 | - <tal:has_bugs condition="context/bugs"> |
1123 | - |
1124 | + <div id="related-bugs" tal:condition="context/bugs"> |
1125 | <h2>Related bugs and status</h2> |
1126 | |
1127 | - <p> |
1128 | - <tal:cve replace="context/title">CVE-1234-5678</tal:cve> |
1129 | - is related to these bugs: |
1130 | - </p> |
1131 | + <p> |
1132 | + <tal:cve replace="context/title">CVE-1234-5678</tal:cve> |
1133 | + is related to these bugs: |
1134 | + </p> |
1135 | |
1136 | - <div class="bug" tal:repeat="link view/buglinks"> |
1137 | - <b>Bug #<span tal:replace="link/bug/id" />: |
1138 | - <span tal:replace="link/title" /></b> |
1139 | + <div tal:repeat="link view/buglinks"> |
1140 | + <strong class="sprite bug">Bug #<span tal:replace="link/bug/id" />: |
1141 | + <span tal:replace="link/title" /></strong> |
1142 | <tal:details condition="link/can_view_bug"> |
1143 | <div |
1144 | tal:replace="structure link/bug/@@+bugtasks-and-nominations-table" /> |
1145 | </tal:details> |
1146 | </div> |
1147 | - |
1148 | - </tal:has_bugs> |
1149 | + </div> |
1150 | |
1151 | <div style="margin-top: 1em"> |
1152 | See the <img src="/@@/link" /> |
1153 | |
1154 | === modified file 'lib/lp/bugs/templates/cve-portlet-bugs2.pt' |
1155 | --- lib/lp/bugs/templates/cve-portlet-bugs2.pt 2009-09-07 13:38:16 +0000 |
1156 | +++ lib/lp/bugs/templates/cve-portlet-bugs2.pt 2009-11-14 22:08:12 +0000 |
1157 | @@ -9,7 +9,7 @@ |
1158 | <div class="portletBody portletContent"> |
1159 | |
1160 | <ul tal:condition="links"> |
1161 | - <li class="bug" tal:repeat="link links"> |
1162 | + <li class="sprite bug" tal:repeat="link links"> |
1163 | <a tal:attributes="href link/bug/fmt:url">#<span |
1164 | tal:replace="link/bug/id">122</span>: |
1165 | <span tal:replace="link/title">foo bar baz</span></a> |
1166 | |
1167 | === modified file 'lib/lp/coop/answersbugs/stories/question-buglink.txt' |
1168 | --- lib/lp/coop/answersbugs/stories/question-buglink.txt 2009-11-14 03:06:56 +0000 |
1169 | +++ lib/lp/coop/answersbugs/stories/question-buglink.txt 2009-11-14 22:08:12 +0000 |
1170 | @@ -51,11 +51,10 @@ |
1171 | |
1172 | >>> user_browser.getControl('Bug ID').value = '1' |
1173 | >>> user_browser.getControl('Link').click() |
1174 | - >>> soup = find_portlet(user_browser.contents, 'Related bugs') |
1175 | - >>> soup.first('li', 'bug-row') |
1176 | - <li class="bug-row"> |
1177 | - <a class="sprite bug" href=".../bugs/1">Bug #1: Firefox does not support SVG</a> |
1178 | - </li> |
1179 | + >>> print extract_text( |
1180 | + ... find_tag_by_id(user_browser.contents, 'related-bugs')) |
1181 | + Related bugs |
1182 | + Bug #1: Firefox does not support SVG |
1183 | |
1184 | A notification is also displayed. |
1185 | |
1186 | @@ -86,8 +85,10 @@ |
1187 | >>> soup = find_main_content(user_browser.contents) |
1188 | >>> soup.first('div', 'informational message') |
1189 | <div class="informational message">Removed link to bug #...</div> |
1190 | - >>> soup.first('div', {'id': 'portlet-related-bugs'}) is None |
1191 | - True |
1192 | + >>> print extract_text( |
1193 | + ... find_tag_by_id(user_browser.contents, 'related-bugs')) |
1194 | + Related bugs |
1195 | + |
1196 | |
1197 | == Link to Private Bugs == |
1198 | |
1199 | @@ -129,23 +130,21 @@ |
1200 | >>> admin_browser.getLink('Link existing bug').click() |
1201 | >>> admin_browser.getControl('Bug ID').value = '6' |
1202 | >>> admin_browser.getControl('Link').click() |
1203 | - >>> soup = find_portlet(admin_browser.contents, 'Related bugs') |
1204 | - >>> soup.first('li', 'bug-row') |
1205 | - <li class="bug-row"> |
1206 | - <a class="sprite bug" href=".../bugs/6">Bug #6: Firefox crashes when Save As dialog |
1207 | - for a nonexistent window is closed</a> |
1208 | - </li> |
1209 | + >>> print extract_text( |
1210 | + ... find_tag_by_id(admin_browser.contents, 'related-bugs')) |
1211 | + Related bugs |
1212 | + Bug #6: Firefox crashes when Save As dialog for a nonexistent window |
1213 | + is closed |
1214 | |
1215 | An anonymous visitor (or a user that doesn't have access to the bug) |
1216 | will only see that a private bug is linked. |
1217 | |
1218 | >>> anon_browser.open( |
1219 | ... 'http://launchpad.dev/firefox/+question/2') |
1220 | - >>> soup = find_portlet(anon_browser.contents, 'Related bugs') |
1221 | - >>> soup.first('li', 'bug-row') |
1222 | - <li class="bug-row"> |
1223 | - <a class="sprite bug" href=".../bugs/6">Bug #6: private bug</a> |
1224 | - </li> |
1225 | + >>> print extract_text( |
1226 | + ... find_tag_by_id(anon_browser.contents, 'related-bugs')) |
1227 | + Related bugs |
1228 | + Bug #6: private bug |
1229 | |
1230 | Only the administrator will be able to unlink the bug. |
1231 |
This is my branch to make the question page more like other 3.0 pages.
The guiding principle is that questions are read more often than answered,
so the most pertinent information about the question must be clearly
presented for the reader. Answer contact also need to read the question
details before trying to answer.
lp:~sinzui/launchpad/answers-ui /bugs.launchpad .net/bugs/ 434846 *(browser| stories) " implementation: no one, I pushed the content about the page until
it looked like other pages and address my personal
concerns.
Diff size: 779
Launchpad bug: https:/
Test command: ./bin/test -vvt "answers.
Pre-
Target release: 3.1.11
= Make the question page more like other 3.0 pages =
Bug 434846 [Question index is missing its info portlet]
* The entire Question information portlet is missing that should show:
status, language, assignee, reopening, whiteboard. The crucial
information is either in the wrong place or absent
* The linked bugs and FAQs should be in the content because answers are
read more often than asked -- prominent links will reduce duplicate
questions.
== Rules ==
* Create an information portlet.
* Move the bugs and details into the content.
* Remove the 1.0 portlets.
Screencaps
* http:// people. canonical. com/~curtis/ question- project- new.png people. canonical. com/~curtis/ question- project- answered. png people. canonical. com/~curtis/ question- distro- solved. png
* http://
* http://
== QA ==
On edge, pretend to be a user looking for the answer to a problem
* Verify the new layout presents the information you need to know
without reading a 15 message conversation.
On edge, as a Launcpad answer contact
* Verify that you understand the state of the questions you are looking
at.
== Lint ==
Linting changed files: answers/ browser/ question. py answers/ browser/ tests/test_ menus.py answers/ stories/ question- add-in- other-languages .txt answers/ stories/ question- add.txt answers/ stories/ question- answer- contact. txt answers/ stories/ question- confirm- url.txt answers/ stories/ question- edit.txt answers/ stories/ question- reject- and-change- status. txt answers/ stories/ question- workflow. txt answers/ stories/ this-is- a-faq.txt answers/ templates/ question- index.pt answers/ templates/ question- portlet- details. pt testing/ menu.py
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 ==
Ne tests.
* lib/lp/ answers/ browser/ tests/test_ menus.py
* Added basic testing of the question menus.
* Added an explcit test of of the linkfaq Link icon
Updated tests to do a much better job of checking question status,
language, and faqs.
* lib/lp/ answers/ stories/ question- add-in- other-languages .txt answers/ stories/ question- add.txt answers/ stories/ question- answer- contact. txt answers/ stories/ question- confirm- url.txt answers/ stories/ question- edit.txt answers/ stories/ question- reject- and-change- status. txt answers/ stories/ question- workflow. txt answers/ stories/ this...
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/
* lib/lp/