filebrowser/assets/templates/base.tmpl

68 lines
2.5 KiB
Cheetah
Raw Normal View History

2016-06-10 21:18:44 +00:00
<!DOCTYPE html>
<html>
<head>
<title>{{.Name}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2016-06-14 15:13:38 +00:00
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
2016-06-11 13:32:50 +00:00
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500' rel='stylesheet' type='text/css'>
2016-06-14 17:19:10 +00:00
<link rel="stylesheet" href="{{ .Config.BaseURL }}/_filemanagerinternal/css/styles.css">
<script src="{{ .Config.BaseURL }}/_filemanagerinternal/js/application.js"></script>
{{ if ne .Config.StyleSheet "" }}<style>{{ .Config.StyleSheet}}</style>{{ end }}
2016-06-10 21:18:44 +00:00
</head>
<body>
<header>
2016-06-14 15:13:38 +00:00
<div>
2016-06-14 17:19:10 +00:00
{{ $lnk := .PreviousLink }}
2016-06-14 19:33:59 +00:00
{{ if ne $lnk ""}}<a href="{{ if eq $lnk "/" }}/{{else }}../../{{.PreviousLink}}{{ end }}"><div class="action" id="prev"><i class="material-icons">subdirectory_arrow_left</i></div></a>{{ else }}
2016-06-14 17:19:10 +00:00
<div class="action disabled" id="prev"><i class="material-icons">subdirectory_arrow_left</i></div>{{ end }}
2016-06-14 19:33:59 +00:00
<p><a href="{{ if eq .Config.BaseURL "" }}/{{ else }}{{ .Config.BaseURL }}{{ end }}">File Manager</a> {{ if ne .Name "/"}}<i class="material-icons">chevron_right</i> {{ .Name }}</p>{{ end }}
2016-06-14 15:13:38 +00:00
</div>
2016-06-14 19:33:59 +00:00
{{ if .IsDir}}
2016-06-14 15:13:38 +00:00
<div>
2016-06-14 15:28:33 +00:00
<form>
<i class="material-icons">search</i> <input type="text" placeholder="Search">
</form>
2016-06-14 19:33:59 +00:00
<div class="action" id="view"><i class="material-icons">view_headline</i></div>
2016-06-14 15:13:38 +00:00
<div class="action" id="upload"><i class="material-icons">file_upload</i></div>
2016-06-11 13:32:50 +00:00
</div>
2016-06-14 19:33:59 +00:00
{{ else }}
{{ template "actions" . }}
{{ end }}
2016-06-10 21:18:44 +00:00
</header>
2016-06-14 19:33:59 +00:00
{{ if .IsDir }}
2016-06-14 15:13:38 +00:00
<div id="toolbar">
<div>
<div class="action" id="back"><i class="material-icons">arrow_back</i></div>
<p><span id="selected-number">0</span> selected.</p>
</div>
2016-06-14 19:33:59 +00:00
{{ template "actions" . }}
2016-06-14 15:13:38 +00:00
</div>
2016-06-14 19:33:59 +00:00
{{ end }}
2016-06-14 15:13:38 +00:00
2016-06-10 21:18:44 +00:00
<main>
2016-06-11 09:08:33 +00:00
{{ template "content" .Data }}
2016-06-10 21:18:44 +00:00
</main>
<footer>
2016-06-14 17:19:10 +00:00
Served with <a rel="noopener noreferrer" href="https://caddyserver.com">Caddy</a> and <a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">File Manager</a>.
2016-06-10 21:18:44 +00:00
</footer>
<script type="text/javascript">
function localizeDatetime(e, index, ar) {
if (e.textContent === undefined) {
return;
}
var d = new Date(e.getAttribute('datetime'));
if (isNaN(d)) {
d = new Date(e.textContent);
if (isNaN(d)) {
return;
}
}
e.textContent = d.toLocaleString();
}
var timeList = Array.prototype.slice.call(document.getElementsByTagName("time"));
timeList.forEach(localizeDatetime);
</script>
</body>
</html>