[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>Show ${className}</title> |
---|
| 8 | </head> |
---|
| 9 | <body> |
---|
| 10 | <div class="nav"> |
---|
[158] | 11 | <span class="menuButton"><a class="home" href="\${resource(dir:'')}">Home</a></span> |
---|
[128] | 12 | <span class="menuButton"><g:link class="list" action="list">${className} List</g:link></span> |
---|
| 13 | <span class="menuButton"><g:link class="create" action="create">New ${className}</g:link></span> |
---|
| 14 | </div> |
---|
| 15 | <div class="body"> |
---|
| 16 | <h1>Show ${className}</h1> |
---|
| 17 | <g:if test="\${flash.message}"> |
---|
| 18 | <div class="message">\${flash.message}</div> |
---|
| 19 | </g:if> |
---|
| 20 | <div class="dialog"> |
---|
| 21 | <table> |
---|
| 22 | <tbody> |
---|
| 23 | |
---|
| 24 | <% |
---|
| 25 | excludedProps = ['version', |
---|
| 26 | Events.ONLOAD_EVENT, |
---|
| 27 | Events.BEFORE_DELETE_EVENT, |
---|
| 28 | Events.BEFORE_INSERT_EVENT, |
---|
| 29 | Events.BEFORE_UPDATE_EVENT] |
---|
| 30 | props = domainClass.properties.findAll { !excludedProps.contains(it.name) } |
---|
| 31 | Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[])) |
---|
| 32 | props.each { p -> %> |
---|
| 33 | <tr class="prop"> |
---|
| 34 | <td valign="top" class="name">${p.naturalName}:</td> |
---|
| 35 | <% if(p.isEnum()) { %> |
---|
| 36 | <td valign="top" class="value">\${${propertyName}?.${p.name}?.encodeAsHTML()}</td> |
---|
| 37 | <% } else if(p.oneToMany || p.manyToMany) { %> |
---|
| 38 | <td valign="top" style="text-align:left;" class="value"> |
---|
| 39 | <ul> |
---|
| 40 | <g:each var="${p.name[0]}" in="\${${propertyName}.${p.name}}"> |
---|
| 41 | <li><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.name[0]}.id}">\${${p.name[0]}?.encodeAsHTML()}</g:link></li> |
---|
| 42 | </g:each> |
---|
| 43 | </ul> |
---|
| 44 | </td> |
---|
| 45 | <% } else if(p.manyToOne || p.oneToOne) { %> |
---|
| 46 | <td valign="top" class="value"><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${propertyName}?.${p.name}?.id}">\${${propertyName}?.${p.name}?.encodeAsHTML()}</g:link></td> |
---|
| 47 | <% } else { %> |
---|
| 48 | <td valign="top" class="value">\${fieldValue(bean:${propertyName}, field:'${p.name}')}</td> |
---|
| 49 | <% } %> |
---|
| 50 | </tr> |
---|
| 51 | <% } %> |
---|
| 52 | </tbody> |
---|
| 53 | </table> |
---|
| 54 | </div> |
---|
| 55 | <div class="buttons"> |
---|
| 56 | <g:form> |
---|
| 57 | <input type="hidden" name="id" value="\${${propertyName}?.id}" /> |
---|
| 58 | <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> |
---|
| 59 | <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span> |
---|
| 60 | </g:form> |
---|
| 61 | </div> |
---|
| 62 | </div> |
---|
| 63 | </body> |
---|
| 64 | </html> |
---|