Skip to content

Commit

Permalink
Finished changing trac templates to handle upgrade to 0.9pre -- fixes #…
Browse files Browse the repository at this point in the history
…424 and #358

git-svn-id: http://code.djangoproject.com/svn/djangoproject.com@559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacob committed Aug 26, 2005
1 parent 3067701 commit 72a49ed
Show file tree
Hide file tree
Showing 20 changed files with 1,661 additions and 1,306 deletions.
72 changes: 54 additions & 18 deletions django_website/templates/trac_templates/attachment.cs
Original file line number Diff line number Diff line change
@@ -1,40 +1,76 @@
<?cs set:html.stylesheet = 'css/code.css' ?>
<?cs set:html.stylesheet = 'css/diff.css' ?>
<?cs include "header.cs" ?>
<?cs include "macros.cs" ?>

<div id="ctxtnav" class="nav"></div>

<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"?>
165 changes: 95 additions & 70 deletions django_website/templates/trac_templates/browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 72a49ed

Please sign in to comment.