mirror of
https://github.com/cuigh/swirl
synced 2025-01-03 17:42:29 +00:00
71 lines
2.5 KiB
Go
71 lines
2.5 KiB
Go
{{ extends "_base" }}
|
|
{{ import "../../_modules/pager" }}
|
|
|
|
{{ block script() }}
|
|
<script>$(() => new Swirl.Service.Template.ListPage())</script>
|
|
{{ end }}
|
|
|
|
{{ block body_content() }}
|
|
<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="Search by name">
|
|
</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.service.template") }}</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<!-- Right side -->
|
|
<div class="level-right">
|
|
<p class="level-item">
|
|
<a class="button is-success" href="new"><span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
|
|
</p>
|
|
</div>
|
|
</nav>
|
|
<table id="table-items" class="table is-bordered is-striped is-hoverable is-narrow is-fullwidth">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ i18n("field.name") }}</th>
|
|
<th>{{ i18n("field.created-at") }}</th>
|
|
<th>{{ i18n("field.updated-at") }}</th>
|
|
<th width="160">{{ i18n("field.action") }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{ range .Templates }}
|
|
<tr data-id="{{ .ID }}">
|
|
<td>{{ .Name }}</td>
|
|
<td>{{time(.CreatedAt)}}</td>
|
|
<td>{{time(.UpdatedAt)}}</td>
|
|
<td>
|
|
<a href="/service/new?template={{.ID}}" class="button is-small is-success is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("service.template.button.create") }}">
|
|
<span class="icon"><i class="fas fa-plus"></i></span>
|
|
</a>
|
|
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("button.edit") }}">
|
|
<span class="icon"><i class="fas fa-edit"></i></span>
|
|
</a>
|
|
<button class="button is-small is-danger is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("button.delete") }}" data-action="delete-template">
|
|
<span class="icon"><i class="far fa-trash-alt"></i></span>
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
{{ yield pager(info=.Pager) }}
|
|
</section>
|
|
{{ end }} |