1 | <% import grails.persistence.Event %> |
---|
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 | <g:set var="entityName" value="\${message(code: '${domainClass.propertyName}.label', default: '${className}')}" /> |
---|
8 | <title><g:message code="default.edit.label" args="[entityName]" /></title> |
---|
9 | </head> |
---|
10 | <body> |
---|
11 | <div class="nav"> |
---|
12 | <span class="menuButton"><a class="home" href="\${createLink(uri: '/')}">Home</a></span> |
---|
13 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
14 | <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> |
---|
15 | </div> |
---|
16 | <div class="body"> |
---|
17 | <h1><g:message code="default.edit.label" args="[entityName]" /></h1> |
---|
18 | <g:if test="\${flash.message}"> |
---|
19 | <div class="message">\${flash.message}</div> |
---|
20 | </g:if> |
---|
21 | <g:hasErrors bean="\${${propertyName}}"> |
---|
22 | <div class="errors"> |
---|
23 | <g:renderErrors bean="\${${propertyName}}" as="list" /> |
---|
24 | </div> |
---|
25 | </g:hasErrors> |
---|
26 | <g:form method="post" <%= multiPart ? ' enctype="multipart/form-data"' : '' %>> |
---|
27 | <g:hiddenField name="id" value="\${${propertyName}?.id}" /> |
---|
28 | <g:hiddenField name="version" value="\${${propertyName}?.version}" /> |
---|
29 | <div class="dialog"> |
---|
30 | <table> |
---|
31 | <tbody> |
---|
32 | <% excludedProps = Event.allEvents.toList() << 'version' << 'id' |
---|
33 | props = domainClass.properties.findAll { !excludedProps.contains(it.name) } |
---|
34 | Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[])) |
---|
35 | props.each { p -> |
---|
36 | cp = domainClass.constrainedProperties[p.name] |
---|
37 | display = (cp ? cp.display : true) |
---|
38 | if (display) { %> |
---|
39 | <tr class="prop"> |
---|
40 | <td valign="top" class="name"> |
---|
41 | <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></label> |
---|
42 | </td> |
---|
43 | <td valign="top" class="value \${hasErrors(bean: ${propertyName}, field: '${p.name}', 'errors')}"> |
---|
44 | ${renderEditor(p)} |
---|
45 | </td> |
---|
46 | </tr> |
---|
47 | <% } } %> |
---|
48 | </tbody> |
---|
49 | </table> |
---|
50 | </div> |
---|
51 | <div class="buttons"> |
---|
52 | <span class="button"><g:actionSubmit class="save" action="update" value="\${message(code: 'default.button.update.label', default: 'Update')}" /></span> |
---|
53 | <span class="button"><g:actionSubmit class="delete" action="delete" value="\${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('\${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span> |
---|
54 | </div> |
---|
55 | </g:form> |
---|
56 | </div> |
---|
57 | </body> |
---|
58 | </html> |
---|