Edgewall Software

source: trunk/trac/templates/attachment.html@ 9400

Last change on this file since 9400 was 9330, checked in by Christian Boos, 14 years ago

i18n: in r9329 (kept for illustration), the i18n:msg attribute is ineffective inside a py:otherwise element (and likely any py:… element).

  • Property svn:eol-style set to native
File size: 5.2 KB
Line 
1<!DOCTYPE html
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml"
5 xmlns:py="http://genshi.edgewall.org/"
6 xmlns:xi="http://www.w3.org/2001/XInclude"
7 xmlns:i18n="http://genshi.edgewall.org/i18n"
8 py:with="parent = attachments and attachments.parent or attachment.resource.parent">
9 <xi:include href="layout.html" />
10 <head>
11 <title py:choose="mode">
12 <py:when test="'new'">${name_of(parent)} &ndash; Attachment</py:when>
13 <py:when test="'list'">${name_of(parent)} &ndash; Attachments</py:when>
14 <py:otherwise><i18n:msg params="filename, parent">${attachment.filename} on ${name_of(parent)} &ndash; Attachment</i18n:msg></py:otherwise>
15 </title>
16 <py:if test="preview">
17 <script type="text/javascript" src="${chrome.htdocs_location}js/folding.js"></script>
18 <script type="text/javascript">
19 jQuery(document).ready(function($) {
20 $('#preview table.code').enableCollapsibleColumns($('#preview table.code thead th.content'));
21 });
22 </script>
23 </py:if>
24 </head>
25
26 <body>
27 <div py:choose="mode" id="content" class="attachment">
28 <py:when test="'new'">
29 <h1>Add Attachment to <a href="${url_of(parent)}">${name_of(parent)}</a></h1>
30 <form id="attachment" method="post" enctype="multipart/form-data" action="">
31 <div class="field">
32 <label>File<py:if test="max_size >= 0"> (size limit
33 ${pretty_size(max_size)})</py:if>:<br />
34 <input type="file" name="attachment" /></label>
35 </div>
36 <fieldset>
37 <legend>Attachment Info</legend>
38 <py:if test="authname == 'anonymous'">
39 <div class="field">
40 <label>Your email or username:<br />
41 <input type="text" name="author" size="30" value="$author" />
42 </label>
43 </div>
44 </py:if>
45 <div class="field">
46 <label>Description of the file (optional):<br />
47 <input type="text" name="description" size="60" /></label>
48 </div>
49 <br />
50 <py:if test="authname and authname != 'anonymous'">
51 <div class="options">
52 <label><input type="checkbox" name="replace" />
53 Replace existing attachment of the same name</label>
54 </div>
55 <br />
56 </py:if>
57 </fieldset>
58 <div class="buttons">
59 <input type="hidden" name="action" value="new" />
60 <input type="hidden" name="realm" value="$parent.realm" />
61 <input type="hidden" name="id" value="$parent.id" />
62 <input type="submit" value="${_('Add attachment')}" />
63 <input type="submit" name="cancel" value="${_('Cancel')}" />
64 </div>
65 </form>
66 </py:when>
67
68 <py:when test="'delete'">
69 <h1><a href="${url_of(parent)}">${name_of(parent)}</a>: $attachment.filename</h1>
70 <p><strong>Are you sure you want to delete this attachment?</strong><br />
71 This is an irreversible operation.</p>
72 <div class="buttons">
73 <form method="post" action="">
74 <div id="delete">
75 <input type="hidden" name="action" value="delete" />
76 <input type="submit" name="cancel" value="${_('Cancel')}" />
77 <input type="submit" value="${_('Delete attachment')}" />
78 </div>
79 </form>
80 </div>
81 </py:when>
82
83 <py:when test="'list'">
84 <h1><a href="${url_of(parent)}">${name_of(parent)}</a></h1>
85 <py:with vars="context = context(parent)">
86 <xi:include href="list_of_attachments.html"
87 py:with="alist = attachments; add_button_title = _('Attach another file')"/>
88 </py:with>
89 </py:when>
90
91 <py:otherwise> <!--! 'render' mode -->
92 <h1><a href="${url_of(parent)}">${name_of(parent)}</a>: $attachment.filename</h1>
93 <table id="info" summary="Description">
94 <tbody>
95 <tr>
96 <th scope="col" i18n:msg="file,size,author,date">
97 File $attachment.filename,
98 <span title="${_('%(size)s bytes', size=attachment.size)}">${pretty_size(attachment.size)}</span>
99 (added by ${authorinfo(attachment.author)}, ${dateinfo(attachment.date)} ago)
100 </th>
101 </tr>
102 <tr>
103 <td class="message searchable" xml:space="preserve">
104 ${wiki_to_html(context(parent), attachment.description)}
105 </td>
106 </tr>
107 </tbody>
108 </table>
109
110 <div py:if="preview" id="preview" class="searchable">
111 <xi:include href="preview_file.html" py:with="preview = preview"/>
112 </div>
113
114 <py:if test="attachment and 'ATTACHMENT_DELETE' in perm(attachment.resource)">
115 <div class="buttons">
116 <form method="get" action="">
117 <div id="delete">
118 <input type="hidden" name="action" value="delete" />
119 <input type="submit" value="${_('Delete attachment')}" />
120 </div>
121 </form>
122 </div>
123 </py:if>
124 </py:otherwise>
125
126 </div>
127 </body>
128</html>
Note: See TracBrowser for help on using the repository browser.