filebrowser/_assets/_old/templates/actions.tmpl

111 lines
3.7 KiB
Cheetah
Raw Normal View History

2017-06-27 18:00:58 +00:00
{{ define "info-button" }}
<button title="Info" aria-label="Info" class="action" id="info">
<i class="material-icons">info</i>
<span>Info</span>
</button>
{{ end }}
{{ define "delete-button" }}
<button aria-label="Delete" title="Delete" class="action" id="delete">
<i class="material-icons">delete</i>
<span>Delete</span>
</button>
{{ end }}
2017-06-26 19:38:40 +00:00
{{ define "right-side-actions" }}
2017-06-27 18:00:58 +00:00
{{ template "info-button" }}
{{ end }}
{{ define "right" }}
{{- if not .IsEditor }}
2017-06-26 19:38:40 +00:00
<a aria-label="Switch View" href="?display={{- if eq .Display "mosaic" }}list{{ else }}mosaic{{ end }}" class="action">
<i class="material-icons">{{- if eq .Display "mosaic" }}view_list{{ else }}view_module{{ end }}</i>
<span>Switch view</span>
</a>
<button aria-label="Select multiple" class="action mobile-only" id="multiple-selection-activate">
<i class="material-icons">check_circle</i>
<span>Select</span>
</button>
{{- end }}
2017-06-27 18:00:58 +00:00
{{- if and (.User.AllowNew) (not .IsEditor) }}
2017-06-26 19:38:40 +00:00
<button aria-label="Upload" title="Upload" class="action" id="upload">
<i class="material-icons">file_upload</i>
<span>Upload</span>
</button>
{{- end }}
2017-06-27 18:00:58 +00:00
{{- if and .User.AllowEdit (.IsEditor) }}
2017-06-26 19:38:40 +00:00
<button aria-label="Delete" title="Delete" class="action" id="delete">
<i class="material-icons">delete</i>
<span>Delete</span>
</button>
{{- end }}
<button {{ if .IsDir }}data-dropdown{{ end }} aria-label="Download" title="Download" class="action" id="download">
2017-06-27 18:00:58 +00:00
{{- if .IsEditor}}<a href="?download=true">{{ end }}
2017-06-26 19:38:40 +00:00
<i class="material-icons">file_download</i><span>Download</span>
2017-06-27 18:00:58 +00:00
{{- if .IsEditor}}</a>{{ end }}
2017-06-26 19:38:40 +00:00
2017-06-27 18:00:58 +00:00
{{- if not .IsEditor }}
2017-06-26 19:38:40 +00:00
<ul class="dropdown" id="download-drop">
<a tabindex="0" aria-label="Download as Zip" data-format="zip" href="?download=zip"><li>zip</li></a>
<a tabindex="0" aria-label="Download as Tar" data-format="tar" href="?download=tar"><li>tar</li></a>
<a tabindex="0" aria-label="Download as TarGz" data-format="targz" href="?download=targz"><li>tar.gz</li></a>
<a tabindex="0" aria-label="Download as TarBz2" data-format="tarbz2" href="?download=tarbz2"><li>tar.bz2</li></a>
<a tabindex="0" aria-label="Download as TarXz" data-format="tarbz2" href="?download=tarxz"><li>tar.xz</li></a>
</ul>
{{- end }}
</button>
2017-06-27 18:00:58 +00:00
{{ end }}
2017-06-26 19:38:40 +00:00
{{ define "left-side-actions" }}
2017-06-27 18:00:58 +00:00
{{ end }}
{{ define "left" }}
{{- if and (not .IsDir) (.User.AllowEdit) }}
2017-06-26 19:38:40 +00:00
{{- if .Editor}}
{{- if eq .Data.Mode "markdown" }}
<button aria-label="Preview" class="action" id="preview" onclick="notImplemented(event);">
<i class="material-icons" title="Preview">remove_red_eye</i>
</button>
{{- end }}
{{- if eq .Data.Visual true }}
<button aria-label="Toggle edit source" class="action" id="edit-source">
<i class="material-icons" title="Toggle edit source">code</i>
</button>
{{- end }}
{{/* end if editor */}}
<button aria-label="Save" class="action" id="save">
<i class="material-icons" title="Save">save</i>
</button>
2017-06-27 18:00:58 +00:00
{{- end }}
2017-06-26 19:38:40 +00:00
{{/* end if not dir and AllowEdit */}}
{{- end }}
{{- if and .IsDir .User.AllowEdit }}
<button aria-label="Edit" class="action" id="rename">
<i class="material-icons" title="Edit">mode_edit</i>
<span>Rename</span>
</button>
<button aria-label="Move" class="action" id="move">
<i class="material-icons" title="Move">forward</i>
<span>Move file</span>
</button>
<button aria-label="Delete" class="action" id="delete">
2017-06-27 18:00:58 +00:00
<i class="material-icons" title="Delete">delete</i><span>Delete</span>
2017-06-26 19:38:40 +00:00
</button>
{{- end }}
2017-06-27 18:00:58 +00:00
{{ end }}