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