-
Notifications
You must be signed in to change notification settings - Fork 131
/
html.stg
198 lines (181 loc) · 7.04 KB
/
html.stg
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/* HTML Templates for WebDAV door.
*
* Must provide page and errorpage templates.
*
* See StringTemplate V4 documentation at http://www.stringtemplate.org/
* for details on the format.
*
* Do not modify this file. Any changes will be lost on upgrade. To
* customize the look and feel a copy of this file should be
* created. Update the webdav.templates.html configuration property to
* point to the copy.
*/
page(static,subject,path,files,base,config,root,query) ::= <<
$render(list(files))$
>>
errorpage(static,subject,path,errorcode,errormessage,base,config,root,query) ::= <<
$render(error(errorcode,errormessage))$
>>
queryWithPrefix(prefix) ::= <<$if(query)$$prefix$$query$$endif$>>
list(files) ::= <<
<table class="table table-condensed sortable">
<thead>
<tr>
<th data-sorter="false"></th>
<th>Name</th>
<th>Size</th>
<th data-sorter="customtime">Last Modified</th>
</tr>
</thead>
<tbody>
$files: file()$
</tbody>
</table>
>>
/* Renders a directory entry.
*/
file(f) ::= <<
<tr>
$if(f.showGhosted)$
<td></td>
<td class="text-muted">$f.name.unencoded$</td>
<td></td>
<td></td>
$elseif(f.isDirectory)$
<td class="text-muted text-center">
<span class="fa-solid fa-folder-open"></span>
</td>
<td>
<a href="$root$/$[path:{item|$item.encoded$},f.name.encoded]; separator="/"$/$queryWithPrefix("?")$">$f.name.unencoded$</a>
</td>
<td></td>
<td>
$f.mtime$
</td>
$elseif(f.isUploading)$
<td class="text-muted text-center">
<span class="fa-solid fa-file"></span>
</td>
<td class="text-muted" title="Upload not yet complete">$f.name.unencoded$</td>
<td></td>
<td class="text-muted">
$f.mtime$
</td>
$else$
<td class="text-muted text-center">
$localityIcon(f.locality)$
</td>
<td>
<a href="$root$/$[path:{item|$item.encoded$},f.name.encoded]; separator="/"$?action=show$queryWithPrefix("&")$" title="Show $f.name.unencoded$">$f.name.unencoded$</a>
<a href="$root$/$[path:{item|$item.encoded$},f.name.encoded]; separator="/"$$queryWithPrefix("?")$" title="Download $f.name.unencoded$" download="$f.name.encoded$">
<span class="fa-solid fa-cloud-arrow-down"></span>
</a>
</td>
<td title="$f.size.humanFriendly$">$f.size$</td>
<td>
$f.mtime$
</td>
$endif$
</tr>
>>
localityIcon(l) ::= <<
$if(l.online)$
<i title="This file's data is available with no delay." class="fa-solid fa-file"></i>
$elseif(l.nearline)$
<i title="Reading this file's data may be delayed." class="fa-solid fa-tape"></i>
$elseif(l.onlineAndNearline)$
<span class="text-muted"
title="This file's data is available with no delay now, but may be delayed in the future."><i
class="fa-solid fa-file"></i><i class="other-locality fa-solid fa-tape"></i></span>
$elseif(l.lost)$
<i title="This file's data has been lost." class="fa-solid fa-exclamation-circle"></i>
$elseif(l.none)$
/* This is for non-file types; e.g., symbolic links. Note that directories
are handled separately. */
<i class="fa-solid fa-file"></i>
$elseif(l.unavailable)$
<i title="This file's data is currently unavailable." class="fa-solid fa-minus-circle"></i>
$else$
/* This branch should never happen. */
<i title="Status of this file's data is unknown." class="fa-solid fa-exclamation-triangle"></i>
$endif$
>>
error(errorcode,errormessage) ::= <<
<div class="alert alert-warning">
$errorcode$ $errormessage$
</div>
>>
render(body) ::= <<
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>$config.head_title$</title>
<link rel="stylesheet" href="$root$$static$/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="$root$$static$/css/solid.min.css" rel="stylesheet">
<link rel="stylesheet" href="$root$$static$/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="$root$$static$/css/custom.css" rel="stylesheet">
<link rel="stylesheet" href="$root$$static$/css/tablesorter.custom.css" rel="stylesheet">
<link rel="stylesheet" href="$root$$static$/css/bootstrap.custom.css" rel="stylesheet">
<script src="$root$$static$/jquery/jquery.min.js"></script>
<script src="$root$$static$/bootstrap/js/bootstrap.bundle.js"></script>
<script src="$root$$static$/tablesorter/js/jquery.tablesorter.min.js"></script>
<script src="$root$$static$/tablesorter/js/jquery.tablesorter.widgets.min.js"></script>
<script src="$root$$static$/js/jquery.tablesorter.init.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container">
<div class="navbar-header pull-left">
<a class="navbar-brand" href="#">$config.header_brand$</a>
<p class="navbar-text">$config.header_text$</p>
</div>
<div class="navbar-header pull-right">
<div class="dropdown">
<button class="btn dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<span class="fa-solid fa-user-shield"></span>
</button>
<ul class="dropdown-menu dropdown-menu-right">
$subject.principals:{p|<li><a class="dropdown-item" href="#">$p$</a></li>}$
</ul>
</div>
</div>
</div>
</nav>
<div class="container">
<nav aria-label="breadcrumb" class="bg-light">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="$root$$url(base)$"><span class="fa-solid fa-hard-drive"></span></a></li>
$breadcrumbs(base,path)$
</ol>
</nav>
</div>
<div class="container">
$body$
</div>
<div id="footer">
<div class="container">
<p class="text-muted text-center">$config.footer$</p>
</div>
</div>
</body>
</html>
>>
url(path) ::= <<$path:{item|$item.encoded$/}$$queryWithPrefix("?")$>>
/* Recursively renders the path as a breadcrumb trail.
*/
breadcrumbs(base,path) ::= <<
$if(path)$
<li class="breadcrumb-item"><a href="$root$$url([base,first(path)])$">$first(path).unencoded$</a>
$breadcrumbs([base,first(path)],rest(path))$
</li>
$endif$
>>