mirror of
https://github.com/cuigh/swirl
synced 2025-01-07 03:21:29 +00:00
70 lines
2.2 KiB
Go
70 lines
2.2 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">Search</button>
|
|
</p>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="level-item">
|
|
<p class="subtitle is-5">
|
|
<strong>{{ .Pager.Count }}</strong> templates
|
|
</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>
|
|
<th>Created at</th>
|
|
<th>Updated at</th>
|
|
<th width="160">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="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>
|
|
</td>
|
|
</tr>
|
|
{{ end }}
|
|
</tbody>
|
|
</table>
|
|
{{ yield pager(info=.Pager) }}
|
|
</section>
|
|
{{ end }} |