filebrowser/_embed/templates/base.tmpl

172 lines
6.9 KiB
Cheetah
Raw Normal View History

2016-06-10 21:18:44 +00:00
<!DOCTYPE html>
<html>
2016-10-25 20:08:26 +00:00
{{ $absURL := .Config.AbsoluteURL }}
<head>
<title>{{.Name}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2016-12-29 22:50:36 +00:00
<meta charset="utf-8">
2016-11-01 12:30:59 +00:00
<meta name="token" content="{{ .Token }}">
2016-12-30 22:57:14 +00:00
<link rel="stylesheet" href="{{ .Config.AbsoluteURL }}/_filemanagerinternal/css/normalize.css">
<link rel="stylesheet" href="{{ .Config.AbsoluteURL }}/_filemanagerinternal/css/fonts.css">
2016-10-25 20:08:26 +00:00
<link rel="stylesheet" href="{{ .Config.AbsoluteURL }}/_filemanagerinternal/css/styles.css">
2016-12-30 22:57:14 +00:00
{{- if ne .User.StyleSheet "" -}}
2016-10-25 20:08:26 +00:00
<style>{{ CSS .User.StyleSheet }}</style>
2016-12-30 22:57:14 +00:00
{{- end -}}
2016-12-29 18:01:28 +00:00
<!-- SCRIPTS -->
<!-- User Data and Permissions; WebDavURL -->
2016-12-30 11:15:10 +00:00
<script>
var user = JSON.parse('{{ Marshal .User }}'),
webdavURL = "{{.Config.AbsoluteURL}}{{.Config.WebDavURL}}",
baseURL = "{{.Config.AbsoluteURL}}";
</script>
<script src="{{ .Config.AbsoluteURL }}/_filemanagerinternal/js/common.js" defer></script>
2016-12-30 22:57:14 +00:00
{{- if .IsDir }}
2016-12-30 11:15:10 +00:00
<script src="{{ .Config.AbsoluteURL }}/_filemanagerinternal/js/listing.js" defer></script>
2016-12-30 22:57:14 +00:00
{{- else }}
2016-12-30 11:15:10 +00:00
<script src="{{ .Config.AbsoluteURL }}/_filemanagerinternal/js/vendor/ace/ace.js" defer></script>
<script src="{{ .Config.AbsoluteURL }}/_filemanagerinternal/js/vendor/form2js.js" defer></script>
<script src="{{ .Config.AbsoluteURL }}/_filemanagerinternal/js/editor.js" defer></script>
2016-12-30 22:57:14 +00:00
{{- end }}
2016-10-25 20:08:26 +00:00
</head>
<body>
<header>
2016-12-30 22:57:14 +00:00
<div id="top-bar">
2016-12-29 22:50:36 +00:00
<div><p>File Manager</p></div>
<div id="search">
2016-12-30 16:22:26 +00:00
<i class="material-icons" title="Search">search</i>
2016-12-29 22:50:36 +00:00
<input type="text" placeholder="Search or execute a command...">
<div>
2016-12-30 11:32:54 +00:00
<div>Loading...</div>
2016-12-29 22:50:36 +00:00
<p><i class="material-icons spin">autorenew</i></p>
</div>
2016-07-01 09:46:09 +00:00
</div>
2016-08-26 20:59:06 +00:00
2016-12-29 22:50:36 +00:00
<div class="action" id="logout">
2016-12-30 22:57:14 +00:00
<i class="material-icons" title="Logout">exit_to_app</i>
2016-10-25 20:08:26 +00:00
</div>
</div>
2016-12-29 22:50:36 +00:00
2016-12-30 22:57:14 +00:00
<div id="bottom-bar">
2016-12-29 22:50:36 +00:00
<div>
2016-12-31 15:29:36 +00:00
{{- if ne .Name "/"}}
2016-12-30 16:22:26 +00:00
<p id="breadcrumbs-button">Previous</p>
<ul id="breadcrumbs">
2016-12-31 15:29:36 +00:00
{{- range $item := .BreadcrumbMap }}
2016-12-30 16:22:26 +00:00
<a href="{{ $absURL }}{{ $item.URL }}"><li>{{ $item.Name }}</li></a>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-12-30 16:22:26 +00:00
</ul><i class="material-icons">keyboard_arrow_right</i>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-12-30 16:22:26 +00:00
<p id="current-file">{{ if ne .Name "/"}}{{ .Name }}{{ else }}Root{{ end }}</p>
2016-10-25 20:08:26 +00:00
</div>
2016-12-29 22:50:36 +00:00
<div class="actions">
<div id="file-only" {{ if .IsDir }}class="disabled"{{ end }}>
2016-12-31 15:29:36 +00:00
{{- if and (not .IsDir) (.User.AllowEdit) }}
{{- if .Editor}}
{{- if eq .Data.Mode "markdown" }}
<div class="action" id="preview" onclick="notImplemented(event);">
<i class="material-icons">remove_red_eye</i>
</div>
{{- end }}
{{- end }}
<div class="action" id="save">
<i class="material-icons" title="Save">save</i>
</div>
{{- end }}
2016-12-29 22:50:36 +00:00
<div class="action" id="open">
2016-12-30 22:57:14 +00:00
<i class="material-icons" title="See raw">open_in_new</i>
2016-11-01 15:00:36 +00:00
</div>
2016-12-31 15:29:36 +00:00
{{- if and .IsDir .User.AllowEdit }}
2016-12-29 22:50:36 +00:00
<div class="action" id="rename">
<i class="material-icons" title="Edit">mode_edit</i>
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-12-29 22:50:36 +00:00
2016-12-31 15:29:36 +00:00
{{- if .User.AllowEdit }}
2016-12-29 22:50:36 +00:00
<div class="action" id="delete">
<i class="material-icons" title="Delete">delete</i> <span>Delete</span>
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
</div>
{{- if .IsDir }}
<div class="action" id="view">
{{- if eq .Display "mosaic" }}
<a href="?display=list"><i class="material-icons" title="Switch View">view_list</i></a>
{{- else }}
<a href="?display=mosaic"><i class="material-icons" title="Switch View">view_module</i></a>
{{- end }}
2016-10-25 20:08:26 +00:00
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-12-29 22:50:36 +00:00
2016-12-31 15:29:36 +00:00
{{- if and (.User.AllowNew) (.IsDir) }}
2016-10-25 20:08:26 +00:00
<div class="action" id="upload">
<i class="material-icons" title="Upload">file_upload</i> <span>Upload</span>
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-12-29 22:50:36 +00:00
<div class="action" id="download">
2016-10-25 20:08:26 +00:00
<a href="?download=true">
<i class="material-icons" title="Download">file_download</i> <span>Download</span>
</a>
2016-12-31 15:29:36 +00:00
{{- if .IsDir }}
2016-10-25 20:08:26 +00:00
<ul class="prev-links">
2016-12-29 22:50:36 +00:00
<a data-format="tarbz2" href="?download=tarbz2"><li>tar.bz2</li></a>
<a data-format="targz" href="?download=targz"><li>tar.gz</li></a>
<a data-format="tar" href="?download=tar"><li>tar</li></a>
<a data-format="zip" href="?download=zip"><li>zip</li></a>
2016-10-25 20:08:26 +00:00
</ul>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-10-25 20:08:26 +00:00
</div>
2016-12-29 22:50:36 +00:00
2016-12-31 15:29:36 +00:00
<div class="action" id="info" onclick="notImplemented(event);">
<i class="material-icons" title="Info">info</i>
2016-12-29 22:50:36 +00:00
</div>
2016-11-02 19:29:29 +00:00
</div>
</div>
2016-12-29 22:50:36 +00:00
</header>
2016-06-23 21:27:13 +00:00
2016-10-25 20:08:26 +00:00
<main>
2016-12-31 15:29:36 +00:00
{{- template "content" . }}
</main>
<div class="overlay"></div>
{{- if and (.User.AllowNew) (.IsDir) }}
<div class="floating">
<div class="action" id="new">
<i class="material-icons" title="New file or directory">add</i>
</div>
</div>
{{- end }}
<template id="question-template">
<form class="prompt">
<h3></h3>
<p></p>
<input autofocus type="text">
<div>
<button type="submit" default class="ok">OK</button>
<button class="cancel" onclick="closePrompt(event);">Cancel</button>
</div>
</form>
</template>
<template id="info-template">
<div class="prompt">
<h3></h3>
<p></p>
<div>
<button type="submit" onclick="closePrompt(event);" class="ok">OK</button>
2016-12-30 11:53:46 +00:00
</div>
</div>
2016-12-31 15:29:36 +00:00
</template>
2016-10-25 20:08:26 +00:00
2016-11-02 19:29:29 +00:00
<footer>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>.</footer>
2016-10-25 20:08:26 +00:00
</body>
2016-06-23 15:10:31 +00:00
</html>