Skip to content
Browse files

Upgraded to Grails 1.2.5

  • Loading branch information...
1 parent 7b09a21 commit 7e3f9bb5519c47ff751ea9ecf18c716d45e1ff75 @nboukeffa nboukeffa committed Apr 22, 2011
View
10 application.properties
@@ -1,18 +1,18 @@
#Grails Metadata file
-#Wed Oct 27 22:45:45 CEST 2010
-app.grails.version=1.2.2
+#Sat Apr 16 11:12:37 CEST 2011
+app.grails.version=1.2.5
app.name=seekin
app.servlet.version=2.4
app.version=0.1
plugins.acegi=0.5.2
-plugins.bubbling=2.1.1
+plugins.bubbling=2.1.2
plugins.fixtures=1.0-M4-SNAPSHOT
plugins.grails-ui=1.2-SNAPSHOT
plugins.gss=1.0.1
-plugins.hibernate=1.2.2
+plugins.hibernate=1.2.5
plugins.i18n-templates=1.1.0.1
plugins.navigation=1.1.1
plugins.ofchart=0.6
-plugins.tomcat=1.2.2
+plugins.tomcat=1.2.5
plugins.transparent-message=0.1
plugins.yui=2.7.0.1
View
56 src/templates/scaffolding/Controller.groovy
@@ -1,14 +1,13 @@
-<%=packageName ? "package ${packageName}\n\n" : ""%>
-<% import org.codehaus.groovy.grails.orm.hibernate.support.ClosureEventTriggeringInterceptor as Events %>
-import grails.converters.JSON
-class ${className}Controller {
+<%=packageName ? "package ${packageName}\n\n" : ""%>class ${className}Controller {
def index = { redirect(action: "list", params: params) }
// the delete, save and update actions only accept POST requests
static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
def list = {
+ params.max = Math.min(params.max ? params.max.toInteger() : 10, 100)
+ [${propertyName}List: ${className}.list(params), ${propertyName}Total: ${className}.count()]
}
def create = {
@@ -111,53 +110,4 @@ class ${className}Controller {
redirect(action: "list")
}
}
-
- def dataTableDataAsJSON = {
- def list = ${className}.list(params)
- def ret = []
- response.setHeader("Cache-Control", "no-store")
-
- list.each {
- ret << [
- <% excludedProps = ["version",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- def props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- props.eachWithIndex
- {
- p, i ->
- if (i < 6)
- {
- def propertyClassName = p.type.name
- if(propertyClassName =~ "me.hcl.seekin")
- {
- def controller = propertyClassName.substring(propertyClassName.lastIndexOf(".") + 1).toLowerCase()
- println " ${p.name}:[name:it.${p.name}?.id, link:g.createLink(controller: '${controller}', action: 'show', id:it.${p.name}?.id)],"
- }
- else if(propertyClassName =~ "Date")
- {
- println " ${p.name}:it.${p.name}?.toString(),"
- }
- else
- {
- println " ${p.name}:it.${p.name},"
- }
- }
- }
- %>
- urlID: it.id
- ]
- }
-
- def data = [
- totalRecords: ${className}.count(),
- results: ret
- ]
-
- render data as JSON
- }
-
}
View
87 src/templates/scaffolding/create.gsp
@@ -4,43 +4,56 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
- <title><g:message code="${domainClass.propertyName}.create" /></title>
-
+ <title><g:message code="${domainClass.propertyName}.create" default="Create ${className}" /></title>
</head>
- <body>
- <h2><g:message code="${domainClass.propertyName}.create" /></h2>
- <g:if test="\${flash.message}">
- <div class="flash_message"><g:message code="\${flash.message}" args="\${flash.args}" /></div>
- </g:if>
- <g:hasErrors bean="\${${propertyName}}">
- <div class="flash_message">
- <g:renderErrors bean="\${${propertyName}}" as="list" />
- </div>
- </g:hasErrors>
- <g:form class="boxed_form" name="crud_panel" action="save" method="post" <%= multiPart ? " enctype=\"multipart/form-data\"" : "" %>>
- <% excludedProps = ["version",
- "id",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- props.each { p ->
- if (!Collection.class.isAssignableFrom(p.type)) {
- cp = domainClass.constrainedProperties[p.name]
- display = (cp ? cp.display : true)
- if (display) { %>
- <p>
- <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" />:</label>
- ${renderEditor(p)}
- </p>
- <% } } } %>
- <div class="actionpad yui-skin-sam">
- <g:buildCreateButtons />
- </div>
-
- </g:form>
-
+ <body>
+ <div class="nav">
+ <span class="menuButton"><a class="home" href="\${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
+ <span class="menuButton"><g:link class="list" action="list"><g:message code="${domainClass.propertyName}.list" default="${className} List" /></g:link></span>
+ </div>
+ <div class="body">
+ <h1><g:message code="${domainClass.propertyName}.create" default="Create ${className}" /></h1>
+ <g:if test="\${flash.message}">
+ <div class="message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
+ </g:if>
+ <g:hasErrors bean="\${${propertyName}}">
+ <div class="errors">
+ <g:renderErrors bean="\${${propertyName}}" as="list" />
+ </div>
+ </g:hasErrors>
+ <g:form action="save" method="post" <%= multiPart ? " enctype=\"multipart/form-data\"" : "" %>>
+ <div class="dialog">
+ <table>
+ <tbody>
+ <% excludedProps = ["version",
+ "id",
+ Events.ONLOAD_EVENT,
+ Events.BEFORE_INSERT_EVENT,
+ Events.BEFORE_UPDATE_EVENT,
+ Events.BEFORE_DELETE_EVENT]
+ props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
+ Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
+ props.each { p ->
+ if (!Collection.class.isAssignableFrom(p.type)) {
+ cp = domainClass.constrainedProperties[p.name]
+ display = (cp ? cp.display : true)
+ if (display) { %>
+ <tr class="prop">
+ <td valign="top" class="name">
+ <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" />:</label>
+ </td>
+ <td valign="top" class="value \${hasErrors(bean: ${propertyName}, field: '${p.name}', 'errors')}">
+ ${renderEditor(p)}
+ </td>
+ </tr>
+ <% } } } %>
+ </tbody>
+ </table>
+ </div>
+ <div class="buttons">
+ <span class="button"><g:submitButton name="create" class="save" value="\${message(code: 'create', 'default': 'Create')}" /></span>
+ </div>
+ </g:form>
+ </div>
</body>
</html>
View
86 src/templates/scaffolding/edit.gsp
@@ -4,41 +4,59 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
- <title><g:message code="${domainClass.propertyName}.edit"/></title>
-
+ <title><g:message code="${domainClass.propertyName}.edit" default="Edit ${className}" /></title>
</head>
<body>
- <h2><g:message code="${domainClass.propertyName}.edit"/></h2>
- <g:if test="\${flash.message}">
- <div class="flash_message"><g:message code="\${flash.message}" args="\${flash.args}"/></div>
- </g:if>
- <g:hasErrors bean="\${${propertyName}}">
- <div class="flash_message"><g:renderErrors bean="\${${propertyName}}" as="list" /></div>
- </g:hasErrors>
- <g:form class="boxed_form" name="crud_panel" method="post" <%= multiPart ? " enctype=\"multipart/form-data\"" : "" %>>
- <g:hiddenField name="id" value="\${${propertyName}?.id}" />
- <g:hiddenField name="version" value="\${${propertyName}?.version}" />
- <% excludedProps = ["version",
- "id",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- props.each { p ->
- cp = domainClass.constrainedProperties[p.name]
- display = (cp ? cp.display : true)
- if (display) { %>
- <p>
-
- <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" /></label>
- ${renderEditor(p)}
- </p>
- <% } } %>
- <div class="actionpad yui-skin-sam">
- <g:buildEditButtons />
- </div>
- </g:form>
+ <div class="nav">
+ <span class="menuButton"><a class="home" href="\${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
+ <span class="menuButton"><g:link class="list" action="list"><g:message code="${domainClass.propertyName}.list" default="${className} List" /></g:link></span>
+ <span class="menuButton"><g:link class="create" action="create"><g:message code="${domainClass.propertyName}.new" default="New ${className}" /></g:link></span>
+ </div>
+ <div class="body">
+ <h1><g:message code="${domainClass.propertyName}.edit" default="Edit ${className}" /></h1>
+ <g:if test="\${flash.message}">
+ <div class="message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
+ </g:if>
+ <g:hasErrors bean="\${${propertyName}}">
+ <div class="errors">
+ <g:renderErrors bean="\${${propertyName}}" as="list" />
+ </div>
+ </g:hasErrors>
+ <g:form method="post" <%= multiPart ? " enctype=\"multipart/form-data\"" : "" %>>
+ <g:hiddenField name="id" value="\${${propertyName}?.id}" />
+ <g:hiddenField name="version" value="\${${propertyName}?.version}" />
+ <div class="dialog">
+ <table>
+ <tbody>
+ <% excludedProps = ["version",
+ "id",
+ Events.ONLOAD_EVENT,
+ Events.BEFORE_INSERT_EVENT,
+ Events.BEFORE_UPDATE_EVENT,
+ Events.BEFORE_DELETE_EVENT]
+ props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
+ Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
+ props.each { p ->
+ cp = domainClass.constrainedProperties[p.name]
+ display = (cp ? cp.display : true)
+ if (display) { %>
+ <tr class="prop">
+ <td valign="top" class="name">
+ <label for="${p.name}"><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" />:</label>
+ </td>
+ <td valign="top" class="value \${hasErrors(bean: ${propertyName}, field: '${p.name}', 'errors')}">
+ ${renderEditor(p)}
+ </td>
+ </tr>
+ <% } } %>
+ </tbody>
+ </table>
+ </div>
+ <div class="buttons">
+ <span class="button"><g:actionSubmit class="save" action="update" value="\${message(code: 'update', 'default': 'Update')}" /></span>
+ <span class="button"><g:actionSubmit class="delete" action="delete" value="\${message(code: 'delete', 'default': 'Delete')}" onclick="return confirm('\${message(code: 'delete.confirm', 'default': 'Are you sure?')}');" /></span>
+ </div>
+ </g:form>
+ </div>
</body>
</html>
View
117 src/templates/scaffolding/list.gsp
@@ -4,71 +4,62 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
- <title><g:message code="${domainClass.propertyName}.list" /></title>
-
+ <title><g:message code="${domainClass.propertyName}.list" default="${className} List" /></title>
</head>
<body>
- <h2><g:message code="${domainClass.propertyName}.list" /></h2>
- <g:if test="\${flash.message}">
- <div class="flash_message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
- </g:if>
- <div class="yui-skin-sam" id="crud_panel">
- <g:buildListButtons />
- <% excludedProps = ["version",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- size = props.size()
- props.eachWithIndex
- { p, i ->
- if (i < 6)
- { %>
- <g:set var="${p.name}Internationalized" value="\${message(code:'${domainClass.propertyName}.${p.name}')}" />
- <% }
-
- } %>
- <gui:dataTable
- id="dt_2"
- draggableColumns="true"
- columnDefs="[
- <% excludedProps = ["version",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- size = props.size()
- props.eachWithIndex
- { p, i ->
- if (i < 6)
- {
- if (p.isAssociation())
- { %>
- [key: '${p.name}', sortable: true, resizeable: true, label: ${p.name}Internationalized, formatter: 'customLinkFormatter'],
- <% }
- else
- { %>
- [key: '${p.name}', sortable: true, resizeable: true, label: ${p.name}Internationalized],
- <% }
- }
-
- } %>
- [key: 'urlID', sortable: false, resizeable: false, label:'Actions', formatter: 'adminPanelFormatter']
- ]"
- controller="${domainClass.propertyName}"
- action="dataTableDataAsJSON"
- paginatorConfig="[
- template:'{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}',
- pageReportTemplate:'{totalRecords} ' + message(code:'list.total.records')
- ]"
- rowExpansion="false"
- rowsPerPage="10"
- />
-
+ <div class="nav">
+ <span class="menuButton"><a class="home" href="\${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
+ <span class="menuButton"><g:link class="create" action="create"><g:message code="${domainClass.propertyName}.new" default="New ${className}" /></g:link></span>
+ </div>
+ <div class="body">
+ <h1><g:message code="${domainClass.propertyName}.list" default="${className} List" /></h1>
+ <g:if test="\${flash.message}">
+ <div class="message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
+ </g:if>
+ <div class="list">
+ <table>
+ <thead>
+ <tr>
+ <% excludedProps = ["version",
+ Events.ONLOAD_EVENT,
+ Events.BEFORE_INSERT_EVENT,
+ Events.BEFORE_UPDATE_EVENT,
+ Events.BEFORE_DELETE_EVENT]
+ props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
+ Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
+ props.eachWithIndex { p, i ->
+ if (i < 6) {
+ if (p.isAssociation()) { %>
+ <th><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" /></th>
+ <% } else { %>
+ <g:sortableColumn property="${p.name}" title="${p.naturalName}" titleKey="${domainClass.propertyName}.${p.name}" />
+ <% } } } %>
+ </tr>
+ </thead>
+ <tbody>
+ <g:each in="\${${propertyName}List}" status="i" var="${propertyName}">
+ <tr class="\${(i % 2) == 0 ? 'odd' : 'even'}">
+ <% props.eachWithIndex { p, i ->
+ if (i == 0) { %>
+ <td><g:link action="show" id="\${${propertyName}.id}">\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</g:link></td>
+ <% } else if (i < 6) {
+ if (p.type == Boolean.class || p.type == boolean.class) { %>
+ <td><g:formatBoolean boolean="\${${propertyName}.${p.name}}" /></td>
+ <% } else if (p.type == Date.class || p.type == java.sql.Date.class || p.type == java.sql.Time.class || p.type == Calendar.class) { %>
+ <td><g:formatDate date="\${${propertyName}.${p.name}}" /></td>
+ <% } else if (BigDecimal.class.isAssignableFrom(p.type)) { %>
+ <td><g:formatNumber number="\${${propertyName}.${p.name}}" /></td>
+ <% } else { %>
+ <td>\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</td>
+ <% } } } %>
+ </tr>
+ </g:each>
+ </tbody>
+ </table>
+ </div>
+ <div class="paginateButtons">
+ <g:paginate total="\${${propertyName}Total}" />
+ </div>
</div>
</body>
</html>
View
16 src/templates/scaffolding/renderEditor.template
@@ -37,7 +37,7 @@
private renderStringEditor(domainClass, property) {
if (!cp) {
- return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" class=\"field\${hasErrors(bean:${domainInstance} ,field:'${property.name}','error')}\"/>"
+ return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
}
else {
if ("textarea" == cp.widget || (cp.maxSize > 250 && !cp.password && !cp.inList)) {
@@ -49,7 +49,7 @@
}
else {
- def sb = new StringBuffer("<g:${cp.password ? 'passwordField' : 'textField'} name=\"${property.name}\" class=\"field\${hasErrors(bean:${domainInstance} ,field:'${property.name}','error')}\" ")
+ def sb = new StringBuffer("<g:${cp.password ? 'passwordField' : 'textField'} name=\"${property.name}\" ")
if (cp.maxSize) sb << "maxlength=\"${cp.maxSize}\" "
if (!cp.editable) sb << "readonly=\"readonly\" "
sb << "value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
@@ -85,10 +85,12 @@
def sw = new StringWriter()
def pw = new PrintWriter(sw)
pw.println()
- pw.println "<g:link controller=\"${property.referencedDomainClass.propertyName}\" params=\"['${domainClass.propertyName}.id': ${domainInstance}?.id]\" action=\"create\"><g:message code=\"${property.referencedDomainClass.propertyName}.new\" default=\"New ${property.referencedDomainClass.shortName}\" /></g:link>"
- pw.println "<br /><g:each in=\"\${${domainInstance}?.${property.name}}\" var=\"${property.referencedDomainClass.propertyName}Instance\">"
- pw.println " - <g:link controller=\"${property.referencedDomainClass.propertyName}\" action=\"show\" id=\"\${${property.referencedDomainClass.propertyName}Instance.id}\">\${${property.referencedDomainClass.propertyName}Instance?.encodeAsHTML()}</g:link><br />"
+ pw.println "<ul>"
+ pw.println "<g:each in=\"\${${domainInstance}?.${property.name}}\" var=\"${property.referencedDomainClass.propertyName}Instance\">"
+ pw.println " <li><g:link controller=\"${property.referencedDomainClass.propertyName}\" action=\"show\" id=\"\${${property.referencedDomainClass.propertyName}Instance.id}\">\${${property.referencedDomainClass.propertyName}Instance?.encodeAsHTML()}</g:link></li>"
pw.println "</g:each>"
+ pw.println "</ul>"
+ pw.println "<g:link controller=\"${property.referencedDomainClass.propertyName}\" params=\"['${domainClass.propertyName}.id': ${domainInstance}?.id]\" action=\"create\"><g:message code=\"${property.referencedDomainClass.propertyName}.new\" default=\"New ${property.referencedDomainClass.shortName}\" /></g:link>"
return sw.toString()
}
@@ -98,7 +100,7 @@
return "<g:select name=\"${property.name}\" from=\"\${-128..127}\" value=\"\${${domainInstance}?.${property.name}}\" />"
}
else {
- return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" class=\"field\${hasErrors(bean:${domainInstance} ,field:'${property.name}','error')}\" />"
+ return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
}
}
else {
@@ -112,7 +114,7 @@
return "<g:select name=\"${property.name}\" from=\"\${-128..127}\" value=\"\${${domainInstance}?.${property.name}}\" ${renderNoSelection(property)} />"
}
else {
- return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" class=\"field\${hasErrors(bean:${domainInstance} ,field:'${property.name}','error')}\"/>"
+ return "<g:textField name=\"${property.name}\" value=\"\${fieldValue(bean: ${domainInstance}, field: '${property.name}')}\" />"
}
}
}
View
99 src/templates/scaffolding/show.gsp
@@ -4,54 +4,65 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
- <title><g:message code="${domainClass.propertyName}.show" /></title>
-
+ <title><g:message code="${domainClass.propertyName}.show" default="Show ${className}" /></title>
</head>
<body>
-
- <h2><g:message code="${domainClass.propertyName}.show" /></h2>
- <g:form class="boxed_form" name="crud_panel">
+ <div class="nav">
+ <span class="menuButton"><a class="home" href="\${createLinkTo(dir: '')}"><g:message code="home" default="Home" /></a></span>
+ <span class="menuButton"><g:link class="list" action="list"><g:message code="${domainClass.propertyName}.list" default="${className} List" /></g:link></span>
+ <span class="menuButton"><g:link class="create" action="create"><g:message code="${domainClass.propertyName}.new" default="New ${className}" /></g:link></span>
+ </div>
+ <div class="body">
+ <h1><g:message code="${domainClass.propertyName}.show" default="Show ${className}" /></h1>
<g:if test="\${flash.message}">
- <div class="flash_message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
+ <div class="message"><g:message code="\${flash.message}" args="\${flash.args}" default="\${flash.defaultMessage}" /></div>
</g:if>
- <g:hiddenField name="id" value="\${${propertyName}?.id}" />
- <% excludedProps = ["version",
- Events.ONLOAD_EVENT,
- Events.BEFORE_INSERT_EVENT,
- Events.BEFORE_UPDATE_EVENT,
- Events.BEFORE_DELETE_EVENT]
- props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
- props.each { p -> %>
- <p>
- <label><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" /></label>
- <span class="field_value">
- <% if (p.isEnum()) { %>
- \${${propertyName}?.${p.name}?.encodeAsHTML()}
- <% } else if (p.oneToMany || p.manyToMany) { %>
- <ul>
- <g:each in="\${${propertyName}?.${p.name}}" var="${p.referencedDomainClass?.propertyName}Instance">
- <li><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.referencedDomainClass?.propertyName}Instance.id}">\${${p.referencedDomainClass?.propertyName}Instance.encodeAsHTML()}</g:link></li>
- </g:each>
- </ul>
- <% } else if (p.manyToOne || p.oneToOne) { %>
- <g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${propertyName}?.${p.name}?.id}">\${${propertyName}?.${p.name}?.encodeAsHTML()}</g:link>
- <% } else if (p.type == Boolean.class || p.type == boolean.class) { %>
- <g:formatBoolean boolean="\${${propertyName}?.${p.name}}" />
- <% } else if (p.type == Date.class || p.type == java.sql.Date.class || p.type == java.sql.Time.class || p.type == Calendar.class) { %>
- <g:formatDate date="\${${propertyName}?.${p.name}}" />
- <% } else if (BigDecimal.class.isAssignableFrom(p.type)) { %>
- <g:formatNumber number="\${${propertyName}?.${p.name}}" />
- <% } else { %>
- \${fieldValue(bean: ${propertyName}, field: "${p.name}")}
+ <g:form>
+ <g:hiddenField name="id" value="\${${propertyName}?.id}" />
+ <div class="dialog">
+ <table>
+ <tbody>
+ <% excludedProps = ["version",
+ Events.ONLOAD_EVENT,
+ Events.BEFORE_INSERT_EVENT,
+ Events.BEFORE_UPDATE_EVENT,
+ Events.BEFORE_DELETE_EVENT]
+ props = domainClass.properties.findAll { !excludedProps.contains(it.name) }
+ Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
+ props.each { p -> %>
+ <tr class="prop">
+ <td valign="top" class="name"><g:message code="${domainClass.propertyName}.${p.name}" default="${p.naturalName}" />:</td>
+ <% if (p.isEnum()) { %>
+ <td valign="top" class="value">\${${propertyName}?.${p.name}?.encodeAsHTML()}</td>
+ <% } else if (p.oneToMany || p.manyToMany) { %>
+ <td valign="top" style="text-align: left;" class="value">
+ <ul>
+ <g:each in="\${${propertyName}?.${p.name}}" var="${p.referencedDomainClass?.propertyName}Instance">
+ <li><g:link controller="${p.referencedDomainClass?.propertyName}" action="show" id="\${${p.referencedDomainClass?.propertyName}Instance.id}">\${${p.referencedDomainClass?.propertyName}Instance.encodeAsHTML()}</g:link></li>
+ </g:each>
+ </ul>
+ </td>
+ <% } else if (p.manyToOne || p.oneToOne) { %>
+ <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>
+ <% } else if (p.type == Boolean.class || p.type == boolean.class) { %>
+ <td valign="top" class="value"><g:formatBoolean boolean="\${${propertyName}?.${p.name}}" /></td>
+ <% } else if (p.type == Date.class || p.type == java.sql.Date.class || p.type == java.sql.Time.class || p.type == Calendar.class) { %>
+ <td valign="top" class="value"><g:formatDate date="\${${propertyName}?.${p.name}}" /></td>
+ <% } else if (BigDecimal.class.isAssignableFrom(p.type)) { %>
+ <td valign="top" class="value"><g:formatNumber number="\${${propertyName}?.${p.name}}" /></td>
+ <% } else { %>
+ <td valign="top" class="value">\${fieldValue(bean: ${propertyName}, field: "${p.name}")}</td>
+ <% } %>
+ </tr>
<% } %>
- </span>
- </p>
- <% } %>
-
- <div class="actionpad yui-skin-sam">
- <g:buildShowButtons />
- </div>
+ </tbody>
+ </table>
+ </div>
+ <div class="buttons">
+ <span class="button"><g:actionSubmit class="edit" action="edit" value="\${message(code: 'edit', 'default': 'Edit')}" /></span>
+ <span class="button"><g:actionSubmit class="delete" action="delete" value="\${message(code: 'delete', 'default': 'Delete')}" onclick="return confirm('\${message(code: 'delete.confirm', 'default': 'Are you sure?')}');" /></span>
+ </div>
</g:form>
- </body>
+ </div>
+ </body>
</html>

0 comments on commit 7e3f9bb

Please sign in to comment.
Something went wrong with that request. Please try again.