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

121 lines
4.1 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>
<section class="section">
<div class="container">
<h2 class="title">Create user</h2>
<hr>
<form method="post" data-form="ajax-json" data-url="/system/user/">
<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" 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 class="field">
<label class="label">Login name</label>
<div class="control has-icons-left">
<input name="login_name" class="input" placeholder="Login name" data-v-rule="native" required>
<span class="icon is-small is-left">
<i class="fa fa-user"></i>
</span>
</div>
</div>
<div class="field">
<label class="label">Email</label>
<div class="control has-icons-left">
<input name="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 class="column is-6">
<div class="field">
<label class="label">Password</label>
<div class="control has-icons-left">
<input id="txt-password" name="password" type="password" class="input" placeholder="Password" data-v-rule="native" required>
<span class="icon is-small is-left">
<i class="fa fa-lock"></i>
</span>
</div>
</div>
<div class="field">
<label class="label">Password confirmation</label>
<div class="control has-icons-left">
<input type="password" class="input" placeholder="Password confirmation" data-v-rule="match" data-v-arg-match="txt-password">
<span class="icon is-small is-left">
<i class="fa fa-lock"></i>
</span>
</div>
</div>
</div>
</div>
<div class="field">
{{ yield switch(id="cb-admin", name="admin", label="Administrator") }}
</div>
<div class="field">
<label class="label">Type</label>
<div class="control">
{{ yield radio(name="type", value="internal", label="Internal", checked="internal") }}
{{ yield radio(name="type", value="ldap", label="LDAP") }}
</div>
</div>
<div class="field">
<label class="label">Roles</label>
<div class="control">
{{range .Roles}}
{{ yield checkbox(name="roles", value=.ID, label=.Name) }}
{{end}}
</div>
</div>
<div class="field is-grouped">
<div class="control">
<button type="submit" class="button is-primary">Submit</button>
</div>
<div class="control">
<a href="/system/user/" class="button is-link">Cancel</a>
</div>
</div>
</form>
</div>
</section>
{{ end }}