updates
This commit is contained in:
@@ -1,96 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{.Name}}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="{{ .Config.BaseURL }}/_filemanagerinternal/css/styles.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js"></script>
|
||||
<script src="{{ .Config.BaseURL }}/_filemanagerinternal/js/form-to-json.js"></script>
|
||||
<script src="{{ .Config.BaseURL }}/_filemanagerinternal/js/application.js"></script>
|
||||
{{ if ne .Config.StyleSheet "" }}<style>{{.Config.StyleSheet}}</style>{{ end }}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div>
|
||||
{{ $lnk := .PreviousLink }}
|
||||
{{ if ne $lnk ""}}<a href="{{ $lnk }}">{{ end }}
|
||||
<div class="action{{ if eq $lnk ""}} disabled{{ end }}" id="prev">
|
||||
<i class="material-icons">subdirectory_arrow_left</i>
|
||||
</div>
|
||||
{{ if ne $lnk ""}}</a>{{ end }}
|
||||
<head>
|
||||
<title>{{.Name}}</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500' rel='stylesheet' type='text/css'>
|
||||
<link rel="stylesheet" href="{{ .Config.BaseURL }}/_filemanagerinternal/css/styles.css">
|
||||
|
||||
<p>
|
||||
<a href="{{ if eq .Config.BaseURL "" }}/{{ else }}{{ .Config.BaseURL }}{{ end }}">
|
||||
{{ if .Config.HugoEnabled }}Hugo{{ else }}File Manager{{ end }}
|
||||
</a>
|
||||
{{ if ne .Name "/"}}<i class="material-icons">chevron_right</i>{{ .Name }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if ne .Config.StyleSheet "" }}
|
||||
<style>
|
||||
{{.Config.StyleSheet}}
|
||||
</style>
|
||||
{{ end }}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div>
|
||||
{{ $lnk := .PreviousLink }}
|
||||
{{ if ne $lnk ""}}
|
||||
<a href="{{ $lnk }}">
|
||||
{{ end }}
|
||||
<div class="action{{ if eq $lnk " "}} disabled{{ end }}" id="prev">
|
||||
<i class="material-icons">subdirectory_arrow_left</i>
|
||||
</div>
|
||||
{{ if ne $lnk ""}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
<a href="{{ if eq .Config.BaseURL " " }}/{{ else }}{{ .Config.BaseURL }}{{ end }}">
|
||||
{{ if .Config.HugoEnabled }}Hugo{{ else }}File Manager{{ end }}
|
||||
</a>
|
||||
{{ if ne .Name "/"}}
|
||||
<i class="material-icons">chevron_right</i>{{ .Name }}
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ if .IsDir}}
|
||||
<!--
|
||||
<form>
|
||||
<i class="material-icons">search</i>
|
||||
<input type="text" placeholder="Search or command">
|
||||
</form>
|
||||
-->
|
||||
<div class="action" id="view">
|
||||
<i class="material-icons">view_headline</i>
|
||||
</div>
|
||||
<div class="action" id="upload">
|
||||
<i class="material-icons">file_upload</i>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ template "actions" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Config.HugoEnabled }}
|
||||
<a href="{{ .Config.BaseURL }}/settings">
|
||||
<div class="action">
|
||||
<i class="material-icons">settings</i>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="action" id="logout">
|
||||
<i class="material-icons">exit_to_app</i>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{ if .IsDir }}
|
||||
<div id="toolbar">
|
||||
<div>
|
||||
{{ if .IsDir}}
|
||||
<!-- <form>
|
||||
<i class="material-icons">search</i>
|
||||
<input type="text" placeholder="Search or command">
|
||||
</form> -->
|
||||
<div class="action" id="view">
|
||||
<i class="material-icons">view_headline</i>
|
||||
</div>
|
||||
<div class="action" id="upload">
|
||||
<i class="material-icons">file_upload</i>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ template "actions" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Config.HugoEnabled }}
|
||||
<a href="{{ .Config.BaseURL }}/settings">
|
||||
<div class="action">
|
||||
<i class="material-icons">settings</i>
|
||||
</div>
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="action" id="logout">
|
||||
<i class="material-icons">exit_to_app</i>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{{ if .IsDir }}
|
||||
<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 class="action" id="back">
|
||||
<i class="material-icons">arrow_back</i>
|
||||
</div>
|
||||
<p>
|
||||
<span id="selected-number">0</span>
|
||||
selected.</p>
|
||||
</div>
|
||||
<div>
|
||||
{{ template "actions" . }}
|
||||
{{ template "actions" . }}
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<main>
|
||||
{{ template "content" .Data }}
|
||||
</main>
|
||||
<main>
|
||||
{{ template "content" .Data }}
|
||||
</main>
|
||||
|
||||
{{ if .IsDir }}
|
||||
<div class="floating">
|
||||
{{ if .IsDir }}
|
||||
<div class="floating">
|
||||
<div class="action" id="newfolder">
|
||||
<i class="material-icons">add</i>
|
||||
<i class="material-icons">add</i>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<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>.
|
||||
{{ if .Config.HugoEnabled }}With a flavour of
|
||||
<a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">Hugo</a>.{{ end }}
|
||||
</footer>
|
||||
</body>
|
||||
<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>.
|
||||
{{ if .Config.HugoEnabled }}With a flavour of
|
||||
<a rel="noopener noreferrer" href="https://github.com/hacdias/caddy-filemanager">Hugo</a>.{{ end }}
|
||||
</footer>
|
||||
|
||||
<!-- SCRIPTS -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.3/ace.js"></script>
|
||||
<script src="{{ .Config.BaseURL }}/_filemanagerinternal/js/form2js.js"></script>
|
||||
<script src="{{ .Config.BaseURL }}/_filemanagerinternal/js/application.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
{{ define "content" }}
|
||||
<div id="editor" class="container" data-kind="{{ .Class }}">
|
||||
<form method="POST" action="./">
|
||||
{{ if or (eq .Class "frontmatter-only") (eq .Class "complete") }}
|
||||
<div class="frontmatter" data-type="parent">
|
||||
{{ template "blocks" .FrontMatter }}
|
||||
<div class="button add">Add field</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div id="editor" class="container" data-kind="{{ .Class }}">
|
||||
<form method="POST" action="./">
|
||||
{{ if or (eq .Class "frontmatter-only") (eq .Class "complete") }}
|
||||
<div class="frontmatter" data-type="parent">
|
||||
{{ template "blocks" .FrontMatter }}
|
||||
<div class="button add">Add field</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq .Class "content-only") (eq .Class "complete") }}
|
||||
{{ if or (eq .Class "content-only") (eq .Class "complete") }}
|
||||
|
||||
{{ if (eq .Class "complete")}}<h3>Body</h3>{{ end }}
|
||||
<div class="content">
|
||||
<div id="editor-source" data-mode="{{ .Mode }}"></div>
|
||||
<textarea name="content">{{ .Content }}</textarea>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if (eq .Class "complete")}}
|
||||
<h3>Body</h3>
|
||||
{{ end }}
|
||||
<div class="content">
|
||||
<div id="editor-source" data-mode="{{ .Mode }}"></div>
|
||||
<textarea name="content">{{ .Content }}</textarea>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div>
|
||||
<button id="submit" type="submit" data-type="{{ .Class }}"><span><i class="material-icons">save</i></span> <span>save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<button id="submit" type="submit" data-type="{{ .Class }}">
|
||||
<span>
|
||||
<i class="material-icons">save</i>
|
||||
</span>
|
||||
<span>save</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -1,55 +1,60 @@
|
||||
{{ define "blocks" }}
|
||||
{{ if .Fields }}<div class="group">{{ end }}
|
||||
{{ range $key, $value := .Fields }}
|
||||
{{ if eq $value.Parent.Type "array" }}
|
||||
<div id="{{ $value.Name }}-{{ $key }}" data-type="array-item">
|
||||
{{ template "value" $value }}
|
||||
<div class="action delete" data-delete="{{ $value.Name }}-{{ $key }}">
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="block" id="block-{{ $value.Name }}" data-content="{{ $value.Name }}">
|
||||
<label for="{{ $value.Name }}">{{ SplitCapitalize $value.Title }}</label>
|
||||
{{ template "value" $value }}
|
||||
<div class="action delete" data-delete="block-{{ $value.Name }}">
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Fields }}</div>{{ end }}
|
||||
{{ if .Fields }}
|
||||
<div class="group">
|
||||
{{ end }}
|
||||
{{ range $key, $value := .Fields }}
|
||||
{{ if eq $value.Parent.Type "array" }}
|
||||
<div id="{{ $value.Name }}-{{ $key }}" data-type="array-item">
|
||||
{{ template "value" $value }}
|
||||
<div class="action delete" data-delete="{{ $value.Name }}-{{ $key }}">
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="block" id="block-{{ $value.Name }}" data-content="{{ $value.Name }}">
|
||||
<label for="{{ $value.Name }}">{{ SplitCapitalize $value.Title }}</label>
|
||||
{{ template "value" $value }}
|
||||
<div class="action delete" data-delete="block-{{ $value.Name }}">
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if .Fields }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ range $key, $value := .Arrays }}
|
||||
{{ template "fielset" $value }}
|
||||
{{ end }}
|
||||
{{ range $key, $value := .Arrays }}
|
||||
{{ template "fielset" $value }}
|
||||
{{ end }}
|
||||
|
||||
{{ range $key, $value := .Objects }}
|
||||
{{ template "fielset" $value }}
|
||||
{{ end }}
|
||||
{{ range $key, $value := .Objects }}
|
||||
{{ template "fielset" $value }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ define "value" }}
|
||||
{{ if eq .HTMLType "textarea" }}
|
||||
<textarea class="scroll" name="{{ .Name }}" id="{{.Name }}" data-parent-type="{{ .Parent.Type }}">{{ .Content.Other }}</textarea>
|
||||
{{ else if eq .HTMLType "datetime" }}
|
||||
<input name="{{ .Name }}" id="{{ .Name }}" value="{{ .Content.Other.Format "2006-01-02T15:04" }}" type="datetime-local" data-parent-type="{{ .Parent.Type }}"></input>
|
||||
{{ else }}
|
||||
<input name="{{ .Name }}" id="{{ .Name }}" value="{{ .Content.Other }}" type="{{ .HTMLType }}" data-parent-type="{{ .Parent.Type }}"></input>
|
||||
{{ if eq .HTMLType "textarea" }}
|
||||
<textarea class="scroll" name="{{ .Name }}" id="{{.Name }}" data-parent-type="{{ .Parent.Type }}">{{ .Content.Other }}</textarea>
|
||||
{{ else if eq .HTMLType "datetime" }}
|
||||
<input name="{{ .Name }}" id="{{ .Name }}" value="{{ .Content.Other.Format " 2006-01-02T15:04" }}" type="datetime-local" data-parent-type="{{ .Parent.Type }}"></input>
|
||||
{{ else }}
|
||||
<input name="{{ .Name }}" id="{{ .Name }}" value="{{ .Content.Other }}" type="{{ .HTMLType }}" data-parent-type="{{ .Parent.Type }}"></input>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ define "fielset" }}
|
||||
<fieldset id="{{ .Name }}" data-type="{{ .Type }}">
|
||||
{{ if not (eq .Title "") }}<h3>{{ SplitCapitalize .Title }}</h3>{{ end }}
|
||||
<fieldset id="{{ .Name }}" data-type="{{ .Type }}">
|
||||
{{ if not (eq .Title "") }}
|
||||
<h3>{{ SplitCapitalize .Title }}</h3>
|
||||
{{ end }}
|
||||
<div class="action add">
|
||||
<i class="material-icons">add</i>
|
||||
<i class="material-icons">add</i>
|
||||
</div>
|
||||
<div class="action delete" data-delete="{{ .Name }}">
|
||||
<i class="material-icons">close</i>
|
||||
<i class="material-icons">close</i>
|
||||
</div>
|
||||
{{ template "blocks" .Content }}
|
||||
</fieldset>
|
||||
{{ template "blocks" .Content }}
|
||||
</fieldset>
|
||||
{{ end }}
|
||||
|
||||
@@ -25,11 +25,10 @@
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
<span class="checkbox">
|
||||
<span class="checkbox"></div>
|
||||
{{- end}}
|
||||
</div>
|
||||
{{- end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input style="display:none" type="file" id="upload-input" onchange="handleFiles(this.files)" value="Upload" multiple>
|
||||
{{ end }}
|
||||
<input style="display:none" type="file" id="upload-input" onchange="handleFiles(this.files)" value="Upload" multiple>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user