[128] | 1 | <% import org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor as Events %> |
---|
| 2 | <%=packageName%> |
---|
| 3 | <html> |
---|
| 4 | <head> |
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
---|
| 6 | <meta name="layout" content="main" /> |
---|
| 7 | <title>Edit ${className}</title> |
---|
| 8 | </head> |
---|
| 9 | <body> |
---|
| 10 | <div class="nav"> |
---|
| 11 | <span class="menuButton"><g:link class="list" action="list">${className} List</g:link></span> |
---|
| 12 | <span class="menuButton"><g:link class="create" action="create">New ${className}</g:link></span> |
---|
| 13 | </div> |
---|
| 14 | <div class="body"> |
---|
| 15 | <h1>Edit ${className}</h1> |
---|
| 16 | <g:if test="\${flash.message}"> |
---|
| 17 | <div class="message">\${flash.message}</div> |
---|
| 18 | </g:if> |
---|
| 19 | <g:hasErrors bean="\${${propertyName}}"> |
---|
| 20 | <div class="errors"> |
---|
| 21 | <g:renderErrors bean="\${${propertyName}}" as="list" /> |
---|
| 22 | </div> |
---|
| 23 | </g:hasErrors> |
---|
| 24 | <g:form method="post" <%= multiPart ? ' enctype="multipart/form-data"' : '' %>> |
---|
| 25 | <input type="hidden" name="id" value="\${${propertyName}?.id}" /> |
---|
| 26 | <input type="hidden" name="version" value="\${${propertyName}?.version}" /> |
---|
| 27 | <div class="dialog"> |
---|
| 28 | <table> |
---|
| 29 | <tbody> |
---|
| 30 | <% |
---|
| 31 | excludedProps = ['version', |
---|
| 32 | 'id', |
---|
| 33 | Events.ONLOAD_EVENT, |
---|
| 34 | Events.BEFORE_DELETE_EVENT, |
---|
| 35 | Events.BEFORE_INSERT_EVENT, |
---|
| 36 | Events.BEFORE_UPDATE_EVENT] |
---|
| 37 | props = domainClass.properties.findAll { !excludedProps.contains(it.name) } |
---|
| 38 | |
---|
| 39 | Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[])) |
---|
| 40 | props.each { p -> |
---|
| 41 | cp = domainClass.constrainedProperties[p.name] |
---|
| 42 | display = (cp ? cp.display : true) |
---|
| 43 | if(display) { %> |
---|
| 44 | <tr class="prop"> |
---|
| 45 | <td valign="top" class="name"> |
---|
| 46 | <label for="${p.name}">${p.naturalName}:</label> |
---|
| 47 | </td> |
---|
| 48 | <td valign="top" class="value \${hasErrors(bean:${propertyName},field:'${p.name}','errors')}"> |
---|
| 49 | ${renderEditor(p)} |
---|
| 50 | </td> |
---|
| 51 | </tr> |
---|
| 52 | <% } } %> |
---|
| 53 | </tbody> |
---|
| 54 | </table> |
---|
| 55 | </div> |
---|
| 56 | <div class="buttons"> |
---|
| 57 | <span class="button"><g:actionSubmit class="save" value="Update" /></span> |
---|
| 58 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
| 59 | </div> |
---|
| 60 | </g:form> |
---|
| 61 | </div> |
---|
| 62 | </body> |
---|
| 63 | </html> |
---|