swirl/views/system/role/list.jet
2021-02-26 13:32:05 +08:00

51 lines
1.6 KiB
Go

{{ extends "base" }}
{{ block script() }}
<script>$(() => new Swirl.Role.ListPage())</script>
{{ end }}
{{ block body_content() }}
<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>
<span class="is-lowercase">{{ i18n("menu.role") }}</span>
</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="fas fa-plus"></i></span><span>{{ i18n("button.new") }}</span></a>
</p>
</div>
</nav>
<table id="table-items" class="table is-bordered is-striped is-hoverable is-narrow is-fullwidth">
<thead>
<tr>
<th>{{ i18n("field.name") }}</th>
<th>Description</th>
<th>{{ i18n("field.updated-at") }}</th>
<th>{{ i18n("field.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">{{ i18n("button.edit") }}</a>
<button class="button is-small is-danger is-outlined" data-action="delete-role">{{ i18n("button.delete") }}</button>
</td>
</tr>
{{end}}
</tbody>
</table>
</section>
{{ end }}