Changeset 7 for trunk/grails-app/views/run/show.gsp
- Timestamp:
- Jan 26, 2011, 5:08:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/run/show.gsp
r4 r7 1 <h2>${run.name}</h2> 1 <html> 2 <head> 3 <meta name="layout" content="main" /> 4 <title>Show run ${run.name} | Metagenomics | dbNP</title> 5 6 <link rel="stylesheet" href="<g:resource dir="css" file="showAssay.css" />" type="text/css"/> 7 <link rel="stylesheet" href="<g:resource dir="css" file="fileuploader.new.css" />" type="text/css"/> 8 9 <g:javascript src="jquery.ui.tabbeddialog.js" /> 10 <g:javascript src="assay.show.addFilesDialog.js" /> 2 11 3 <h2>Details</h2> 12 <g:javascript src="run.show.enterTagsDialog.js" /> 13 <g:javascript src="run.show.assayDialog.js" /> 14 <g:javascript src="showSampleDialog.js" /> 4 15 5 <ul> 6 <li><label>Date</label><span class="value"><g:formatDate format="dd-MM-yyyy" date="${run.date}"/></span></li> 7 <li><label>Supplier</label><span class="value">${run.supplier}</span></li> 8 <li><label>Machine</label><span class="value">${run.machine}</span></li> 9 <li><label>Parameter file</label><span class="value"><g:uploadedFile value="${run.parameterFile}" /></span></li> 16 <g:javascript src="assay.show.showRunDialog.js" /> 17 18 <g:javascript src="fileuploader.new.js" /> 19 <g:javascript src="fileuploads.new.js" /> 20 21 <script> 22 var runId = ${run.id}; 23 var numOtherAssays = ${otherAssays.size()}; 24 25 function initializeUploadedFiles( selector ) { 26 if( selector == undefined ) 27 selector = ""; 28 29 $( selector + ' .uploadedFile').each( function( idx, el ) { 30 $(el).html( createFileHTML( $(el).text(), 'getPermanent' ) ); 31 }); 32 } 33 34 // Initializefiles on load 35 $(function() { initializeUploadedFiles(); }); 36 </script> 37 </head> 38 <body> 39 <h1> 40 Run ${run.name} 41 </h1> 10 42 11 <li><label># files</label><span class="value">${run.numFiles()}</span></li> 12 <li><label># sequences</label><span class="value">${run.numSequences()}</span></li> 13 </ul> 14 <% def runSamples = run.samples( assay.id ); %> 15 <g:if test="${runSamples.size()}"> 43 <label>Run</label>: ${run.name}<br /> 44 <label># samples</label>: ${run.assaySamples?.size()} 45 <% def numHidden = run.assaySamples?.findAll { !it.assay?.study.canRead( session.user ) }.size() ; %> 46 <g:if test="${numHidden}"> 47 (${numHidden} 48 <a href="#" onClick="alert( '${numHidden} samples from this run are hidden because you don\'t have the right permissions to view them.' ); return false;"> 49 hidden</a>) 50 </g:if> 51 <br /> 52 <label># sequences</label>: ${run.numSequences()}<br /> 53 <label># files</label>: ${run.numFiles()}<br /> 54 55 <!-- Samples --> 16 56 <h2>Samples</h2> 17 <table class="paginate"> 18 <thead> 19 <tr> 20 <th nowrap>Sample</th> 21 <th nowrap>Sequence file</th> 22 <th nowrap>Quality file</th> 23 <th nowrap># sequences</th> 24 <th nowrap>avg quality</th> 25 </tr> 26 </thead> 27 <tbody> 28 <g:each in="${runSamples}" var="assaySample"> 29 <% def files = assaySample.sequenceData.findAll { it.sample.assay.id == assay.id }; %> 30 <g:each in="${files}" var="data" status="i"> 57 <g:if test="${run.assaySamples == null || run.assaySamples.size() == 0}"> 58 No samples found in run. 59 </g:if> 60 <g:else> 61 <table class="paginate"> 62 <thead> 63 <tr> 64 <th nowrap>name</th> 65 <th nowrap>assay</th> 66 <th nowrap>tag sequence</th> 67 <th nowrap># sequences</th> 68 <th nowrap># unique sequences</th> 69 </tr> 70 </thead> 71 <tbody> 72 <% def assaySamples = run.assaySamples.findAll { it.assay?.study.canRead( session.user ) }.toList().sort { it.sample.name }; %> 73 <g:each in="${assaySamples}" var="assaySample"> 31 74 <tr> 32 <td>${assaySample.sample.name}</td> 33 <td><g:uploadedFile value="${data.sequenceFile}" /></td> 75 <td><a href="#" onClick="showSample(${assaySample.id}, 'run'); return false;">${assaySample.sample.name}</a></td> 76 <td>${assaySample.assay.study.name} - ${assaySample.assay.name}</td> 77 <td>${assaySample.tagSequence}</td> 78 <td>${assaySample.numSequences()}</td> 34 79 <td> 35 <g:if test="${data.qualityFile}"> 36 <g:uploadedFile value="${data.qualityFile}" /> 37 </g:if> 38 </td> 39 <td>${data.numSequences}</td> 40 <td> 41 <g:if test="${data.averageQuality > 0.0}"> 42 <g:formatNumber number="${data.averageQuality}" format="0.0" /> 80 <g:if test="${assaySample.numUniqueSequences > 0}"> 81 ${assaySample.numUniqueSequences} 43 82 </g:if> 44 83 <g:else> … … 48 87 </tr> 49 88 </g:each> 50 </g:each> 51 </tbody> 52 </table> 53 </g:if> 89 </tbody> 90 </table> 91 <g:if test="${editable}"> 92 <% def writableAssaySamples = assaySamples.findAll { it.assay.study.canWrite( session.user ) } %> 93 <g:if test="${writableAssaySamples.size() > 0}"> 94 <input type="button" value="Edit sample data" onClick="showEnterTagsDialog();"> 95 <input type="button" value="Add sequence files" onClick="showAddFilesDialog();" <g:if test="${run.assays == null || run.assays.size() == 0}">disabled="disabled"</g:if>> 96 <g:render template="enterTagsDialog" model="[run: run, writableAssaySamples: writableAssaySamples]" /> 97 <g:render template="addFilesDialog" model="[run: run]" /> 98 </g:if> 99 <g:else> 100 <input type="button" value="Edit sample data" disabled="disabled"> 101 <input type="button" value="Add sequence files" disabled="disabled"> 102 </g:else> 54 103 55 <h2>Delete run</h2> 56 <g:if test="${run.sequenceData?.size()}"> 57 <p> 58 You can't delete this run because samples are associated with this run. 59 </p> 60 </g:if> 61 <g:else> 62 <g:if test="${run.assays?.size() > 1}"> 63 <p>If you delete this run, it will also be deleted from the other assays it is associated to!</p> 104 </g:if> 105 <div id="showSampleDialog" class="dialog"></div> 106 </g:else> 107 108 <!-- Runs --> 109 <h2>Assays</h2> 110 <g:if test="${run.assays == null || run.assays.size() == 0}"> 111 No assay found for this run 64 112 </g:if> 65 <p><g:link onClick="return confirm( 'Are you sure you want to delete this run from the system?' );" controller="run" action="delete" id="${run.id}" params="[assayId: assay.id]">Delete this run from the system.</g:link></p> 66 </g:else> 113 <g:else> 114 <table class="paginate"> 115 <thead> 116 <tr> 117 <th nowrap>name</th> 118 <th nowrap>study</th> 119 <th nowrap># samples</th> 120 <th nowrap>other runs</th> 121 <th class="nonsortable"></th> 122 </tr> 123 </thead> 124 <tbody> 125 <% def assays = run.assays.findAll { it.study.canRead( session.user ) }.toList().sort { it.name }; %> 126 <g:each in="${assays}" var="assay"> 127 <tr> 128 <td><g:link controller="assay" action="show" id="${assay.id}">${assay.name}</g:link></td> 129 <td>${assay.study?.name}</td> 130 <td>${assay.assaySamples?.size()}</td> 131 <td> 132 <g:if test="${assay.runs?.size() == 1}"> 133 <% /* If only 1 run is found, then it is the current one */ %> 134 - 135 </g:if> 136 <g:else> 137 <g:each in="${assay.runs - run}" var="otherRun"> 138 <g:link action="show" id="${otherRun.id}">${otherRun.name}</g:link><br /> 139 </g:each> 140 </g:else> 141 </td> 142 <td class="button"> 143 <g:if test="${run.samples(assay.id).size()}"> 144 <img src="${fam.icon(name: 'application_delete')}" class="disabled" title="You can't remove this assay because sequences from this assay are coupled to this run." /> 145 </g:if> 146 <g:else> 147 <g:link onClick="return confirm( 'Are you sure you want to remove the selected assay from this run?' );" controller="run" action="removeAssay" id="${run.id}" params="${[assay_id: assay.id]}" ><img src="${fam.icon(name: 'application_delete')}" /></g:link> 148 </g:else> 149 </td> 150 </tr> 151 </g:each> 152 </tbody> 153 </table> 154 </g:else> 155 <% def writableAssays = otherAssays.findAll { it.study.canWrite( session.user ) } %> 156 <g:if test="${editable}"> 157 <g:if test="${writableAssays.size() > 0}"> 158 <input type="button" value="Add assay" onClick="showAddAssayDialog();" /> 159 <g:render template="addAssayDialog" model="[run: run, writableAssays: writableAssays]" /> 160 </g:if> 161 <g:else> 162 <input type="button" value="Add assay" disabled="disabled" /> 163 </g:else> 164 </g:if> 165 <div id="showRunDialog" class="dialog"></div> 166 </body> 167 </html>
Note: See TracChangeset
for help on using the changeset viewer.