Permalink
Browse files

fix list template after merge

  • Loading branch information...
1 parent c69ec41 commit 29339c94cd1b2a0a1a238375bdff1d1b92f2e189 Rob Fletcher committed Oct 19, 2012
@@ -1,28 +1,29 @@
<% import grails.persistence.Event %>
<div class="page-header">
- <h1>${className} List</h1>
+ <h1>${className} List</h1>
</div>
<alert level="{{message.level}}" text="{{message.text}}"/>
<table class="table table-bordered table-striped">
<thead>
<tr>
- <% excludedProps = Event.allEvents.toList() << 'id' << 'version'
- allowedNames = domainClass.persistentProperties*.name << 'dateCreated' << 'lastUpdated'
- props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) && it.type != null && !Collection.isAssignableFrom(it.type) && !it.isAssociation() && !it.embedded }
- Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
+ <% excludedProps = Event.allEvents.toList() << 'id' << 'version'
+ allowedNames = domainClass.persistentProperties*.name << 'dateCreated' << 'lastUpdated'
+ props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) && it.type != null && !Collection.isAssignableFrom(it.type) && !it.isAssociation() && !it.embedded }
+ Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
if (props.size() > 6) props = props[0..5]
- for (p in props) { %>
- <th>${p.naturalName}</th>
- <% } else { %>
+ for (p in props) {
+ if (p.isAssociation()) { %>
+ <th>${p.naturalName}</th>
+ <% } else { %>
<th data-sortable="${p.name}">${p.naturalName}</th>
- <% } } } %>
+ <% } } %>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="item in list" data-ng-click="show(item)">
- <% for (p in props) { %>
- <td>{{item.${p.name}}}</td>
- <% } %>
+ <% for (p in props) { %>
+ <td>{{item.${p.name}}}</td>
+ <% } %>
</tr>
</tbody>
</table>
@@ -11,11 +11,12 @@
props = domainClass.properties.findAll { allowedNames.contains(it.name) && !excludedProps.contains(it.name) && it.type != null && !Collection.isAssignableFrom(it.type) && !it.isAssociation() && !it.embedded }
Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
if (props.size() > 6) props = props[0..5]
- for (p in props) { %>
+ for (p in props) {
+ if (p.isAssociation()) { %>
<th>${p.naturalName}</th>
- <% } else { %>
+ <% } else { %>
<th data-sortable="${p.name}">${p.naturalName}</th>
- <% } } } %>
+ <% } } %>
</tr>
</thead>
<tbody>
@@ -11,9 +11,9 @@
<th data-sortable="title">Title</th>
- <th>Year</th>
+ <th data-sortable="year">Year</th>
- <th>Compilation</th>
+ <th data-sortable="compilation">Compilation</th>
</tr>
</thead>

0 comments on commit 29339c9

Please sign in to comment.