This commit is contained in:
Henrique Dias
2016-08-21 20:10:12 +01:00
parent 63184da48f
commit b9ca7e2a9c
10 changed files with 134 additions and 97 deletions

View File

@@ -2,7 +2,7 @@
<div class="action" id="open">
<i class="material-icons" title="See raw">open_in_new</i> <span>See raw</span>
</div>
{{ if .IsDir }}
{{ if and .IsDir .User.AllowEdit }}
<div class="action" id="rename">
<i class="material-icons" title="Edit">mode_edit</i>
</div>
@@ -10,7 +10,9 @@
<div class="action" id="download">
<i class="material-icons" title="Download">file_download</i> <span>Download</span>
</div>
{{ if .User.AllowEdit }}
<div class="action" id="delete">
<i class="material-icons" title="Delete">delete</i> <span>Delete</span>
</div>
{{ end }}
{{ end }}

View File

@@ -63,18 +63,22 @@
{{ if .IsDir}}
{{ if .User.AllowCommands }}
<div id="search">
<i class="material-icons" title="Storage">storage</i>
<input type="text" placeholder="Execute a command...">
<div>Write your git, mercurial or svn command and press enter.</div>
</div>
{{ end }}
<div class="action" id="view">
<i class="material-icons" title="Switch view">view_headline</i> <span>Switch view</span>
</div>
{{ if .User.AllowNew }}
<div class="action" id="upload">
<i class="material-icons" title="Upload">file_upload</i> <span>Upload</span>
</div>
{{ end }}
{{ else }}
{{ template "actions" . }}
{{ end }}
@@ -103,7 +107,7 @@
{{ end }}
<main>
{{ template "content" .Data }}
{{ template "content" . }}
<span id="token">{{ .Config.Token }}</span>
</main>

View File

@@ -1,4 +1,5 @@
{{ define "content" }}
{{ with .Data }}
<div id="editor" class="container" data-kind="{{ .Class }}">
<form method="POST" action="./">
{{ if or (eq .Class "frontmatter-only") (eq .Class "complete") }}
@@ -30,3 +31,4 @@
</form>
</div>
{{ end }}
{{ end }}

View File

@@ -1,42 +1,46 @@
{{ define "content" }}
<div class="listing">
<div class="container" id="listing">
{{- range .Items}}
<div class="item" data-dir="{{- if .IsDir}}true{{ else }}false{{ end }}" id="{{.URL}}">
<div>
<a href="{{.URL}}">
{{- if .IsDir}}
<i class="material-icons">folder</i>
{{- else}}
<i class="material-icons">insert_drive_file</i>
{{- end}}
</a>
</div>
<div>
<a href="{{.URL}}">
<span class="name">{{.Name}}</span>
{{- if .IsDir}}
<p data-order="-1">&mdash;</p>
{{- else}}
<p data-order="{{.Size}}">{{.HumanSize}}</p>
{{- end}}
<p>
<time datetime="{{.HumanModTime " 2006-01-02T15:04:05Z"}}">{{.HumanModTime "01/02/2006 03:04:05 PM -07:00"}}</time>
</p>
</a>
</div>
<span class="checkbox" data-href="{{.URL}}"><i class="material-icons">check</i></div>
{{ with .Data }}
<div class="listing">
<div class="container" id="listing">
{{- range .Items}}
<div class="item" data-dir="{{- if .IsDir}}true{{ else }}false{{ end }}" id="{{.URL}}">
<div>
<a href="{{.URL}}">
{{- if .IsDir}}
<i class="material-icons">folder</i>
{{- else}}
<i class="material-icons">insert_drive_file</i>
{{- end}}
</a>
</div>
<div>
<a href="{{.URL}}">
<span class="name">{{.Name}}</span>
{{- if .IsDir}}
<p data-order="-1">&mdash;</p>
{{- else}}
<p data-order="{{.Size}}">{{.HumanSize}}</p>
{{- end}}
<p>
<time datetime="{{.HumanModTime " 2006-01-02T15:04:05Z"}}">{{.HumanModTime "01/02/2006 03:04:05 PM -07:00"}}</time>
</p>
</a>
</div>
<span class="checkbox" data-href="{{.URL}}"><i class="material-icons">check</i>
</div>
{{- end}}
</div>
</div>
</div>
</div>
<input style="display:none" type="file" id="upload-input" onchange="handleFiles(this.files)" value="Upload" multiple>
<input style="display:none" type="file" id="upload-input" onchange="handleFiles(this.files)" value="Upload" multiple>
{{ end }}
{{ if .User.AllowNew }}
<input id="newdir" type="text" placeholder="Name...">
<div class="floating">
<div class="action" id="new">
<i class="material-icons" title="New">add</i>
</div>
</div>
{{ end }}
<div class="floating">
<div class="action" id="new">
<i class="material-icons" title="New">add</i>
</div>
</div>
{{ end }}
{{ end }}

View File

@@ -1,2 +1,2 @@
{{ template "content" .Data }}
{{ template "content" . }}
<span id="token">{{ .Config.Token }}</span>

View File

@@ -1,5 +1,5 @@
{{ define "content" }}
{{ with .Data}}
<main class="container">
{{ if eq .Type "image" }}
<img src="{{ .URL }}?raw=true">
@@ -11,5 +11,5 @@
<pre>{{ .Content }}</pre>
{{ end }}
</main>
{{ end }}
{{ end }}