Roundup Tracker - Issues

Issue 1501545

classification
Adds Issue Preview to Issue Index
Type: Severity: normal
Components: User Interface Versions:
process
Status: closed rejected
:
: richard : richard, tjwarren
Priority: normal : patch

Created on 2006-06-06 10:31 by tjwarren, last changed 2006-08-11 00:21 by richard.

Files
File name Uploaded Description Edit Remove
issuepreview.patch tjwarren, 2006-06-06 10:31 Patch to implement issue preview
Messages
msg2847 Author: [hidden] (tjwarren) Date: 2006-06-06 10:31
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
msg2848 Author: [hidden] (richard) Date: 2006-08-11 00:21
Logged In: YES 
user_id=6405

I would prefer this be added to the wiki. I don't believe 
the modification to roundup/cgi/templating.py is required 
to make this work.
History
Date User Action Args
2006-06-06 10:31:59tjwarrencreate