mirror of
https://github.com/cuigh/swirl
synced 2024-12-31 16:23:13 +00:00
83 lines
2.6 KiB
Go
83 lines
2.6 KiB
Go
{{ extends "../_layouts/default" }}
|
|
{{ import "../_modules/pager" }}
|
|
|
|
{{ block script() }}
|
|
<script>$(() => new Swirl.Image.ListPage())</script>
|
|
{{ end }}
|
|
|
|
{{ block body() }}
|
|
<section class="hero is-info">
|
|
<div class="hero-body">
|
|
<div class="container has-text-centered">
|
|
<h1 class="title is-2 is-uppercase">{{ i18n("image.title") }}</h1>
|
|
<h2 class="subtitle is-5">{{ i18n("image.description") }}</h2>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="section">
|
|
<nav class="level">
|
|
<!-- Left side -->
|
|
<div class="level-left">
|
|
<div class="level-item">
|
|
<form>
|
|
<div class="field has-addons">
|
|
<p class="control">
|
|
<input name="name" value="{{.Name}}" class="input" placeholder="{{ i18n("image.placeholder.search") }}">
|
|
</p>
|
|
<p class="control">
|
|
<button class="button is-primary">{{ i18n("button.search") }}</button>
|
|
</p>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="level-item">
|
|
<p class="subtitle is-5">
|
|
<strong>{{.Pager.Count}}</strong>
|
|
<span class="is-lowercase">{{ i18n("menu.image") }}</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<!-- Right side -->
|
|
<div class="level-right">
|
|
<p class="level-item">
|
|
<button id="btn-delete" class="button is-danger"><span class="icon"><i class="far fa-trash-alt"></i></span><span>{{ i18n("button.delete") }}</span></button>
|
|
</p>
|
|
</div>
|
|
</nav>
|
|
|
|
<table id="table-items" class="table is-bordered is-striped is-hoverable is-narrow is-fullwidth">
|
|
<thead>
|
|
<tr>
|
|
<th width="30"><input type="checkbox" data-action="check-all"></th>
|
|
<th>{{ i18n("field.id") }}</th>
|
|
<th>{{ i18n("field.tag") }}</th>
|
|
<th>{{ i18n("field.size") }}</th>
|
|
<th>{{ i18n("field.created-at") }}</th>
|
|
<th>{{ i18n("field.action") }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{range .Images}}
|
|
<tr>
|
|
<td><input type="checkbox" value="{{.ID}}" data-action="check"></td>
|
|
<td><a href="/image/{{ .ID }}/detail">{{ limit(.ID, 30) }}</a></td>
|
|
<td>
|
|
<div class="tags">
|
|
{{range .RepoTags}}
|
|
<span class="tag is-success">{{ . }}</span>
|
|
{{end}}
|
|
</div>
|
|
</td>
|
|
<td>{{ printf("%0.1f", .Size / 1024 / 1024) }} MB</td>
|
|
<td>{{ time(.CreatedAt) }}</td>
|
|
<td>
|
|
<button class="button is-small is-danger is-outlined" data-action="delete-image">{{ i18n("button.delete") }}</button>
|
|
</td>
|
|
</tr>
|
|
{{end}}
|
|
</tbody>
|
|
</table>
|
|
{{ yield pager(info=.Pager) }}
|
|
</section>
|
|
{{ end }} |