Changeset 862
- Timestamp:
- Aug 30, 2010, 4:16:31 PM (13 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/WizardController.groovy
r857 r862 669 669 } 670 670 }.to "assays" 671 on("deleteAssay") { 672 // handle form data 673 assayPage(flow, flash, params) 674 675 // reset errors 676 flash.errors = [:] 677 678 // find this assay 679 def assay = flow.study.assays.find { it.getIdentifier() == (params.get('do') as int) } 680 681 // perform delete 682 if (assay) flow.study.deleteAssay( assay ) 683 }.to "assays" 671 684 on("previous") { 672 685 // handle form data … … 682 695 assayPage(flow, flash, params) ? success() : error() 683 696 }.to "assayGroups" 697 on("quickSave") { 698 // handle form data 699 assayPage(flow, flash, params) ? success() : error() 700 }.to "waitForSave" 684 701 } 685 702 … … 703 720 assayGroupPage(flow, flash, params) ? success() : error() 704 721 }.to "confirm" 722 on("quickSave") { 723 // handle form data 724 assayGroupPage(flow, flash, params) ? success() : error() 725 }.to "waitForSave" 705 726 } 706 727 … … 1303 1324 flash.values = params 1304 1325 1326 // iterate through samples 1327 flow.study.samples.each() { sample -> 1328 // iterate through assays 1329 flow.study.assays.each() { assay -> 1330 if (params.get( 'sample_' + sample.getIdentifier() + '_assay_' + assay.getIdentifier() )) { 1331 println "add sample "+sample.getIdentifier()+" to assay "+assay.getIdentifier() 1332 // add sample to assay 1333 assay.addToSamples( sample ) 1334 } else { 1335 // remove sample from assay 1336 assay.removeFromSamples( sample ) 1337 } 1338 println assay.samples 1339 } 1340 } 1341 1305 1342 return !errors 1306 1343 } -
trunk/grails-app/domain/dbnp/studycapturing/Study.groovy
r861 r862 44 44 static constraints = { 45 45 owner(nullable: true, blank: true) 46 code(nullable:false, blank:true,unique:true) 46 code(nullable:false, blank:true,unique:true) 47 47 } 48 48 … … 82 82 */ 83 83 def String toString() { 84 return code + " - " +title84 return title 85 85 } 86 86 … … 219 219 220 220 return msg 221 } 222 223 /** 224 * Delete an assay from the study 225 * @param Assay 226 * @void 227 */ 228 def deleteAssay(Assay assay) { 229 // remove this assay from the study 230 this.removeFromAssays( assay ) 221 231 } 222 232 -
trunk/grails-app/views/wizard/pages/_assay_groups.gsp
r836 r862 22 22 </span> 23 23 24 <% 25 // TODO: render a table of assays (in the columns) versus samples (in the rows) 26 // with the samples grouped according to the EventGroups of the parent SamplingEvents 27 // and with all boxes checked by default 28 %> 24 <g:if test="${(study.samples && study.assays)}"> 25 <g:set var="previousTemplate" value=""/> 26 <div class="table"> 27 <div class="header"> 28 <div class="firstColumn">#</div> 29 <div class="column" style="width:150px;">Sample Type</div> 30 <div class="column" style="width:200px;">Sample Name</div> 31 <g:each var="assay" in="${study.assays}"> 32 <div class="column">${assay}</div> 33 </g:each> 34 </div> 35 <g:each var="sampleTemplate" in="${study.giveSampleTemplates()}"> 36 <g:each var="sample" in="${study.giveSamplesForTemplate(sampleTemplate)}"> 37 <div class="row"> 38 <div class="firstColumn">${sample.getIdentifier()}</div> 39 <div class="column"> 40 <g:if test="${previousTemplate != sampleTemplate.name}"> 41 <g:set var="previousTemplate" value="${sampleTemplate.name}"/> 42 ${sampleTemplate.name} 43 <div class="helpIcon"></div> 44 <div class="helpContent"> 45 <h1>${sampleTemplate.name}</h1> 46 <h2>Template Fields:</h2> 47 <g:each var="field" in="${sample.giveFields()}"> 48 ${field.name[0].toUpperCase() + field.name.substring(1)}<br/> 49 </g:each> 50 </div> 51 </g:if> 52 </div> 53 <div class="column">${sample.name}</div> 54 <g:each var="assay" in="${study.assays}"> 55 <div class="column"> 56 <input type="checkbox" name="sample_${sample.getIdentifier()}_assay_${assay.getIdentifier()}"<g:if test="${assay.samples.find{ it == sample } }"> checked="checked"</g:if>/> 57 </div> 58 </g:each> 59 </div> 60 </g:each> 61 </g:each> 62 </div> 63 <div class="sliderContainer"> 64 <div class="slider" ></div> 65 </div> 66 </g:if> 29 67 30 68 </wizard:pageContent> -
trunk/grails-app/views/wizard/pages/_groups.gsp
r857 r862 64 64 <g:if test="${study.eventGroups}"><g:each var="eventGroup" in="${study.eventGroups}"> 65 65 <div class="column"> 66 <g:if test="${eventGroup.subjects.find{ it == subject } }"> 67 <input type="checkbox" name="subject_${subject.getIdentifier()}_group_${eventGroup.getIdentifier()}" checked="checked"/> 68 </g:if><g:else> 69 <input type="checkbox" name="subject_${subject.getIdentifier()}_group_${eventGroup.getIdentifier()}" /> 70 </g:else> 66 <input type="checkbox" name="subject_${subject.getIdentifier()}_group_${eventGroup.getIdentifier()}"<g:if test="${eventGroup.subjects.find{ it == subject } }"> checked="checked"</g:if>/> 71 67 </div> 72 68 </g:each></g:if>
Note: See TracChangeset
for help on using the changeset viewer.