hydra/src/root/user.tt

78 lines
2.6 KiB
Plaintext
Raw Normal View History

2010-12-03 09:40:25 +00:00
[% 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 %]
2013-01-22 13:41:02 +00:00
[% END %]
2010-12-03 09:40:25 +00:00
[% 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>
2010-12-03 09:40:25 +00:00
<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">
2013-01-22 13:41:02 +00:00
<fieldset>
2010-12-03 09:40:25 +00:00
[% 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>
2010-12-03 09:40:25 +00:00
[% 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>
2010-12-03 09:40:25 +00:00
<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>
2013-01-22 13:41:02 +00:00
</p>
2010-12-03 09:40:25 +00:00
</form>
[% END %]