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.show.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.show.label" args="[entityName]" /></h1> |
---|
18 | <g:if test="\${flash.message}"> |
---|
19 | <div class="message">\${flash.message}</div> |
---|
20 | </g:if> |
---|
21 | <div class="dialog"> |
---|
22 | <table> |
---|
23 | <tbody> |
---|
24 | <% excludedProps = Event.allEvents.toList() << 'version' |
---|
25 | props = domainClass.properties.findAll { !excludedProps.contains(it.name) } |
---|
26 | Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[])) |
---|
27 | props.each { p -> %> |
---|
28 | <tr class="prop"> |
---|
29 | <td valign="top" class="name"><g:message code="${domainClass.propertyName}.${p.name}.label" default="${p.naturalName}" /></td> |
---|
30 | <% if (p.isEnum()) { %> |
---|
31 | <td valign="top" class="value">\${${propertyName}?.${p.name}?.encodeAsHTML()}</td> |
---|
32 | <% } else if (p.oneToMany || p.manyToMany) { %> |
---|
33 | <td valign="top" style="text-align: left;" class="value"> |
---|
34 | <ul> |
---|
35 | <g:each in="\${${propertyName}.${p.name}}" var="${p.name[0]}"> |
---|
36 | <li><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.name[0]}.id}">\${${p.name[0]}?.encodeAsHTML()}</g:link></li> |
---|
37 | </g:each> |
---|
38 | </ul> |
---|
39 | </td> |
---|
40 | <% } else if (p.manyToOne || p.oneToOne) { %> |
---|
41 | <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> |
---|
42 | <% } else if (p.type == Boolean.class || p.type == boolean.class) { %> |
---|
43 | <td valign="top" class="value"><g:formatBoolean boolean="\${${propertyName}?.${p.name}}" /></td> |
---|
44 | <% } else if (p.type == Date.class || p.type == java.sql.Date.class || p.type == java.sql.Time.class || p.type == Calendar.class) { %> |
---|
45 | <td valign="top" class="value"><g:formatDate date="\${${propertyName}?.${p.name}}" /></td> |
---|
46 | <% } else { %> |
---|
47 | <td valign="top" class="value">\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</td> |
---|
48 | <% } %> |
---|
49 | </tr> |
---|
50 | <% } %> |
---|
51 | </tbody> |
---|
52 | </table> |
---|
53 | </div> |
---|
54 | <div class="buttons"> |
---|
55 | <g:form> |
---|
56 | <g:hiddenField name="id" value="\${${propertyName}?.id}" /> |
---|
57 | <span class="button"><g:actionSubmit class="edit" action="edit" value="\${message(code: 'default.button.edit.label', default: 'Edit')}" /></span> |
---|
58 | <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> |
---|
59 | </g:form> |
---|
60 | </div> |
---|
61 | </div> |
---|
62 | </body> |
---|
63 | </html> |
---|