hydra/src/root/user.tt

76 lines
2.5 KiB
Plaintext
Raw Normal View History

2013-02-20 14:54:33 +00:00
[% WRAPPER layout.tt title=(create ? "New user" : "User $user.username") %]
2010-12-03 09:40:25 +00:00
[% 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 %]
<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 %]