swirl/views/service/template/list.jet

71 lines
2.5 KiB
Go
Raw Normal View History

{{ extends "_base" }}
2017-09-26 12:50:09 +00:00
{{ import "../../_modules/pager" }}
2017-10-09 13:02:41 +00:00
{{ block script() }}
<script>$(() => new Swirl.Service.Template.ListPage())</script>
{{ end }}
2017-09-26 12:50:09 +00:00
2017-10-09 13:02:41 +00:00
{{ block body_content() }}
2017-09-26 12:50:09 +00:00
<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">
2017-10-09 13:02:41 +00:00
<input name="name" value="{{ .Name }}" class="input" placeholder="Search by name">
2017-09-26 12:50:09 +00:00
</p>
<p class="control">
<button class="button is-primary">{{ i18n("button.search") }}</button>
2017-09-26 12:50:09 +00:00
</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>
2017-09-26 12:50:09 +00:00
</p>
</div>
</div>
<!-- Right side -->
<div class="level-right">
<p class="level-item">
2018-01-26 05:10:38 +00:00
<a class="button is-success" href="new"><span class="icon"><i class="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
2017-09-26 12:50:09 +00:00
</p>
</div>
</nav>
2018-04-23 08:36:19 +00:00
<table id="table-items" class="table is-bordered is-striped is-hoverable is-narrow is-fullwidth">
2017-09-26 12:50:09 +00:00
<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>
2017-09-26 12:50:09 +00:00
</tr>
</thead>
<tbody>
2017-10-09 13:02:41 +00:00
{{ range .Templates }}
<tr data-id="{{ .ID }}">
<td>{{ .Name }}</td>
<td>{{time(.CreatedAt)}}</td>
<td>{{time(.UpdatedAt)}}</td>
2017-09-26 12:50:09 +00:00
<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") }}">
2018-01-26 05:10:38 +00:00
<span class="icon"><i class="fas fa-plus"></i></span>
2017-10-09 13:02:41 +00:00
</a>
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("button.edit") }}">
2018-01-26 05:10:38 +00:00
<span class="icon"><i class="fas fa-edit"></i></span>
2017-10-09 13:02:41 +00:00
</a>
<button class="button is-small is-danger is-outlined tooltip is-tooltip-bottom" data-tooltip="{{ i18n("button.delete") }}" data-action="delete-template">
2018-04-10 09:37:44 +00:00
<span class="icon"><i class="far fa-trash-alt"></i></span>
2017-10-09 13:02:41 +00:00
</button>
2017-09-26 12:50:09 +00:00
</td>
2017-10-09 13:02:41 +00:00
</tr>
{{ end }}
2017-09-26 12:50:09 +00:00
</tbody>
</table>
2017-10-09 13:02:41 +00:00
{{ yield pager(info=.Pager) }}
2017-09-26 12:50:09 +00:00
</section>
{{ end }}