38
41
req.write_html_head_foot = True # Have dispatch print head and foot
40
43
# Start writing data
41
req.write("<p>File Browser Application</p>\n")
45
<!-- Top bar section -->
48
<h1>IVLE File Browser</h1>
49
<p id="path"><a href="javascript:alert("Navigate to home")">home</a> /
50
<a href="javascript:alert("Navigate to home/work")">work</a></p>
51
<p><input type="button" value="Refresh" onclick="action_refresh()" />
52
<input type="button" value="New File" onclick="action_newfile()" />
53
<input type="button" value="Commit All" onclick="action_svncommitall()" /></p>
57
<!-- Centre section - files and side panel -->
58
<!-- Using a table-based layout, for reasons of sanity -->
59
<table id="middle"><tr>
64
<div id="filetablediv">
69
<th class="col-check"></th>
70
<th colspan="2" class="col-filename"><a href="javascript:alert("Sort by name")" title="Sort by name">Filename</a>
71
<img src="%s/images/interface/sortdown.png" alt="*" /></th>
72
<th class="col-size"><a href="javascript:alert("Sort by file size")" title="Sort by file size">Size</a></th>
73
<th class="col-date"><a href="javascript:alert("Sort by date modified")" title="Sort by date modified">Modified</a></th>
78
<td class="col-check"><input type="checkbox" title="Select this file" /></td>
79
<td class="col-icons"><img src="%s/images/mime/dir.png" width="22" height="22" title="Directory" alt="" />
80
<img src="%s/images/svn/normal.png" width="22" height="22" title="Permanent file" alt="" /></td>
81
<td class="col-filename"><a href="javascript:alert("Navigate to home/work/subdir1")" title="subdir1">subdir1</a></td>
82
<td class="col-size"></td>
83
<td class="col-date"><span title="Dec 3 2007, 3:47 PM">Dec 3</span></td>
86
<td class="col-check"><input type="checkbox" title="Select this file" /></td>
87
<td class="col-icons"><img src="%s/images/mime/dir.png" width="22" height="22" title="Directory" alt="" />
88
<img src="%s/images/svn/unversioned.png" width="22" height="22" title="Temporary file" alt="" /></td>
89
<td class="col-filename"><a href="javascript:alert("Navigate to home/work/subdir2")" title="subdir2">subdir2</a></td>
90
<td class="col-size"></td>
91
<td class="col-date"><span title="Dec 8 2007, 11:37 AM">Today, 11:37 AM</span></td>
94
<td class="col-check"><input type="checkbox" title="Select this file" checked="true" /></td>
95
<td class="col-icons"><img src="%s/images/mime/py.png" width="22" height="22" title="Python source code" alt="" />
96
<img src="%s/images/svn/modified.png" width="22" height="22" title="Permanent file (modified)" alt="" /></td>
97
<td class="col-filename">hello.py</td>
98
<td class="col-size">60 B</td>
99
<td class="col-date"><span title="Dec 8 2007, 2:50 PM">Today, 2:50 PM</span></td>
102
<td class="col-check"><input type="checkbox" title="Select this file" /></td>
103
<td class="col-icons"><img src="%s/images/mime/txt.png" width="22" height="22" title="Text file" alt="" />
104
<img src="%s/images/svn/unversioned.png" width="22" height="22" title="Temporary file" alt="" /></td>
105
<td class="col-filename">world</td>
106
<td class="col-size">24 B</td>
107
<td class="col-date"><span title="Dec 5 2007, 1:40 AM">3 days ago</span></td>
110
<td class="col-check"><input type="checkbox" title="Select this file" /></td>
111
<td class="col-icons"><img src="%s/images/mime/txt.png" width="22" height="22" title="Text file" alt="" />
112
<img src="%s/images/svn/unversioned.png" width="22" height="22" title="Temporary file" alt="" /></td>
113
<td class="col-filename">File names that are extremely long are not condensed, merely they extend very far and wrap if necessary.txt</td>
114
<td class="col-size">14 kB</td>
115
<td class="col-date"><span title="Nov 11 2007, 9:14 AM">Nov 11</span></td>
121
<!-- End filetable -->
126
<!-- This section is entirely dynamically generated by selecting files.
127
An example follows -->
128
<p><img src="%s/images/mime/large/py.png" title="Python source code" alt="" /></p>
130
<p>Python source code</p>
131
<p><img src="%s/images/svn/modified.png" width="22" height="22" title="Permanent file (modified)" alt="" /><br />Permanent file (modified)</p>
132
<p>Size: 60 bytes</p>
133
<p>Modified: Dec 8 2007, 2:50 PM</p>
135
<p><a href="">Edit</a></p>
136
<p><a href="">Run in Browser</a></p>
137
<p><a href="">Run in Console</a></p>
138
<p><a href="">Rename</a></p>
139
<p><a href="">Download</a></p>
140
<p><a href="">Cut</a></p>
141
<p><a href="">Copy</a></p>
143
<p><a href="">Commit</a></p>
144
<p><a href="">Update</a></p>
146
<!-- End sidepanel -->
151
<!-- Bottom status bar -->
155
<tr><td>5 files, 14 kB</td></tr>
158
<!-- End statusbar -->
163
# All the %ses above refer to the location of the IVLE media directory
164
(util.make_path("media"),
165
util.make_path("media"),
166
util.make_path("media"),
167
util.make_path("media"),
168
util.make_path("media"),
169
util.make_path("media"),
170
util.make_path("media"),
171
util.make_path("media"),
172
util.make_path("media"),
173
util.make_path("media"),
174
util.make_path("media"),
175
util.make_path("media"),
176
util.make_path("media"))