source: trunk/grails-app/views/user/edit.gsp @ 1152

Last change on this file since 1152 was 1152, checked in by robert@…, 12 years ago

Changed flash.error to flash.userError in the authentication part to resolve #197

File size: 2.7 KB
Line 
1<head>
2        <meta name='layout' content='main'/>
3        <g:set var="entityName" value="${message(code: 'user.label', default: 'User')}"/>
4        <title><g:message code="default.edit.label" args="[entityName]"/></title>
5
6    <script type="text/javascript">
7      // This method is called on the event body.onLoad
8      $(function() {
9              $("#tabs").tabs();
10      });
11    </script>
12        <style type="text/css">
13          div.usermanagement { font-size: 0.8em; }
14        </style>
15</head>
16
17<body>
18    <script src="${resource(dir: 'js', file: 'jquery-callback-1.2.js')}" type="text/javascript"></script>
19
20        <g:if test="${flash.userError}">
21          <div id="error" class="error" title="errors">
22                        <p>
23                          ${flash.userError}
24                        </p>
25          </div>
26        <h3><g:message code="default.edit.label" args="[entityName]"/></h3>
27
28<g:form action="update" name='userEditForm' class="button-style">
29<g:hiddenField name="id" value="${user?.id}"/>
30<g:hiddenField name="version" value="${user?.version}"/>
31
32      <div id="tabs" class="usermanagement">
33        <ul>
34          <li><a href="#userinfo">User info</a></li>
35          <li><a href="#roles">Roles</a></li>
36        </ul>
37
38        <div id="userinfo">
39
40                  <table>
41                  <tbody>
42                        <tr><td>Username</td><td><g:textField name="username" value="${user?.username}"/></td></tr>
43                        <tr><td>Password</td><td><g:passwordField name="password" value="${user?.password}"/></td></tr>
44                        <tr><td>Email address</td><td><g:textField name="email" value="${user?.email}"/></td></tr>
45                        <tr><td>User confirmed</td><td><g:checkBox name="userConfirmed" value="${user?.userConfirmed}"/></td></tr>
46                        <tr><td>Admin confirmed</td><td><g:checkBox name="adminConfirmed" value="${user?.adminConfirmed}"/></td></tr>
47                        <tr><td>Account expired</td><td><g:checkBox name="accountExpired" value="${user?.accountExpired}"/></td></tr>
48                        <tr><td>Account locked</td><td><g:checkBox name="accountLocked" value="${user?.accountLocked}"/></td></tr>
49                        <tr><td>Password expired</td><td><g:checkBox name="passwordExpired" value="${user?.passwordExpired}"/></td></tr>
50
51                  </tbody>
52                  </table>
53          </div>
54          <div id="roles">
55                <g:each var="entry" in="${roleMap}">
56                <div>
57                        <g:checkBox name="${entry.key.authority}" value="${entry.value}"/>
58                        <g:link controller='role' action='edit' id='${entry.key.id}'>${entry.key.authority.encodeAsHTML()}</g:link>
59                </div>
60                </g:each>
61          </div>
62
63          </div>
64
65<div style='float:left; margin-top: 10px;'>
66  <input type="submit" value="Save" />
67
68  <g:if test='${user}'>
69    <input type="button" value="Delete" onClick="$('#userDeleteForm').submit(); return false;"/>
70  </g:if>
71
72</div>
73
74</g:form>
75
76<g:if test='${user}'>
77  <g:form action="delete" name='userDeleteForm'>
78        <g:hiddenField name="id" value="${user?.id}"/>
79  </g:form>
80</g:if>
81
82<script>
83$(document).ready(function() {
84        $('#username').focus();
85});
86</script>
87
88</body>
Note: See TracBrowser for help on using the repository browser.