Changeset 229
- Timestamp:
- Mar 3, 2010, 12:50:40 PM (11 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r228 r229 51 51 52 52 /** 53 * Return the unique Subject templates that are used in this study 54 */ 55 def Set<Template> giveSubjectTemplates() { 56 TemplateEntity.giveTemplates(subjects); 57 } 58 59 60 /** 53 61 * Returns the template of all subjects in the study 54 62 * Throws an error if there are no or multiple subject templates 55 63 */ 56 def Template giveSubjectTemplate() { 57 TemplateEntity.giveTemplate(subjects); 58 } 64 // outcommented, we shouldn't make it too easy for ourselves by introducing uncertain assumptions (1 distinct template) 65 //def Template giveSubjectTemplate() { 66 // TemplateEntity.giveTemplate(subjects); 67 //} 59 68 60 69 /** 61 * Returns the template of all samples in the study 62 * Throws an error if there are no or multiple sample templates 70 * Returns the unique Sample templates that are used in the study 63 71 */ 64 def Template giveSampleTemplate () {65 TemplateEntity.giveTemplate (samples);72 def Template giveSampleTemplates() { 73 TemplateEntity.giveTemplates(samples); 66 74 } 67 75 /** -
trunk/grails-app/views/study/show.gsp
r226 r229 129 129 </div> 130 130 131 <div id="subjects"> 131 <div id="subjects"> 132 <g:each in="${studyInstance.giveSubjectTemplates()}" var="template"> 132 133 <table> 133 134 <tr> … … 135 136 <td><b>Species</b></td> 136 137 <td><b>Name</b></td> 137 <g:each in="${ studyInstance.template.fields}" var="g">138 <g:each in="${template.fields}" var="g"> 138 139 <td><b> 139 140 <g:link controller="templateField" action="show" id="${g.id}"> … … 143 144 </tr> 144 145 145 <g:each in="${studyInstance.subjects }" var="s">146 <g:each in="${studyInstance.subjects.findAll { it.template == template}}" var="s"> 146 147 <tr> 147 148 <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> 148 149 <td>${s.species}</td> 149 150 <td>${s.name}</td> 150 <g:each in="${ studyInstance.template.fields}" var="g">151 <g:each in="${template.fields}" var="g"> 151 152 <td> 152 153 <% print s.getFieldValue(g.toString()) %> … … 157 158 158 159 </table> 160 161 </g:each> 159 162 </div> 160 163
Note: See TracChangeset
for help on using the changeset viewer.