1 | <head> |
---|
2 | <meta name="layout" content="main" /> |
---|
3 | <title>Edit Person</title> |
---|
4 | <nav:resources override="true"/> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | |
---|
9 | <div class="nav"> |
---|
10 | <nav:renderSubItems group="navAlt"/> |
---|
11 | </div> |
---|
12 | |
---|
13 | <div class="body"> |
---|
14 | <g:if test="${flash.message}"> |
---|
15 | <div class="message">${flash.message}</div> |
---|
16 | </g:if> |
---|
17 | <g:if test="${params.message}"> |
---|
18 | <div class="message">${params.message}</div> |
---|
19 | </g:if> |
---|
20 | <g:hasErrors bean="${person}"> |
---|
21 | <div class="errors"> |
---|
22 | <g:renderErrors bean="${person}" as="list" /> |
---|
23 | </div> |
---|
24 | </g:hasErrors> |
---|
25 | |
---|
26 | <!--<div class="prop"> |
---|
27 | <span class="name">ID: ${person.id}</span> |
---|
28 | </div>--> |
---|
29 | |
---|
30 | <g:form> |
---|
31 | <input type="hidden" name="id" value="${person.id}" /> |
---|
32 | <input type="hidden" name="version" value="${person.version}" /> |
---|
33 | <input type="hidden" name="password" value="${person.password}" /> |
---|
34 | <div class="dialog"> |
---|
35 | <table> |
---|
36 | <tbody> |
---|
37 | |
---|
38 | <tr class="prop"> |
---|
39 | <td valign="top" class="name"><label for="loginName">Login Name:</label></td> |
---|
40 | <td valign="top" class="value ${hasErrors(bean:person,field:'loginName','errors')}"> |
---|
41 | <input type="text" id="loginName" name="loginName" value="${person.loginName?.encodeAsHTML()}"/> |
---|
42 | <g:helpBalloon class="helpballoon" code="person.loginName" /> |
---|
43 | </td> |
---|
44 | </tr> |
---|
45 | |
---|
46 | <tr class="prop"> |
---|
47 | <td valign="top" class="name"><label for="firstName">First Name:</label></td> |
---|
48 | <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}"> |
---|
49 | <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/> |
---|
50 | <g:helpBalloon class="helpballoon" code="person.firstName" /> |
---|
51 | </td> |
---|
52 | </tr> |
---|
53 | |
---|
54 | <tr class="prop"> |
---|
55 | <td valign="top" class="name"><label for="lastName">Last Name:</label></td> |
---|
56 | <td valign="top" class="value ${hasErrors(bean:person,field:'lastName','errors')}"> |
---|
57 | <input type="text" id="lastName" name="lastName" value="${person.lastName?.encodeAsHTML()}"/> |
---|
58 | <g:helpBalloon class="helpballoon" code="person.lastName" /> |
---|
59 | </td> |
---|
60 | </tr> |
---|
61 | |
---|
62 | <tr class="prop"> |
---|
63 | <td valign="top" class="name"><label for="pass">Password:</label></td> |
---|
64 | <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}"> |
---|
65 | <input type="password" id="pass" name="pass" value="${person.pass?.encodeAsHTML()}"/> |
---|
66 | <g:helpBalloon class="helpballoon" code="person.password" /> |
---|
67 | </td> |
---|
68 | </tr> |
---|
69 | |
---|
70 | <tr class="prop"> |
---|
71 | <td valign="top" class="name"><label for="isActive">Active:</label></td> |
---|
72 | <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}"> |
---|
73 | <g:checkBox name="isActive" value="${person.isActive}"/> |
---|
74 | <g:helpBalloon class="helpballoon" code="person.isActive" /> |
---|
75 | </td> |
---|
76 | </tr> |
---|
77 | |
---|
78 | <tr class="prop"> |
---|
79 | <td valign="top" class="name"><label for="description">Description:</label></td> |
---|
80 | <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}"> |
---|
81 | <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/> |
---|
82 | </td> |
---|
83 | </tr> |
---|
84 | |
---|
85 | <tr class="prop"> |
---|
86 | <td valign="top" class="name"> |
---|
87 | <label for="addresses">Contact:</label> |
---|
88 | </td> |
---|
89 | <td valign="top" class="value"> |
---|
90 | <ul> |
---|
91 | <g:each var="i" in="${person?.contacts}"> |
---|
92 | <li><g:link controller="contactDetailed" action="show" id="${i.id}"> |
---|
93 | ${i?.encodeAsHTML()} |
---|
94 | </g:link></li> |
---|
95 | </g:each> |
---|
96 | </ul> |
---|
97 | <g:link controller="contactDetailed" params="['person.id':person?.id]" action="create">+Add Contact</g:link> |
---|
98 | </td> |
---|
99 | </tr> |
---|
100 | |
---|
101 | <tr class="prop"> |
---|
102 | <td valign="top" class="name"> |
---|
103 | <label for="addresses">Addresses:</label> |
---|
104 | </td> |
---|
105 | <td valign="top" class="value"> |
---|
106 | <ul> |
---|
107 | <g:each var="i" in="${person?.addresses}"> |
---|
108 | <li><g:link controller="addressDetailed" action="show" id="${i.id}"> |
---|
109 | ${i?.encodeAsHTML()} |
---|
110 | </g:link></li> |
---|
111 | </g:each> |
---|
112 | </ul> |
---|
113 | <g:link controller="addressDetailed" params="['person.id':person?.id]" action="create">+Add Address</g:link> |
---|
114 | </td> |
---|
115 | </tr> |
---|
116 | |
---|
117 | <tr class="prop"> |
---|
118 | <td valign="top" class="name"><label for="employeeID">employee ID:</label></td> |
---|
119 | <td valign="top" class="value ${hasErrors(bean:person,field:'employeeID','errors')}"> |
---|
120 | <input type="text" id="employeeID" name="employeeID" value="${person.employeeID?.encodeAsHTML()}"/> |
---|
121 | </td> |
---|
122 | </tr> |
---|
123 | |
---|
124 | <tr class="prop"> |
---|
125 | <td valign="top" class="name"> |
---|
126 | <label for="department">Department:</label> |
---|
127 | </td> |
---|
128 | <td valign="top" class="value ${hasErrors(bean:person,field:'department','errors')}"> |
---|
129 | <g:select optionKey="id" from="${Department.list()}" name="department.id" value="${person?.department?.id}" noSelection="['null':'--None--']"></g:select> |
---|
130 | </td> |
---|
131 | </tr> |
---|
132 | |
---|
133 | <tr class="prop"> |
---|
134 | <td valign="top" class="name"> |
---|
135 | <label for="personGroups">Groups:</label> |
---|
136 | </td> |
---|
137 | <td valign="top" class="value ${hasErrors(bean:person,field:'personGroups','errors')}"> |
---|
138 | <g:helpBalloon class="helpballoon" code="person.personGroups" /> |
---|
139 | <custom:checkBoxList name="personGroups" |
---|
140 | from="${PersonGroup.list().sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) }}" |
---|
141 | value="${person?.personGroups?.collect{it.id}}" |
---|
142 | optionKey="id"/> |
---|
143 | </td> |
---|
144 | </tr> |
---|
145 | |
---|
146 | <tr class="prop"> |
---|
147 | <td valign="top" class="name" align="left"> |
---|
148 | Authorities: |
---|
149 | </td> |
---|
150 | <td valign="top" class="name" align="left"> |
---|
151 | <g:helpBalloon class="helpballoon" code="person.authorities" /> |
---|
152 | </td> |
---|
153 | </tr> |
---|
154 | |
---|
155 | <g:each var="entry" in="${roleMap}"> |
---|
156 | <tr> |
---|
157 | <td valign="top" class="name" align="left">${entry.key.description.encodeAsHTML()}</td> |
---|
158 | <td align="left"><g:checkBox name="${entry.key.authority}" value="${entry.value}"/></td> |
---|
159 | </tr> |
---|
160 | </g:each> |
---|
161 | |
---|
162 | </tbody> |
---|
163 | </table> |
---|
164 | </div> |
---|
165 | |
---|
166 | <div class="buttons"> |
---|
167 | <span class="button"><g:actionSubmit class="save" value="Update" /></span> |
---|
168 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
169 | </div> |
---|
170 | |
---|
171 | </g:form> |
---|
172 | |
---|
173 | </div> |
---|
174 | </body> |
---|