Files
PetitTetonMeteor/imports/ui/UserManagement.html

90 lines
3.0 KiB
HTML

<template name="UserManagement">
<div id="userManagement">
{{#if Template.subscriptionsReady}}
<div class="insert">
{{>UserInsert}}
</div>
<div class="grid">
<table class="dataTable table table-striped table-hover">
<thead>
<tr class="headers">
<th>Username</th>
<th>Email</th>
<th>Roles</th>
<th>Actions</th>
</tr>
<tr class="footers">
<th>{{>UserSearch columnName='username' maxWidth='40' minWidth='30'}}</th>
<th>{{>UserSearch columnName='email' collectionQueryColumnName='name' collection='Items' collectionResultColumnName='_id' maxWidth='150' minWidth='50'}}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{#each users}}
{{> User}}
{{/each}}
</tbody>
</table>
</div>
{{else}}
{{/if}}
</div>
</template>
<template name="User">
<tr>
{{#if editing}}
<td><input name="username" class="form-control" type="text" value="{{username}}" required></td>
<td><input name="email" class="form-control" type="text" value="{{email}}" required></td>
<td class="roles center" style="font-size: 1.2em">
{{#each allRoles}}
<span class="role {{getRoleState this}} noselect">{{name}}</span>
{{/each}}
</td>
<td class="center tdLarge"><i class="editorApply fa fa-check-square-o fa-lg noselect clickable" aria-hidden="true"></i>&nbsp;/&nbsp;<i class="editorCancel fa fa-times-circle fa-lg noselect clickable" aria-hidden="true"></i></td>
{{else}}
<td class="tdLarge noselect nonclickable">{{username}}</td>
<td class="tdLarge noselect nonclickable">{{email}}</td>
<td class="tdLarge noselect nonclickable">{{roles}}</td>
<td class="center tdLarge"><i class="userRemove fa fa-times-circle fa-lg noselect clickable" aria-hidden="true"></i>&nbsp;/&nbsp;<i class="userEdit fa fa-pencil-square-o fa-lg noselect clickable" aria-hidden="true"></i></td>
{{/if}}
</tr>
</template>
<template name="UserSearch">
<div class="">
<input type="text" class="searchInput" placeholder="Filter..." value="{{searchValue}}" style="max-width: {{maxWidth}}px; min-width: {{minWidth}}px;"/>
</div>
</template>
<template name="UserInsert">
<form name="insert" autocomplete="off">
<div class="row">
<div class="col-md-3 col-sm-0"></div>
<div class="col-md-6 col-sm-12">
<div class="formGroupHeading">New User</div>
<div class="form-group">
<label class='control-label'>User Name</label>
<input name="username" type="text" class="form-control" required>
</div>
<div class="form-group">
<label class='control-label'>Email</label>
<input name="email" class="form-control" type="text" required/>
</div>
<div class="form-group">
<label class='control-label'>Roles</label>
<div class="roles">
{{#each allRoles}}
<span class="role">{{name}}</span>
{{/each}}
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-success" value="Create">
</div>
</div>
<div class="col-md-3 col-sm-0"></div>
</div>
</form>
</template>