changeset 4243:c3e3e00932a0 gsoc-2009

Added patch stuff support
author Pygi <pygi@users.sourceforge.net>
date Sat, 15 Aug 2009 07:43:11 +0000
parents f79670fe6fc9
children e8fb186265b7
files share/roundup/templates/devel/html/bug.item.html share/roundup/templates/devel/html/patch.index.html share/roundup/templates/devel/html/patch.item.html
diffstat 3 files changed, 295 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/share/roundup/templates/devel/html/bug.item.html	Fri Jul 24 04:48:28 2009 +0000
+++ b/share/roundup/templates/devel/html/bug.item.html	Sat Aug 15 07:43:11 2009 +0000
@@ -171,6 +171,27 @@
  <th><tal:block i18n:translate="">File Description</tal:block>:</th>
  <td colspan=3><input type="edit" name="file-1@description" size="40"></td>
 </tr>
+
+<tr tal:condition="context/is_edit_ok">
+ <th><tal:block i18n:translate="">Patch</tal:block>:</th>
+ <td colspan="3">
+   <input type="hidden" name="@link@patches" value="patch-1"/>
+   <input type="file" name="patch-1@content" size="35"/>
+ </td>
+</tr>
+<tr tal:condition="context/is_edit_ok">
+ <th><tal:block i18n:translate="">Patch Description</tal:block>:</th>
+ <td colspan=3><input type="edit" name="patch-1@description" size="40"></td>
+</tr>
+<tr tal:condition="context/is_edit_ok">
+ <th><tal:block i18n:translate="">Repository</tal:block>:</th>
+ <td colspan=3><input type="edit" name="patch-1@repository" size="40"></td>
+</tr>
+<tr tal:condition="context/is_edit_ok">
+ <th><tal:block i18n:translate="">Repo. Revision</tal:block>:</th>
+ <td colspan=3><input type="edit" name="patch-1@revision" size="40"></td>
+</tr>
+
 </table>
 </fieldset>
 <table class="form">
@@ -229,6 +250,42 @@
  </tr>
 </table>
 
+<table class="files" tal:condition="context/patches">
+ <tr><th colspan="5" class="header" i18n:translate="">Patches</th></tr>
+ <tr>
+  <th i18n:translate="">Patch name</th>
+  <th i18n:translate="">Uploaded</th>
+  <th i18n:translate="">Description</th>
+  <th i18n:translate="">View</th>
+  <th i18n:translate="">Edit</th>
+  <th i18n:translate="">Remove</th>
+ </tr>
+ <tr tal:repeat="patch python:context.patches.sorted('creation')">
+  <td>
+   <a tal:attributes="href patch/download_url"
+      tal:content="patch/name">dld link</a>
+  </td>
+  <td>
+   <span tal:content="patch/creator">creator's name</span>,
+   <span tal:content="python:patch.creation.pretty('%Y-%m-%d %H:%M')">creation date</span>
+  </td>
+  <td tal:content="patch/description" />
+  <td><a tal:attributes="href string:patch_view${patch/id}">Show patch</a>
+  </td>
+  <td><a tal:condition="patch/is_edit_ok"
+          tal:attributes="href string:patch${patch/id}">Edit</a>
+  </td>
+  <td>
+   <form style="padding:0" tal:condition="patch/is_edit_ok"
+         tal:attributes="action string:bug${context/id}">
+    <input type="hidden" name="@remove@patches" tal:attributes="value patch/id"/>
+    <input type="hidden" name="@action" value="edit"/>
+    <input type="submit" value="remove" i18n:attributes="value"/>
+   </form>
+  </td>
+ </tr>
+</table>
+
 <table class="messages" tal:condition="context/messages">
  <tr><th colspan="4" class="header" i18n:translate="">Messages</th></tr>
  <tal:block tal:repeat="msg context/messages">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/roundup/templates/devel/html/patch.index.html	Sat Aug 15 07:43:11 2009 +0000
@@ -0,0 +1,66 @@
+<tal:block metal:use-macro="templates/page/macros/frame">
+<title metal:fill-slot="head_title" i18n:translate="">
+  List of patches - <span tal:replace="config/TRACKER_NAME" i18n:name="tracker" />
+</title>
+<span metal:fill-slot="body_title" tal:omit-tag="python:1"
+  i18n:translate="">List of patches</span>
+<td class="content" metal:fill-slot="content">
+
+<table class="otherinfo" tal:define="batch request/batch">
+ <tr><th style="padding-right: 10" i18n:translate="">Download</th>
+     <th style="padding-right: 10" i18n:translate="">Description</th>
+     <th style="padding-right: 10" i18n:translate="">Content Type</th>
+     <th style="padding-right: 10" i18n:translate="">Uploaded By</th>
+     <th style="padding-right: 10" i18n:translate="">Date</th>
+ </tr>
+ <tr tal:repeat="patch batch" tal:attributes="class python:['normal', 'alt'][repeat['patch'].index%6/3]">
+  <td>
+   <a tal:attributes="href string:patch${patch/id}/${patch/name}"
+      tal:content="patch/name">dld link</a>
+  </td>
+  <td tal:content="patch/description">description</td>
+  <td tal:content="patch/type">content type</td>
+  <td tal:content="patch/creator">creator's name</td>
+  <td tal:content="patch/creation">creation date</td>
+ </tr>
+
+ <metal:block use-macro="templates/issue.index/macros/batch-footer" />
+
+</table>
+
+</td>
+
+</tal:block>
+<tal:block metal:use-macro="templates/page/macros/frame">
+<title metal:fill-slot="head_title" i18n:translate="">
+  List of patches - <span tal:replace="config/TRACKER_NAME" i18n:name="tracker" />
+</title>
+<span metal:fill-slot="body_title" tal:omit-tag="python:1"
+  i18n:translate="">List of patches</span>
+<td class="content" metal:fill-slot="content">
+
+<table class="otherinfo" tal:define="batch request/batch">
+ <tr><th style="padding-right: 10" i18n:translate="">Download</th>
+     <th style="padding-right: 10" i18n:translate="">Description</th>
+     <th style="padding-right: 10" i18n:translate="">Content Type</th>
+     <th style="padding-right: 10" i18n:translate="">Uploaded By</th>
+     <th style="padding-right: 10" i18n:translate="">Date</th>
+ </tr>
+ <tr tal:repeat="patch batch" tal:attributes="class python:['normal', 'alt'][repeat['patch'].index%6/3]">
+  <td>
+   <a tal:attributes="href string:patch${patch/id}/${patch/name}"
+      tal:content="patch/name">dld link</a>
+  </td>
+  <td tal:content="patch/description">description</td>
+  <td tal:content="patch/type">content type</td>
+  <td tal:content="patch/creator">creator's name</td>
+  <td tal:content="patch/creation">creation date</td>
+ </tr>
+
+ <metal:block use-macro="templates/issue.index/macros/batch-footer" />
+
+</table>
+
+</td>
+
+</tal:block>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/roundup/templates/devel/html/patch.item.html	Sat Aug 15 07:43:11 2009 +0000
@@ -0,0 +1,172 @@
+<tal:block metal:use-macro="templates/page/macros/frame">
+<title metal:fill-slot="head_title" i18n:translate="">Patch display - <span
+ i18n:name="tracker" tal:replace="config/TRACKER_NAME" /></title>
+<span metal:fill-slot="body_title" tal:omit-tag="python:1"
+ i18n:translate="">Modify patch</span>
+
+<td class="content" metal:fill-slot="content">
+
+<p tal:condition="python:not (context.is_view_ok()
+ or request.user.hasRole('Anonymous'))" i18n:translate="">
+ You are not allowed to view this page.</p>
+
+<p tal:condition="python:not context.is_view_ok()
+ and request.user.hasRole('Anonymous')" i18n:translate="">
+ Please login with your username and password.</p>
+
+<form method="POST" onSubmit="return submit_once()"
+      enctype="multipart/form-data" tal:condition="context/is_view_ok"
+      tal:attributes="action context/designator">
+
+<table class="form">
+ <tr>
+  <th i18n:translate="">Name</th>
+  <td tal:content="structure context/name/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td tal:content="structure context/description/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Content Type</th>
+  <td tal:content="structure context/type/field"/>
+  <td style="border: none" tal:condition="python: context.is_edit_ok()">Please note that
+  for security reasons, it's not permitted to set content type to <i>text/html</i>.</td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Repository</th>
+  <td tal:content="structure context/repository/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Repository revision</th>
+  <td tal:content="structure context/revision/field"></td>
+ </tr>
+ <tr tal:condition="python:context.is_edit_ok()">
+  <td>
+   &nbsp;
+   <input type="hidden" name="@template" value="item">
+   <input type="hidden" name="@required" value="name,type">
+   <input type="hidden" name="@multilink"
+          tal:condition="python:request.form.has_key('@multilink')"
+          tal:attributes="value request/form/@multilink/value">
+  </td>
+  <td tal:content="structure context/submit">submit button here</td>
+ </tr>
+</table>
+</form>
+
+<!--<p tal:condition="python:utils.sb_is_spam(context)" class="error-message">
+   File has been classified as spam.</p>-->
+
+<a tal:condition="python:context.id and context.content.is_view_ok()"
+ tal:attributes="href string:patch${context/id}/${context/name}"
+ i18n:translate="">download</a>
+
+<!--<p tal:condition="python:context.id and not context.content.is_view_ok()">
+   Files classified as spam are not available for download by
+   unathorized users. If you think the file has been misclassified,
+   please login and click on the button for reclassification.
+</p>-->
+
+
+<!--     <form method="POST" onSubmit="return submit_once()"
+       enctype="multipart/form-data"
+       tal:attributes="action context/designator"
+       tal:condition="python:request.user.hasPermission('SB: May Classify')">
+ 
+      <input type="hidden" name="@action" value="spambayes_classify">
+      <input type="submit" name="trainspam" value="Mark as SPAM" i18n:attributes="value">
+      <input type="submit" name="trainham" value="Mark as HAM (not SPAM)" i18n:attributes="value">
+     </form>-->
+
+<tal:block tal:condition="context/id" tal:replace="structure context/history" />
+
+</td>
+
+</tal:block>
+<tal:block metal:use-macro="templates/page/macros/frame">
+<title metal:fill-slot="head_title" i18n:translate="">Patch display - <span
+ i18n:name="tracker" tal:replace="config/TRACKER_NAME" /></title>
+<span metal:fill-slot="body_title" tal:omit-tag="python:1"
+ i18n:translate="">Patch display</span>
+
+<td class="content" metal:fill-slot="content">
+
+<p tal:condition="python:not (context.is_view_ok()
+ or request.user.hasRole('Anonymous'))" i18n:translate="">
+ You are not allowed to view this page.</p>
+
+<p tal:condition="python:not context.is_view_ok()
+ and request.user.hasRole('Anonymous')" i18n:translate="">
+ Please login with your username and password.</p>
+
+<form method="POST" onSubmit="return submit_once()"
+      enctype="multipart/form-data" tal:condition="context/is_view_ok"
+      tal:attributes="action context/designator">
+
+<table class="form">
+ <tr>
+  <th i18n:translate="">Name</th>
+  <td tal:content="structure context/name/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Description</th>
+  <td tal:content="structure context/description/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Content Type</th>
+  <td tal:content="structure context/type/field"/>
+  <td style="border: none" tal:condition="python: context.is_edit_ok()">Please note that
+  for security reasons, it's not permitted to set content type to <i>text/html</i>.</td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Repository</th>
+  <td tal:content="structure context/repository/field"></td>
+ </tr>
+ <tr>
+  <th i18n:translate="">Repository revision</th>
+  <td tal:content="structure context/revision/field"></td>
+ </tr>
+ <tr tal:condition="python:context.is_edit_ok()">
+  <td>
+   &nbsp;
+   <input type="hidden" name="@template" value="item">
+   <input type="hidden" name="@required" value="name,type">
+   <input type="hidden" name="@multilink"
+          tal:condition="python:request.form.has_key('@multilink')"
+          tal:attributes="value request/form/@multilink/value">
+  </td>
+  <td tal:content="structure context/submit">submit button here</td>
+ </tr>
+</table>
+</form>
+
+<!--<p tal:condition="python:utils.sb_is_spam(context)" class="error-message">
+   File has been classified as spam.</p>-->
+
+<a tal:condition="python:context.id and context.content.is_view_ok()"
+ tal:attributes="href string:patch${context/id}/${context/name}"
+ i18n:translate="">download</a>
+
+<!--<p tal:condition="python:context.id and not context.content.is_view_ok()">
+   Files classified as spam are not available for download by
+   unathorized users. If you think the file has been misclassified,
+   please login and click on the button for reclassification.
+</p>-->
+
+
+<!--     <form method="POST" onSubmit="return submit_once()"
+       enctype="multipart/form-data"
+       tal:attributes="action context/designator"
+       tal:condition="python:request.user.hasPermission('SB: May Classify')">
+ 
+      <input type="hidden" name="@action" value="spambayes_classify">
+      <input type="submit" name="trainspam" value="Mark as SPAM" i18n:attributes="value">
+      <input type="submit" name="trainham" value="Mark as HAM (not SPAM)" i18n:attributes="value">
+     </form>-->
+
+<tal:block tal:condition="context/id" tal:replace="structure context/history" />
+
+</td>
+
+</tal:block>

Roundup Issue Tracker: http://roundup-tracker.org/