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:render template="/shared/messages" /> |
---|
17 | <g:hasErrors bean="\${${propertyName}}"> |
---|
18 | <div class="errors"> |
---|
19 | <g:renderErrors bean="\${${propertyName}}" as="list" /> |
---|
20 | </div> |
---|
21 | </g:hasErrors> |
---|
22 | <g:form method="post" <%= multiPart ? ' enctype="multipart/form-data"' : '' %>> |
---|
23 | <input type="hidden" name="id" value="\${${propertyName}?.id}" /> |
---|
24 | <input type="hidden" name="version" value="\${${propertyName}?.version}" /> |
---|
25 | <div class="dialog"> |
---|
26 | <table> |
---|
27 | <tbody> |
---|
28 | <% |
---|
29 | excludedProps = ['version', |
---|
30 | 'id', |
---|
31 | Events.ONLOAD_EVENT, |
---|
32 | Events.BEFORE_DELETE_EVENT, |
---|
33 | Events.BEFORE_INSERT_EVENT, |
---|
34 | Events.BEFORE_UPDATE_EVENT] |
---|
35 | props = domainClass.properties.findAll { !excludedProps.contains(it.name) } |
---|
36 | |
---|
37 | Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[])) |
---|
38 | props.each { p -> |
---|
39 | cp = domainClass.constrainedProperties[p.name] |
---|
40 | display = (cp ? cp.display : true) |
---|
41 | if(display) { %> |
---|
42 | <tr class="prop"> |
---|
43 | <td valign="top" class="name"> |
---|
44 | <label for="${p.name}">${p.naturalName}:</label> |
---|
45 | </td> |
---|
46 | <td valign="top" class="value \${hasErrors(bean:${propertyName},field:'${p.name}','errors')}"> |
---|
47 | ${renderEditor(p)} |
---|
48 | </td> |
---|
49 | </tr> |
---|
50 | <% } } %> |
---|
51 | </tbody> |
---|
52 | </table> |
---|
53 | </div> |
---|
54 | <div class="buttons"> |
---|
55 | <span class="button"><g:actionSubmit class="save" value="Update" /></span> |
---|
56 | <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span> |
---|
57 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
58 | </div> |
---|
59 | </g:form> |
---|
60 | </div> |
---|
61 | </body> |
---|
62 | </html> |
---|