dexter/app/templates/index.html.ep

110 lines
5.3 KiB
Plaintext

<!DOCTYPE html>
<html lang="en_US">
<head>
<title>Index of <%= $c->req->url->path->to_route %></title>
<meta charset="utf-8" />
<link rel="stylesheet" href="/.assets/style.css" />
<script src="/.assets/main.js"></script>
</head>
<body>
<header>
<h1>Index of <%= $c->req->url->path->to_route %></h1>
</header>
<article>
<table>
<thead>
<tr>
<th class="left">
<a href="?sort=name-<%= $SORTS->{name}{order} %>">
Name<%= $SORTS->{name}{symbol} %>
</a>
</th>
<th class="right">
<a href="?sort=size-<%= $SORTS->{size}{order} %>">
Size<%= $SORTS->{size}{symbol} %>
</a>
</th>
<th class="right">
<a href="?sort=date-<%= $SORTS->{date}{order} %>">
Date Modified<%= $SORTS->{date}{symbol} %>
</a>
</th>
</tr>
</thead>
% if ( permission_available_at_path('CREATE', 'file') ) {
<tfoot>
<tr>
<td colspan="3">
<a class="button" onclick="upload_button(this)">
+ Upload File...
</a>
<form action="./" onsubmit="upload_submit(this)" method="post" enctype="multipart/form-data">
<input type="hidden" name="intent" value="upload" />
<input type="hidden" name="target_path" />
<input type="file" name="upload" />
<input type="submit" value="Send It" />
</form>
</td>
</tr>
<tr>
<td colspan="3">
<a class="button" onclick="mkdir_button(this)">
+ Make Directory...
</a>
<form action="./" method="post">
<input type="hidden" name="intent" value="mkdir" />
<input type="hidden" name="target_path" />
</form>
</td>
</tr>
</tfoot>
% }
<tbody>
% foreach my $file (@$FILES) {
<tr>
<td class="left">
<a href="<%= $file->{name_dec} %>">
<%= $file->{name_dec} %>
</a>
<span class="buttons">
% if ( permission_available_at_path('MOVE', $file->{name}) ) {
<span>
<a class="button" onclick="file_move(this)">&nbsp;✎&nbsp;</a>
<form action="./" method="post">
<input type="hidden" name="intent" value="move" />
<input type="hidden" name="target_path" value="<%= $file->{name_dec} %>" />
<input type="hidden" name="dest_path" value="" />
</form>
</span>
% }
% if ( permission_available_at_path('DELETE', $file->{name}) ) {
<span>
<a class="button" onclick="file_delete(this)">&nbsp;✖&nbsp;</a>
<form action="./" method="post">
<input type="hidden" name="intent" value="delete" />
<input type="hidden" name="target_path" value="<%= $file->{name_dec} %>" />
</form>
</span>
% }
</span>
</td>
<td class="right">
<%= make_size_human_readable($file->{size}) %>
</td>
<td class="right">
<%= localtime($file->{mtime}) %>
</td>
</tr>
% }
</tbody>
</table>
</article>
<footer>
<p>
<sub>Powered by <a href="https://git.unix.dog/oaktal/dexter">Dexter</a>.</sub>
</p>
</footer>
</body>
</html>