Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished changing trac templates to handle upgrade to 0.9pre -- fixes #…

…424 and #358

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 72a49ed46e59662958d729690ed49f305a7f5ea2 1 parent 3067701
jacob authored
Showing with 1,661 additions and 1,306 deletions.
  1. +54 −18 django_website/templates/trac_templates/attachment.cs
  2. +95 −70 django_website/templates/trac_templates/browser.cs
  3. +113 −83 django_website/templates/trac_templates/changeset.cs
  4. +2 −2 django_website/templates/trac_templates/header.cs
  5. +104 −21 django_website/templates/trac_templates/log.cs
  6. +24 −28 django_website/templates/trac_templates/log_rss.cs
  7. +128 −156 django_website/templates/trac_templates/macros.cs
  8. +160 −114 django_website/templates/trac_templates/milestone.cs
  9. +71 −41 django_website/templates/trac_templates/newticket.cs
  10. +212 −142 django_website/templates/trac_templates/query.cs
  11. +46 −0 django_website/templates/trac_templates/query_rss.cs
  12. +53 −43 django_website/templates/trac_templates/report.cs
  13. +2 −6 django_website/templates/trac_templates/report_rss.cs
  14. +57 −25 django_website/templates/trac_templates/roadmap.cs
  15. +39 −76 django_website/templates/trac_templates/search.cs
  16. +28 −32 django_website/templates/trac_templates/settings.cs
  17. +233 −199 django_website/templates/trac_templates/ticket.cs
  18. +28 −74 django_website/templates/trac_templates/timeline.cs
  19. +29 −63 django_website/templates/trac_templates/timeline_rss.cs
  20. +183 −113 django_website/templates/trac_templates/wiki.cs
View
72 django_website/templates/trac_templates/attachment.cs
@@ -1,4 +1,4 @@
-<?cs set:html.stylesheet = 'css/code.css' ?>
+<?cs set:html.stylesheet = 'css/diff.css' ?>
<?cs include "header.cs" ?>
<?cs include "macros.cs" ?>
@@ -6,35 +6,71 @@
<div id="content" class="attachment">
- <h3>Add Attachment to <a href="<?cs
- var:file.attachment_parent_href?>"><?cs var:file.attachment_parent?></a></h3>
- <form id="attachment" method="post" enctype="multipart/form-data" action="<?cs
- var:cgi_location ?>">
+<?cs if:attachment.mode == 'new' ?>
+ <h1>Add Attachment to <a href="<?cs var:attachment.parent.href?>"><?cs
+ var:attachment.parent.name ?></a></h1>
+ <form id="attachment" method="post" enctype="multipart/form-data" action="">
<div class="field">
- <label for="file">File:</label>
- <input type="file" id="file" name="attachment" />
+ <label>File:<br /><input type="file" name="attachment" /></label>
</div>
<fieldset>
<legend>Attachment Info</legend>
<div class="field">
- <label for="author">Your email or username:</label><br />
- <input type="text" id="author" name="author" class="textwidget" size="30"
- value="<?cs var:attachment.author?>" />
+ <label>Your email or username:<br />
+ <input type="text" name="author" size="30" value="<?cs
+ var:attachment.author?>" /></label>
</div>
<div class="field">
- <label for="description">Description of the file (optional):</label><br />
- <input type="text" id="description" name="description" class="textwidget"
- size="60" />
- </div><br />
+ <label>Description of the file (optional):<br />
+ <input type="text" name="description" size="60" /></label
+ </div>
+ <div class="options">
+ <label><input type="checkbox" name="replace" checked="checked" />
+ Replace existing attachment of the same name</label>
+ </div>
+ <br />
</fieldset>
<div class="buttons">
- <input type="hidden" name="mode" value="attachment" />
- <input type="hidden" name="type" value="<?cs var:attachment.type ?>" />
- <input type="hidden" name="id" value="<?cs var:attachment.id ?>" />
- <input type="submit" value="Add Attachment" />
+ <input type="hidden" name="action" value="new" />
+ <input type="hidden" name="type" value="<?cs var:attachment.parent.type ?>" />
+ <input type="hidden" name="id" value="<?cs var:attachment.parent.id ?>" />
+ <input type="submit" value="Add attachment" />
<input type="submit" name="cancel" value="Cancel" />
</div>
</form>
+<?cs elif:attachment.mode == 'delete' ?>
+ <h1><a href="<?cs var:attachment.parent.href ?>"><?cs
+ var:attachment.parent.name ?></a>: <?cs var:attachment.filename ?></h1>
+ <p><strong>Are you sure you want to delete this attachment?</strong><br />
+ This is an irreversible operation.</p>
+ <div class="buttons">
+ <form method="post" action=""><div id="delete">
+ <input type="hidden" name="action" value="delete" />
+ <input type="submit" name="cancel" value="Cancel" />
+ <input type="submit" value="Delete attachment" />
+ </div></form>
+ </div><?cs else ?>
+ <h1><a href="<?cs var:attachment.parent.href ?>"><?cs
+ var:attachment.parent.name ?></a>: <?cs var:attachment.filename ?></h1>
+ <div id="preview"><?cs
+ if:attachment.preview ?>
+ <?cs var:attachment.preview ?><?cs
+ elif:attachment.max_file_size_reached ?>
+ <strong>HTML preview not available</strong>, since file-size exceeds
+ <?cs var:attachment.max_file_size ?> bytes. You may <a href="<?cs
+ var:attachment.raw_href ?>">download the file</a> instead.<?cs
+ else ?>
+ <strong>HTML preview not available</strong>. To view the file,
+ <a href="<?cs var:attachment.raw_href ?>">download the file</a>.<?cs
+ /if ?>
+ </div>
+ <?cs if:attachment.can_delete ?><div class="buttons">
+ <form method="get" action=""><div id="delete">
+ <input type="hidden" name="action" value="delete" />
+ <input type="submit" value="Delete attachment" />
+ </div></form>
+ </div><?cs /if ?>
+<?cs /if ?>
</div>
<?cs include "footer.cs"?>
View
165 django_website/templates/trac_templates/browser.cs
@@ -9,81 +9,106 @@
</div>
<div id="content" class="browser">
- <?cs call:browser_path_links(browser.path, browser) ?>
+ <h1><?cs call:browser_path_links(browser.path, browser) ?></h1>
<div id="jumprev">
- <form action="<?cs var:browser_current_href ?>" method="get">
- <div>
- <label for="rev">View revision:</label>
- <input type="text" id="rev" name="rev" value="<?cs
- var:browser.revision?>" size="4" />
- </div>
- </form>
+ <form action="" method="get"><div>
+ <label for="rev">View revision:</label>
+ <input type="text" id="rev" name="rev" value="<?cs
+ var:browser.revision ?>" size="4" />
+ </div></form>
</div>
- <table class="listing" id="dirlist">
- <thead>
- <tr>
- <th class="name<?cs if:browser.order == "name" ?> <?cs
- var:browser.order_dir ?><?cs /if ?>"><a title="Sort by name<?cs
- if:browser.order == "name" && browser.order_dir == "asc" ?> (descending)<?cs
- /if ?>" href="<?cs var:browser.current_href?>?order=name<?cs
- if:browser.order == "name" && browser.order_dir == "asc" ?>&desc=1<?cs
- /if ?>">Name</a>
- </th>
- <th class="rev">Rev</th>
- <th class="age<?cs if:browser.order == "date" ?> <?cs
- var:browser.order_dir ?><?cs /if ?>"><a title="Sort by age<?cs
- if:browser.order == "date" && browser.order_dir == "asc" ?> (descending)<?cs
- /if ?>" href="<?cs var:browser.current_href?>?order=date<?cs
- if:browser.order == "date" && browser.order_dir == "asc" ?>&desc=1<?cs
- /if ?>">Age</a>
- </th>
- <th class="change">Last Change</th>
- </tr>
- </thead>
- <tbody>
- <?cs if:browser.path != "/" ?>
- <tr class="even">
- <td class="name" colspan="4">
- <a class="parent" title="Parent Directory" href="<?cs
- var:browser.parent_href ?>">../</a>
- </td>
- </tr>
- <?cs /if ?>
- <?cs each:item = browser.items ?>
- <tr class="<?cs if:name(item) % #2 ?>even<?cs else ?>odd<?cs /if ?>">
- <td class="name"><?cs
- if:item.is_dir ?><?cs
- if:item.permission ?>
- <a class="dir" title="Browse Directory" href="<?cs
- var:item.browser_href ?>"><?cs var:item.name ?></a><?cs
- else ?>
- <span class="dir" title="Access Denied" href=""><?cs
- var:item.name ?></span><?cs
- /if ?><?cs
- else ?><?cs
- if:item.permission != '' ?>
- <a class="file" title="View File" href="<?cs
- var:item.browser_href ?>"><?cs var:item.name ?></a><?cs
- else ?>
- <span class="file" title="Access Denied" href=""><?cs
- var:item.name ?></span><?cs
- /if ?><?cs
- /if ?>
- </td>
- <td class="rev"><?cs if:item.permission != '' ?><a title="View Revision Log" href="<?cs
- var:item.log_href ?>"><?cs var:item.created_rev ?></a><?cs else ?><?cs var:item.created_rev ?><?cs /if ?></td>
- <td class="age"><span title="<?cs var:item.date ?>"><?cs
- var:item.age ?></span></td>
- <td class="change">
- <span class="author"><?cs var:item.author ?>:</span>
- <span class="change"><?cs var:item.change ?></span>
- </td>
+ <?cs if:browser.is_dir ?>
+ <table class="listing" id="dirlist">
+ <thead>
+ <tr><?cs
+ call:sortable_th(browser.order, browser.desc, 'name', 'Name', browser.href) ?><?cs
+ call:sortable_th(browser.order, browser.desc, 'size', 'Size', browser.href) ?>
+ <th class="rev">Rev</th><?cs
+ call:sortable_th(browser.order, browser.desc, 'date', 'Age', browser.href) ?>
+ <th class="change">Last Change</th>
</tr>
- <?cs /each ?>
- </tbody>
- </table>
+ </thead>
+ <tbody>
+ <?cs if:len(links.up) != "/" ?>
+ <tr class="even">
+ <td class="name" colspan="4">
+ <a class="parent" title="Parent Directory" href="<?cs
+ var:links.up.0.href ?>">../</a>
+ </td>
+ </tr>
+ <?cs /if ?>
+ <?cs each:item = browser.items ?>
+ <?cs set:change = browser.changes[item.rev] ?>
+ <tr class="<?cs if:name(item) % #2 ?>even<?cs else ?>odd<?cs /if ?>">
+ <td class="name"><?cs
+ if:item.is_dir ?><?cs
+ if:item.permission ?>
+ <a class="dir" title="Browse Directory" href="<?cs
+ var:item.browser_href ?>"><?cs var:item.name ?></a><?cs
+ else ?>
+ <span class="dir" title="Access Denied" href=""><?cs
+ var:item.name ?></span><?cs
+ /if ?><?cs
+ else ?><?cs
+ if:item.permission != '' ?>
+ <a class="file" title="View File" href="<?cs
+ var:item.browser_href ?>"><?cs var:item.name ?></a><?cs
+ else ?>
+ <span class="file" title="Access Denied" href=""><?cs
+ var:item.name ?></span><?cs
+ /if ?><?cs
+ /if ?>
+ </td>
+ <td class="size"><?cs var:item.size ?></td>
+ <td class="rev"><?cs if:item.permission != '' ?><a title="View Revision Log" href="<?cs
+ var:item.log_href ?>"><?cs var:item.rev ?></a><?cs else ?><?cs var:item.rev ?><?cs /if ?></td>
+ <td class="age"><span title="<?cs var:browser.changes[item.rev].date ?>"><?cs
+ var:browser.changes[item.rev].age ?></span></td>
+ <td class="change">
+ <span class="author"><?cs var:browser.changes[item.rev].author ?>:</span>
+ <span class="change"><?cs var:browser.changes[item.rev].message ?></span>
+ </td>
+ </tr>
+ <?cs /each ?>
+ </tbody>
+ </table><?cs
+ /if ?><?cs
+
+ if:len(browser.props) || !browser.is_dir ?>
+ <table id="info" summary="Revision info"><?cs
+ if:!browser.is_dir ?><tr>
+ <th scope="row">
+ Revision <a href="<?cs var:file.changeset_href ?>"><?cs var:file.rev ?></a>
+ (checked in by <?cs var:file.author ?>, <?cs var:file.age ?> ago)
+ </th>
+ <td class="message"><?cs var:file.message ?></td>
+ </tr><?cs /if ?><?cs
+ if:len(browser.props) ?><tr>
+ <td colspan="2"><ul class="props"><?cs
+ each:prop = browser.props ?>
+ <li>Property <strong><?cs var:name(prop) ?></strong> set to <em><code><?cs
+ var:prop ?></code></em></li><?cs
+ /each ?>
+ </ul></td><?cs
+ /if ?></tr>
+ </table><?cs
+ /if ?><?cs
+
+ if:!browser.is_dir ?>
+ <div id="preview"><?cs
+ if:file.preview ?><?cs
+ var:file.preview ?><?cs
+ elif:file.max_file_size_reached ?>
+ <strong>HTML preview not available</strong>, since file-size exceeds <?cs
+ var:file.max_file_size ?> bytes. Try <a href="<?cs
+ var:file.raw_href ?>">downloading</a> the file instead.<?cs
+ else ?><strong>HTML preview not available</strong>. To view, <a href="<?cs
+ var:file.raw_href ?>">download</a> the file.<?cs
+ /if ?>
+ </div><?cs
+ /if ?>
<div id="help">
<strong>Note:</strong> See <a href="<?cs var:trac.href.wiki
View
196 django_website/templates/trac_templates/changeset.cs
@@ -23,7 +23,13 @@
<div id="content" class="changeset">
<h1>Changeset <?cs var:changeset.revision ?></h1>
-<?cs if:len(changeset.diff.files) ?><form method="post" id="prefs" action="">
+<?cs each:change = changeset.changes ?><?cs
+ if:len(change.diff) ?><?cs
+ set:has_diffs = 1 ?><?cs
+ /if ?><?cs
+/each ?><?cs if:has_diffs || diff.options.ignoreblanklines
+ || diff.options.ignorecase || diff.options.ignorewhitespace ?>
+<form method="post" id="prefs" action="">
<div>
<label for="style">View differences</label>
<select id="style" name="style">
@@ -63,6 +69,36 @@
</div>
</form><?cs /if ?>
+<?cs def:node_change(item,cl,kind) ?><?cs
+ set:ndiffs = len(item.diff) ?><?cs
+ set:nprops = len(item.props) ?>
+ <div class="<?cs var:cl ?>"></div><?cs
+ if:cl == "rem" ?>
+ <a title="Show what was removed (rev. <?cs var:item.rev.old ?>)" href="<?cs
+ var:item.browser_href.old ?>"><?cs var:item.path.old ?></a><?cs
+ else ?>
+ <a title="Show entry in browser" href="<?cs
+ var:item.browser_href.new ?>"><?cs var:item.path.new ?></a><?cs
+ /if ?>
+ <span class="comment">(<?cs var:kind ?>)</span><?cs
+ if:item.path.old && item.change == 'copy' || item.change == 'move' ?>
+ <small><em>(<?cs var:kind ?> from <a href="<?cs
+ var:item.browser_href.old ?>" title="Show original file (rev. <?cs
+ var:item.rev.old ?>)"><?cs var:item.path.old ?></a>)</em></small><?cs
+ /if ?><?cs
+ if:$ndiffs + $nprops > #0 ?>
+ (<a href="#file<?cs var:name(item) ?>" title="Show differences"><?cs
+ if:$ndiffs > #0 ?><?cs var:ndiffs ?>&nbsp;diff<?cs if:$ndiffs > #1 ?>s<?cs /if ?><?cs
+ /if ?><?cs
+ if:$ndiffs && $nprops ?>, <?cs /if ?><?cs
+ if:$nprops > #0 ?><?cs var:nprops ?>&nbsp;prop<?cs if:$nprops > #1 ?>s<?cs /if ?><?cs
+ /if ?></a>)<?cs
+ elif:cl == "mod" ?>
+ (<a href="<?cs var:item.browser_href.old ?>"
+ title="Show previous version in browser">previous</a>)<?cs
+ /if ?>
+<?cs /def ?>
+
<dl id="overview">
<dt class="time">Timestamp:</dt>
<dd class="time"><?cs var:changeset.time ?></dd>
@@ -71,24 +107,20 @@
<dt class="message">Message:</dt>
<dd class="message" id="searchable"><?cs var:changeset.message ?></dd>
<dt class="files">Files:</dt>
- <dd class="files"><?cs set:anchor_idx = #0 ?>
+ <dd class="files">
<ul><?cs each:item = changeset.changes ?>
- <li>
- <?cs if:item.change == "A" ?>
- <div class="add"></div>
- <a href="<?cs var:item.browser_href ?>" title="Show file in browser"><?cs
- var:item.name ?></a> <span class="comment">(added)</span>
- <?cs elif:item.change == "M" ?>
- <div class="mod"></div>
- <a href="<?cs var:item.browser_href ?>" title="Show file in browser"><?cs
- var:item.name ?></a> <span class="comment">(modified)</span><?cs
- if:len(changeset.diff.files[anchor_idx].changes) ?>
- (<a href="#file<?cs var:anchor_idx ?>" title="Show differences">diff</a>)<?cs
- /if ?><?cs set:anchor_idx = anchor_idx + #1 ?>
- <?cs elif:item.change == "D" ?>
- <div class="rem"></div>
- <?cs var:item.name ?> <span class="comment">(deleted)</span>
- <?cs /if ?>
+ <li><?cs
+ if:item.change == 'add' ?><?cs
+ call:node_change(item, 'add', 'added') ?><?cs
+ elif:item.change == 'delete' ?><?cs
+ call:node_change(item, 'rem', 'deleted') ?><?cs
+ elif:item.change == 'copy' ?><?cs
+ call:node_change(item, 'cp', 'copied') ?><?cs
+ elif:item.change == 'move' ?><?cs
+ call:node_change(item, 'mv', 'moved') ?><?cs
+ elif:item.change == 'edit' ?><?cs
+ call:node_change(item, 'mod', 'modified') ?><?cs
+ /if ?>
</li>
<?cs /each ?></ul>
</dd>
@@ -102,73 +134,71 @@
<dt class="add"></dt><dd>Added</dd>
<dt class="rem"></dt><dd>Removed</dd>
<dt class="mod"></dt><dd>Modified</dd>
+ <dt class="cp"></dt><dd>Copied</dd>
+ <dt class="mv"></dt><dd>Moved</dd>
</dl>
</div>
- <ul>
- <?cs each:file = changeset.diff.files ?>
- <?cs if:len(file.changes) ?>
- <li id="file<?cs var:name(file) ?>">
- <h2><a href="<?cs
- var:file.browser_href.new ?>" title="Show version <?cs
- var:file.rev.new ?> of this file in browser"><?cs
- var:file.name.new ?></a></h2>
- <?cs if:diff.style == 'sidebyside' ?>
- <table class="sidebyside" summary="Differences" cellspacing="0">
- <colgroup class="base">
- <col class="lineno" /><col class="content" />
- <colgroup class="chg">
- <col class="lineno" /><col class="content" />
- </colgroup>
- <thead><tr>
- <th colspan="2"><a href="<?cs var:file.browser_href.old ?>">Revision <?cs
- var:file.rev.old ?></a></th>
- <th colspan="2"><a href="<?cs var:file.browser_href.new ?>">Revision <?cs
- var:file.rev.new ?></a></th>
- </tr></thead>
- <?cs each:change = file.changes ?>
- <tbody>
- <?cs call:diff_display(change, diff.style) ?>
- </tbody>
- <?cs if:name(change) < len(file.changes) - 1 ?>
- <tbody class="skippedlines">
- <tr><th>&hellip;</th><td>&nbsp;</td>
- <th>&hellip;</th><td>&nbsp;</td></tr>
- </tbody>
- <?cs /if ?>
- <?cs /each ?>
- </table>
- <?cs else ?>
- <table class="inline" summary="Differences" cellspacing="0">
- <colgroup>
- <col class="lineno" />
- <col class="lineno" />
- <col class="content" />
- </colgroup>
- <thead><tr>
- <th title="Revision <?cs var:file.rev.old ?>"><a href="<?cs
- var:file.browser_href.old ?>" title="Show revision <?cs
- var:file.rev.old ?> of this file in browser">r<?cs
- var:file.rev.old ?></a></th>
- <th title="Revision <?cs var:file.rev.new ?>"><a href="<?cs
- var:file.browser_href.new ?>" title="Show revision <?cs
- var:file.rev.new ?> of this file in browser">r<?cs
- var:file.rev.new ?></a></th>
- <th>&nbsp;</th>
- </tr></thead>
- <?cs each:change = file.changes ?>
- <?cs call:diff_display(change, diff.style) ?>
- <?cs if:name(change) < len(file.changes) - 1 ?>
- <tbody class="skippedlines">
- <tr><th>&hellip;</th><th>&hellip;</th><td>&nbsp;</td></tr>
- </tbody>
- <?cs /if ?>
- <?cs /each ?>
- </table>
- <?cs /if ?>
- </li>
- <?cs /if ?>
- <?cs /each ?>
- </ul>
+ <ul class="entries"><?cs
+ each:item = changeset.changes ?><?cs
+ if:len(item.diff) || len(item.props) ?><li class="entry" id="file<?cs
+ var:name(item) ?>"><h2><a href="<?cs
+ var:item.browser_href.new ?>" title="Show new revision <?cs
+ var:item.rev.new ?> of this file in browser"><?cs
+ var:item.path.new ?></a></h2><?cs
+ if:len(item.props) ?><ul class="props"><?cs
+ each:prop = item.props ?><li>Property <strong><?cs
+ var:name(prop) ?></strong> <?cs
+ if:prop.old && prop.new ?>changed from <?cs
+ elif:!prop.old ?>set<?cs
+ else ?>deleted<?cs
+ /if ?><?cs
+ if:prop.old && prop.new ?><em><tt><?cs var:prop.old ?></tt></em><?cs /if ?><?cs
+ if:prop.new ?> to <em><tt><?cs var:prop.new ?></tt></em><?cs /if ?></li><?cs
+ /each ?></ul><?cs
+ /if ?><?cs
+ if:len(item.diff) ?><table class="<?cs
+ var:diff.style ?>" summary="Differences" cellspacing="0"><?cs
+ if:diff.style == 'sidebyside' ?>
+ <colgroup class="l"><col class="lineno" /><col class="content" /></colgroup>
+ <colgroup class="r"><col class="lineno" /><col class="content" /></colgroup>
+ <thead><tr>
+ <th colspan="2"><a href="<?cs
+ var:item.browser_href.old ?>" title="Show old rev. <?cs
+ var:item.rev.old ?> of <?cs var:item.path.old ?>">Revision <?cs
+ var:item.rev.old ?></a></th>
+ <th colspan="2"><a href="<?cs
+ var:item.browser_href.new ?>" title="Show new rev. <?cs
+ var:item.rev.old ?> of <?cs var:item.path.new ?>">Revision <?cs
+ var:item.rev.new ?></a></th>
+ </tr>
+ </thead><?cs
+ each:change = item.diff ?><tbody><?cs
+ call:diff_display(change, diff.style) ?></tbody><?cs
+ if:name(change) < len(item.diff) - 1 ?><tbody class="skipped"><tr>
+ <th>&hellip;</th><td>&nbsp;</td><th>&hellip;</th><td>&nbsp;</td>
+ </tr></tbody><?cs /if ?><?cs
+ /each ?><?cs
+ else ?>
+ <colgroup><col class="lineno" /><col class="lineno" /><col class="content" /></colgroup>
+ <thead><tr>
+ <th title="Revision <?cs var:item.rev.old ?>"><a href="<?cs
+ var:item.browser_href.old ?>" title="Show old version of <?cs
+ var:item.path.old ?>">r<?cs var:item.rev.old ?></a></th>
+ <th title="Revision <?cs var:item.rev.new ?>"><a href="<?cs
+ var:item.browser_href.new ?>" title="Show new version of <?cs
+ var:item.path.new ?>">r<?cs var:item.rev.new ?></a></th>
+ <th>&nbsp;</th></tr>
+ </thead><?cs
+ each:change = item.diff ?><?cs
+ call:diff_display(change, diff.style) ?><?cs
+ if:name(change) < len(item.diff) - 1 ?><tbody class="skipped"><tr>
+ <th>&hellip;</th><th>&hellip;</th><td>&nbsp;</td>
+ </tr></tbody><?cs /if ?><?cs
+ /each ?><?cs
+ /if ?></table><?cs
+ /if ?></li><?cs
+ /if ?><?cs
+ /each ?></ul>
</div>
</div>
View
4 django_website/templates/trac_templates/header.cs
@@ -26,8 +26,8 @@
<?cs /each ?>
<style type="text/css">
- <?cs if:html.stylesheet ?>@import url(http://media.djangoproject.com/trac/<?cs
- var:html.stylesheet ?>);<?cs /if ?>
+ <?cs if:html.stylesheet ?>@import url(http://media.djangoproject.com/trac/<?cs var:html.stylesheet ?>);<?cs /if ?>
+ <?cs if:html.stylesheet2 ?>@import url(http://media.djangoproject.com/trac/<?cs var:html.stylesheet2 ?>);<?cs /if ?>
<?cs include "site_css.cs" ?>
</style>
<script src="<?cs var:htdocs_location ?>trac.js" type="text/javascript"></script>
View
125 django_website/templates/trac_templates/log.cs
@@ -5,26 +5,80 @@
<div id="ctxtnav" class="nav">
<ul>
<li class="last"><a href="<?cs
- var:log.items.0.file_href ?>">View Latest Revision</a></li>
+ var:log.browser_href ?>">View Latest Revision</a></li><?cs
+ if:len(chrome.links.prev) ?>
+ <li class="first<?cs if:!len(chrome.links.next) ?> last<?cs /if ?>">
+ &larr; <a href="<?cs var:chrome.links.prev.0.href ?>" title="<?cs
+ var:chrome.links.prev.0.title ?>">Newer Revisions</a>
+ </li><?cs
+ /if ?><?cs
+ if:len(chrome.links.next) ?>
+ <li class="<?cs if:!len(chrome.links.prev) ?>first <?cs /if ?>last">
+ <a href="<?cs var:chrome.links.next.0.href ?>" title="<?cs
+ var:chrome.links.next.0.title ?>">Older Revisions</a> &rarr;
+ </li><?cs
+ /if ?>
</ul>
</div>
-<div id="content" class="log">
- <?cs call:browser_path_links(log.path, log) ?>
- <div id="jumprev">
- <form action="<?cs var:browser_current_href ?>" method="get">
- <div>
- <label for="rev">View revision:</label>
- <input type="text" id="rev" name="rev" value="<?cs
- var:log.items.0.rev ?>" size="4" />
+<div id="content" class="log">
+ <h1><?cs call:browser_path_links(log.path, log) ?></h1>
+ <form id="prefs" action="<?cs var:browser_current_href ?>" method="get">
+ <div>
+ <input type="hidden" name="action" value="<?cs var:log.mode ?>" />
+ <label>View log starting at <input type="text" id="rev" name="rev" value="<?cs
+ var:log.items.0.rev ?>" size="5" /></label>
+ <label>and back to <input type="text" id="stop_rev" name="stop_rev" value="<?cs
+ var:log.stop_rev ?>" size="5" /></label>
+ <br />
+ <div class="choice" ?>
+ <fieldset>
+ <legend>Mode:</legend>
+ <label for="stop_on_copy">
+ <input type="radio" id="stop_on_copy" name="mode" value="stop_on_copy" <?cs
+ if:log.mode != "follow_copy" || log.mode != "path_history" ?> checked="checked" <?cs
+ /if ?> />
+ Stop on copy
+ </label>
+ <label for="follow_copy">
+ <input type="radio" id="follow_copy" name="mode" value="follow_copy" <?cs
+ if:log.mode == "follow_copy" ?> checked="checked" <?cs /if ?> />
+ Follow copies
+ </label>
+ <label for="path_history">
+ <input type="radio" id="path_history" name="mode" value="path_history" <?cs
+ if:log.mode == "path_history" ?> checked="checked" <?cs /if ?> />
+ Show only adds, moves and deletes
+ </label>
+ </fieldset>
</div>
- </form>
+ <label><input type="checkbox" name="verbose" <?cs
+ if:log.verbose ?> checked="checked" <?cs
+ /if ?> /> Show full log messages</label>
+ </div>
+ <div class="buttons">
+ <input type="submit" value="Update"
+ title="Warning: by updating, you will clear the page history" />
+ </div>
+ </form>
+ <div class="diff">
+ <div id="legend">
+ <h3>Legend:</h3>
+ <dl>
+ <dt class="add"></dt><dd>Added</dd><?cs
+ if:log.mode == "path_history" ?>
+ <dt class="rem"></dt><dd>Removed</dd><?cs
+ /if ?>
+ <dt class="mod"></dt><dd>Modified</dd>
+ <dt class="cp"></dt><dd>Copied or renamed</dd>
+ </dl>
+ </div>
</div>
-
<table id="chglist" class="listing">
<thead>
<tr>
+ <th class="change"></th>
<th class="data">Date</th>
<th class="rev">Rev</th>
<th class="chgset">Chgset</th>
@@ -32,22 +86,51 @@
<th class="summary">Log Message</th>
</tr>
</thead>
- <tbody>
- <?cs each:item = log.items ?>
+ <tbody><?cs
+ set:indent = #1 ?><?cs
+ each:item = log.items ?><?cs
+ if:item.copyfrom_path ?>
+ <tr class="<?cs if:name(item) % #2 ?>even<?cs else ?>odd<?cs /if ?>">
+ <td class="copyfrom_path" colspan="6" style="padding-left: <?cs var:indent ?>em">
+ copied from <a href="<?cs var:item.browser_href ?>"?><?cs var:item.copyfrom_path ?></a>:
+ </td>
+ </tr><?cs
+ set:indent = indent + #1 ?><?cs
+ elif:log.mode == "path_history" ?><?cs
+ set:indent = #1 ?><?cs
+ /if ?>
<tr class="<?cs if:name(item) % #2 ?>even<?cs else ?>odd<?cs /if ?>">
- <td class="date"><?cs var:item.date ?></td>
+ <td class="change" style="padding-left:<?cs var:indent ?>em">
+ <a title="View log starting at this revision" href="<?cs var:item.log_href ?>">
+ <div class="<?cs var:item.change ?>"></div>
+ <span class="comment">(<?cs var:item.change ?>)</span>
+ </a>
+ </td>
+ <td class="date"><?cs var:log.changes[item.rev].date ?></td>
<td class="rev">
- <a href="<?cs var:item.file_href ?>"><?cs var:item.rev ?></a>
+ <a href="<?cs var:item.browser_href ?>"><?cs var:item.rev ?></a>
</td>
<td class="chgset">
- <a class="block-link" href="<?cs var:item.changeset_href ?>"><?cs var:item.rev ?></a>
+ <a href="<?cs var:item.changeset_href ?>"><?cs var:item.rev ?></a>
</td>
- <td class="author"><?cs var:item.author ?></td>
- <td class="summary"><?cs var:item.log ?></td>
- </tr>
- <?cs /each ?>
+ <td class="author"><?cs var:log.changes[item.rev].author ?></td>
+ <td class="summary"><?cs var:log.changes[item.rev].message ?></td>
+ </tr><?cs
+ /each ?>
</tbody>
- </table>
+ </table><?cs
+ if:len(links.prev) || len(links.next) ?><div id="paging" class="nav"><ul><?cs
+ if:len(links.prev) ?><li class="first<?cs
+ if:!len(links.next) ?> last<?cs /if ?>">&larr; <a href="<?cs
+ var:links.prev.0.href ?>" title="<?cs
+ var:links.prev.0.title ?>">Younger Revisions</a></li><?cs
+ /if ?><?cs
+ if:len(links.next) ?><li class="<?cs
+ if:len(links.prev) ?>first <?cs /if ?>last"><a href="<?cs
+ var:links.next.0.href ?>" title="<?cs
+ var:links.next.0.title ?>">Older Revisions</a> &rarr;</li><?cs
+ /if ?></ul></div><?cs
+ /if ?>
</div>
<?cs include "footer.cs"?>
View
52 django_website/templates/trac_templates/log_rss.cs
@@ -1,31 +1,27 @@
<?xml version="1.0"?>
-<!-- RSS generated by Trac v<?cs var:$trac.version ?> on <?cs var:$trac.time ?> -->
+<!-- RSS generated by Trac v<?cs var:trac.version ?> on <?cs var:trac.time ?> -->
<rss version="2.0">
- <?cs set base_url = $HTTP.Protocol+'://'+$HTTP.Host ?>
- <?cs if $HTTP.Port ?>
- <?cs set base_url = $base_url + ':' + $HTTP.Port ?>
- <?cs /if ?>
- <channel>
- <?cs if $project.name.encoded ?>
- <title><?cs var:$project.name.encoded ?>: Revisions of <?cs var:$log.path ?></title>
- <?cs else ?>
- <title>Revisions of <?cs var:$log.filename ?></title>
- <?cs /if ?>
- <link><?cs var:$base_url ?><?cs var:$log.href ?></link>
- <description>Trac Log - Revisions of <?cs var:$log.path ?></description>
- <language>en-us</language>
- <generator>Trac v<?cs var:$trac.version ?></generator>
- <?cs each:item = $log.items ?>
- <item>
-<!-- XXX: author element requires email address in rss 2.0.
- maybe we should use the DC rdf stuff for metadata instead?
- <author><?cs var:$item.author ?></author> -->
- <pubDate><?cs var:$item.gmt ?></pubDate>
- <title><?cs var:$item.rev+': '+$item.shortlog ?></title>
- <link><?cs var:$base_url+$item.file_href ?></link>
- <description><?cs var:$item.log.raw ?></description>
- <category>Report</category>
- </item>
- <?cs /each ?>
- </channel>
+ <channel><?cs
+ if:project.name.encoded ?>
+ <title><?cs var:project.name.encoded ?>: Revisions of <?cs var:log.path ?></title><?cs
+ else ?>
+ <title>Revisions of <?cs var:log.path ?></title><?cs
+ /if ?>
+ <link><?cs var:base_host ?><?cs var:log.log_href ?></link>
+ <description>Trac Log - Revisions of <?cs var:log.path ?></description>
+ <language>en-us</language>
+ <generator>Trac v<?cs var:trac.version ?></generator><?cs
+ each:item = log.items ?><?cs
+ with:change = log.changes[item.rev] ?>
+ <item>
+ <author><?cs var:change.author ?></author>
+ <pubDate><?cs var:change.date ?></pubDate>
+ <title>Revision <?cs var:item.rev ?>: <?cs var:change.shortlog ?></title>
+ <link><?cs var:base_host ?><?cs var:item.changeset_href ?></link>
+ <description><?cs var:change.message ?></description>
+ <category>Report</category>
+ </item><?cs
+ /with ?><?cs
+ /each ?>
+ </channel>
</rss>
View
284 django_website/templates/trac_templates/macros.cs
@@ -1,207 +1,179 @@
-<?cs def:hdf_select(options, name, selected) ?>
+<?cs def:hdf_select(options, name, selected, optional) ?>
<select size="1" id="<?cs var:name ?>" name="<?cs var:name ?>"><?cs
- each:option = options ?><?cs
- if option.name == $selected ?>
- <option selected="selected"><?cs var:option.name ?></option><?cs
- else ?>
- <option><?cs var:option.name ?></option><?cs
- /if ?><?cs
+ if:optional ?><option></option><?cs /if ?><?cs
+ each:option = options ?>
+ <option<?cs if:option == selected ?> selected="selected"<?cs /if ?>><?cs
+ var:option ?></option><?cs
/each ?>
</select><?cs
/def?>
-<?cs def:hdf_select_multiple(options, name, size) ?>
- <select size="<?cs var:size ?>" id="<?cs var:name ?>" name="<?cs
- var:name ?>" multiple="multiple"><?cs
- each:option = options ?>
- <option<?cs if:option.selected ?> selected="selected"<?cs /if ?>><?cs
- var:option.name ?></option><?cs
- /each ?>
- </select><?cs
+<?cs def:labelled_hdf_select(label, options, name, selected, optional) ?><?cs
+ if:len(options) > #0 ?>
+ <label for="<?cs var:name ?>"><?cs var:label ?></label><?cs
+ call:hdf_select(options, name, selected, optional) ?>
+ </label>
+ <br /><?cs
+ /if ?><?cs
/def ?>
<?cs def:browser_path_links(path, file) ?><?cs
- set:first = #1 ?>
- <h1><?cs
+ set:first = #1 ?><?cs
each:part = path ?><?cs
set:last = name(part) == len(path) - #1 ?><a<?cs
if:first ?> class="first" title="Go to root directory"<?cs
set:first = #0 ?><?cs
- else ?> title="Go to directory"<?cs
- /if ?> href="<?cs var:part.url ?>"><?cs var:part ?></a><?cs
- if:file.filename || !last ?><span class="sep">/</span><?cs /if ?><?cs
+ else ?> title="View <?cs var:part.name ?>"<?cs
+ /if ?> href="<?cs var:part.href ?>"><?cs var:part.name ?></a><?cs
+ if:!last ?><span class="sep">/</span><?cs /if ?><?cs
/each ?><?cs
- if:file.filename ?><span class="filename"><?cs var:file.filename ?></span><?cs
- /if ?></h1>
-<?cs /def ?>
+/def ?>
-<?cs def:diff_display(change, style) ?><?cs
+<?cs def:diff_line_class(block, line) ?><?cs
+ set:first = name(line) == 0 ?><?cs
+ set:last = name(line) + 1 == len(block.lines) ?><?cs
+ if:first || last ?> class="<?cs
+ if:first ?>first<?cs /if ?><?cs
+ if:first && last ?> <?cs /if ?><?cs
+ if:last ?>last<?cs /if ?>"<?cs
+ /if ?><?cs
+/def ?>
+
+<?cs def:diff_display(diff, style) ?><?cs
if:style == 'sidebyside' ?><?cs
- each:block = change.blocks ?><?cs
- if:block.type == 'unmod' ?><tbody class="unmod"><?cs
- each:line = block.base.lines ?><tr>
- <th class="base"><?cs var:#block.base.offset + name(line) + 1 ?></th>
- <td class="base"><span><?cs var:line ?></span>&nbsp;</td>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + 1 ?></th>
- <td class="chg"><span><?cs var:line ?></span>&nbsp;</td>
- </tr><?cs /each ?>
- </tbody><?cs
+ each:block = diff ?><?cs
+ if:block.type == 'unmod' ?><tbody><?cs
+ each:line = block.base.lines ?><tr><th><?cs
+ var:#block.base.offset + name(line) + 1 ?></th><td class="l"><span><?cs
+ var:line ?></span>&nbsp;</td><th><?cs
+ var:#block.changed.offset + name(line) + 1 ?></th><td class="r"><span><?cs
+ var:block.changed.lines[name(line)] ?></span>&nbsp;</td></tr><?cs
+ /each ?></tbody><?cs
elif:block.type == 'mod' ?><tbody class="mod"><?cs
if:len(block.base.lines) >= len(block.changed.lines) ?><?cs
- each:line = block.base.lines ?><tr>
- <th class="base"><?cs var:#block.base.offset + name(line) + 1 ?></th>
- <td class="base"><?cs var:line ?>&nbsp;</td><?cs
+ each:line = block.base.lines ?><tr><th><?cs
+ var:#block.base.offset + name(line) + 1 ?></th><td class="l"><?cs
+ var:line ?>&nbsp;</td><?cs
if:len(block.changed.lines) >= name(line) + 1 ?><?cs
each:changedline = block.changed.lines ?><?cs
- if:name(changedline) == name(line) ?>
- <th class="chg"><?cs var:#block.changed.offset + name(changedline) + 1 ?></th>
- <td class="chg"><?cs var:changedline ?>&nbsp;</td><?cs
+ if:name(changedline) == name(line) ?><th><?cs
+ var:#block.changed.offset + name(changedline) + 1 ?></th><td class="r"><?cs
+ var:changedline ?>&nbsp;</td><?cs
/if ?><?cs
/each ?><?cs
- else ?>
- <th class="chg">&nbsp;</th>
- <td class="chg">&nbsp;</td><?cs
- /if ?>
- </tr><?cs /each ?><?cs
+ else ?><th>&nbsp;</th><td class="r">&nbsp;</td><?cs
+ /if ?></tr><?cs
+ /each ?><?cs
else ?><?cs
each:line = block.changed.lines ?><tr><?cs
if:len(block.base.lines) >= name(line) + 1 ?><?cs
each:baseline = block.base.lines ?><?cs
- if:name(baseline) == name(line) ?>
- <th class="base"><?cs var:#block.base.offset + name(baseline) + 1 ?></th>
- <td class="base"><?cs var:baseline ?>&nbsp;</td><?cs
+ if:name(baseline) == name(line) ?><th><?cs
+ var:#block.base.offset + name(baseline) + 1 ?></th><td class="l"><?cs
+ var:baseline ?>&nbsp;</td><?cs
/if ?><?cs
/each ?><?cs
- else ?>
- <th class="base">&nbsp;</th>
- <td class="base">&nbsp;</td><?cs
+ else ?><th>&nbsp;</th><td class="l">&nbsp;</td><?cs
/if ?>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + 1 ?></th>
- <td class="chg"><?cs var:line ?>&nbsp;</td>
- </tr><?cs /each ?><?cs
- /if ?>
- </tbody><?cs
+ <th><?cs var:#block.changed.offset + name(line) + 1 ?></th>
+ <td class="r"><?cs var:line ?>&nbsp;</td></tr><?cs
+ /each ?><?cs
+ /if ?></tbody><?cs
elif:block.type == 'add' ?><tbody class="add"><?cs
- each:line = block.changed.lines ?><tr>
- <th class="base">&nbsp;</th>
- <td class="base">&nbsp;</td>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + 1 ?></th>
- <td class="chg"><ins><?cs var:line ?></ins>&nbsp;</td>
- </tr><?cs /each ?><?cs
+ each:line = block.changed.lines ?><tr><th>&nbsp;</th><td class="l">&nbsp;</td><th><?cs
+ var:#block.changed.offset + name(line) + 1 ?></th><td class="r"><ins><?cs
+ var:line ?></ins>&nbsp;</td></tr><?cs
+ /each ?><?cs
elif:block.type == 'rem' ?><tbody class="rem"><?cs
- each:line = block.base.lines ?><tr>
- <th class="base"><?cs var:#block.base.offset + name(line) + 1 ?></th>
- <td class="base"><del><?cs var:line ?></del>&nbsp;</td>
- <th class="chg">&nbsp;</th>
- <td class="chg">&nbsp;</td>
- </tr><?cs /each ?><?cs
- /if ?>
- </tbody><?cs
+ each:line = block.base.lines ?><tr><th><?cs
+ var:#block.base.offset + name(line) + 1 ?></th><td class="l"><del><?cs
+ var:line ?></del>&nbsp;</td><th>&nbsp;</th><td class="r">&nbsp;</td></tr><?cs
+ /each ?><?cs
+ /if ?></tbody><?cs
/each ?><?cs
else ?><?cs
- each:block = change.blocks ?>
- <?cs if:block.type == 'unmod' ?><tbody class="unmod"><?cs
- each:line = block.base.lines ?><tr>
- <th class="base"><?cs var:#block.base.offset + name(line) + #1 ?></th>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + #1 ?></th>
- <td class="base"><span><?cs var:line ?></span>&nbsp;</td>
- </tr><?cs /each ?>
- </tbody>
- <?cs elif:block.type == 'mod' ?><tbody class="mod"><?cs
- each:line = block.base.lines ?><tr class="<?cs
- if:name(line) == 0 ?>first<?cs /if ?>">
- <th class="base"><?cs var:#block.base.offset + name(line) + #1 ?></th>
- <th class="chg">&nbsp;</th>
- <td class="base"><?cs var:line ?>&nbsp;</td>
- </tr><?cs /each ?><?cs
- each:line = block.changed.lines ?><tr class="<?cs
- if:name(line) + 1 == len(block.changed.lines) ?> last<?cs /if ?>">
- <th class="base">&nbsp;</th>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + #1 ?></th>
- <td class="chg"><?cs var:line ?>&nbsp;</td>
- </tr><?cs /each ?>
- </tbody>
- <?cs elif:block.type == 'add' ?><tbody class="add"><?cs
- each:line = block.changed.lines ?><tr class="<?cs
- if:name(line) == 0 ?>first<?cs /if ?><?cs
- if:name(line) + 1 == len(block.changed.lines) ?> last ?><?cs /if ?>">
- <th class="base">&nbsp;</th>
- <th class="chg"><?cs var:#block.changed.offset + name(line) + #1 ?></th>
- <td class="chg"><ins><?cs var:line ?></ins>&nbsp;</td>
- </tr><?cs /each ?>
- </tbody>
- <?cs elif:block.type == 'rem' ?><tbody class="rem"><?cs
- each:line = block.base.lines ?><tr class="<?cs
- if:name(line) == 0 ?>first<?cs /if ?><?cs
- if:name(line) + 1 == len(block.base.lines) ?> last ?><?cs /if ?>">
- <th class="base"><?cs var:#block.base.offset + name(line) + 1 ?></th>
- <th class="chg">&nbsp;</th>
- <td class="base"><del><?cs var:line ?></del>&nbsp;</td>
- </tr><?cs /each ?>
- </tbody>
- <?cs /if ?><?cs
+ each:block = diff ?><?cs
+ if:block.type == 'unmod' ?><tbody><?cs
+ each:line = block.base.lines ?><tr><th><?cs
+ var:#block.base.offset + name(line) + #1 ?></th><th><?cs
+ var:#block.changed.offset + name(line) + #1 ?></th><td class="l"><span><?cs
+ var:line ?></span>&nbsp;</td></tr><?cs
+ /each ?></tbody><?cs
+ elif:block.type == 'mod' ?><tbody class="mod"><?cs
+ each:line = block.base.lines ?><tr<?cs
+ if:name(line) == 0 ?> class="first"<?cs /if ?>><th><?cs
+ var:#block.base.offset + name(line) + #1 ?></th><th>&nbsp;</th><td class="l"><?cs
+ var:line ?>&nbsp;</td></tr><?cs
+ /each ?><?cs
+ each:line = block.changed.lines ?><tr<?cs
+ if:name(line) + 1 == len(block.changed.lines) ?> class="last"<?cs /if ?>><th>&nbsp;</th><th><?cs
+ var:#block.changed.offset + name(line) + #1 ?></th><td class="r"><?cs
+ var:line ?>&nbsp;</td></tr><?cs
+ /each ?></tbody><?cs
+ elif:block.type == 'add' ?><tbody class="add"><?cs
+ each:line = block.changed.lines ?><tr<?cs
+ call:diff_line_class(block.changed, line) ?>><th>&nbsp;</th><th><?cs
+ var:#block.changed.offset + name(line) + #1 ?></th><td class="r"><ins><?cs
+ var:line ?></ins>&nbsp;</td></tr><?cs
+ /each ?></tbody><?cs
+ elif:block.type == 'rem' ?><tbody class="rem"><?cs
+ each:line = block.base.lines ?><tr<?cs
+ call:diff_line_class(block.base, line) ?>><th><?cs
+ var:#block.base.offset + name(line) + 1 ?></th><th>&nbsp;</th><td class="l"><del><?cs
+ var:line ?></del>&nbsp;</td></tr><?cs
+ /each ?></tbody><?cs
+ /if ?><?cs
/each ?><?cs
/if ?><?cs
-/def ?>
-
-<?cs def:session_name_email() ?><?cs
- if trac.authname != "anonymous" ?><?cs
- var:trac.authname ?><?cs
- elif trac.session.var.name && trac.session.var.email ?><?cs
- var:trac.session.var.name ?> &lt;<?cs var:trac.session.var.email ?>&gt;<?cs
- elif !trac.session.var.name && trac.session.var.email ?><?cs
- var:trac.session.var.email ?><?cs
- else ?><?cs
- var:trac.authname ?><?cs
- /if ?><?cs
- /def ?>
+/def ?><?cs
-<?cs def:ticket_custom_props(ticket) ?><?cs
+def:ticket_custom_props(ticket) ?><?cs
each c=ticket.custom ?>
<div class="field custom_<?cs var c.name ?>"><?cs
- if c.type == 'text' || c.type == 'select' ?>
- <label for="custom_<?cs var c.name ?>"><?cs alt c.label ?><?cs
- var c.name ?><?cs /alt ?></label>:<?cs
- /if ?><?cs
if c.type == 'text' ?>
- <input type="text" id="custom_<?cs var c.name ?>" name="custom_<?cs
- var c.name ?>" value="<?cs var c.value ?>" /><?cs
+ <label>
+ <?cs alt c.label ?><?cs var c.name ?><?cs /alt ?>:
+ <input type="text" name="custom_<?cs var c.name ?>" value="<?cs var c.value ?>" />
+ </label><?cs
elif c.type == 'textarea' ?>
- <label for="custom_<?cs var c.name ?>"><?cs alt c.label ?><?cs
- var c.name ?><?cs /alt ?></label>:<br />
- <textarea cols="<?cs alt c.width ?>60<?cs /alt ?>" rows="<?cs
- alt c.height ?>12<?cs /alt ?>" name="custom_<?cs var c.name ?>"><?cs
- var c.value ?></textarea><?cs
+ <label>
+ <?cs alt c.label ?><?cs var c.name ?><?cs /alt ?>:<br />
+ <textarea cols="<?cs alt c.width ?>60<?cs /alt ?>" rows="<?cs
+ alt c.height ?>12<?cs /alt ?>" name="custom_<?cs var c.name ?>"><?cs
+ var c.value ?></textarea>
+ </label><?cs
elif c.type == 'checkbox' ?>
- <input type="hidden" name="checkbox_<?cs var c.name ?>" value="custom_<?cs
- var c.name ?>" />
- <input type="checkbox" id="custom_<?cs var c.name ?>" name="custom_<?cs
- var c.name ?>" value="1" <?cs if c.selected ?>checked="checked"<?cs /if ?> />
- <label for="custom_<?cs var c.name ?>"><?cs alt c.label ?><?cs
- var c.name ?><?cs /alt ?></label><?cs
+ <input type="hidden" name="checkbox_<?cs var c.name ?>" />
+ <label>
+ <input type="checkbox" name="custom_<?cs var c.name ?>" value="1"<?cs
+ if c.selected ?> checked="checked"<?cs /if ?> />
+ <?cs alt c.label ?><?cs var c.name ?><?cs /alt ?>
+ </label><?cs
elif c.type == 'select' ?>
- <select name="custom_<?cs var c.name ?>"><?cs each v = c.option ?>
- <option <?cs if v.selected ?>selected="selected"<?cs /if ?>><?cs
- var v ?></option><?cs /each ?>
- </select><?cs
+ <label>
+ <?cs alt c.label ?><?cs var c.name ?><?cs /alt ?>:
+ <select name="custom_<?cs var c.name ?>"><?cs each v = c.option ?>
+ <option<?cs if v.selected ?> selected="selected"<?cs /if ?>><?cs
+ var v ?></option><?cs /each ?>
+ </select>
+ </label><?cs
elif c.type == 'radio' ?>
<fieldset class="radio">
<legend><?cs alt c.label ?><?cs var c.name ?><?cs /alt ?>:</legend><?cs
each v = c.option ?>
- <input type="radio" id="custom_<?cs var c.name ?>_<?cs
- var v ?>" name="custom_<?cs var c.name ?>"<?cs
- if v.selected ?> checked="checked"<?cs /if ?> value="<?cs var v ?>"/>
- <label for="custom_<?cs var c.name ?>_<?cs var v ?>"><?cs
- var v ?></label><?cs
+ <label><input type="radio" name="custom_<?cs var c.name ?>" value="<?cs
+ var v ?>"<?cs if v.selected ?> checked="checked"<?cs /if ?> /> <?cs
+ var v ?></label><?cs
/each ?>
</fieldset><?cs
/if ?>
</div><?cs
/each ?><?cs
-/def ?>
+/def ?><?cs
-<?cs def:wiki_toolbar(textarea_id) ?>
-<script type='text/javascript'>
- addWikiFormattingToolbar(document.getElementById("<?cs var:textarea_id ?>"));
-</script>
-<?cs /def ?>
+def:sortable_th(order, desc, class, title, href) ?>
+ <th class="<?cs var:class ?><?cs if:order == class ?> <?cs if:desc ?>desc<?cs else ?>asc<?cs /if ?><?cs /if ?>">
+ <a title="Sort by <?cs var:class ?><?cs if:order == class && !desc ?> (descending)<?cs /if ?>"
+ href="<?cs var:href ?>&order=<?cs var:class ?><?cs if:order == class && !desc ?>&desc=1<?cs /if ?>"><?cs var:title ?></a>
+ </th><?cs
+/def ?>
View
274 django_website/templates/trac_templates/milestone.cs
@@ -2,14 +2,7 @@
<?cs include:"header.cs"?>
<?cs include:"macros.cs"?>
-<div id="ctxtnav" class="nav">
- <ul>
- <?cs if:milestone.href.edit ?><li class="first"><a href="<?cs
- var:milestone.href.edit ?>">Edit Milestone Info</a></li><?cs /if ?>
- <?cs if:milestone.href.delete ?><li class="last"><a href="<?cs
- var:milestone.href.delete ?>">Delete Milestone</a></li><?cs /if ?>
- </ul>
-</div>
+<div id="ctxtnav" class="nav"></div>
<div id="content" class="milestone">
<?cs if:milestone.mode == "new" ?>
@@ -20,76 +13,78 @@
<h1>Delete Milestone <?cs var:milestone.name ?></h1>
<?cs else ?>
<h1>Milestone <?cs var:milestone.name ?></h1>
- <form action="#stats" id="prefs" method="get">
- <div>
- <label for="by">View status by</label>
- <select id="by" name="by"><?cs each:group = milestone.stats.available_groups ?>
- <option<?cs
- if:milestone.stats.grouped_by == group?> selected="selected"<?cs
- /if ?>><?cs var:group ?></option>
- <?cs /each ?></select>
- <div>
- <input name="showempty" id="showempty" type="checkbox"<?cs
- if:milestone.stats.show_empty ?> checked="checked"<?cs /if ?>>
- <label for="showempty">Show groups with no assigned tickets</label>
- </div>
- <div class="buttons">
- <input type="submit" value="Update" />
- </div>
- </div>
- </form>
<?cs /if ?>
<?cs if:milestone.mode == "edit" || milestone.mode == "new" ?>
<script type="text/javascript">
addEvent(window, 'load', function() {
- document.getElementById('name').focus() }
- );
+ document.getElementById('name').focus();
+ });
</script>
- <form id="edit" action="<?cs var:cgi_location ?>" method="post">
- <input type="hidden" name="mode" value="milestone" />
+ <form id="edit" action="<?cs var:milestone.href ?>" method="post">
<input type="hidden" name="id" value="<?cs var:milestone.name ?>" />
- <input type="hidden" name="action" value="commit_changes" />
+ <input type="hidden" name="action" value="edit" />
<div class="field">
- <label for="name">Name of the milestone:</label><br />
+ <label>Name of the milestone:<br />
<input type="text" id="name" name="name" size="32" value="<?cs
- var:milestone.name ?>" />
- </div>
- <div class="field">
- <label for="datemode">Completion date:</label><br />
- <select name="datemode" id="datemode"
- onchange="enableControl('date',this.value=='manual');
- if (this.value=='manual') document.getElementById('date').focus();">
- <option value="manual">Set manually</option>
- <option value="now">Mark as completed now</option>
- </select>
- <input type="text" id="date" name="date" size="8" value="<?cs
- var:milestone.date ?>" title="Format: <?cs var:milestone.date_hint ?>" />
- <label for="date"><em>Format: <?cs var:milestone.date_hint ?></em></label>
+ var:milestone.name ?>" /></label>
</div>
+ <fieldset>
+ <legend>Schedule</legend>
+ <label>Due:<br />
+ <input type="text" id="duedate" name="duedate" size="<?cs
+ var:len(milestone.date_hint) ?>" value="<?cs
+ var:milestone.due_date ?>" title="Format: <?cs var:milestone.date_hint ?>" />
+ <em>Format: <?cs var:milestone.date_hint ?></em>
+ </label>
+ <div class="field">
+ <label>
+ <input type="checkbox" id="completed" name="completed"<?cs
+ if:milestone.completed ?> checked="checked"<?cs /if ?> />
+ Completed:<br />
+ </label>
+ <label>
+ <input type="text" id="completeddate" name="completeddate" size="<?cs
+ var:len(milestone.date_hint) ?>" value="<?cs
+ alt:milestone.completed_date ?><?cs
+ var:milestone.datetime_now ?><?cs
+ /alt ?>" title="Format: <?cs
+ var:milestone.datetime_hint ?>" />
+ <em>Format: <?cs var:milestone.datetime_hint ?></em>
+ </label>
+ <script type="text/javascript">
+ var completed = document.getElementById("completed");
+ var enableCompletedDate = function() {
+ enableControl("completeddate", completed.checked);
+ };
+ addEvent(window, "load", enableCompletedDate);
+ addEvent(completed, "click", enableCompletedDate);
+ </script>
+ </div>
+ </fieldset>
<div class="field">
<fieldset class="iefix">
- <label for="descr">Description (you may use <a tabindex="42" href="<?cs
+ <label for="description">Description (you may use <a tabindex="42" href="<?cs
var:trac.href.wiki ?>/WikiFormatting">WikiFormatting</a> here):</label>
- <p><textarea id="descr" name="descr" rows="12" cols="80"><?cs
- var:milestone.descr_source ?></textarea></p>
- <?cs call:wiki_toolbar('descr') ?>
+ <p><textarea id="description" name="description" class="wikitext" rows="10" cols="78"><?cs
+ var:milestone.description_source ?></textarea></p>
</fieldset>
</div>
<div class="buttons">
<?cs if:milestone.mode == "new"
- ?><input type="submit" name="save" value="Add Milestone" /><?cs
+ ?><input type="submit" value="Add milestone" /><?cs
else
- ?><input type="submit" name="save" value="Save Changes" /><?cs
+ ?><input type="submit" value="Submit changes" /><?cs
/if ?>
<input type="submit" name="cancel" value="Cancel" />
</div>
+ <script type="text/javascript" src="<?cs
+ var:htdocs_location ?>js/wikitoolbar.js"></script>
</form>
<?cs elif:milestone.mode == "delete" ?>
- <form action="<?cs var:cgi_location ?>" method="post">
- <input type="hidden" name="mode" value="milestone" />
+ <form action="<?cs var:milestone.href ?>" method="post">
<input type="hidden" name="id" value="<?cs var:milestone.name ?>" />
- <input type="hidden" name="action" value="confirm_delete" />
+ <input type="hidden" name="action" value="delete" />
<p><strong>Are you sure you want to delete this milestone?</strong></p>
<input type="checkbox" id="retarget" name="retarget" checked="checked"
onclick="enableControl('target', this.checked)"/>
@@ -102,71 +97,122 @@
</select>
<div class="buttons">
<input type="submit" name="cancel" value="Cancel" />
- <input type="submit" name="delete" value="Delete Milestone" />
+ <input type="submit" value="Delete milestone" />
</div>
</form>
<?cs else ?>
- <em class="date"><?cs if:milestone.date ?>
- <?cs var:milestone.date ?><?cs else ?>No date set<?cs /if ?>
- </em>
- <div class="descr"><?cs var:milestone.descr ?></div>
- <?cs /if ?>
-
<?cs if:milestone.mode == "view" ?>
- <h2 class="stats">Status by <?cs var:milestone.stats.grouped_by ?></h2>
- <table class="listing" id="stats"
- summary="Shows the milestone completion status grouped by <?cs
- var:milestone.stats.grouped_by ?>">
- <thead><tr>
- <th class="name" rowspan="2"><?cs var:milestone.stats.grouped_by ?></th>
- <th class="tickets" scope="col" colspan="2">Tickets</th>
- <th class="progress" rowspan="2">Percent Resolved</th>
- </tr><tr>
- <th class="open" scope="col">Active</th>
- <th class="closed" scope="col">Closed</th>
- </tr></thead>
- <?cs if:len(milestone.stats.groups) ?><tbody>
- <?cs each:group = milestone.stats.groups ?>
- <tr class="<?cs if:name(group) % 2 ?>odd<?cs else ?>even<?cs /if ?>">
- <th class="name" scope="row"><a href="<?cs
- var:group.queries.all_tickets ?>"><?cs var:group.name ?></a></th>
- <td class="open tickets"><a href="<?cs
- var:group.queries.active_tickets ?>"><?cs
- var:group.active_tickets ?></a></td>
- <td class="closed tickets"><a href="<?cs
- var:group.queries.closed_tickets ?>"><?cs
- var:group.closed_tickets ?></a></td>
- <td class="progress">
- <?cs if:#group.total_tickets ?>
- <div class="progress" style="width: <?cs
- var:#group.percent_total * #80 / #100 ?>%"><div style="width: <?cs
- var:#group.percent_complete ?>%"></div>
- </div>
- <p class="percent"><?cs var:#group.percent_complete ?>%</p>
- <?cs /if ?>
- </td>
- </tr>
- <?cs /each ?>
- </tbody><?cs /if ?>
- <tbody class="totals"><tr>
- <th class="name" scope="row"><a href="<?cs
- var:milestone.queries.all_tickets ?>">Total</a></th>
- <td class="open tickets"><a href="<?cs
- var:milestone.queries.active_tickets ?>"><?cs
- var:milestone.stats.active_tickets ?></a></td>
- <td class="closed tickets"><a href="<?cs
- var:milestone.queries.closed_tickets ?>"><?cs
- var:milestone.stats.closed_tickets ?></a></td>
- <td class="progress">
- <?cs if:#milestone.stats.total_tickets ?>
- <div class="progress" style="width: 80%">
- <div style="width: <?cs var:#milestone.stats.percent_complete ?>%"></div>
+ <div class="info">
+ <p class="date"><?cs
+ if:milestone.completed_date ?>
+ Completed <?cs var:milestone.completed_delta ?> ago (<?cs var:milestone.completed_date ?>)<?cs
+ elif:milestone.due_date ?><?cs
+ if:milestone.late ?>
+ <strong><?cs var:milestone.due_delta ?> late</strong><?cs
+ else ?>
+ Due in <?cs var:milestone.due_delta ?><?cs
+ /if ?> (<?cs var:milestone.due_date ?>)<?cs
+ else ?>
+ No date set<?cs
+ /if ?>
+ </p><?cs
+ with:stats = milestone.stats ?><?cs
+ if:#stats.total_tickets > #0 ?>
+ <div class="progress">
+ <a class="closed" href="<?cs
+ var:milestone.queries.closed_tickets ?>" style="width: <?cs
+ var:#stats.percent_closed ?>%" title="<?cs
+ var:#stats.closed_tickets ?> of <?cs
+ var:#stats.total_tickets ?> ticket<?cs
+ if:#stats.total_tickets != #1 ?>s<?cs /if ?> closed"></a>
+ <a class="open" href="<?cs
+ var:milestone.queries.active_tickets ?>" style="width: <?cs
+ var:#stats.percent_active ?>%" title="<?cs
+ var:#stats.active_tickets ?> of <?cs
+ var:#stats.total_tickets ?> ticket<?cs
+ if:#stats.total_tickets != #1 ?>s<?cs /if ?> active"></a>
</div>
- <p class="percent"><?cs var:#milestone.stats.percent_complete ?>%</p>
- <?cs /if ?>
- </td>
- </tr></tbody>
- </table><?cs /if ?>
+ <p class="percent"><?cs var:#stats.percent_closed ?>%</p>
+ <dl>
+ <dt>Closed tickets:</dt>
+ <dd><a href="<?cs var:milestone.queries.closed_tickets ?>"><?cs
+ var:stats.closed_tickets ?></a></dd>
+ <dt>Active tickets:</dt>
+ <dd><a href="<?cs var:milestone.queries.active_tickets ?>"><?cs
+ var:stats.active_tickets ?></a></dd>
+ </dl><?cs
+ /if ?><?cs
+ /with ?>
+ </div>
+ <form id="stats" method="get">
+ <fieldset><?cs
+ if:milestone.id_param ?>
+ <input type="hidden" name="id" value="<?cs var:milestone.name ?>" /><?cs
+ /if ?>
+ <legend>
+ <label for="by">Ticket status by</label>
+ <select id="by" name="by" onchange="this.form.submit()"><?cs
+ each:group = milestone.stats.available_groups ?>
+ <option value="<?cs var:group.name ?>" <?cs
+ if:milestone.stats.grouped_by == group.name ?> selected="selected"<?cs
+ /if ?>><?cs var:group.label ?></option><?cs
+ /each ?></select>
+ <noscript><input type="submit" value="Update" /></noscript>
+ </legend>
+ <table summary="Shows the milestone completion status grouped by <?cs
+ var:milestone.stats.grouped_by ?>"><?cs
+ each:group = milestone.stats.groups ?>
+ <tr>
+ <th scope="row"><a href="<?cs
+ var:group.queries.all_tickets ?>"><?cs var:group.name ?></a></th>
+ <td nowrap=nowrap><?cs if:#group.total_tickets ?>
+ <div class="progress" style="width: <?cs
+ var:#group.percent_total * #80 / #milestone.stats.max_percent_total ?>%">
+ <a class="closed" href="<?cs
+ var:group.queries.closed_tickets ?>" style="width: <?cs
+ var:#group.percent_closed ?>%" title="<?cs
+ var:group.closed_tickets ?> of <?cs
+ var:group.total_tickets ?> ticket<?cs
+ if:group.total_tickets != #1 ?>s<?cs /if ?> closed"></a>
+ <a class="open" href="<?cs
+ var:group.queries.active_tickets ?>" style="width: <?cs
+ var:#group.percent_active - 1 ?>%" title="<?cs
+ var:group.active_tickets ?> of <?cs
+ var:group.total_tickets ?> ticket<?cs
+ if:group.total_tickets != 1 ?>s<?cs /if ?> active"></a>
+ </div>
+ <p class="percent"><?cs var:group.closed_tickets ?>/<?cs
+ var:group.total_tickets ?></p>
+ <?cs /if ?></td>
+ </tr><?cs
+ /each ?>
+ </table><?cs /if ?>
+ </fieldset>
+ </form>
+ <div class="description"><?cs var:milestone.description ?></div><?cs
+ if:trac.acl.MILESTONE_MODIFY || trac.acl.MILESTONE_DELETE ?>
+ <div class="buttons"><?cs
+ if:trac.acl.MILESTONE_MODIFY ?>
+ <form method="get" action=""><div>
+ <input type="hidden" name="action" value="edit" /><?cs
+ if:milestone.id_param ?>
+ <input type="hidden" name="id" value="<?cs var:milestone.name ?>" /><?cs
+ /if ?>
+ <input type="submit" value="Edit milestone info" />
+ </div></form><?cs
+ /if ?><?cs
+ if:trac.acl.MILESTONE_DELETE ?>
+ <form method="get" action=""><div>
+ <input type="hidden" name="action" value="delete" /><?cs
+ if:milestone.id_param ?>
+ <input type="hidden" name="id" value="<?cs var:milestone.name ?>" /><?cs
+ /if ?>
+ <input type="submit" value="Delete milestone" />
+ </div></form><?cs
+ /if ?>
+ </div><?cs
+ /if ?><?cs
+ /if ?>
<div id="help">
<strong>Note:</strong> See <a href="<?cs
View
112 django_website/templates/trac_templates/newticket.cs
@@ -9,8 +9,9 @@
<div id="content" class="ticket">
-<h3>Create New Ticket:</h3>
-<form id="newticket" action="<?cs var:cgi_location ?>#preview" method="post">
+<h1>Create New Ticket</h1>
+<form id="newticket" method="post" action="<?cs
+ var:trac.href.newticket ?>#preview">
<div class="field">
<label for="reporter">Your email or username:</label><br />
<input type="text" id="reporter" name="reporter" size="40" value="<?cs
@@ -18,14 +19,20 @@
</div>
<div class="field">
<label for="summary">Short summary:</label><br />
- <input id="summary" type="text" name="summary" size="80" value="<?cs var:newticket.summary ?>"/>
- </div>
+ <input id="summary" type="text" name="summary" size="80" value="<?cs
+ var:newticket.summary ?>"/>
+ </div><?cs
+ if:len(newticket.fields.type.options) ?>
+ <div class="field"><label for="type">Type:</label> <?cs
+ call:hdf_select(newticket.fields.type.options, 'type',
+ newticket.type, 0) ?>
+ </div><?cs
+ /if ?>
<div class="field">
<label for="description">Full description (you may use <a tabindex="42" href="<?cs
var:$trac.href.wiki ?>/WikiFormatting">WikiFormatting</a> here):</label><br />
- <textarea id="description" name="description" rows="10" cols="78"><?cs
+ <textarea id="description" name="description" class="wikitext" rows="10" cols="78"><?cs
var:newticket.description ?></textarea><?cs
- call:wiki_toolbar('description') ?><?cs
if:newticket.description_preview ?>
<fieldset id="preview">
<legend>Description Preview</legend>
@@ -36,49 +43,72 @@
<fieldset id="properties">
<legend>Ticket Properties</legend>
- <input type="hidden" name="mode" value="newticket" />
<input type="hidden" name="action" value="create" />
<input type="hidden" name="status" value="new" />
- <div class="col1">
- <label for="component">Component:</label><?cs
- call:hdf_select(newticket.components, "component", newticket.component) ?>
- <br />
- <label for="version">Version:</label><?cs
- call:hdf_select(newticket.versions, "version", newticket.version) ?>
- <br />
- <label for="severity">Severity:</label><?cs
- call:hdf_select(enums.severity, "severity", newticket.severity) ?>
- <br />
- <label for="keywords">Keywords:</label>
- <input type="text" id="keywords" name="keywords" size="20"
- value="<?cs var:newticket.keywords ?>" />
- </div>
- <div class="col2">
- <label for="priority">Priority:</label><?cs
- call:hdf_select(enums.priority, "priority", newticket.priority) ?><br />
- <label for="milestone">Milestone:</label><?cs
- call:hdf_select(newticket.milestones, "milestone", newticket.milestone) ?><br />
- <label for="owner">Assign to:</label>
- <input type="text" id="owner" name="owner" size="20" value="<?cs
- var:newticket.owner ?>" /><br />
- <label for="cc">Cc:</label>
- <input type="text" id="cc" name="cc" size="30" value="<?cs var:newticket.cc ?>" />
- </div>
- <?cs if:len(ticket.custom) ?><div class="custom">
- <?cs call:ticket_custom_props(ticket) ?>
- </div><?cs /if ?>
+ <table><tr><?cs set:num_fields = 0 ?><?cs
+ each:field = newticket.fields ?><?cs
+ if:!field.skip ?><?cs
+ set:num_fields = num_fields + 1 ?><?cs
+ /if ?><?cs
+ /each ?><?cs set:idx = 0 ?><?cs
+ each:field = newticket.fields ?><?cs
+ if:!field.skip ?><?cs set:fullrow = field.type == 'textarea' ?><?cs
+ if:fullrow && idx % 2 ?><?cs set:idx = idx + 1 ?><th class="col2"></th><td></td></tr><tr><?cs /if ?>
+ <th class="col<?cs var:idx % 2 + 1 ?>"><?cs
+ if:field.type != 'radio' ?><label for="<?cs var:name(field) ?>"><?cs
+ /if ?><?cs alt:field.label ?><?cs var:field.name ?><?cs /alt ?>:<?cs
+ if:field.type != 'radio' ?></label><?cs /if ?></th>
+ <td<?cs if:fullrow ?> colspan="3"<?cs /if ?>><?cs
+ if:field.type == 'text' ?><input type="text" id="<?cs
+ var:name(field) ?>" name="<?cs
+ var:name(field) ?>" value="<?cs var:newticket[name(field)] ?>" /><?cs
+ elif:field.type == 'select' ?><select id="<?cs
+ var:name(field) ?>" name="<?cs var:name(field) ?>"><?cs
+ if:field.optional ?><option></option><?cs /if ?><?cs
+ each:option = field.options ?><option<?cs
+ if:option == newticket[name(field)] ?> selected="selected"<?cs /if ?>><?cs
+ var:option ?></option><?cs
+ /each ?></select><?cs
+ elif:field.type == 'checkbox' ?><input type="hidden" name="checkbox_<?cs
+ var:name(field) ?>" /><input type="checkbox" id="<?cs
+ var:name(field) ?>" name="<?cs
+ var:name(field) ?>" value="1"<?cs
+ if:newticket[name(field)] ?> checked="checked"<?cs /if ?> /><?cs
+ elif:field.type == 'textarea' ?><textarea id="<?cs
+ var:name(field) ?>" name="<?cs
+ var:name(field) ?>"<?cs
+ if:field.height ?> rows="<?cs var:field.height ?>"<?cs /if ?><?cs
+ if:field.width ?> cols="<?cs var:field.width ?>"<?cs /if ?>><?cs
+ var:newticket[name(field)] ?></textarea><?cs
+ elif:field.type == 'radio' ?><?cs set:optidx = 0 ?><?cs
+ each:option = field.options ?><label><input type="radio" id="<?cs
+ var:name(field) ?>" name="<?cs
+ var:name(field) ?>" value="<?cs var:option ?>"<?cs
+ if:ticket[name(field)] == option ?> checked="checked"<?cs /if ?> /> <?cs
+ var:option ?></label> <?cs set:optidx = optidx + 1 ?><?cs
+ /each ?><?cs
+ /if ?></td><?cs
+ if:idx % 2 || fullrow ?></tr><tr><?cs
+ elif:idx == num_fields - 1 ?><th class="col2"></th><td></td><?cs
+ /if ?><?cs set:idx = idx + #fullrow + 1 ?><?cs
+ /if ?><?cs
+ /each ?></tr>
+ </table>
</fieldset>
+ <script type="text/javascript" src="<?cs
+ var:htdocs_location ?>js/wikitoolbar.js"></script>
+
<div class="buttons">
- <input type="submit" value="Preview" />&nbsp;
- <input type="submit" name="create" value="Submit ticket" />
+ <input type="submit" name="preview" value="Preview" />&nbsp;
+ <input type="submit" value="Submit ticket" />
</div>
</form>
- <div id="help">
- <strong>Note:</strong> See <a href="<?cs var:$trac.href.wiki
- ?>/TracTickets">TracTickets</a> for help on using tickets.
- </div>
+<div id="help">
+ <strong>Note:</strong> See <a href="<?cs
+ var:trac.href.wiki ?>/TracTickets">TracTickets</a> for help on using tickets.
+</div>
</div>
<?cs include "footer.cs" ?>
View
354 django_website/templates/trac_templates/query.cs
@@ -2,161 +2,231 @@
<?cs include:"header.cs" ?>
<?cs include:"macros.cs" ?>
-<div id="ctxtnav" class="nav"><?cs if:query.edit_href ?>
- <ul>
- <li class="last"><a href="<?cs var:query.edit_href ?>">Refine Query</a></li>
- </ul>
-<?cs /if ?></div>
+<div id="ctxtnav" class="nav"><?cs
+ if:query.report_href ?><ul>
+ <li class="first"><a href="<?cs
+ var:query.report_href ?>">Available Reports</a></li>
+ <li class="last">Custom Query</li></ul><?cs
+ /if ?>
+</div>
<div id="content" class="query">
- <h1><?cs var:title ?></h1>
-
-<?cs if:query.action == 'edit' ?>
+ <h1><?cs var:title ?> <span class="numrows">(<?cs alt:len(query.results) ?>No<?cs /alt ?> match<?cs
+ if:len(query.results) != 1 ?>es<?cs /if ?>)</span></h1>
-<form id="query" action="<?cs var:cgi_location ?>" method="post">
- <fieldset>
- <input type="hidden" name="mode" value="query" />
- <input type="hidden" name="order" value="<?cs var:query.order ?>" />
- <?cs if:query.desc ?><input type="hidden" name="desc" value="1" /><?cs /if ?>
- <legend>Ticket Properties</legend>
- <div>
- <label for="component" accesskey="c">Component:</label>
- <?cs call:hdf_select_multiple(query.options.component, 'component', 4) ?>
- </div>
- <div>
- <label for="version" accesskey="v">Version:</label>
- <?cs call:hdf_select_multiple(query.options.version, 'version', 4) ?>
- </div>
- <div>
- <label for="severity" accesskey="e">Severity:</label>
- <?cs call:hdf_select_multiple(query.options.severity, 'severity', 4) ?>
- </div>
- <br />
- <div>
- <label for="keywords">Keywords contain:</label>
- <input type="text" name="keywords" id="keywords" accesskey="k" value="<?cs
- var:query.constraints.keywords.0 ?>" />
- </div>
- <br />
- <div>
- <label for="status" accesskey="s">Status:</label>
- <?cs call:hdf_select_multiple(query.options.status, 'status', 4) ?>
- </div>
- <div>
- <label for="resolution" accesskey="r">Resolution:</label>
- <?cs call:hdf_select_multiple(query.options.resolution, 'resolution', 4) ?>
- <script type="text/javascript">
- var status = document.getElementById("status");
- var updateResolution = function() {
- enableControl('resolution', status.selectedIndex == -1 ||
- status.selectedIndex >= 3);
- };
- addEvent(window, 'load', updateResolution);
- addEvent(status, 'change', updateResolution);
- </script>
- </div>
- <div>
- <label for="milestone" accesskey="m">Milestone:</label>
- <?cs call:hdf_select_multiple(query.options.milestone, 'milestone', 4) ?>
- </div>
- <div>
- <label for="priority" accesskey="p">Priority:</label>
- <?cs call:hdf_select_multiple(query.options.priority, 'priority', 4) ?>
- </div>
- <br />
- <div>
- <label for="owner">Assigned to:</label>
- <input type="text" name="owner" id="owner" accesskey="a" value="<?cs
- var:query.constraints.owner.0 ?>" />
- </div>
- <div>
- <label for="reporter">Reported by:</label>
- <input type="text" name="reporter" id="reporter" accesskey="b" value="<?cs
- var:query.constraints.reporter.0 ?>" />
- </div>
- <div>
- <label for="cc">Cc contains:</label>
- <input type="text" name="cc" id="cc" value="<?cs
- var:query.constraints.cc.0 ?>" />
- </div>
- <?cs if:len(query.custom) ?><?cs set:idx = 0 ?><?cs
- each:custom = query.custom ?><?cs
- if:custom.type == 'select' || custom.type == 'radio' ?>
- <?cs if:idx == 0 ?><br /><?cs /if ?><div>
- <label for="<?cs var:custom.name ?>"><?cs var:custom.label ?></label>
- <?cs call:hdf_select_multiple(custom.options, custom.name, 4) ?>
- </div><?cs set:idx = idx + 1 ?><?cs
+<form id="query" method="post" action="<?cs var:trac.href.query ?>">
+ <fieldset id="filters">
+ <legend>Filters</legend>
+ <?cs def:checkbox_checked(constraint, option) ?><?cs
+ each:value = constraint.values ?><?cs
+ if:value == option ?> checked="checked"<?cs
/if ?><?cs
- /each ?><?cs set:idx = 0 ?><?cs
- each:custom = query.custom ?><?cs
- if:custom.type == 'text' ?>
- <?cs if:idx == 0 ?><br /><?cs /if ?><div>
- <label for="<?cs var:custom.name ?>"><?cs var:custom.label ?></label>
- <input type="text" name="<?cs var:custom.name ?>" id="<?cs
- var:custom.name ?>" value="<?cs var:query[custom.name] ?>" />
- </div><?cs set:idx = idx + 1 ?><?cs
+ /each ?><?cs
+ /def ?><?cs
+ def:option_selected(constraint, option) ?><?cs
+ each:value = constraint.values ?><?cs
+ if:value == option ?> selected="selected"<?cs
/if ?><?cs
/each ?><?cs
- /if ?>
- <br />
+ /def ?>
+ <table summary="Query filters"><?cs each:field = query.fields ?><?cs
+ each:constraint = query.constraints ?><?cs
+ if:name(field) == name(constraint) ?>
+ <tbody><tr class="<?cs var:name(field) ?>">
+ <th scope="row"><label><?cs var:field.label ?></label></th><?cs
+ if:field.type != "radio" ?>
+ <td class="mode">
+ <select name="<?cs var:name(field) ?>_mode"><?cs
+ each:mode = query.modes[field.type] ?>
+ <option value="<?cs var:mode.value ?>"<?cs
+ if:mode.value == constraint.mode ?> selected="selected"<?cs
+ /if ?>><?cs var:mode.name ?></option><?cs
+ /each ?>
+ </select>
+ </td><?cs
+ /if ?>
+ <td class="filter"<?cs if:field.type == "radio" ?> colspan="2"<?cs /if ?>><?cs
+ if:field.type == "select" ?><?cs
+ each:value = constraint.values ?>
+ <select name="<?cs var:name(constraint) ?>"><option></option><?cs
+ each:option = field.options ?>
+ <option<?cs if:option == value ?> selected="selected"<?cs /if ?>><?cs
+ var:option ?></option><?cs
+ /each ?></select><?cs
+ if:name(value) != len(constraint.values) - 1 ?>
+ </td>
+ <td class="actions"><input type="submit" name="rm_filter_<?cs
+ var:name(field) ?>_<?cs var:name(value) ?>" value="-" /></td>
+ </tr><tr class="<?cs var:name(field) ?>">
+ <th colspan="2"><label>or</label></th>
+ <td class="filter"><?cs
+ /if ?><?cs
+ /each ?><?cs
+ elif:field.type == "radio" ?><?cs
+ each:option = field.options ?>
+ <input type="checkbox" id="<?cs var:name(field) ?>_<?cs
+ var:option ?>" name="<?cs var:name(field) ?>" value="<?cs
+ var:option ?>"<?cs call:checkbox_checked(constraint, option) ?> />
+ <label for="<?cs var:name(field) ?>_<?cs var:option ?>"><?cs
+ alt:option ?>none<?cs /alt ?></label><?cs
+ /each ?><?cs
+ elif:field.type == "text" ?><?cs
+ each:value = constraint.values ?>
+ <input type="text" name="<?cs var:name(field) ?>" value="<?cs
+ var:value ?>" size="42" /><?cs
+ if:name(value) != len(constraint.values) - 1 ?>
+ </td>
+ <td class="actions"><input type="submit" name="rm_filter_<?cs
+ var:name(field) ?>_<?cs var:name(value) ?>" value="-" /></td>
+ </tr><tr class="<?cs var:name(field) ?>">
+ <th colspan="2"><label>or</label></th>
+ <td class="filter"><?cs
+ /if ?><?cs
+ /each ?><?cs
+ /if ?>
+ </td>
+ <td class="actions"><input type="submit" name="rm_filter_<?cs
+ var:name(field) ?><?cs
+ if:field.type != 'radio' ?>_<?cs
+ var:len(constraint.values) - 1 ?><?cs
+ /if ?>" value="-" /></td>
+ </tr></tbody><?cs /if ?><?cs
+ /each ?><?cs
+ /each ?>
+ <tbody><tr class="actions">
+ <td class="actions" colspan="4" style="text-align: right">
+ <label for="add_filter">Add filter</label>&nbsp;
+ <select name="add_filter" id="add_filter">
+ <option></option><?cs
+ each:field = query.fields ?>
+ <option value="<?cs var:name(field) ?>"<?cs
+ if:field.type == "radio" ?><?cs
+ if:len(query.constraints[name(field)]) != 0 ?> disabled="disabled"<?cs
+ /if ?><?cs
+ /if ?>><?cs var:field.label ?></option><?cs
+ /each ?>
+ </select>
+ <input type="submit" name="add" value="+" />
+ </td>
+ </tr></tbody>
+ </table>
</fieldset>
+ <p class="option">
+ <label for="group">Group results by</label>
+ <select name="group" id="group">
+ <option></option><?cs
+ each:field = query.fields ?><?cs
+ if:field.type == 'select' || field.type == 'radio' ||
+ name(field) == 'owner' ?>
+ <option value="<?cs var:name(field) ?>"<?cs
+ if:name(field) == query.group ?> selected="selected"<?cs /if ?>><?cs
+ var:field.label ?></option><?cs
+ /if ?><?cs
+ /each ?>
+ </select>
+ <input type="checkbox" name="groupdesc" id="groupdesc"<?cs
+ if:query.groupdesc ?> checked="checked"<?cs /if ?> />
+ <label for="groupdesc">descending</label>
+ <script type="text/javascript">
+ var group = document.getElementById("group");
+ var updateGroupDesc = function() {
+ enableControl('groupdesc', group.selectedIndex > 0);
+ }
+ addEvent(window, 'load', updateGroupDesc);
+ addEvent(group, 'change', updateGroupDesc);
+ </script>
+ </p>
+ <p class="option">
+ <input type="checkbox" name="verbose" id="verbose"<?cs
+ if:query.verbose ?> checked="checked"<?cs /if ?> />
+ <label for="verbose">Show full description under each result</label>
+ </p>
<div class="buttons">
- <input type="submit" name="search" value="Search">
+ <input type="hidden" name="order" value="<?cs var:query.order ?>" />
+ <?cs if:query.desc ?><input type="hidden" name="desc" value="1" /><?cs /if ?>
+ <input type="submit" name="update" value="Update" />
</div>
+ <hr />
</form>
+<script type="text/javascript" src="<?cs
+ var:htdocs_location ?>js/query.js"></script>
+<script type="text/javascript"><?cs set:idx = 0 ?>
+ var properties={<?cs each:field = query.fields ?><?cs
+ var:name(field) ?>:{type:"<?cs var:field.type ?>",label:"<?cs
+ var:field.label ?>",options:[<?cs
+ each:option = field.options ?>"<?cs var:option ?>"<?cs
+ if:name(option) < len(field.options) -1 ?>,<?cs /if ?><?cs
+ /each ?>]}<?cs
+ set:idx = idx + 1 ?><?cs if:idx < len(query.fields) ?>,<?cs /if ?><?cs
+ /each ?>};<?cs set:idx = 0 ?>
+ var modes = {<?cs each:type = query.modes ?><?cs var:name(type) ?>:[<?cs
+ each:mode = type ?>{text:"<?cs var:mode.name ?>",value:"<?cs var:mode.value ?>"}<?cs
+ if:name(mode) < len(type) -1 ?>,<?cs /if ?><?cs
+ /each ?>]<?cs
+ set:idx = idx + 1 ?><?cs if:idx < len(query.modes) ?>,<?cs /if ?><?cs
+ /each ?>};
+ initializeFilters();
+</script>
-<?cs else ?>
-
-<?cs if:len(query.results) ?>
- <p><?cs var:len(query.results) ?> ticket<?cs if:len(query.results) != 1 ?>s<?cs
- /if ?> matched this query.</p>
- <table id="tktlist" class="listing">
- <thead><tr><?cs each:header = query.headers ?><?cs
- if:name(header) == 0 ?><th class="ticket<?cs
- if:header.order ?> <?cs var:header.order ?><?cs /if ?>">
- <a href="<?cs var:header.href ?>" title="Sort by ID (<?cs
- if:header.order == 'asc' ?>descending<?cs
- else ?>ascending<?cs /if ?>)">Ticket</a>
- </th><?cs
- else ?>
- <th<?cs if:header.order ?> class="<?cs var:header.order ?>"<?cs /if ?>>
- <a href="<?cs var:header.href ?>" title="Sort by <?cs
- var:header.name ?> (<?cs if:header.order == 'asc' ?>descending<?cs
- else ?>ascending<?cs /if ?>)"><?cs var:header.name ?></a>
- </th><?cs
- /if ?>
- <?cs /each ?></tr></thead>
- <tbody>
- <?cs each:result = query.results ?><tr class="<?cs
- if:name(result) % 2 ?>odd<?cs else ?>even<?cs /if ?> <?cs
- var:result.priority ?>">
- <?cs each:header = query.headers ?><?cs
- if:name(header) == 0 ?>
- <td class="ticket"><a href="<?cs var:result.href ?>" title="View ticket"><?cs
- var:result.id ?></a></td><?cs
- else ?>
- <td><?cs if:header.name == 'summary' ?>
- <a href="<?cs var:result.href ?>" title="View ticket"><?cs
- var:result[header.name] ?></a><?cs
- else ?>
- <?cs var:result[header.name] ?><?cs
- /if ?>
- </td><?cs
- /if ?>
- <?cs /each ?>
- </tr><?cs /each ?>
- </tbody>
- </table>
-<?cs else ?>
- <p>No tickets matched this query.</p>
-<?cs /if ?>
+<?cs def:thead() ?>
+ <thead><tr><?cs each:header = query.headers ?><?cs
+ if:name(header) == 0 ?><?cs
+ call:sortable_th(query.order, query.desc, 'id', 'ticket', query.href) ?><?cs
+ else ?><?cs
+ call:sortable_th(query.order, query.desc, header.name, header.name, query.href) ?><?cs
+ /if ?>
+ <?cs /each ?></tr></thead>
+<?cs /def ?>
-<?cs /if ?>
+<?cs if:len(query.results) ?><?cs
+ if:!query.group ?>
+ <table class="listing tickets">
+ <?cs call:thead() ?><tbody><?cs
+ /if ?><?cs
+ each:result = query.results ?><?cs
+ if:result[query.group] != prev_group ?>
+ <?cs if:prev_group ?></tbody></table><?cs /if ?>
+ <h2><?cs
+ each:field = query.fields ?><?cs
+ if:name(field) == query.group ?><?cs
+ var:field.label ?><?cs
+ /if ?><?cs
+ /each ?>: <?cs var:result[query.group] ?></h2>
+ <table class="listing tickets">
+ <?cs call:thead() ?><tbody><?cs
+ /if ?>
+ <tr class="<?cs
+ if:name(result) % 2 ?>odd<?cs else ?>even<?cs /if ?> prio<?cs
+ var:result.priority_value ?><?cs
+ if:result.added ?> added<?cs /if ?><?cs
+ if:result.changed ?> changed<?cs /if ?><?cs
+ if:result.removed ?> removed<?cs /if ?>"><?cs
+ each:header = query.headers ?><?cs
+ if:name(header) == 0 ?><td class="id"><a href="<?cs
+ var:result.href ?>" title="View ticket"><?cs var:result.id ?></a></td><?cs
+ else ?><td class="<?cs var:header.name ?>"><?cs
+ if:header.name == 'summary' ?><a href="<?cs
+ var:result.href ?>" title="View ticket"><?cs
+ var:result.summary ?></a><?cs
+ else ?><span><?cs var:result[header.name] ?></span><?cs
+ /if ?></td><?cs
+ /if ?><?cs
+ /each ?>
+ <?cs if:query.verbose ?>
+ </tr><tr class="fullrow"><td colspan="<?cs var:len(query.headers) ?>">
+ <p class="meta">Reported by <strong><?cs var:result.reporter ?></strong>,
+ <?cs var:result.time ?><?cs if:result.description ?>:<?cs /if ?></p>
+ <?cs if:result.description ?><p><?cs var:result.description ?></p><?cs /if ?>
+ </td>
+ <?cs /if ?><?cs set:prev_group = result[query.group] ?>
+ </tr><?cs /each ?>
+</tbody></table><?cs
+/if ?>
- <div id="help">
- <strong>Note:</strong> See <a href="<?cs var:$trac.href.wiki ?>/TracQuery">TracQuery</a>
- for help on using queries.
- </div>
+<div id="help">
+ <strong>Note:</strong> See <a href="<?cs var:$trac.href.wiki ?>/TracQuery">TracQuery</a>
+ for help on using queries.
+</div>
</div>
<?cs include:"footer.cs" ?>
View
46 django_website/templates/trac_templates/query_rss.cs
@@ -0,0 +1,46 @@
+<?xml version="1.0"?>
+<rss version="2.0">
+ <channel><?cs
+ if:project.name.encoded ?>
+ <title><?cs var:project.name.encoded ?>: Ticket Query</title><?cs
+ else ?>
+ <title>Ticket Query</title><?cs
+ /if ?>
+ <link><?cs var:base_host ?><?cs var:trac.href.query ?></link><?cs
+ if:project.descr ?>
+ <description><?cs var:project.descr ?></description><?cs
+ /if ?>
+ <language>en-us</language>
+ <image>
+ <title><?cs var:project.name.encoded ?></title>
+ <url><?cs
+ if:!header_logo.src_abs ?><?cs var:base_host ?><?cs
+ /if ?><?cs
+ var:header_logo.src ?></url>
+ <link><?cs var:base_host ?><?cs var:trac.href.timeline ?></link><?cs
+ if:header_logo.width ?>
+ <width><?cs var:header_logo.width ?></width><?cs
+ /if ?><?cs
+ if:header_logo.height ?>
+ <height><?cs var:header_logo.height ?></height><?cs
+ /if ?>
+ </image>
+ <generator>Trac v<?cs var:trac.version ?></generator><?cs
+ each:result = query.results ?>
+ <item>
+ <link><?cs var:result.href ?></link>
+ <guid isPermaLink="true"><?cs var:result.href ?></guid>
+ <title><?cs var:'#' + result.id + ': ' + result.summary ?></title><?cs
+ if:result.created ?>
+ <pubDate><?cs var:result.created ?></pubDate><?cs
+ /if ?><?cs
+ if:result.reporter ?>
+ <author><?cs var:result.reporter ?></author><?cs
+ /if ?>
+ <description><?cs var:result.description ?></description>
+ <category>Tickets</category>
+ <comments><?cs var:result.href ?>#changelog</comments>
+ </item><?cs
+ /each ?>
+ </channel>
+</rss>
View
96 django_website/templates/trac_templates/report.cs
@@ -5,29 +5,19 @@
<div id="ctxtnav" class="nav">
<h2>Report Navigation</h2>
<ul>
- <?cs if report.edit_href || report.copy_href || report.delete_href ?>
- <li><b>This report:</b>
- <ul>
- <?cs if report.edit_href
- ?><li <?cs if !report.delete_href && !report.copy_href ?>class="last"<?cs /if
- ?>><a href="<?cs var:report.edit_href ?>">Edit</a></li><?cs
- /if ?><?cs
- if report.copy_href ?><li <?cs if !report.delete_href ?>class="last"<?cs /if
- ?>><a href="<?cs var:report.copy_href ?>">Copy</a></li><?cs /if ?><?cs
- if report.delete_href ?><li class="last"><a href="<?cs var:report.delete_href ?>">Delete</a></li><?cs /if ?></ul></li>
- <?cs /if ?>
- <?cs if:report.create_href ?>
- <li><a href="<?cs var:report.create_href ?>">New Report</a></li>
- <?cs /if ?>
- <li class="last"><a href="<?cs var:$trac.href.query ?>">Custom Query</a></li>
+ <li class="first"><?cs
+ if:chrome.links.up.0.href ?><li class="first"><a href="<?cs
+ var:chrome.links.up.0.href ?>">Available Reports</a><?cs
+ else ?>Available Reports<?cs
+ /if ?></li><?cs
+ if:report.query_href ?><li class="last"><a href="<?cs
+ var:report.query_href ?>">Custom Query</a></li><?cs
+ /if ?>
</ul>
</div>
<div id="content" class="report">
-<?cs if report.message ?>
- <div class="error"><?cs var report.message ?></div>
-<?cs else ?>
<?cs def:report_hdr(header) ?>
<?cs if $header ?>
<?cs if idx > 0 ?>
@@ -36,9 +26,9 @@
<?cs /if ?>
<?cs if:header ?><h2><?cs var:header ?></h2><?cs /if ?>
<?cs if $report.id == -1 ?>