Changeset 1224 for trunk/grails-app/views
- Timestamp:
- Nov 30, 2010, 5:12:08 PM (10 years ago)
- Location:
- trunk/grails-app/views/study
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/study/show_samples.gsp
r1213 r1224 21 21 // Determine a union of the fields for all different 22 22 // samples in all studies. In order to show a proper list. 23 // We want every field to appear just once, 24 // so the list is filtered for unique values 23 // We want every field to appear just once, so the list is filtered 24 // for unique names. This ensures that different template fields with 25 // the same name, show up in the same column. This might happen when 26 // both humans and mice are shown, where humans have a weight in kgs 27 // and mice have a weight in grams. 25 28 sampleTemplates = studyList*.giveSampleTemplates().flatten().unique() 26 29 … … 30 33 showSampleFields = []; 31 34 } else { 32 sampleFields = sampleTemplates*.fields.flatten(). unique()35 sampleFields = sampleTemplates*.fields.flatten().name.unique() 33 36 if( !sampleFields ) { 34 37 sampleFields = []; … … 45 48 // show the field and should not check any other 46 49 // samples (hence the break) 47 if( sample.fieldExists( sampleField .name ) && sample.getFieldValue( sampleField.name) ) {50 if( sample.fieldExists( sampleField ) && sample.getFieldValue( sampleField ) ) { 48 51 showSampleFields << sampleField; 49 52 break; … … 84 87 </g:each> 85 88 86 <g:each in="${showSampleFields}" var="field ">89 <g:each in="${showSampleFields}" var="fieldname"> 87 90 <td> 88 <g:if test="${sample.fieldExists(field.name)}"> 91 <g:if test="${sample.fieldExists(fieldname)}"> 92 <g:set var="field" value="${sample.getField(fieldname)}" /> 89 93 <wizard:showTemplateField field="${field}" entity="${sample}" /> 90 94 </g:if> -
trunk/grails-app/views/study/show_subjects.gsp
r1213 r1224 16 16 // Determine a union of the fields for all different 17 17 // subjects in all studies. In order to show a proper list. 18 // We want every field to appear just once, 19 // so the list is filtered for unique values 18 // We want every field to appear just once, so the list is filtered 19 // for unique names. This ensures that different template fields with 20 // the same name, show up in the same column. This might happen when 21 // both humans and mice are shown, where humans have a weight in kgs 22 // and mice have a weight in grams. 20 23 subjectTemplates = studyList*.giveSubjectTemplates()?.flatten().unique() 21 24 if( !subjectTemplates ) { … … 23 26 subjectFields = []; 24 27 } else { 25 subjectFields = subjectTemplates*.fields?.flatten(). unique()28 subjectFields = subjectTemplates*.fields?.flatten().name.unique() 26 29 if( !subjectFields ) { 27 30 subjectFields = []; … … 51 54 // show the field and should not check any other 52 55 // subjects (hence the break) 53 if( subject.fieldExists( subjectField .name ) && subject.getFieldValue( subjectField.name) ) {56 if( subject.fieldExists( subjectField ) && subject.getFieldValue( subjectField ) ) { 54 57 showSubjectFields << subjectField; 55 58 break; … … 80 83 </g:each> 81 84 82 <g:each in="${showSubjectFields}" var="field ">85 <g:each in="${showSubjectFields}" var="fieldname"> 83 86 <td> 84 <g:if test="${subject.fieldExists(field.name)}"> 87 <g:if test="${subject.fieldExists(fieldname)}"> 88 <g:set var="field" value="${subject.getField(fieldname)}" /> 85 89 <wizard:showTemplateField field="${field}" entity="${subject}" /> 86 90 </g:if>
Note: See TracChangeset
for help on using the changeset viewer.