~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/apps/browser/__init__.py

  • Committer: mattgiuca
  • Date: 2008-01-11 07:10:18 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:185
Integrated the (second) Prototype browser (HTML+CSS but no code) into the main
filebrowser app. Note that this still is non-functional - it looks the same as
the original prototype.
browser: Added the full HTML source (including example rows) into the Python
code. (Note this will be a lot cleaner once example rows are removed).
media: Added "images" directory (copied from the demo). This contains all the
icons needed for the demo.
       browser.css: Pasted the entire CSS from the demo. This styles the
        browser interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
# The file browser application. Presents an Ajax-based interface to the
23
23
# student's subversion workspace.
 
24
# Note that there is virtually no server-side code for this application. It
 
25
# simply presents static HTML and JavaScript, and all server-side activities
 
26
# take place in the FileService app (for handling Ajax requests).
24
27
 
25
28
from common import util
26
29
 
38
41
    req.write_html_head_foot = True     # Have dispatch print head and foot
39
42
 
40
43
    # Start writing data
41
 
    req.write("<p>File Browser Application</p>\n")
 
44
    req.write("""
 
45
<!-- Top bar section -->
 
46
 
 
47
<div id="topbar">
 
48
<h1>IVLE File Browser</h1>
 
49
<p id="path"><a href="javascript:alert(&quot;Navigate to home&quot;)">home</a> /
 
50
    <a href="javascript:alert(&quot;Navigate to home/work&quot;)">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>
 
54
</div>
 
55
<!-- End topbar -->
 
56
 
 
57
<!-- Centre section - files and side panel -->
 
58
<!-- Using a table-based layout, for reasons of sanity -->
 
59
<table id="middle"><tr>
 
60
 
 
61
<!-- File table -->
 
62
<td id="filetable">
 
63
 
 
64
<div id="filetablediv">
 
65
 
 
66
<table width="100%%">
 
67
<thead>
 
68
<tr class="rowhead">
 
69
    <th class="col-check"></th>
 
70
    <th colspan="2" class="col-filename"><a href="javascript:alert(&quot;Sort by name&quot;)" 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(&quot;Sort by file size&quot;)" title="Sort by file size">Size</a></th>
 
73
    <th class="col-date"><a href="javascript:alert(&quot;Sort by date modified&quot;)" title="Sort by date modified">Modified</a></th>
 
74
</tr>
 
75
</thead>
 
76
<tbody id="files">
 
77
<tr class="row1">
 
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(&quot;Navigate to home/work/subdir1&quot;)" 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>
 
84
</tr>
 
85
<tr class="row2">
 
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(&quot;Navigate to home/work/subdir2&quot;)" 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>
 
92
</tr>
 
93
<tr class="row1sel">
 
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>
 
100
</tr>
 
101
<tr class="row2">
 
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>
 
108
</tr>
 
109
<tr class="row1">
 
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>
 
116
</tr>
 
117
</tbody>
 
118
</table>
 
119
</div>
 
120
</td>
 
121
<!-- End filetable -->
 
122
 
 
123
<!-- Side panel -->
 
124
 
 
125
<td id="sidepanel">
 
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>
 
129
     <h1>hello.py</h1>
 
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>
 
134
     <h2>Actions</h2>
 
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>
 
142
     <h2>Subversion</h2>
 
143
     <p><a href="">Commit</a></p>
 
144
     <p><a href="">Update</a></p>
 
145
</td>
 
146
<!-- End sidepanel -->
 
147
 
 
148
</tr></table>
 
149
<!-- End middle -->
 
150
 
 
151
<!-- Bottom status bar -->
 
152
 
 
153
<div id="statusbar">
 
154
<table>
 
155
<tr><td>5 files, 14 kB</td></tr>
 
156
</table>
 
157
</div>
 
158
<!-- End statusbar -->
 
159
 
 
160
</body>
 
161
</html>
 
162
""" %
 
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"))
 
177
)
 
178