teampltes update

pull/144/head
Henrique Dias 2016-06-22 22:18:21 +01:00
parent a22bc751ec
commit f2846ebde5
4 changed files with 149 additions and 101 deletions

View File

@ -1,6 +1,16 @@
{{ define "actions" }}
<div class="action" id="open"><i class="material-icons">open_in_new</i></div>
{{ if .IsDir }}<div class="action" id="rename"><i class="material-icons">mode_edit</i></div>{{ end }}
<div class="action" id="download"><i class="material-icons">file_download</i></div>
<div class="action" id="delete"><i class="material-icons">delete</i></div>
<div class="action" id="open">
<i class="material-icons">open_in_new</i>
</div>
{{ if .IsDir }}
<div class="action" id="rename">
<i class="material-icons">mode_edit</i>
</div>
{{ end }}
<div class="action" id="download">
<i class="material-icons">file_download</i>
</div>
<div class="action" id="delete">
<i class="material-icons">delete</i>
</div>
{{ end }}

View File

@ -7,7 +7,11 @@
<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="{{ .Config.BaseURL }}/_filemanagerinternal/js/application.js"></script>
{{ if ne .Config.StyleSheet "" }}<style>{{ .Config.StyleSheet}}</style>{{ end }}
{{ if ne .Config.StyleSheet "" }}
<style>
{{.Config.StyleSheet}}
</style>
{{ end }}
{{ if .Config.HugoEnabled }}
<!-- Hugo plugin stuff -->
<link rel="stylesheet" href="{{ .Config.BaseURL }}/_hugointernal/css/styles.css">
@ -18,25 +22,51 @@
<header>
<div>
{{ $lnk := .PreviousLink }}
{{ 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 }}
<div class="action disabled" id="prev"><i class="material-icons">subdirectory_arrow_left</i></div>{{ 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 }}
{{ 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 }}
<div class="action disabled" id="prev">
<i class="material-icons">subdirectory_arrow_left</i>
</div>
{{ 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">
<i class="material-icons">search</i>
<input type="text" placeholder="Search">
</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>
<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 }}
<!-- Hugo plugin stuff -->
<a href="{{ .Config.BaseURL }}/settings"><div class="action"><i class="material-icons">settings</i></div></a>
<div class="action" id="logout"><i class="material-icons">exit_to_app</i></div>
<a href="{{ .Config.BaseURL }}/settings">
<div class="action">
<i class="material-icons">settings</i>
</div>
</a>
<div class="action" id="logout">
<i class="material-icons">exit_to_app</i>
</div>
{{ end }}
</div>
</header>
@ -44,8 +74,12 @@
{{ 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" . }}
@ -56,7 +90,12 @@
{{ template "content" .Data }}
</main>
<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 }}
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>
</html>

View File

@ -1,5 +1,5 @@
{{ define "content" }}
<div class="listing">
<div class="listing">
<div class="container" id="listing">
{{- range .Items}}
<div class="item" id="{{.URL}}">
@ -20,11 +20,13 @@
{{- else}}
<p data-order="{{.Size}}">{{.HumanSize}}</p>
{{- end}}
<p class="hideable"><time datetime="{{.HumanModTime "2006-01-02T15:04:05Z"}}">{{.HumanModTime "01/02/2006 03:04:05 PM -07:00"}}</time></p>
<p class="hideable">
<time datetime="{{.HumanModTime " 2006-01-02T15:04:05Z"}}">{{.HumanModTime "01/02/2006 03:04:05 PM -07:00"}}</time>
</p>
</a>
</div>
</div>
{{- end}}
</div>
</div>
</div>
{{ end }}

View File

@ -1,18 +1,15 @@
{{ define "content" }}
<main class="container">
<main class="container">
{{ if eq .Type "image" }}
<img src="{{ .URL }}?raw=true">
{{ else if eq .Type "audio" }}
<audio src="{{ .URL }}?raw=true">
</audio>
<audio src="{{ .URL }}?raw=true"></audio>
{{ else if eq .Type "video" }}
{{ else}}
<pre>{{ .Content }}</pre>
{{ end }}
</main>
</main>
{{ end }}