Merge lp:~kfogel/launchpad/534736-patches-portlet-first into lp:launchpad

Proposed by Karl Fogel
Status: Merged
Approved by: Karl Fogel
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~kfogel/launchpad/534736-patches-portlet-first
Merge into: lp:launchpad
Diff against target: 87 lines (+42/-22)
2 files modified
lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt (+20/-0)
lib/lp/bugs/templates/bug-portlet-attachments.pt (+22/-22)
To merge this branch: bzr merge lp:~kfogel/launchpad/534736-patches-portlet-first
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+21377@code.launchpad.net

Description of the change

Do exactly what the bug says: show patch attachments portlet before non-patch attachments.

To post a comment you must log in.
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/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt'
2--- lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt 2009-09-04 00:37:37 +0000
3+++ lib/lp/bugs/stories/bugattachments/xx-attachments-to-bug-report.txt 2010-03-15 16:10:45 +0000
4@@ -51,3 +51,23 @@
5 >>> link = browser.getLink('sample data')
6 >>> print link.url
7 http://localhost:58000/.../test.txt
8+
9+== Patch attachments are shown before non-patch attachments ==
10+
11+ >>> login("test@canonical.com")
12+ >>> patch_attachment = bug_11.addAttachment(
13+ ... owner=None, data=StringIO.StringIO('patchy patch patch'),
14+ ... comment=bug_11.initial_message, filename='patch.txt',
15+ ... is_patch=True, content_type='text/plain',
16+ ... description='a patch')
17+ >>> syncUpdate(patch_attachment)
18+ >>> syncUpdate(bug_11)
19+ >>> logout()
20+ >>> browser.open("http://bugs.launchpad.dev/redfish/+bug/11")
21+ >>> print extract_text(browser.contents)
22+ Bug #11 in Jokosher...
23+ ...Patches...
24+ ...a patch...
25+ ...Bug attachments...
26+ ...sample data...
27+ ...
28
29=== modified file 'lib/lp/bugs/templates/bug-portlet-attachments.pt'
30--- lib/lp/bugs/templates/bug-portlet-attachments.pt 2009-12-10 15:07:18 +0000
31+++ lib/lp/bugs/templates/bug-portlet-attachments.pt 2010-03-15 16:10:45 +0000
32@@ -3,6 +3,28 @@
33 xmlns:metal="http://xml.zope.org/namespaces/metal"
34 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
35 tal:omit-tag="">
36+ <div tal:condition="view/patches" class="portlet" id="portlet-patches">
37+ <h2>Patches</h2>
38+ <ul>
39+ <li class="download-attachment"
40+ tal:repeat="attachment view/patches">
41+ <a tal:attributes="href attachment/libraryfile/http_url"
42+ tal:content="attachment/title"
43+ class="sprite haspatch-icon">
44+ Attachment Title
45+ </a>
46+ <small>
47+ (<a tal:attributes="href attachment/fmt:url">edit</a>)
48+ </small>
49+ </li>
50+ </ul>
51+ <ul>
52+ <li>
53+ <a tal:attributes="href string:${view/current_bugtask/fmt:url/+addcomment}?field.patch=on"
54+ class="sprite add">Add patch</a>
55+ </li>
56+ </ul>
57+ </div>
58 <div tal:condition="view/regular_attachments" class="portlet"
59 id="portlet-attachments">
60 <h2>Bug attachments</h2>
61@@ -26,26 +48,4 @@
62 </li>
63 </ul>
64 </div>
65- <div tal:condition="view/patches" class="portlet" id="portlet-patches">
66- <h2>Patches</h2>
67- <ul>
68- <li class="download-attachment"
69- tal:repeat="attachment view/patches">
70- <a tal:attributes="href attachment/libraryfile/http_url"
71- tal:content="attachment/title"
72- class="sprite haspatch-icon">
73- Attachment Title
74- </a>
75- <small>
76- (<a tal:attributes="href attachment/fmt:url">edit</a>)
77- </small>
78- </li>
79- </ul>
80- <ul>
81- <li>
82- <a tal:attributes="href string:${view/current_bugtask/fmt:url/+addcomment}?field.patch=on"
83- class="sprite add">Add patch</a>
84- </li>
85- </ul>
86- </div>
87 </div>