Adds BoxActivity model to track actions taken on a box. Updates related endpoints and UI for activity feed.
152 lines
9.3 KiB
HTML
152 lines
9.3 KiB
HTML
{{ template "account_shell_start" . }}
|
|
<main class="account-window" aria-labelledby="box-manager-title">
|
|
{{ template "account_window_titlebar" . }}
|
|
|
|
<nav class="menu-bar" aria-label="Box manager toolbar">
|
|
<div class="menu-item">
|
|
<button class="menu-button" type="button" aria-expanded="false">File</button>
|
|
<div class="menu-popup" role="menu">
|
|
<a class="menu-action" href="/account/boxes"><span>B</span><span>Back to boxes</span><span></span></a>
|
|
<a class="menu-action" href="{{ .Box.OpenURL }}"><span>O</span><span>Open shared box</span><span></span></a>
|
|
<div class="menu-separator"></div>
|
|
<form action="/account/logout" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<button class="menu-action" type="submit"><span>Q</span><span>Log out</span><span></span></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<div class="box-manager-layout account-body-content">
|
|
{{ if .Error }}<p class="account-error">{{ .Error }}</p>{{ end }}
|
|
|
|
<section class="stats-grid" aria-label="Box summary">
|
|
<article class="stat-card sunken-panel is-info">
|
|
<p class="stat-label">Status</p>
|
|
<p class="stat-value">{{ .Box.Status }}</p>
|
|
<p class="stat-note"><span class="stat-note-pill">{{ .Box.Flags }}</span></p>
|
|
</article>
|
|
<article class="stat-card sunken-panel is-info">
|
|
<p class="stat-label">Storage</p>
|
|
<p class="stat-value">{{ .Box.Storage }}</p>
|
|
<p class="stat-note"><span class="stat-note-pill">{{ len .Files }} files</span></p>
|
|
</article>
|
|
<article class="stat-card sunken-panel is-warning">
|
|
<p class="stat-label">Expiration</p>
|
|
<p class="stat-note"><span class="stat-note-pill">{{ .Box.ExpiresAt }}</span></p>
|
|
</article>
|
|
<article class="stat-card sunken-panel is-ok">
|
|
<p class="stat-label">Owner policy</p>
|
|
<p class="stat-note"><span class="stat-note-pill">{{ if .Policy.CanEditMetadata }}editable{{ else }}locked{{ end }}</span><span class="stat-note-pill">{{ if .Policy.CanExtendExpiry }}refreshable{{ else }}no refresh{{ end }}</span></p>
|
|
</article>
|
|
</section>
|
|
|
|
<section class="box-manager-grid">
|
|
<div class="box-manager-main">
|
|
<section class="win98-window section-window">
|
|
<div class="win98-titlebar"><div class="win98-titlebar-label"><span class="win98-titlebar-icon">I</span><h2 id="box-manager-title">Identity</h2></div></div>
|
|
<div class="section-body sunken-panel">
|
|
<p><strong>Box:</strong> {{ .Box.ID }}</p>
|
|
<p><strong>Owner:</strong> {{ .Box.Owner }}</p>
|
|
<p><strong>Created:</strong> {{ .Box.CreatedAt }}</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="win98-window section-window">
|
|
<div class="win98-titlebar"><div class="win98-titlebar-label"><span class="win98-titlebar-icon">S</span><h2>Sharing Rules</h2></div></div>
|
|
<form class="section-body sunken-panel account-form" action="/account/boxes/{{ .Box.ID }}" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<label><input type="checkbox" name="disable_zip" value="true" {{ if .Box.DisableZip }}checked{{ end }} {{ if not .Policy.CanEditSharingRules }}disabled{{ end }}> Disable ZIP downloads</label>
|
|
<label><input type="checkbox" name="one_time_download" value="true" {{ if .Box.OneTimeDownload }}checked{{ end }} {{ if not .Policy.CanEditSharingRules }}disabled{{ end }}> One-time download</label>
|
|
<button class="win98-button" type="submit" {{ if not .Policy.CanEditSharingRules }}disabled{{ end }}>Save Rules</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="win98-window section-window">
|
|
<div class="win98-titlebar"><div class="win98-titlebar-label"><span class="win98-titlebar-icon">F</span><h2>Files</h2></div></div>
|
|
<form class="section-body sunken-panel" action="/account/boxes/{{ .Box.ID }}/files/delete" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<div class="scroll-panel files-scroll">
|
|
<table class="account-table boxes-table">
|
|
<thead><tr><th>Select</th><th>Name</th><th>Size</th><th>Status</th><th>Download</th></tr></thead>
|
|
<tbody>
|
|
{{ range .Files }}
|
|
<tr>
|
|
<td><input type="checkbox" name="file_ids" value="{{ .ID }}"></td>
|
|
<td>{{ .Name }}</td>
|
|
<td>{{ .Size }}</td>
|
|
<td>{{ .Status }}</td>
|
|
<td><a class="tiny-button" href="{{ .Download }}">Open</a></td>
|
|
</tr>
|
|
{{ else }}
|
|
<tr><td colspan="5">No files.</td></tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="bulk-actions raised-panel">
|
|
<button class="win98-button" type="submit" data-confirm="Delete selected files permanently?" {{ if not .Policy.CanDeleteFiles }}disabled{{ end }}>Delete Files</button>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
</div>
|
|
|
|
<aside class="box-manager-side">
|
|
<section class="sunken-panel section-body">
|
|
<h2>Expiration</h2>
|
|
<form class="account-form" action="/account/boxes/{{ .Box.ID }}/extend" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<label class="account-form-row"><span>Extend seconds</span><input class="account-control" name="extend_seconds" value="{{ .Policy.MaxExtensionSeconds }}" inputmode="numeric"></label>
|
|
<button class="win98-button" type="submit" {{ if not .Policy.CanExtendExpiry }}disabled{{ end }}>Extend</button>
|
|
</form>
|
|
<form action="/account/boxes/{{ .Box.ID }}/expire" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<button class="win98-button" type="submit" data-confirm="Expire this box now?" {{ if not .Policy.CanEditMetadata }}disabled{{ end }}>Expire Now</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="sunken-panel section-body">
|
|
<h2>Password</h2>
|
|
<form class="account-form" action="/account/boxes/{{ .Box.ID }}/password" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<label class="account-form-row"><span>New password</span><input class="account-control" name="password" type="password" autocomplete="new-password"></label>
|
|
<button class="win98-button" type="submit" {{ if not .Policy.CanEditPassword }}disabled{{ end }}>Set Password</button>
|
|
</form>
|
|
<form action="/account/boxes/{{ .Box.ID }}/password/remove" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<button class="win98-button" type="submit" data-confirm="Remove box password?" {{ if not .Policy.CanEditPassword }}disabled{{ end }}>Remove Password</button>
|
|
</form>
|
|
</section>
|
|
|
|
<section class="sunken-panel section-body">
|
|
<h2>Resolved Policy</h2>
|
|
<pre class="metadata-pre policy-pre">{{ .PolicyJSON }}</pre>
|
|
</section>
|
|
|
|
<section class="sunken-panel section-body">
|
|
<h2>Box Activity</h2>
|
|
<div class="activity-list-compact">
|
|
{{ range .Activity }}
|
|
<div class="activity-row"><span class="activity-time">{{ .At }}</span><div><p class="activity-title">{{ .Message }}</p><p class="activity-meta">{{ .Actor }}</p></div></div>
|
|
{{ end }}
|
|
</div>
|
|
</section>
|
|
|
|
<section class="sunken-panel section-body">
|
|
<form action="/account/boxes/{{ .Box.ID }}/delete" method="post">
|
|
{{ template "account_csrf_field" . }}
|
|
<button class="win98-button" type="submit" data-confirm="Delete this box permanently?" {{ if not .Policy.CanDeleteBox }}disabled{{ end }}>Delete Box</button>
|
|
</form>
|
|
</section>
|
|
</aside>
|
|
</section>
|
|
</div>
|
|
|
|
<footer class="win98-statusbar" aria-label="Box manager status">
|
|
<span>{{ .Box.ID }}</span>
|
|
<span>{{ .Box.Status }}</span>
|
|
<span>ready</span>
|
|
</footer>
|
|
</main>
|
|
{{ template "account_shell_end" . }}
|