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

81 lines
2.1 KiB
Go

{{ extends "../../_layouts/default" }}
{{ block script() }}
<script>$(() => new Swirl.Role.ListPage())</script>
{{ end }}
{{ block body() }}
<section class="hero is-dark">
<div class="hero-body">
<div class="container has-text-centered">
<h1 class="title is-2">ROLE</h1>
<h2 class="subtitle is-5">
A role is a user group with same rights. User can belong to multiple roles.
</h2>
</div>
</div>
<div class="hero-foot">
<div class="container">
<nav class="tabs is-boxed">
<ul>
<li class="is-active">
<a href="/system/role/">Roles</a>
</li>
<li>
<a href="/system/user/">Users</a>
</li>
<li>
<a href="/system/setting/">Settings</a>
</li>
<li>
<a href="/system/event/">Events</a>
</li>
</ul>
</nav>
</div>
</div>
</section>
<section class="section">
<nav class="level">
<!-- Left side -->
<div class="level-left">
<div class="level-item">
<p class="subtitle is-5">
<strong>{{ len(.Roles) }}</strong> roles
</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>Description</th>
<th>Updated at</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{range .Roles}}
<tr data-id="{{.ID}}">
<td><a href="{{.ID}}/detail">{{.Name}}</a></td>
<td>{{.Description}}</td>
<td>{{time(.UpdatedAt)}}</td>
<td>
<a href="{{.ID}}/edit" class="button is-small is-dark is-outlined">Edit</a>
<button class="button is-small is-danger is-outlined" data-action="delete-role">Delete</button>
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{ end }}