filebrowser/_embed/templates/base.tmpl

270 lines
10 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>
2017-01-01 22:40:12 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
2016-12-29 22:50:36 +00:00
<meta charset="utf-8">
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 -}}
2017-01-02 20:22:54 +00:00
2016-12-30 11:15:10 +00:00
<script>
2017-01-02 20:22:54 +00:00
var user = JSON.parse('{{ Marshal .User }}'),
webdavURL = "{{.Config.AbsoluteURL}}{{.Config.WebDavURL}}",
baseURL = "{{.Config.AbsoluteURL}}",
prefixURL = "{{ .Config.PrefixURL }}";
2016-12-30 11:15:10 +00:00
</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 }}
2017-01-03 20:41:24 +00:00
{{- if .Config.HugoEnabled }}
<script src="{{ .Config.AbsoluteURL }}/_hugointernal/js/application.js" defer></script>
{{- 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>
2017-01-02 20:22:54 +00:00
2016-12-30 22:57:14 +00:00
<div id="bottom-bar">
2016-12-29 22:50:36 +00:00
<div>
2017-01-02 20:22:54 +00:00
{{- if ne .Name "/"}}
2017-01-01 23:38:11 +00:00
<div data-dropdown class="action" id="previous">
2017-01-01 22:40:12 +00:00
<i class="material-icons">subdirectory_arrow_left</i>
2017-01-01 23:38:11 +00:00
<ul class="dropdown" id="breadcrumbs">
{{- range $item := .BreadcrumbMap }}
<a href="{{ $absURL }}{{ $item.URL }}"><li>{{ $item.Name }}</li></a>
{{- end }}
</ul>
2017-01-01 22:40:12 +00:00
</div>
2017-01-01 23:46:36 +00:00
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-02 12:20:20 +00:00
{{ if ne .Name "/"}}<p id="current-file">{{ .Name }}</p>{{ end }}
2017-01-01 22:40:12 +00:00
</div>
2017-01-02 20:22:54 +00:00
2017-01-01 22:40:12 +00:00
<div class="actions{{ if .IsDir }} disabled{{ end }}" id="file-only">
{{- if and (not .IsDir) (.User.AllowEdit) }}
{{- if .Editor}}
2017-01-15 11:47:52 +00:00
2017-01-01 22:40:12 +00:00
{{- if eq .Data.Mode "markdown" }}
<div class="action" id="preview" onclick="notImplemented(event);">
2017-01-15 11:47:52 +00:00
<i class="material-icons" title="Preview">remove_red_eye</i>
</div>
{{- end }}
{{- if eq .Data.Visual true }}
<div class="action" id="edit-source">
<i class="material-icons" title="Toggle edit source">code</i>
2017-01-01 22:40:12 +00:00
</div>
{{- end }}
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-01 22:40:12 +00:00
<div class="action" id="save">
<i class="material-icons" title="Save">save</i>
</div>
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-03 21:04:09 +00:00
{{- if .IsDir }}
2017-01-01 22:40:12 +00:00
<div class="action" id="open">
<i class="material-icons" title="See raw">open_in_new</i>
2017-01-03 21:04:09 +00:00
<span>See raw</span>
2016-12-31 15:29:36 +00:00
</div>
2017-01-03 21:04:09 +00:00
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-03 21:04:09 +00:00
{{- if and (.User.AllowEdit) (.IsDir) }}
2017-01-02 20:22:54 +00:00
<div class="action" id="move">
<i class="material-icons" title="Move">forward</i>
2017-01-03 21:04:09 +00:00
<span>Move file</span>
2017-01-02 20:22:54 +00:00
</div>
{{- end }}
2017-01-01 22:40:12 +00:00
{{- if and .IsDir .User.AllowEdit }}
<div class="action" id="rename">
<i class="material-icons" title="Edit">mode_edit</i>
</div>
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-03 21:04:09 +00:00
{{- if and .User.AllowEdit .IsDir }}
2017-01-01 22:40:12 +00:00
<div class="action" id="delete">
<i class="material-icons" title="Delete">delete</i><span>Delete</span>
</div>
{{- end }}
</div>
2017-01-02 20:22:54 +00:00
2017-01-02 12:20:20 +00:00
<div class="action mobile-only" id="more">
<i class="material-icons">more_vert</i>
</div>
2017-01-02 20:22:54 +00:00
<div class="actions" id="main-actions">
2016-12-31 15:29:36 +00:00
{{- if .IsDir }}
<div class="action" id="view">
{{- if eq .Display "mosaic" }}
2017-01-01 22:40:12 +00:00
<a href="?display=list"><i class="material-icons" title="Switch View">view_list</i><span>Switch view</span></a>
2017-01-02 20:22:54 +00:00
{{- else }}
2017-01-01 22:40:12 +00:00
<a href="?display=mosaic"><i class="material-icons" title="Switch View">view_module</i><span>Switch view</span></a>
2016-12-31 15:29:36 +00:00
{{- end }}
2016-10-25 20:08:26 +00:00
</div>
2017-01-02 20:22:54 +00:00
2017-01-01 22:40:12 +00:00
<div class="action mobile-only" id="multiple-selection-activate">
<i class="material-icons">check_circle</i><span>Select</span>
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
2017-01-02 20:22:54 +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">
2017-01-01 22:40:12 +00:00
<i class="material-icons" title="Upload">file_upload</i><span>Upload</span>
2016-10-25 20:08:26 +00:00
</div>
2016-12-31 15:29:36 +00:00
{{- end }}
2017-01-02 20:22:54 +00:00
2017-01-03 21:04:09 +00:00
{{- if not .IsDir }}
<div class="action" id="open">
<i class="material-icons" title="See raw">open_in_new</i>
<span>See raw</span>
</div>
{{- end }}
{{- if and .User.AllowEdit (not .IsDir) }}
<div class="action" id="delete">
<i class="material-icons" title="Delete">delete</i><span>Delete</span>
</div>
{{- end }}
2017-01-01 23:46:36 +00:00
<div {{ if .IsDir }}data-dropdown{{ end }} class="action" id="download">
{{- if not .IsDir}}<a href="?download=true">{{ end }}
2017-01-01 23:38:11 +00:00
<i class="material-icons" title="Download">file_download</i><span>Download</span>
2017-01-01 23:46:36 +00:00
{{- if not .IsDir}}</a>{{ end }}
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
{{- if .IsDir }}
2017-01-01 23:38:11 +00:00
<ul class="dropdown" id="download-drop">
2016-12-29 22:50:36 +00:00
<a data-format="zip" href="?download=zip"><li>zip</li></a>
2017-01-02 14:06:32 +00:00
<a data-format="tar" href="?download=tar"><li>tar</li></a>
<a data-format="targz" href="?download=targz"><li>tar.gz</li></a>
<a data-format="tarbz2" href="?download=tarbz2"><li>tar.bz2</li></a>
<a data-format="tarbz2" href="?download=tarxz"><li>tar.xz</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>
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
<div class="action" id="info" onclick="notImplemented(event);">
2017-01-01 22:40:12 +00:00
<i class="material-icons" title="Info">info</i><span>Info</span>
2016-12-29 22:50:36 +00:00
</div>
2016-11-02 19:29:29 +00:00
</div>
</div>
2017-01-02 20:22:54 +00:00
2017-01-01 22:40:12 +00:00
<div id="click-overlay"></div>
2017-01-02 20:22:54 +00:00
</header>
2017-01-01 22:40:12 +00:00
<div id="multiple-selection" class="mobile-only">
<p>Multiple selection enabled</p>
<div class="action" id="multiple-selection-cancel">
<i class="material-icons" title="Clear">clear</i>
</div>
</div>
2017-01-02 20:22:54 +00:00
2016-10-25 20:08:26 +00:00
<main>
2016-12-31 15:29:36 +00:00
{{- template "content" . }}
</main>
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
<div class="overlay"></div>
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
{{- 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 }}
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
<template id="question-template">
<form class="prompt">
<h3></h3>
<p></p>
<input autofocus type="text">
<div>
2016-12-31 21:04:47 +00:00
<button type="submit" autofocus class="ok">OK</button>
2016-12-31 15:29:36 +00:00
<button class="cancel" onclick="closePrompt(event);">Cancel</button>
</div>
</form>
</template>
2017-01-02 20:22:54 +00:00
2016-12-31 15:29:36 +00:00
<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>
2017-01-02 20:22:54 +00:00
<template id="move-template">
2017-01-03 15:10:33 +00:00
<!-- TODO: And the back button? :) -->
2017-01-02 20:22:54 +00:00
<form class="prompt">
<h3>Move</h3>
2017-01-03 15:10:33 +00:00
<p>Choose new house for your file(s)/folder(s):</p>
2017-01-03 17:35:13 +00:00
2017-01-02 20:22:54 +00:00
<div class="file-list">
<ul>
</ul>
</div>
2017-01-03 17:35:13 +00:00
2017-01-03 15:10:33 +00:00
<p>Currently navigating on: <code></code>.</p>
2017-01-02 20:22:54 +00:00
<div>
2017-01-03 15:10:33 +00:00
<button type="submit" autofocus class="ok">Move</button>
2017-01-02 20:22:54 +00:00
<button class="cancel" onclick="closePrompt(event);">Cancel</button>
</div>
</form>
</template>
2016-12-31 19:13:35 +00:00
<div class="help">
<h3>Help</h3>
2017-01-02 20:22:54 +00:00
2017-01-02 12:20:20 +00:00
<ul>
<li><strong>F1</strong> - this information</li>
<li><strong>F2</strong> - rename file</li>
<li><strong>DEL</strong> - delete selected items</li>
<li><strong>ESC</strong> - clear selection and/or close the prompt</li>
<li><strong>CTRL + S</strong> - save a file or download the directory where you are</li>
<li><strong>CTRL + Click</strong> - select multiple files or directories</li>
<li><strong>Double click</strong> - open a file or directory</li>
<li><strong>Click</strong> - select file or directory</li>
</ul>
2017-01-02 20:22:54 +00:00
2016-12-31 21:04:47 +00:00
<p>Not available yet</p>
2017-01-02 20:22:54 +00:00
2017-01-02 12:20:20 +00:00
<ul>
<li><strong>Alt + Click</strong> - select a group of files</li>
</ul>
2017-01-02 20:22:54 +00:00
2016-12-31 19:13:35 +00:00
<div>
<button type="submit" onclick="closeHelp(event);" class="ok">OK</button>
</div>
</div>
2016-10-25 20:08:26 +00:00
2017-01-14 16:39:33 +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>. Revision {{ .Commit }}.</footer>
2016-10-25 20:08:26 +00:00
</body>
2016-06-23 15:10:31 +00:00
</html>