Last change
on this file since 1482 was
1482,
checked in by robert@…, 13 years ago
|
Implemented saving of queries
|
-
Property svn:keywords set to
Rev Author Date
|
File size:
1.8 KB
|
Rev | Line | |
---|
[1424] | 1 | <html> |
---|
| 2 | <head> |
---|
| 3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
---|
| 4 | <meta name="layout" content="main"/> |
---|
| 5 | <title>Query results</title> |
---|
| 6 | <link rel="stylesheet" href="<g:resource dir="css" file="advancedQuery.css" />" type="text/css"/> |
---|
| 7 | </head> |
---|
| 8 | <body> |
---|
| 9 | |
---|
| 10 | <h1>Query results</h1> |
---|
| 11 | |
---|
| 12 | <p> |
---|
[1482] | 13 | Your search for samples with: |
---|
[1424] | 14 | </p> |
---|
[1482] | 15 | <g:render template="criteria" model="[criteria: search.getCriteria()]" /> |
---|
[1424] | 16 | <p> |
---|
| 17 | resulted in ${search.getNumResults()} <g:if test="${search.getNumResults() == 1}">sample</g:if><g:else>samples</g:else>. |
---|
| 18 | </p> |
---|
| 19 | |
---|
| 20 | <g:if test="${search.getNumResults() > 0}"> |
---|
[1482] | 21 | <% |
---|
| 22 | def resultFields = search.getShowableResultFields(); |
---|
| 23 | def extraFields = resultFields[ search.getResults()[ 0 ].id ]?.keySet(); |
---|
| 24 | %> |
---|
[1424] | 25 | <table id="searchresults" class="paginate"> |
---|
| 26 | <thead> |
---|
| 27 | <tr> |
---|
| 28 | <th>Study</th> |
---|
| 29 | <th>Name</th> |
---|
[1482] | 30 | <g:each in="${extraFields}" var="fieldName"> |
---|
| 31 | <th>${fieldName}</th> |
---|
| 32 | </g:each> |
---|
[1424] | 33 | </tr> |
---|
| 34 | </thead> |
---|
| 35 | <tbody> |
---|
| 36 | <g:each in="${search.getResults()}" var="sampleInstance" status="i"> |
---|
| 37 | <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> |
---|
| 38 | <td><g:link controller="study" action="show" id="${sampleInstance?.parent?.id}">${sampleInstance?.parent?.title}</g:link></td> |
---|
| 39 | <td>${fieldValue(bean: sampleInstance, field: "name")}</td> |
---|
[1482] | 40 | <g:each in="${extraFields}" var="fieldName"> |
---|
| 41 | <td> |
---|
| 42 | <% |
---|
| 43 | def fieldValue = resultFields[ sampleInstance.id ]?.get( fieldName ); |
---|
| 44 | if( fieldValue ) { |
---|
| 45 | if( fieldValue instanceof Collection ) |
---|
| 46 | fieldValue = fieldValue.collect { it.toString() }.findAll { it }.join( ', ' ); |
---|
| 47 | else |
---|
| 48 | fieldValue = fieldValue.toString(); |
---|
| 49 | } |
---|
| 50 | %> |
---|
| 51 | ${fieldValue} |
---|
| 52 | </td> |
---|
| 53 | </g:each> |
---|
[1424] | 54 | </tr> |
---|
| 55 | </g:each> |
---|
| 56 | </tbody> |
---|
| 57 | </table> |
---|
| 58 | |
---|
| 59 | </g:if> |
---|
[1482] | 60 | <g:render template="resultbuttons" model="[queryId: queryId]" /> |
---|
[1424] | 61 | </body> |
---|
| 62 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.