mirror of
https://github.com/cuigh/swirl
synced 2025-01-06 19:11:29 +00:00
123 lines
3.9 KiB
Go
123 lines
3.9 KiB
Go
{{ extends "../../_layouts/default" }}
|
|
{{ import "../../_modules/form" }}
|
|
|
|
{{ block body() }}
|
|
<section class="hero is-dark">
|
|
<div class="hero-body">
|
|
<div class="container has-text-centered">
|
|
<h1 class="title is-2">USER</h1>
|
|
<h2 class="subtitle is-5">
|
|
You ever have that feeling where you're not sure if you're awake or still dreaming?
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
<div class="hero-foot">
|
|
<div class="container">
|
|
<nav class="tabs is-boxed">
|
|
<ul>
|
|
<li>
|
|
<a href="/system/role/">Roles</a>
|
|
</li>
|
|
<li class="is-active">
|
|
<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>
|
|
|
|
<div class="container">
|
|
<nav class="breadcrumb has-succeeds-separator is-small is-marginless" aria-label="breadcrumbs">
|
|
<ul>
|
|
<li><a href="/">Dashboard</a></li>
|
|
<li><a href="/system/user/">Users</a></li>
|
|
<li class="is-active"><a>Edit</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
|
|
<section class="hero is-small is-light">
|
|
<div class="hero-body">
|
|
<div class="container">
|
|
<h2 class="title is-2">
|
|
{{ .User.Name }}
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<nav class="navbar has-shadow">
|
|
<div class="container">
|
|
<div class="navbar-brand">
|
|
<a class="navbar-item is-tab" href="/system/user/{{.User.LoginName}}/detail">Detail</a>
|
|
<a class="navbar-item is-tab is-active" href="/system/user/{{.User.LoginName}}/edit">Edit</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<section class="section">
|
|
<div class="container">
|
|
<form method="post" action="update" data-form="ajax-json" data-url="/system/user/">
|
|
<input name="id" value="{{ .User.ID }}" type="hidden">
|
|
<div class="columns is-bottom-marginless">
|
|
<div class="column is-6">
|
|
<div class="field">
|
|
<label class="label">Name</label>
|
|
<div class="control has-icons-left">
|
|
<input name="name" value="{{ .User.Name }}" class="input" placeholder="Name" data-v-rule="native" required>
|
|
<span class="icon is-small is-left">
|
|
<i class="fa fa-user"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column is-6">
|
|
<div class="field">
|
|
<label class="label">Email</label>
|
|
<div class="control has-icons-left">
|
|
<input name="email" value="{{ .User.Email }}" class="input" placeholder="Email" data-v-rule="native" required>
|
|
<span class="icon is-small is-left">
|
|
<i class="fa fa-envelope"></i>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
{{ yield switch(id="cb-admin", name="admin", label="Administrator", checked=.User.Admin) }}
|
|
</div>
|
|
<div class="field">
|
|
<label class="label">Type</label>
|
|
<div class="control">
|
|
{{ yield radio(name="type", value="internal", label="Internal", checked=.User.Type) }}
|
|
{{ yield radio(name="type", value="ldap", label="LDAP", checked=.User.Type) }}
|
|
</div>
|
|
</div>
|
|
<div class="field">
|
|
<label class="label">Roles</label>
|
|
<div class="control">
|
|
{{ roles := .UserRoles }}
|
|
{{range .Roles}}
|
|
{{ yield checkbox(name="roles", value=.ID, label=.Name, checked=isset(roles[.ID])) }}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
<div class="field is-grouped">
|
|
<div class="control">
|
|
<button type="submit" class="button is-primary">Submit</button>
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-link">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
{{ end }} |