swirl/views/stack/archive/list.jet
2017-09-26 20:50:09 +08:00

91 lines
2.7 KiB
Go

{{ extends "../../_layouts/default" }}
{{ import "../../_modules/pager" }}
{{ block script() }}
<script>$(() => new Swirl.Stack.Archive.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">
STACK
</h1>
<h2 class="subtitle is-5">
A stack is a logical grouping of related services that are usually deployed together and require each other to work as intended.
</h2>
</div>
</div>
<div class="hero-foot">
<div class="container">
<nav class="tabs is-boxed">
<ul>
<li>
<a href="/stack/task/">Tasks</a>
</li>
<li class="is-active">
<a href="/stack/archive/">Archives</a>
</li>
</ul>
</nav>
</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" type="text" placeholder="Search by name">
</p>
<p class="control">
<button type="submit" class="button is-primary">Search</button>
</p>
</div>
</form>
</div>
<div class="level-item">
<p class="subtitle is-5">
<strong>{{len(.Archives)}}</strong> archives
</p>
</div>
</div>
<!-- Right side -->
<div class="level-right">
<p class="level-item">
<a href="new" class="button is-success"><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>Action</th>
</tr>
</thead>
<tbody>
{{range .Archives}}
<tr data-id="{{.ID}}">
<td><a href="{{.ID}}/detail">{{.Name}}</a></td>
<td>{{time(.CreatedAt)}}</td>
<td>{{time(.UpdatedAt)}}</td>
<td>
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined">Edit</a>
<button type="button" class="button is-small is-info is-outlined" data-action="deploy-archive">Deploy</button>
<button type="button" class="button is-small is-danger is-outlined" data-action="delete-archive">Delete</button>
</td>
</tr>
{{end}}
</tbody>
</table>
{{ yield pager(info=.Pager) }}
</section>
{{ end }}