swirl/views/service/template/list.jet

70 lines
2.2 KiB
Go
Raw Normal View History

2017-10-09 13:02:41 +00:00
{{ 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">Search</button>
</p>
</div>
</form>
</div>
<div class="level-item">
<p class="subtitle is-5">
2017-10-09 13:02:41 +00:00
<strong>{{ .Pager.Count }}</strong> templates
2017-09-26 12:50:09 +00:00
</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="fa fa-plus"></i></span><span>New</span></a>
</p>
</div>
</nav>
<table id="table-items" class="table is-bordered is-striped is-narrow is-fullwidth">
<thead>
<tr>
<th>Name</th>
2017-10-09 13:02:41 +00:00
<th>Created at</th>
2017-09-26 12:50:09 +00:00
<th>Updated at</th>
<th width="160">Action</th>
</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>
2017-10-09 13:02:41 +00:00
<a href="/service/new?template={{.ID}}" class="button is-small is-success is-outlined tooltip is-tooltip-bottom" data-tooltip="Create Service">
<span class="icon"><i class="fa fa-plus"></i></span>
</a>
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined tooltip is-tooltip-bottom" data-tooltip="Edit">
<span class="icon"><i class="fa fa-edit"></i></span>
</a>
<button class="button is-small is-danger is-outlined tooltip is-tooltip-bottom" data-tooltip="Delete" data-action="delete-template">
<span class="icon"><i class="fa fa-remove"></i></span>
</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 }}