1
<?cs include "header.cs" ?>
2
<?cs include "macros.cs" ?>
4
<div id="ctxtnav" class="nav"></div>
6
<div id="content" class="attachment">
8
<?cs if:attachment.mode == 'new' ?>
9
<h1>Add Attachment to <a href="<?cs var:attachment.parent.href?>"><?cs
10
var:attachment.parent.name ?></a></h1>
11
<form id="attachment" method="post" enctype="multipart/form-data" action="">
13
<label>File:<br /><input type="file" name="attachment" /></label>
16
<legend>Attachment Info</legend>
17
<?cs if:trac.authname == "anonymous" ?>
19
<label>Your email or username:<br />
20
<input type="text" name="author" size="30" value="<?cs
21
var:attachment.author?>" /></label>
25
<label>Description of the file (optional):<br />
26
<input type="text" name="description" size="60" /></label>
30
<label><input type="checkbox" name="replace" />
31
Replace existing attachment of the same name</label>
36
<input type="hidden" name="action" value="new" />
37
<input type="hidden" name="type" value="<?cs var:attachment.parent.type ?>" />
38
<input type="hidden" name="id" value="<?cs var:attachment.parent.id ?>" />
39
<input type="submit" value="Add attachment" />
40
<input type="submit" name="cancel" value="Cancel" />
43
<?cs elif:attachment.mode == 'delete' ?>
44
<h1><a href="<?cs var:attachment.parent.href ?>"><?cs
45
var:attachment.parent.name ?></a>: <?cs var:attachment.filename ?></h1>
46
<p><strong>Are you sure you want to delete this attachment?</strong><br />
47
This is an irreversible operation.</p>
49
<form method="post" action=""><div id="delete">
50
<input type="hidden" name="action" value="delete" />
51
<input type="submit" name="cancel" value="Cancel" />
52
<input type="submit" value="Delete attachment" />
55
<?cs elif:attachment.mode == 'list' ?>
56
<h1><a href="<?cs var:attachment.parent.href ?>"><?cs
57
var:attachment.parent.name ?></a></h1><?cs
58
call:list_of_attachments(attachment.list, attachment.attach_href) ?>
60
<h1><a href="<?cs var:attachment.parent.href ?>"><?cs
61
var:attachment.parent.name ?></a>: <?cs var:attachment.filename ?></h1>
62
<table id="info" summary="Description"><tbody><tr>
64
File <?cs var:attachment.filename ?>, <?cs var:attachment.size ?>
65
(added by <?cs var:attachment.author ?>, <?cs var:attachment.age ?> ago)
67
<td class="message"><?cs var:attachment.description ?></td>
70
<div id="preview"><?cs
71
if:attachment.preview ?>
72
<?cs var:attachment.preview ?><?cs
73
elif:attachment.max_file_size_reached ?>
74
<strong>HTML preview not available</strong>, since the file size exceeds
75
<?cs var:attachment.max_file_size ?> bytes. You may <a href="<?cs
76
var:attachment.raw_href ?>">download the file</a> instead.<?cs
78
<strong>HTML preview not available</strong>. To view the file,
79
<a href="<?cs var:attachment.raw_href ?>">download the file</a>.<?cs
82
<?cs if:attachment.can_delete ?><div class="buttons">
83
<form method="get" action=""><div id="delete">
84
<input type="hidden" name="action" value="delete" />
85
<input type="submit" value="Delete attachment" />
91
<?cs include "footer.cs"?>