hydra/src/root/user.tt

119 lines
3.4 KiB
Plaintext
Raw Normal View History

2013-02-27 17:33:47 +00:00
[% WRAPPER layout.tt title=(create ? "Register new user" : "User $user.username") %]
2010-12-03 09:40:25 +00:00
[% PROCESS common.tt %]
[% BLOCK roleoption %]
2013-02-27 17:33:47 +00:00
<option value="[% role %]"
[% checked = false %]
[% FOREACH r IN user.userroles %]
[% checked = r.role == role %]
[% BREAK IF checked %]
[% END %]
[% IF checked %]
SELECTED
[% END %]
>[% role %]</option>
2010-12-03 09:40:25 +00:00
[% END %]
2013-02-27 17:33:47 +00:00
<form class="form-horizontal" method="post">
<fieldset>
2013-01-22 13:41:02 +00:00
2013-02-27 17:33:47 +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" [% HTML.attributes(value => username) %]></input>
</div>
</div>
2013-02-27 17:33:47 +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 => fullname) %]></input>
</div>
</div>
2013-02-27 17:33:47 +00:00
<div class="control-group">
<label class="control-label">Password</label>
<div class="controls">
<input type="password" class="span3" name="password" value=""></input>
</div>
</div>
2013-02-27 17:33:47 +00:00
<div class="control-group">
<label class="control-label">Confirm password</label>
<div class="controls">
<input type="password" class="span3" name="password2" value=""></input>
</div>
</div>
2010-12-03 09:40:25 +00:00
2013-02-27 17:33:47 +00:00
<!--
<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>
-->
[% IF !create %]
2013-02-27 17:33:47 +00:00
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" name="enabled" [% IF 1; 'checked="checked"'; END %]></input>Receive evaluation error notifications
</label>
</div>
</div>
[% END %]
[% IF !create && c.check_user_roles('admin') %]
<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>
[% END %]
2013-02-27 17:33:47 +00:00
[% IF create %]
<div class="control-group">
<div class="controls">
<img src="[% c.uri_for('/captcha') %]" alt="CAPTCHA"/>
</div>
</div>
<div class="control-group">
<label class="control-label">Type the digits shown in the image above</label>
<div class="controls">
<input type="text" class="span3" name="captcha" value=""></input>
</div>
</div>
[% END %]
<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 %]