updates
Former-commit-id: 758fe342877af58e60b52d5cec1bb27e1f81ac96
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<!-- TOP BAR -->
|
||||
<div id="top-bar">
|
||||
<div><p>File Manager</p></div>
|
||||
<div id="search">
|
||||
@@ -48,86 +47,124 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- BOTTOM BAR -->
|
||||
<div id="bottom-bar">
|
||||
<div>
|
||||
{{ if ne .Name "/"}}
|
||||
{{- if ne .Name "/"}}
|
||||
<p id="breadcrumbs-button">Previous</p>
|
||||
<ul id="breadcrumbs">
|
||||
{{ range $item := .BreadcrumbMap }}
|
||||
{{- range $item := .BreadcrumbMap }}
|
||||
<a href="{{ $absURL }}{{ $item.URL }}"><li>{{ $item.Name }}</li></a>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</ul><i class="material-icons">keyboard_arrow_right</i>
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{- end }}
|
||||
<p id="current-file">{{ if ne .Name "/"}}{{ .Name }}{{ else }}Root{{ end }}</p>
|
||||
</div>
|
||||
|
||||
<!-- ACTIONS -->
|
||||
<div class="actions">
|
||||
<div id="file-only" {{ if .IsDir }}class="disabled"{{ end }}>
|
||||
{{- 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 }}
|
||||
|
||||
<div class="action" id="open">
|
||||
<i class="material-icons" title="See raw">open_in_new</i>
|
||||
</div>
|
||||
{{ if and .IsDir .User.AllowEdit }}
|
||||
|
||||
{{- if and .IsDir .User.AllowEdit }}
|
||||
<div class="action" id="rename">
|
||||
<i class="material-icons" title="Edit">mode_edit</i>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{ if .User.AllowEdit }}
|
||||
{{- if .User.AllowEdit }}
|
||||
<div class="action" id="delete">
|
||||
<i class="material-icons" title="Delete">delete</i> <span>Delete</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
{{ if and (.User.AllowNew) (.IsDir) }}
|
||||
{{- 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 }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
{{- if and (.User.AllowNew) (.IsDir) }}
|
||||
<div class="action" id="upload">
|
||||
<i class="material-icons" title="Upload">file_upload</i> <span>Upload</span>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
||||
<div class="action" id="download">
|
||||
<a href="?download=true">
|
||||
<i class="material-icons" title="Download">file_download</i> <span>Download</span>
|
||||
</a>
|
||||
{{ if .IsDir }}
|
||||
{{- if .IsDir }}
|
||||
<ul class="prev-links">
|
||||
<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>
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{- 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 }}
|
||||
<div class="action" id="info" onclick="notImplemented(event);">
|
||||
<i class="material-icons" title="Info">info</i>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
{{ template "content" . }}
|
||||
|
||||
{{ if and (.User.AllowNew) (.IsDir) }}
|
||||
<input id="newdir" type="text" placeholder="Name. End with a trailing slash to create a dir.">
|
||||
<div class="floating">
|
||||
<div class="action" id="new">
|
||||
<i class="material-icons" title="New file or directory. End name with a trailing slash to create a directory.">add</i>
|
||||
{{- 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>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<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>
|
||||
</body>
|
||||
|
||||
@@ -18,27 +18,10 @@
|
||||
<textarea name="content">{{ .Content }}</textarea>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div>
|
||||
<button id="submit" type="submit" data-type="{{ .Class }}">
|
||||
<span>
|
||||
<i class="material-icons" title="Save">save</i>
|
||||
</span>
|
||||
<span>save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<template id="temporary-template">
|
||||
<div class="group temp" id="">
|
||||
<div class="block" id="">
|
||||
<label>Write the field name and then press enter. If you want to create an array or an object, end the name with ":array" or ":object".</label>
|
||||
<input name="" type="text" placeholder="Write the field name and press enter.."></input>
|
||||
</div></div>
|
||||
</template>
|
||||
|
||||
<template id="base-template">
|
||||
<fieldset id="" data-type="">
|
||||
<h3></h3>
|
||||
@@ -62,19 +45,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="array-template">
|
||||
<fieldset id="" data-type="">
|
||||
<h3></h3>
|
||||
<div class="action add">
|
||||
<i class="material-icons">add</i>
|
||||
</div>
|
||||
<div class="action delete" data-delete="">
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
<div class="group"></div>
|
||||
</fieldset>
|
||||
</template>
|
||||
|
||||
<template id="array-item-template">
|
||||
<div id="" data-type="array-item">
|
||||
<input name="" id="" type="text" data-parent-type="array"></input>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{- if not (eq .NumDirs 0)}}
|
||||
<h2>Folders</h2>
|
||||
<div>
|
||||
{{- range .Items }}
|
||||
@@ -40,7 +41,9 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if not (eq .NumFiles 0)}}
|
||||
<h2>Files</h2>
|
||||
<div>
|
||||
{{- range .Items }}
|
||||
@@ -49,6 +52,7 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
<input style="display:none" type="file" id="upload-input" onchange="handleFiles(this.files, '')" value="Upload" multiple>
|
||||
@@ -56,12 +60,12 @@
|
||||
{{- end -}}
|
||||
|
||||
{{ define "item" }}
|
||||
<div ondragstart="itemDragStart(event)"
|
||||
{{ if .IsDir}}ondragover="itemDragOver(event)" ondrop="itemDrop(event)"{{ end }}
|
||||
<div ondragstart="listing.itemDragStart(event)"
|
||||
{{ if .IsDir}}ondragover="listing.itemDragOver(event)" ondrop="listing.itemDrop(event)"{{ end }}
|
||||
draggable="true"
|
||||
class="item"
|
||||
onclick="selectItemEvent(event)"
|
||||
ondblclick="openItemEvent(event)"
|
||||
onclick="listing.selectItem(event)"
|
||||
ondblclick="listing.openItem(event)"
|
||||
data-dir="{{ .IsDir }}"
|
||||
data-url="{{ .URL }}"
|
||||
id="{{ EncodeBase64 .Name }}">
|
||||
|
||||
Reference in New Issue
Block a user