Message2847
The attached patch adds an issue preview to the
templates/classic/html/issue.index.html page,
displaying the summary of the last attached message (if
one exists). It also patches templates/classic/html/
issue.search.html (to add a checkbox for Previewing).
In addition to modifying the HTML to specify and
display the preview, the attached patch also modifies
roundup/cgi/templating.py. This allows the Preview
flag to be saved as a part of a saved search.
===BEGIN PATCH===
Index: roundup/cgi/templating.py
=======================================================
============
--- roundup/cgi/templating.py (revision 8)
+++ roundup/cgi/templating.py (revision 10)
@@ -2177,6 +2177,12 @@
if self.form.has_key('@dispname'):
self.dispname = self.form['@dispname'].
value
+
+ # issue_preview
+ self.issue_preview = None
+ if self.form.has_key('@issue_preview'):
+ self.issue_preview = self.
form['@issue_preview'].value
+
def updateFromURL(self, url):
''' Parse the URL for query args, and update
my attributes using the
values.
@@ -2311,6 +2317,8 @@
l.append(sc+'pagesize=%s'%self.pagesize)
if not specials.has_key('startwith'):
l.append(sc+'startwith=%s'%self.startwith)
+ if not specials.has_key('issue_preview'):
+ l.append(sc+'issue_preview=%s' % self.
issue_preview)
# finally, the remainder of the filter args in
the request
if self.classname and self.filterspec:
Index: templates/classic/html/issue.search.html
=======================================================
============
--- templates/classic/html/issue.search.html
(revision 8)
+++ templates/classic/html/issue.search.html
(revision 10)
@@ -188,6 +188,14 @@
</td>
</tr>
+<tr>
+ <th i18n:translate="">Preview:</th>
+ <td>
+ <input type="checkbox" name="@issue_preview"
+ tal:attributes="checked request/form/
@issue_preview/value | default">
+ </td>
+</tr>
+
<tr tal:condition="python:request.user.
hasPermission('Edit', 'query')">
<th i18n:translate="">Query name**:</th>
<td tal:define="value request/form/@queryname/value |
nothing">
Index: templates/classic/html/issue.index.html
=======================================================
============
--- templates/classic/html/issue.index.html
(revision 8)
+++ templates/classic/html/issue.index.html
(revision 10)
@@ -53,6 +53,11 @@
<td tal:condition="request/show/title">
<a tal:attributes="href string:issue${i/id}"
tal:content="python:str(i.title.
plain(hyperlink=0)) or '[no title]'">title</a>
+ <span tal:condition="python:request.form.
has_key('@issue_preview')">
+ <br><font size="-2">
+ <span tal:replace="python:'%s...' %
str(i.messages.reverse().next().summary)" tal:on-
error="string:" />
+ </font>
+ </span>
</td>
<td tal:condition="request/show/status"
tal:content="python:i.status.plain() or
default"> </td>
@@ -135,6 +140,12 @@
tal:attributes="checked python:request.
group[0] == '-'">
</td>
</tr>
+ <tr>
+ <th i18n:translate="">Preview:</th>
+ <td>
+ <input type="checkbox"
name="@issue_preview" tal:attributes="checked python:
request.form.has_key('@issue_preview')">
+ </td>
+ </tr>
<tr><td colspan="4">
<input type="submit" value="Redisplay"
i18n:attributes="value">
<tal:block tal:replace="structure
|
|
Date |
User |
Action |
Args |
2009-02-03 14:23:09 | admin | link | issue1501545 messages |
2009-02-03 14:23:09 | admin | create | |
|