forked from lix-project/hydra
51b920c875
Plus lots of other tweaks.
78 lines
2.6 KiB
Plaintext
78 lines
2.6 KiB
Plaintext
[% WRAPPER layout.tt title=(create ? "New user" : "Editing user '$user.username'") %]
|
|
[% PROCESS common.tt %]
|
|
|
|
[% BLOCK roleoption %]
|
|
<option value="[% role %]"
|
|
[% checked = false %]
|
|
[% FOREACH r IN user.userroles %]
|
|
[% checked = r.role == role %]
|
|
[% BREAK IF checked %]
|
|
[% END %]
|
|
[% IF checked %]
|
|
SELECTED
|
|
[% END %]
|
|
>[% role %]</option>
|
|
[% END %]
|
|
|
|
<div class="page-header"><h1>[% IF create %]New user[% ELSE %]User <tt>[% user.username %]</tt>[% END %]</h1></div>
|
|
|
|
<form class="form-horizontal" action="[% IF create %][% c.uri_for('/admin/create-user/submit') %][% ELSE %][% c.uri_for('/admin/user' user.username 'submit') %][% END %]" method="post">
|
|
|
|
<fieldset>
|
|
[% IF create %]
|
|
<div class="control-group">
|
|
<label class="control-label">User name</label>
|
|
<div class="controls">
|
|
<input type="text" class="span3" name="username" value=""></input>
|
|
</div>
|
|
</div>
|
|
[% END %]
|
|
<div class="control-group">
|
|
<label class="control-label">Full name</label>
|
|
<div class="controls">
|
|
<input type="text" class="span3" name="fullname" [% HTML.attributes(value => user.fullname) %]></input>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">Email</label>
|
|
<div class="controls">
|
|
<input type="text" class="span3" name="emailaddress" [% HTML.attributes(value => user.emailaddress) %]></input>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">Evaluation error notifications</label>
|
|
[% INCLUDE renderSelection param="emailonerror" curValue=user.emailonerror radiobuttons=1 options={"1" = "Yes", "0" = "No"} %]
|
|
</div>
|
|
<div class="control-group">
|
|
<label class="control-label">Roles</label>
|
|
<div class="controls">
|
|
<select multiple name="roles" class="span3">
|
|
[% INCLUDE roleoption role="admin" %]
|
|
[% INCLUDE roleoption role="create-project" %]
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="icon-ok icon-white"></i>
|
|
[%IF create %]Create[% ELSE %]Apply changes[% END %]
|
|
</button>
|
|
[% IF !create %]
|
|
<button id="delete-user" type="submit" class="btn btn-danger" name="submit" value="delete">
|
|
<i class="icon-trash icon-white"></i>
|
|
Delete this user
|
|
</button>
|
|
<script type="text/javascript">
|
|
$("#delete-user").click(function() {
|
|
return confirm("Are you sure you want to delete this user?");
|
|
});
|
|
</script>
|
|
[% END %]
|
|
</div>
|
|
</p>
|
|
|
|
</form>
|
|
|
|
[% END %]
|