Changeset 150
- Timestamp:
- Oct 9, 2009, 10:11:43 PM (16 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 11 edited
-
controllers/AppCoreController.groovy (modified) (1 diff)
-
controllers/AuthorityController.groovy (modified) (1 diff)
-
controllers/PersonController.groovy (modified) (6 diffs)
-
views/authority/create.gsp (modified) (1 diff)
-
views/authority/edit.gsp (modified) (1 diff)
-
views/authority/list.gsp (modified) (1 diff)
-
views/authority/show.gsp (modified) (1 diff)
-
views/person/create.gsp (modified) (4 diffs)
-
views/person/edit.gsp (modified) (4 diffs)
-
views/person/show.gsp (modified) (4 diffs)
-
views/taskDetailed/search.gsp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/AppCoreController.groovy
r149 r150 55 55 def personInstance = Person.get(authenticateService.userDomain().id) 56 56 return [ personInstance : personInstance ] 57 } 57 } 58 58 59 59 if (request.method == 'POST') { -
trunk/grails-app/controllers/AuthorityController.groovy
r116 r150 3 3 class AuthorityController extends BaseAppAdminController { 4 4 5 // the delete, save and update actions only accept POST requests6 static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']5 // the delete, save and update actions only accept POST requests 6 static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST'] 7 7 8 def authenticateService8 def authenticateService 9 9 10 def index = {11 redirect action: list, params: params12 }10 def index = { 11 redirect action: list, params: params 12 } 13 13 14 /**15 * Display the list authority page.16 */17 def list = {18 if (!params.max) {19 params.max = 1020 }21 [authorityList: Authority.list(params)]22 }14 /** 15 * Display the list authority page. 16 */ 17 def list = { 18 if (!params.max) { 19 params.max = 10 20 } 21 [authorityList: Authority.list(params)] 22 } 23 23 24 /**25 * Display the show authority page.26 */27 def show = {28 def authority = Authority.get(params.id)29 if (!authority) {30 flash.message = "Authority not found with id $params.id"31 redirect action: list32 return33 }24 /** 25 * Display the show authority page. 26 */ 27 def show = { 28 def authority = Authority.get(params.id) 29 if (!authority) { 30 flash.message = "Authority not found with id $params.id" 31 redirect action: list 32 return 33 } 34 34 35 [authority: authority]36 }35 [authority: authority] 36 } 37 37 38 /**39 * Delete an authority.40 */41 def delete = {42 def authority = Authority.get(params.id)43 if (!authority) {44 flash.message = "Authority not found with id $params.id"45 redirect action: list46 return47 }38 /** 39 * Delete an authority. 40 */ 41 def delete = { 42 def authority = Authority.get(params.id) 43 if (!authority) { 44 flash.message = "Authority not found with id $params.id" 45 redirect action: list 46 return 47 } 48 48 49 authenticateService.deleteRole(authority)49 authenticateService.deleteRole(authority) 50 50 51 flash.message = "Authority $params.id deleted."52 redirect action: list53 }51 flash.message = "Authority $params.id deleted." 52 redirect action: list 53 } 54 54 55 /**56 * Display the edit authority page.57 */58 def edit = {59 def authority = Authority.get(params.id)60 if (!authority) {61 flash.message = "Authority not found with id $params.id"62 redirect action: list63 return64 }55 /** 56 * Display the edit authority page. 57 */ 58 def edit = { 59 def authority = Authority.get(params.id) 60 if (!authority) { 61 flash.message = "Authority not found with id $params.id" 62 redirect action: list 63 return 64 } 65 65 66 [authority: authority]67 }66 [authority: authority] 67 } 68 68 69 /**70 * Authority update action.71 */72 def update = {69 /** 70 * Authority update action. 71 */ 72 def update = { 73 73 74 def authority = Authority.get(params.id)75 if (!authority) {76 flash.message = "Authority not found with id $params.id"77 redirect action: edit, id: params.id78 return79 }74 def authority = Authority.get(params.id) 75 if (!authority) { 76 flash.message = "Authority not found with id $params.id" 77 redirect action: edit, id: params.id 78 return 79 } 80 80 81 long version = params.version.toLong()82 if (authority.version > version) {83 authority.errors.rejectValue 'version', 'authority.optimistic.locking.failure',84 'Another user has updated this Authority while you were editing.'85 render view: 'edit', model: [authority: authority]86 return87 }81 long version = params.version.toLong() 82 if (authority.version > version) { 83 authority.errors.rejectValue 'version', 'authority.optimistic.locking.failure', 84 'Another user has updated this Authority while you were editing.' 85 render view: 'edit', model: [authority: authority] 86 return 87 } 88 88 89 if (authenticateService.updateRole(authority, params)) {90 authenticateService.clearCachedRequestmaps()91 redirect action: show, id: authority.id92 }93 else {94 render view: 'edit', model: [authority: authority]95 }96 }89 if (authenticateService.updateRole(authority, params)) { 90 authenticateService.clearCachedRequestmaps() 91 redirect action: show, id: authority.id 92 } 93 else { 94 render view: 'edit', model: [authority: authority] 95 } 96 } 97 97 98 /**99 * Display the create new authority page.100 */101 def create = {102 [authority: new Authority()]103 }98 /** 99 * Display the create new authority page. 100 */ 101 def create = { 102 [authority: new Authority()] 103 } 104 104 105 /**106 * Save a new authority.107 */108 def save = {105 /** 106 * Save a new authority. 107 */ 108 def save = { 109 109 110 def authority = new Authority()111 authority.properties = params112 if (authority.save()) {113 redirect action: show, id: authority.id114 }115 else {116 render view: 'create', model: [authority: authority]117 }118 }110 def authority = new Authority() 111 authority.properties = params 112 if (authority.save()) { 113 redirect action: show, id: authority.id 114 } 115 else { 116 render view: 'create', model: [authority: authority] 117 } 118 } 119 119 } -
trunk/grails-app/controllers/PersonController.groovy
r149 r150 7 7 def filterService 8 8 9 // the delete, save and update actions only accept POST requests10 static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']9 // the delete, save and update actions only accept POST requests 10 static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST'] 11 11 12 def index = {13 redirect action: list, params: params14 }12 def index = { 13 redirect action: list, params: params 14 } 15 15 16 16 def list = { … … 27 27 } 28 28 29 def show = {29 def show = { 30 30 31 31 // In the case of an actionSubmit button, rewrite action name from 'index'. … … 33 33 { params.action='show' } 34 34 35 def person = Person.get(params.id)36 if (!person) {37 flash.message = "Person not found with id $params.id"38 redirect action: list39 return40 }41 List roleNames = []42 for (role in person.authorities) {43 roleNames << role.authority44 }45 roleNames.sort { n1, n2 ->46 n1 <=> n247 }48 [person: person, roleNames: roleNames]49 }35 def person = Person.get(params.id) 36 if (!person) { 37 flash.message = "Person not found with id $params.id" 38 redirect action: list 39 return 40 } 41 List roleNames = [] 42 for (role in person.authorities) { 43 roleNames << role.authority 44 } 45 roleNames.sort { n1, n2 -> 46 n1 <=> n2 47 } 48 [person: person, roleNames: roleNames] 49 } 50 50 51 /**52 * Person delete action. Before removing an existing person,53 * they should be removed from those authorities which they are involved.54 */55 def delete = {51 /** 52 * Person delete action. Before removing an existing person, 53 * they should be removed from those authorities which they are involved. 54 */ 55 def delete = { 56 56 57 def person = Person.get(params.id)58 if (person) {59 def authPrincipal = authenticateService.principal()60 // Avoid self-delete.61 if (!(authPrincipal instanceof String) && authPrincipal.username == person.loginName) {62 flash.message = "You cannot delete yourself, please login as another manager and try again."57 def person = Person.get(params.id) 58 if (person) { 59 def authPrincipal = authenticateService.principal() 60 // Avoid self-delete. 61 if (!(authPrincipal instanceof String) && authPrincipal.username == person.loginName) { 62 flash.message = "You cannot delete yourself, please login as another manager and try again." 63 63 redirect(action:show,id:params.id) 64 }65 else {66 //first, delete this person from Persons_Authorities table.67 Authority.findAll().each { it.removeFromPersons(person) }64 } 65 else { 66 //first, delete this person from Persons_Authorities table. 67 Authority.findAll().each { it.removeFromPersons(person) } 68 68 person.isActive = false 69 69 person.save(flush: true) … … 78 78 redirect(action:show,id:params.id) 79 79 } 80 }81 }82 else {83 flash.message = "Person not found with id $params.id"84 }85 }80 } 81 } 82 else { 83 flash.message = "Person not found with id $params.id" 84 } 85 } 86 86 87 def edit = {87 def edit = { 88 88 89 89 // In the case of an actionSubmit button, rewrite action name from 'index'. … … 91 91 { params.action='edit' } 92 92 93 def person = Person.get(params.id)94 if (!person) {95 flash.message = "Person not found with id $params.id"96 redirect action: list97 return98 }99 flash.message = "To allow login at least the 'ROLE_AppUser' authority must be given."100 return buildPersonModel(person)101 }93 def person = Person.get(params.id) 94 if (!person) { 95 flash.message = "Person not found with id $params.id" 96 redirect action: list 97 return 98 } 99 params.message = "To allow login at least the 'ROLE_AppUser' authority must be given." 100 return buildPersonModel(person) 101 } 102 102 103 /**104 * Person update action.105 */106 def update = {103 /** 104 * Person update action. 105 */ 106 def update = { 107 107 108 def person = Person.get(params.id)109 if (!person) {110 flash.message = "Person not found with id $params.id"111 redirect action: edit, id: params.id112 return113 }108 def person = Person.get(params.id) 109 if (!person) { 110 flash.message = "Person not found with id $params.id" 111 redirect action: edit, id: params.id 112 return 113 } 114 114 115 long version = params.version.toLong()116 if (person.version > version) {117 person.errors.rejectValue 'version', "person.optimistic.locking.failure",118 "Another user has updated this Person while you were editing."115 long version = params.version.toLong() 116 if (person.version > version) { 117 person.errors.rejectValue 'version', "person.optimistic.locking.failure", 118 "Another user has updated this Person while you were editing." 119 119 render view: 'edit', model: buildPersonModel(person) 120 return121 }120 return 121 } 122 122 123 person.properties = params123 person.properties = params 124 124 125 125 if(params.pass == "") { … … 142 142 } 143 143 144 }144 } 145 145 146 def create = {147 flash.message = "To allow login at least the 'ROLE_AppUser' authority must be given."148 [person: new Person(params), authorityList: Authority.list()]149 }146 def create = { 147 params.message = "To allow login at least the 'ROLE_AppUser' authority must be given." 148 [person: new Person(params), authorityList: Authority.list()] 149 } 150 150 151 /**152 * Person save action.153 */154 def save = {151 /** 152 * Person save action. 153 */ 154 def save = { 155 155 156 def person = new Person()157 person.properties = params158 person.password = authenticateService.encodePassword(params.pass)159 if (person.save()) {160 addRoles(person)161 redirect action: show, id: person.id162 }163 else {164 render view: 'create', model: [authorityList: Authority.list(), person: person]165 }166 }156 def person = new Person() 157 person.properties = params 158 person.password = authenticateService.encodePassword(params.pass) 159 if (person.save()) { 160 addRoles(person) 161 redirect action: show, id: person.id 162 } 163 else { 164 render view: 'create', model: [authorityList: Authority.list(), person: person] 165 } 166 } 167 167 168 private void addRoles(person) {169 for (String key in params.keySet()) {170 if (key.contains('ROLE') && 'on' == params.get(key)) {171 Authority.findByAuthority(key).addToPersons(person)172 }173 }174 }168 private void addRoles(person) { 169 for (String key in params.keySet()) { 170 if (key.contains('ROLE') && 'on' == params.get(key)) { 171 Authority.findByAuthority(key).addToPersons(person) 172 } 173 } 174 } 175 175 176 private Map buildPersonModel(person) {176 private Map buildPersonModel(person) { 177 177 178 List roles = Authority.list()179 roles.sort { r1, r2 ->180 r1.authority <=> r2.authority181 }182 Set userRoleNames = []183 for (role in person.authorities) {184 userRoleNames << role.authority185 }186 LinkedHashMap<Authority, Boolean> roleMap = [:]187 for (role in roles) {188 roleMap[(role)] = userRoleNames.contains(role.authority)189 }178 List roles = Authority.list() 179 roles.sort { r1, r2 -> 180 r1.authority <=> r2.authority 181 } 182 Set userRoleNames = [] 183 for (role in person.authorities) { 184 userRoleNames << role.authority 185 } 186 LinkedHashMap<Authority, Boolean> roleMap = [:] 187 for (role in roles) { 188 roleMap[(role)] = userRoleNames.contains(role.authority) 189 } 190 190 191 return [person: person, roleMap: roleMap]192 }191 return [person: person, roleMap: roleMap] 192 } 193 193 } -
trunk/grails-app/views/authority/create.gsp
r59 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Create Authority</title>2 <meta name="layout" content="main" /> 3 <title>Create Authority</title> 4 4 </head> 5 5 6 6 <body> 7 7 8 <div class="nav">9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span>11 </div>8 <div class="nav"> 9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span> 11 </div> 12 12 13 <div class="body">13 <div class="body"> 14 14 15 <h1>Create Authority</h1>16 <g:if test="${flash.message}">17 <div class="message">${flash.message}</div>18 </g:if>19 <g:hasErrors bean="${authority}">20 <div class="errors">21 <g:renderErrors bean="${authority}" as="list" />22 </div>23 </g:hasErrors>15 <h1>Create Authority</h1> 16 <g:if test="${flash.message}"> 17 <div class="message">${flash.message}</div> 18 </g:if> 19 <g:hasErrors bean="${authority}"> 20 <div class="errors"> 21 <g:renderErrors bean="${authority}" as="list" /> 22 </div> 23 </g:hasErrors> 24 24 25 <g:form action="save">26 <div class="dialog">27 <table>28 <tbody>29 <tr class="prop">30 <td valign="top" class="name"><label for="authority">Authority Name:</label></td>31 <td valign="top" class="value ${hasErrors(bean:authority,field:'authority','errors')}">32 <input type="text" id="authority" name="authority" value="${authority?.authority?.encodeAsHTML()}"/>33 </td>34 </tr>25 <g:form action="save"> 26 <div class="dialog"> 27 <table> 28 <tbody> 29 <tr class="prop"> 30 <td valign="top" class="name"><label for="authority">Authority Name:</label></td> 31 <td valign="top" class="value ${hasErrors(bean:authority,field:'authority','errors')}"> 32 <input type="text" id="authority" name="authority" value="${authority?.authority?.encodeAsHTML()}"/> 33 </td> 34 </tr> 35 35 36 <tr class="prop">37 <td valign="top" class="name"><label for="description">Description:</label></td>38 <td valign="top" class="value ${hasErrors(bean:authority,field:'description','errors')}">39 <input type="text" id="description" name="description" value="${authority?.description?.encodeAsHTML()}"/>40 </td>41 </tr>42 </tbody>43 </table>44 </div>36 <tr class="prop"> 37 <td valign="top" class="name"><label for="description">Description:</label></td> 38 <td valign="top" class="value ${hasErrors(bean:authority,field:'description','errors')}"> 39 <input type="text" id="description" name="description" value="${authority?.description?.encodeAsHTML()}"/> 40 </td> 41 </tr> 42 </tbody> 43 </table> 44 </div> 45 45 46 <div class="buttons">47 <span class="button"><input class="save" type="submit" value="Create" /></span>48 </div>49 </g:form>50 </div>46 <div class="buttons"> 47 <span class="button"><input class="save" type="submit" value="Create" /></span> 48 </div> 49 </g:form> 50 </div> 51 51 </body> -
trunk/grails-app/views/authority/edit.gsp
r59 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Edit Authority</title>2 <meta name="layout" content="main" /> 3 <title>Edit Authority</title> 4 4 </head> 5 5 6 6 <body> 7 7 8 <div class="nav">9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span>11 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span>12 </div>8 <div class="nav"> 9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span> 11 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span> 12 </div> 13 13 14 <div class="body">15 <h1>Edit Authority</h1>16 <g:if test="${flash.message}">17 <div class="message">${flash.message}</div>18 </g:if>19 <g:hasErrors bean="${authority}">20 <div class="errors">21 <g:renderErrors bean="${authority}" as="list" />22 </div>23 </g:hasErrors>24 <div class="prop">25 <span class="name">ID:</span>26 <span class="value">${authority.id}</span>27 </div>28 <g:form>29 <input type="hidden" name="id" value="${authority.id}" />30 <input type="hidden" name="version" value="${authority.version}" />31 <div class="dialog">32 <table>33 <tbody>34 <tr class="prop">35 <td valign="top" class="name"><label for="authority">Authority Name:</label></td>36 <td valign="top" class="value ${hasErrors(bean:authority,field:'authority','errors')}">37 <input type="text" id="authority" name="authority" value="${authority.authority?.encodeAsHTML()}"/>38 </td>39 </tr>14 <div class="body"> 15 <h1>Edit Authority</h1> 16 <g:if test="${flash.message}"> 17 <div class="message">${flash.message}</div> 18 </g:if> 19 <g:hasErrors bean="${authority}"> 20 <div class="errors"> 21 <g:renderErrors bean="${authority}" as="list" /> 22 </div> 23 </g:hasErrors> 24 <div class="prop"> 25 <span class="name">ID:</span> 26 <span class="value">${authority.id}</span> 27 </div> 28 <g:form> 29 <input type="hidden" name="id" value="${authority.id}" /> 30 <input type="hidden" name="version" value="${authority.version}" /> 31 <div class="dialog"> 32 <table> 33 <tbody> 34 <tr class="prop"> 35 <td valign="top" class="name"><label for="authority">Authority Name:</label></td> 36 <td valign="top" class="value ${hasErrors(bean:authority,field:'authority','errors')}"> 37 <input type="text" id="authority" name="authority" value="${authority.authority?.encodeAsHTML()}"/> 38 </td> 39 </tr> 40 40 41 <tr class="prop">42 <td valign="top" class="name"><label for="description">Description:</label></td>43 <td valign="top" class="value ${hasErrors(bean:authority,field:'description','errors')}">44 <input type="text" id="description" name="description" value="${authority.description?.encodeAsHTML()}"/>45 </td>46 </tr>41 <tr class="prop"> 42 <td valign="top" class="name"><label for="description">Description:</label></td> 43 <td valign="top" class="value ${hasErrors(bean:authority,field:'description','errors')}"> 44 <input type="text" id="description" name="description" value="${authority.description?.encodeAsHTML()}"/> 45 </td> 46 </tr> 47 47 48 <tr class="prop">49 <td valign="top" class="name"><label for="persons">Persons:</label></td>50 <td valign="top" class="value ${hasErrors(bean:authority,field:'persons','errors')}">51 <ul>52 <g:each var="p" in="${authority.persons?}">53 <li>${p}</li>54 </g:each>55 </ul>56 </td>57 </tr>58 </tbody>59 </table>60 </div>48 <tr class="prop"> 49 <td valign="top" class="name"><label for="persons">Persons:</label></td> 50 <td valign="top" class="value ${hasErrors(bean:authority,field:'persons','errors')}"> 51 <ul> 52 <g:each var="p" in="${authority.persons?}"> 53 <li>${p}</li> 54 </g:each> 55 </ul> 56 </td> 57 </tr> 58 </tbody> 59 </table> 60 </div> 61 61 62 <div class="buttons">63 <span class="button"><g:actionSubmit class="save" value="Update" /></span>64 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>65 </div>62 <div class="buttons"> 63 <span class="button"><g:actionSubmit class="save" value="Update" /></span> 64 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 65 </div> 66 66 67 </g:form>68 </div>67 </g:form> 68 </div> 69 69 </body> -
trunk/grails-app/views/authority/list.gsp
r59 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Authority List</title>2 <meta name="layout" content="main" /> 3 <title>Authority List</title> 4 4 </head> 5 5 6 6 <body> 7 7 8 <div class="nav">9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>10 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span>11 </div>8 <div class="nav"> 9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 10 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span> 11 </div> 12 12 13 <div class="body">14 <h1>Authority List</h1>15 <g:if test="${flash.message}">16 <div class="message">${flash.message}</div>17 </g:if>18 <div class="list">19 <table>20 <thead>21 <tr>22 <g:sortableColumn property="id" title="ID" />23 <g:sortableColumn property="authority" title="Authority Name" />24 <g:sortableColumn property="description" title="Description" />25 <th> </th>26 </tr>27 </thead>28 <tbody>29 <g:each in="${authorityList}" status="i" var="authority">30 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">31 <td>${authority.id}</td>32 <td>${authority.authority?.encodeAsHTML()}</td>33 <td>${authority.description?.encodeAsHTML()}</td>34 <td class="actionButtons">35 <span class="actionButton">36 <g:link action="show" id="${authority.id}">Show</g:link>37 </span>38 </td>39 </tr>40 </g:each>41 </tbody>42 </table>43 </div>13 <div class="body"> 14 <h1>Authority List</h1> 15 <g:if test="${flash.message}"> 16 <div class="message">${flash.message}</div> 17 </g:if> 18 <div class="list"> 19 <table> 20 <thead> 21 <tr> 22 <g:sortableColumn property="id" title="ID" /> 23 <g:sortableColumn property="authority" title="Authority Name" /> 24 <g:sortableColumn property="description" title="Description" /> 25 <th> </th> 26 </tr> 27 </thead> 28 <tbody> 29 <g:each in="${authorityList}" status="i" var="authority"> 30 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 31 <td>${authority.id}</td> 32 <td>${authority.authority?.encodeAsHTML()}</td> 33 <td>${authority.description?.encodeAsHTML()}</td> 34 <td class="actionButtons"> 35 <span class="actionButton"> 36 <g:link action="show" id="${authority.id}">Show</g:link> 37 </span> 38 </td> 39 </tr> 40 </g:each> 41 </tbody> 42 </table> 43 </div> 44 44 45 <div class="paginateButtons">46 <g:paginate total="${Authority.count()}" />47 </div>48 </div>45 <div class="paginateButtons"> 46 <g:paginate total="${Authority.count()}" /> 47 </div> 48 </div> 49 49 </body> -
trunk/grails-app/views/authority/show.gsp
r59 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Show Authority</title>2 <meta name="layout" content="main" /> 3 <title>Show Authority</title> 4 4 </head> 5 5 6 6 <body> 7 7 8 <div class="nav">9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span>11 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span>12 </div>8 <div class="nav"> 9 <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span> 10 <span class="menuButton"><g:link class="list" action="list">Authority List</g:link></span> 11 <span class="menuButton"><g:link class="create" action="create">New Authority</g:link></span> 12 </div> 13 13 14 <div class="body">15 <h1>Show Authority</h1>16 <g:if test="${flash.message}">17 <div class="message">${flash.message}</div>18 </g:if>19 <div class="dialog">20 <table>21 <tbody>14 <div class="body"> 15 <h1>Show Authority</h1> 16 <g:if test="${flash.message}"> 17 <div class="message">${flash.message}</div> 18 </g:if> 19 <div class="dialog"> 20 <table> 21 <tbody> 22 22 23 <tr class="prop">24 <td valign="top" class="name">ID:</td>25 <td valign="top" class="value">${authority.id}</td>26 </tr>23 <tr class="prop"> 24 <td valign="top" class="name">ID:</td> 25 <td valign="top" class="value">${authority.id}</td> 26 </tr> 27 27 28 <tr class="prop">29 <td valign="top" class="name">Authority Name:</td>30 <td valign="top" class="value">${authority.authority}</td>31 </tr>28 <tr class="prop"> 29 <td valign="top" class="name">Authority Name:</td> 30 <td valign="top" class="value">${authority.authority}</td> 31 </tr> 32 32 33 <tr class="prop">34 <td valign="top" class="name">Description:</td>35 <td valign="top" class="value">${authority.description}</td>36 </tr>33 <tr class="prop"> 34 <td valign="top" class="name">Description:</td> 35 <td valign="top" class="value">${authority.description}</td> 36 </tr> 37 37 38 <tr class="prop">39 <td valign="top" class="name">Persons:</td>40 <td valign="top" class="value">${authority.persons}</td>41 </tr>38 <tr class="prop"> 39 <td valign="top" class="name">Persons:</td> 40 <td valign="top" class="value">${authority.persons}</td> 41 </tr> 42 42 43 </tbody>44 </table>45 </div>43 </tbody> 44 </table> 45 </div> 46 46 47 <div class="buttons">48 <g:form>49 <input type="hidden" name="id" value="${authority?.id}" />50 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>51 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>52 </g:form>53 </div>47 <div class="buttons"> 48 <g:form> 49 <input type="hidden" name="id" value="${authority?.id}" /> 50 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 51 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 52 </g:form> 53 </div> 54 54 55 </div>55 </div> 56 56 57 57 </body> -
trunk/grails-app/views/person/create.gsp
r147 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Create Person</title>2 <meta name="layout" content="main" /> 3 <title>Create Person</title> 4 4 <nav:resources override="true"/> 5 5 </head> … … 7 7 <body> 8 8 9 <div class="nav">9 <div class="nav"> 10 10 <nav:renderSubItems group="navAlt"/> 11 </div>11 </div> 12 12 13 <div class="body"> 14 <g:if test="${flash.message}"> 15 <div class="message">${flash.message}</div> 16 </g:if> 17 <g:hasErrors bean="${person}"> 18 <div class="errors"> 19 <g:renderErrors bean="${person}" as="list" /> 20 </div> 21 </g:hasErrors> 22 <g:form action="save"> 23 <div class="dialog"> 24 <table> 25 <tbody> 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 <g:form action="save"> 26 <div class="dialog"> 27 <table> 28 <tbody> 26 29 27 <tr class="prop">28 <td valign="top" class="name"><label for="loginName">Login Name:</label></td>29 <td valign="top" class="value ${hasErrors(bean:person,field:'loginName','errors')}">30 <input type="text" id="loginName" name="loginName" value="${person.loginName?.encodeAsHTML()}"/>31 </td>32 </tr>30 <tr class="prop"> 31 <td valign="top" class="name"><label for="loginName">Login Name:</label></td> 32 <td valign="top" class="value ${hasErrors(bean:person,field:'loginName','errors')}"> 33 <input type="text" id="loginName" name="loginName" value="${person.loginName?.encodeAsHTML()}"/> 34 </td> 35 </tr> 33 36 34 <tr class="prop">35 <td valign="top" class="name"><label for="firstName">First Name:</label></td>36 <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}">37 <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/>38 </td>39 </tr>37 <tr class="prop"> 38 <td valign="top" class="name"><label for="firstName">First Name:</label></td> 39 <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}"> 40 <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/> 41 </td> 42 </tr> 40 43 41 44 <tr class="prop"> … … 47 50 48 51 49 <tr class="prop">50 <td valign="top" class="name"><label for="pass">Password:</label></td>51 <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}">52 <input type="password" id="pass" name="pass"/>53 </td>54 </tr>52 <tr class="prop"> 53 <td valign="top" class="name"><label for="pass">Password:</label></td> 54 <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}"> 55 <input type="password" id="pass" name="pass"/> 56 </td> 57 </tr> 55 58 56 <tr class="prop">57 <td valign="top" class="name"><label for="isActive">isActive:</label></td>58 <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}">59 <g:checkBox name="isActive" value="${person.isActive}" ></g:checkBox>60 </td>61 </tr>59 <tr class="prop"> 60 <td valign="top" class="name"><label for="isActive">isActive:</label></td> 61 <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}"> 62 <g:checkBox name="isActive" value="${person.isActive}" ></g:checkBox> 63 </td> 64 </tr> 62 65 63 <tr class="prop">64 <td valign="top" class="name"><label for="description">Description:</label></td>65 <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}">66 <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/>67 </td>68 </tr>66 <tr class="prop"> 67 <td valign="top" class="name"><label for="description">Description:</label></td> 68 <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}"> 69 <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/> 70 </td> 71 </tr> 69 72 70 <tr class="prop">71 <td valign="top" class="name"><label for="email">Email:</label></td>72 <td valign="top" class="value ${hasErrors(bean:person,field:'email','errors')}">73 <input type="text" id="email" name="email" value="${person.email?.encodeAsHTML()}"/>74 </td>75 </tr>73 <tr class="prop"> 74 <td valign="top" class="name"><label for="email">Email:</label></td> 75 <td valign="top" class="value ${hasErrors(bean:person,field:'email','errors')}"> 76 <input type="text" id="email" name="email" value="${person.email?.encodeAsHTML()}"/> 77 </td> 78 </tr> 76 79 77 <tr class="prop">78 <td valign="top" class="name"><label for="emailShow">Show Email:</label></td>79 <td valign="top" class="value ${hasErrors(bean:person,field:'emailShow','errors')}">80 <g:checkBox name="emailShow" value="${person.emailShow}"/>81 </td>82 </tr>80 <tr class="prop"> 81 <td valign="top" class="name"><label for="emailShow">Show Email:</label></td> 82 <td valign="top" class="value ${hasErrors(bean:person,field:'emailShow','errors')}"> 83 <g:checkBox name="emailShow" value="${person.emailShow}"/> 84 </td> 85 </tr> 83 86 84 87 <tr class="prop"> … … 89 92 </tr> 90 93 91 <tr class="prop">92 <td valign="top" class="name" align="left">Authorities:</td>93 </tr>94 <tr class="prop"> 95 <td valign="top" class="name" align="left">Authorities:</td> 96 </tr> 94 97 95 <g:each in="${authorityList}">96 <tr>97 <td valign="top" class="name" align="left">${it.authority.encodeAsHTML()}</td>98 <td align="left"><g:checkBox name="${it.authority}"/></td>99 </tr>100 </g:each>98 <g:each in="${authorityList}"> 99 <tr> 100 <td valign="top" class="name" align="left">${it.authority.encodeAsHTML()}</td> 101 <td align="left"><g:checkBox name="${it.authority}"/></td> 102 </tr> 103 </g:each> 101 104 102 </tbody>103 </table>104 </div>105 </tbody> 106 </table> 107 </div> 105 108 106 <div class="buttons">107 <span class="button"><input class="save" type="submit" value="Create" /></span>108 </div>109 <div class="buttons"> 110 <span class="button"><input class="save" type="submit" value="Create" /></span> 111 </div> 109 112 110 </g:form>113 </g:form> 111 114 112 </div>115 </div> 113 116 </body> -
trunk/grails-app/views/person/edit.gsp
r147 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Edit Person</title>2 <meta name="layout" content="main" /> 3 <title>Edit Person</title> 4 4 <nav:resources override="true"/> 5 5 </head> … … 7 7 <body> 8 8 9 <div class="nav">9 <div class="nav"> 10 10 <nav:renderSubItems group="navAlt"/> 11 </div>11 </div> 12 12 13 <div class="body"> 14 <g:if test="${flash.message}"> 15 <div class="message">${flash.message}</div> 16 </g:if> 17 <g:hasErrors bean="${person}"> 18 <div class="errors"> 19 <g:renderErrors bean="${person}" as="list" /> 20 </div> 21 </g:hasErrors> 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> 22 25 23 <!--<div class="prop">24 <span class="name">ID: ${person.id}</span>25 </div>-->26 <!--<div class="prop"> 27 <span class="name">ID: ${person.id}</span> 28 </div>--> 26 29 27 <g:form>28 <input type="hidden" name="id" value="${person.id}" />29 <input type="hidden" name="version" value="${person.version}" />30 <g:form> 31 <input type="hidden" name="id" value="${person.id}" /> 32 <input type="hidden" name="version" value="${person.version}" /> 30 33 <input type="hidden" name="password" value="${person.password}" /> 31 <div class="dialog">32 <table>33 <tbody>34 <div class="dialog"> 35 <table> 36 <tbody> 34 37 35 <tr class="prop">36 <td valign="top" class="name"><label for="loginName">Login Name:</label></td>37 <td valign="top" class="value ${hasErrors(bean:person,field:'loginName','errors')}">38 <input type="text" id="loginName" name="loginName" value="${person.loginName?.encodeAsHTML()}"/>39 </td>40 </tr>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 </td> 43 </tr> 41 44 42 <tr class="prop">43 <td valign="top" class="name"><label for="firstName">First Name:</label></td>44 <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}">45 <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/>46 </td>47 </tr>45 <tr class="prop"> 46 <td valign="top" class="name"><label for="firstName">First Name:</label></td> 47 <td valign="top" class="value ${hasErrors(bean:person,field:'firstName','errors')}"> 48 <input type="text" id="firstName" name="firstName" value="${person.firstName?.encodeAsHTML()}"/> 49 </td> 50 </tr> 48 51 49 52 <tr class="prop"> … … 54 57 </tr> 55 58 56 <tr class="prop">57 <td valign="top" class="name"><label for="pass">Password:</label></td>58 <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}">59 <input type="password" id="pass" name="pass" value="${person.pass?.encodeAsHTML()}"/>60 </td>61 </tr>59 <tr class="prop"> 60 <td valign="top" class="name"><label for="pass">Password:</label></td> 61 <td valign="top" class="value ${hasErrors(bean:person,field:'pass','errors')}"> 62 <input type="password" id="pass" name="pass" value="${person.pass?.encodeAsHTML()}"/> 63 </td> 64 </tr> 62 65 63 <tr class="prop">64 <td valign="top" class="name"><label for="isActive">isActive:</label></td>65 <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}">66 <g:checkBox name="isActive" value="${person.isActive}"/>67 </td>68 </tr>66 <tr class="prop"> 67 <td valign="top" class="name"><label for="isActive">isActive:</label></td> 68 <td valign="top" class="value ${hasErrors(bean:person,field:'isActive','errors')}"> 69 <g:checkBox name="isActive" value="${person.isActive}"/> 70 </td> 71 </tr> 69 72 70 <tr class="prop">71 <td valign="top" class="name"><label for="description">Description:</label></td>72 <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}">73 <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/>74 </td>75 </tr>73 <tr class="prop"> 74 <td valign="top" class="name"><label for="description">Description:</label></td> 75 <td valign="top" class="value ${hasErrors(bean:person,field:'description','errors')}"> 76 <input type="text" id="description" name="description" value="${person.description?.encodeAsHTML()}"/> 77 </td> 78 </tr> 76 79 77 <tr class="prop">78 <td valign="top" class="name"><label for="email">Email:</label></td>79 <td valign="top" class="value ${hasErrors(bean:person,field:'email','errors')}">80 <input type="text" id="email" name="email" value="${person?.email?.encodeAsHTML()}"/>81 </td>82 </tr>80 <tr class="prop"> 81 <td valign="top" class="name"><label for="email">Email:</label></td> 82 <td valign="top" class="value ${hasErrors(bean:person,field:'email','errors')}"> 83 <input type="text" id="email" name="email" value="${person?.email?.encodeAsHTML()}"/> 84 </td> 85 </tr> 83 86 84 <tr class="prop">85 <td valign="top" class="name"><label for="emailShow">Show Email:</label></td>86 <td valign="top" class="value ${hasErrors(bean:person,field:'emailShow','errors')}">87 <g:checkBox name="emailShow" value="${person.emailShow}"/>88 </td>89 </tr>87 <tr class="prop"> 88 <td valign="top" class="name"><label for="emailShow">Show Email:</label></td> 89 <td valign="top" class="value ${hasErrors(bean:person,field:'emailShow','errors')}"> 90 <g:checkBox name="emailShow" value="${person.emailShow}"/> 91 </td> 92 </tr> 90 93 91 94 <tr class="prop"> … … 107 110 </g:each> 108 111 109 </tbody>110 </table>111 </div>112 </tbody> 113 </table> 114 </div> 112 115 113 <div class="buttons">114 <span class="button"><g:actionSubmit class="save" value="Update" /></span>115 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>116 </div>116 <div class="buttons"> 117 <span class="button"><g:actionSubmit class="save" value="Update" /></span> 118 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 119 </div> 117 120 118 </g:form>121 </g:form> 119 122 120 </div>123 </div> 121 124 </body> -
trunk/grails-app/views/person/show.gsp
r147 r150 1 1 <head> 2 <meta name="layout" content="main" />3 <title>Show Person</title>2 <meta name="layout" content="main" /> 3 <title>Show Person</title> 4 4 <nav:resources override="true"/> 5 5 </head> … … 7 7 <body> 8 8 9 <div class="nav">9 <div class="nav"> 10 10 <nav:renderSubItems group="navAlt"/> 11 </div>11 </div> 12 12 13 <div class="body">14 <g:if test="${flash.message}">15 <div class="message">${flash.message}</div>16 </g:if>17 <div class="dialog">18 <table>19 <tbody>13 <div class="body"> 14 <g:if test="${flash.message}"> 15 <div class="message">${flash.message}</div> 16 </g:if> 17 <div class="dialog"> 18 <table> 19 <tbody> 20 20 21 <tr class="prop">22 <td valign="top" class="name">ID:</td>23 <td valign="top" class="value">${person.id}</td>24 </tr>21 <tr class="prop"> 22 <td valign="top" class="name">ID:</td> 23 <td valign="top" class="value">${person.id}</td> 24 </tr> 25 25 26 <tr class="prop">27 <td valign="top" class="name">Login Name:</td>28 <td valign="top" class="value">${person.loginName?.encodeAsHTML()}</td>29 </tr>26 <tr class="prop"> 27 <td valign="top" class="name">Login Name:</td> 28 <td valign="top" class="value">${person.loginName?.encodeAsHTML()}</td> 29 </tr> 30 30 31 <tr class="prop">32 <td valign="top" class="name">First Name:</td>33 <td valign="top" class="value">${person.firstName?.encodeAsHTML()}</td>34 </tr>31 <tr class="prop"> 32 <td valign="top" class="name">First Name:</td> 33 <td valign="top" class="value">${person.firstName?.encodeAsHTML()}</td> 34 </tr> 35 35 36 36 <tr class="prop"> … … 39 39 </tr> 40 40 41 <tr class="prop">42 <td valign="top" class="name">isActive:</td>43 <td valign="top" class="value">${person.isActive}</td>44 </tr>41 <tr class="prop"> 42 <td valign="top" class="name">isActive:</td> 43 <td valign="top" class="value">${person.isActive}</td> 44 </tr> 45 45 46 <tr class="prop">47 <td valign="top" class="name">Description:</td>48 <td valign="top" class="value">${person.description?.encodeAsHTML()}</td>49 </tr>46 <tr class="prop"> 47 <td valign="top" class="name">Description:</td> 48 <td valign="top" class="value">${person.description?.encodeAsHTML()}</td> 49 </tr> 50 50 51 <tr class="prop">52 <td valign="top" class="name">Email:</td>53 <td valign="top" class="value">${person.email?.encodeAsHTML()}</td>54 </tr>51 <tr class="prop"> 52 <td valign="top" class="name">Email:</td> 53 <td valign="top" class="value">${person.email?.encodeAsHTML()}</td> 54 </tr> 55 55 56 <tr class="prop">57 <td valign="top" class="name">Show Email:</td>58 <td valign="top" class="value">${person.emailShow}</td>59 </tr>56 <tr class="prop"> 57 <td valign="top" class="name">Show Email:</td> 58 <td valign="top" class="value">${person.emailShow}</td> 59 </tr> 60 60 61 61 <tr class="prop"> … … 64 64 </tr> 65 65 66 <tr class="prop">67 <td valign="top" class="name">Authorities:</td>68 <td valign="top" class="value">69 <ul>70 <g:each in="${roleNames}" var='name'>71 <li>${name}</li>72 </g:each>73 </ul>74 </td>75 </tr>66 <tr class="prop"> 67 <td valign="top" class="name">Authorities:</td> 68 <td valign="top" class="value"> 69 <ul> 70 <g:each in="${roleNames}" var='name'> 71 <li>${name}</li> 72 </g:each> 73 </ul> 74 </td> 75 </tr> 76 76 77 </tbody>78 </table>79 </div>77 </tbody> 78 </table> 79 </div> 80 80 81 <div class="buttons">82 <g:form>83 <input type="hidden" name="id" value="${person.id}" />84 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>85 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>86 </g:form>87 </div>81 <div class="buttons"> 82 <g:form> 83 <input type="hidden" name="id" value="${person.id}" /> 84 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 85 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> 86 </g:form> 87 </div> 88 88 89 </div>89 </div> 90 90 </body> -
trunk/grails-app/views/taskDetailed/search.gsp
r147 r150 11 11 <nav:renderSubItems group="nav"/> 12 12 </div> 13 13 14 14 <div class="body"> 15 15 <g:if test="${flash.message}"> … … 35 35 <thead> 36 36 <tr> 37 38 <g:sortableColumn property="id" title="Id" params="${filterParams}" />39 40 <g:sortableColumn property="targetStartDate" title="Target Start Date" params="${filterParams}" />41 42 <g:sortableColumn property="description" title="Description" params="${filterParams}" />43 44 <g:sortableColumn property="leadPerson" title="Lead Person" params="${filterParams}" />45 37 38 <g:sortableColumn property="id" title="Id" params="${filterParams}" /> 39 40 <g:sortableColumn property="targetStartDate" title="Target Start Date" params="${filterParams}" /> 41 42 <g:sortableColumn property="description" title="Description" params="${filterParams}" /> 43 44 <g:sortableColumn property="leadPerson" title="Lead Person" params="${filterParams}" /> 45 46 46 <g:sortableColumn property="taskPriority" title="Task Priority" params="${filterParams}" /> 47 47 48 48 <g:sortableColumn property="taskStatus" title="Task Status" params="${filterParams}" /> 49 49 50 50 <th></th> 51 51 52 52 </tr> 53 53 </thead> … … 57 57 58 58 <td>${fieldValue(bean:taskInstance, field:'id')}</td> 59 59 60 60 <td><g:formatDate date="${taskInstance.targetStartDate}" format="EEE, dd-MMM-yyyy"/></td> 61 61 62 62 <td>${fieldValue(bean:taskInstance, field:'description')}</td> 63 63 64 64 <td>${fieldValue(bean:taskInstance, field:'leadPerson')}</td> 65 65 66 66 <td>${fieldValue(bean:taskInstance, field:'taskPriority')}</td> 67 67 68 68 <td>${fieldValue(bean:taskInstance, field:'taskStatus')}</td> 69 69 … … 73 73 </g:link> 74 74 </td> 75 75 76 76 </tr> 77 77 </g:each>
Note: See TracChangeset
for help on using the changeset viewer.
