filebrowser/assets/templates/browse.tmpl

95 lines
4.0 KiB
Cheetah
Raw Normal View History

2015-09-17 20:26:06 +00:00
{{ define "content" }}{{ $path := .Path }}
2015-09-17 16:41:31 +00:00
2016-02-06 16:33:54 +00:00
<main class="browse">
<div class="actions">
<div class="container">
{{if .CanGoUp}}<a data-pjax href=".." class="up" title="Up one level"><i class="fa fa-arrow-left fa-lg"></i></a>{{end}}
<span id="site-title">Path: {{ $path }}</span>
<div class="go-right">
<input type="file" value="Upload" multiple>
<button id="upload">Upload <i class="fa fa-cloud-upload"></i></button>
<button class="default new">New <i class="fa fa-plus"></i></button>
{{ if .User.Git }}<button class="darker git"><i class="fa fa-git"></i></button>{{ end }}
2015-09-18 18:12:47 +00:00
</div>
2015-09-19 21:17:38 +00:00
</div>
2016-02-06 16:33:54 +00:00
</div>
2015-09-17 16:41:31 +00:00
2016-02-06 16:33:54 +00:00
<div class="container">
2016-01-31 22:14:17 +00:00
<table>
<tr>
<th class="left">
{{if and (eq .Sort "name") (ne .Order "desc")}}
<a data-pjax href="?sort=name&order=desc">Name <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "name") (ne .Order "asc")}}
<a data-pjax href="?sort=name&order=asc">Name <i class="fa fa-arrow-down"></i></a> {{else}}
<a data-pjax href="?sort=name&order=asc">Name</a> {{end}}
</th>
<th class="right hideable">
{{if and (eq .Sort "size") (ne .Order "desc")}}
<a data-pjax href="?sort=size&order=desc">Size <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "size") (ne .Order "asc")}}
<a data-pjax href="?sort=size&order=asc">Size <i class="fa fa-arrow-down"></i></a> {{else}}
<a data-pjax href="?sort=size&order=asc">Size</a> {{end}}
</th>
<th class="hideable right">
{{if and (eq .Sort "time") (ne .Order "desc")}}
2016-02-06 16:33:54 +00:00
<a data-pjax href="?sort=time&order=desc">Modified <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "time") (ne .Order "asc")}}
<a data-pjax href="?sort=time&order=asc">Modified <i class="fa fa-arrow-down"></i></a> {{else}}
<a data-pjax href="?sort=time&order=asc">Modified</a> {{end}}
2016-01-31 22:14:17 +00:00
</th>
2016-02-06 16:33:54 +00:00
<th class="right buttons"></th>
2016-01-31 22:14:17 +00:00
</tr>
{{range .Items}}
<tr>
<td>
{{if .IsDir}}
2016-02-07 19:37:01 +00:00
<i class="fa fa-folder"></i> <a data-pjax class="filename" href="{{.URL}}">{{.Name}}</a> {{else}} {{ if CanBeEdited .URL }}
<i class="fa fa-file"></i> <a data-pjax class="file filename" href="/admin/edit{{ $path }}{{.URL}}">{{.Name}}</a> {{ else }}
<i class="fa fa-file"></i> <span class="filename">{{.Name}}</span> {{ end }} {{ end }}
2016-01-31 22:14:17 +00:00
</td>
<td class="right hideable">{{.HumanSize}}</td>
<td class="right hideable">{{.HumanModTime "01/02/2006 3:04:05 PM"}}</td>
2016-02-06 16:33:54 +00:00
<td class="right"><button data-file="/admin/browse{{ $path }}{{.URL}}" data-message="File renamed." class="rename">&#9998;</button> <button data-file="/admin/browse{{ $path }}{{.URL}}" data-message="File deleted." class="delete">&#10006;</button></td>
2016-01-31 22:14:17 +00:00
</tr>
{{end}}
</table>
2016-02-06 16:33:54 +00:00
</div>
</main>
2016-02-07 15:57:43 +00:00
2016-02-07 21:12:01 +00:00
<div id="foreground" class="hidden"></div>
<form class="popup hidden" id="delete">
<h3>Delete</h3>
<p>Are you sure you want to delete "<span></span>"?</p>
<p class="right">
<button class="close" class="darker">No</button>
<input type="submit" value="Yes, I am">
</p>
</form>
2016-02-07 17:16:09 +00:00
2016-02-07 19:37:01 +00:00
<form class="popup hidden" id="new">
2016-02-07 17:16:09 +00:00
<h3>New file</h3>
<p>Write the name of the new file. If you want to use an archetype, add <code>:archetype</code> in the end, replacing 'archetype' by its name.</p>
2016-02-07 19:37:01 +00:00
<input type="text" placeholder="Write here...">
2016-02-07 17:16:09 +00:00
<p class="right">
<input type="submit" value="Create">
</p>
</form>
2016-02-07 19:37:01 +00:00
<form class="popup hidden" id="rename">
2016-02-07 17:16:09 +00:00
<h3>Rename file</h3>
2016-02-07 19:37:01 +00:00
<p>Write down the new name of "<span></span>".</p>
<input type="text" placeholder="New name...">
<p class="right">
<input type="submit" value="Rename">
</p>
</form>
<form class="popup hidden" id="git">
<h3>Git</h3>
<p>Write down the <code>git</code> command you want to execute. You don't need to write <code>git</code>.</p>
<input type="text" placeholder="git push origin master">
<p class="right">
<input type="submit" value="Execute">
</p>
</form>
2015-09-15 20:47:12 +00:00
{{ end }}