/
directoryPage.vm
53 lines (51 loc) · 1.54 KB
/
directoryPage.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#macro( prettyPrint $s )
#if( $s.length() > 60 )
#set ( $t = $s.length() - 40 )
#escape($s.substring(0, 15))...#escape($s.substring($t))#else#escape(${s})#end
#end
<table class="dirListing">
<thead>
<tr>
<th>Name</th>
<th>Size</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
#foreach( $fileInfo in $fileInfoList )
<tr >
<td>
<a href="#escape($fileInfo.name)#if( $fileInfo.directory )/#end">
#if( $fileInfo.directory )<img src="${contextRoot}files/fitnesse/images/folder.gif" alt="folder"/>#end #prettyPrint( $fileInfo.name )#if( $fileInfo.directory )/#end
</a>
</td>
<td>$fileInfo.size</td>
<td>$fileInfo.date</td>
<td class="buttons">
<a href="?responder=renameConfirmation&filename=#escape($fileInfo.name)">Rename</a> | <a href="?responder=deleteConfirmation&filename=#escape($fileInfo.name)">Delete</a>
</td>
</tr>
#end
</tbody>
</table>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="responder" value="upload"/>
<fieldset>
<label for="upload-file">Upload a file:</label>
<input id="upload-file" type="file" name="file" value=""/>
</fieldset>
<fieldset class="buttons">
<input type="submit" name="" value="Upload"/>
</fieldset>
</form>
<form method="get">
<input type="hidden" name="responder" value="createDir"/>
<fieldset>
<label for="create-dir">Create a directory:</label>
<input id="create-dir" type="text" name="dirname" value=""/>
</fieldset>
<fieldset class="buttons">
<input type="submit" name="" value="Create"/>
</fieldset>
</form>