Changeset 23


Ignore:
Timestamp:
Mar 22, 2011, 4:12:45 PM (12 years ago)
Author:
robert@…
Message:

Solved issue with select all (#31)

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/assay/_addRunDialog.gsp

    r15 r23  
    2424                        </p>           
    2525                        <g:form name="addExistingRuns" action="addExistingRuns" id="${assay.id}">
    26                                 <table class="paginate">
    27                                         <thead>
     26                        </g:form>       
     27                        <table class="paginate" id="addRunsTable">
     28                                <thead>
     29                                        <tr>
     30                                                <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
     31                                                <th nowrap>name</th>
     32                                                <th nowrap>date</th>
     33                                                <th nowrap>other assays</th>
     34                                                <th class="nonsortable"></th>
     35                                        </tr>
     36                                </thead>                               
     37                                <tbody>
     38                                        <g:each in="${otherRuns}" var="run">
    2839                                                <tr>
    29                                                         <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
    30                                                         <th nowrap>name</th>
    31                                                         <th nowrap>date</th>
    32                                                         <th nowrap>other assays</th>
    33                                                         <th class="nonsortable"></th>
    34                                                 </tr>
    35                                         </thead>                               
    36                                         <tbody>
    37                                                 <g:each in="${otherRuns}" var="run">
    38                                                         <tr>
    39                                                                 <td><g:checkBox name="runs" value="${run.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
    40                                                                 <td>${run.name}</td>
    41                                                                 <td><g:formatDate format="dd-MM-yyyy" date="${run.date}"/></td>
    42                                                                 <td>
    43                                                                         <g:if test="${run.assays?.size() == 0}">
    44                                                                                 -
     40                                                        <td><g:checkBox name="runs" value="${run.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
     41                                                        <td>${run.name}</td>
     42                                                        <td><g:formatDate format="dd-MM-yyyy" date="${run.date}"/></td>
     43                                                        <td>
     44                                                                <g:if test="${run.assays?.size() == 0}">
     45                                                                        -
     46                                                                </g:if>
     47                                                                <g:else>
     48                                                                        <g:each in="${run.assays}" var="otherAssay">
     49                                                                                <g:link action="show" id="${otherAssay.id}">${otherAssay.name}</g:link><br />
     50                                                                        </g:each>
     51                                                                </g:else>
     52                                                        </td>
     53                                                        <td>
     54                                                                <g:if test="${run.assaySamples?.size()}">
     55                                                                        <img src="${fam.icon(name: 'delete')}" class="disabled" title="You can't delete this run because samples are associated with this run." />
     56                                                                </g:if>
     57                                                                <g:else>
     58                                                                        <g:if test="${run.assays?.size() > 0}">
     59                                                                                <g:link onClick="return confirm( 'Are you sure you want to delete this run from the system? If you delete this run, it will also be deleted from the other assays it is associated to!' );" controller="run" action="delete" id="${run.id}" params="[assayId: assay.id]"><img src="${fam.icon(name: 'delete')}" /></g:link>
    4560                                                                        </g:if>
    4661                                                                        <g:else>
    47                                                                                 <g:each in="${run.assays}" var="otherAssay">
    48                                                                                         <g:link action="show" id="${otherAssay.id}">${otherAssay.name}</g:link><br />
    49                                                                                 </g:each>
    50                                                                         </g:else>
    51                                                                 </td>
    52                                                                 <td>
    53                                                                         <g:if test="${run.assaySamples?.size()}">
    54                                                                                 <img src="${fam.icon(name: 'delete')}" class="disabled" title="You can't delete this run because samples are associated with this run." />
    55                                                                         </g:if>
    56                                                                         <g:else>
    57                                                                                 <g:if test="${run.assays?.size() > 0}">
    58                                                                                         <g:link onClick="return confirm( 'Are you sure you want to delete this run from the system? If you delete this run, it will also be deleted from the other assays it is associated to!' );" controller="run" action="delete" id="${run.id}" params="[assayId: assay.id]"><img src="${fam.icon(name: 'delete')}" /></g:link>
    59                                                                                 </g:if>
    60                                                                                 <g:else>
    61                                                                                         <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]"><img src="${fam.icon(name: 'delete')}" /></g:link>
    62                                                                                 </g:else>
    63                                                                         </g:else>
    64                                                                 </td>
    65                                                         </tr>
    66                                                 </g:each>
    67                                         </tbody>
    68                                 </table>               
    69                         </g:form>       
     62                                                                                <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]"><img src="${fam.icon(name: 'delete')}" /></g:link>
     63                                                                        </g:else>
     64                                                                </g:else>
     65                                                        </td>
     66                                                </tr>
     67                                        </g:each>
     68                                </tbody>
     69                        </table>               
    7070                </div>
    7171        </div>
  • trunk/grails-app/views/run/_addAssayDialog.gsp

    r15 r23  
    66                </p>           
    77                <g:form name="addAssays" action="addAssays" id="${run.id}">
    8                         <table class="paginate">
    9                                 <thead>
     8                </g:form>       
     9                <table class="paginate" id="addAssaysTable">
     10                        <thead>
     11                                <tr>
     12                                        <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
     13                                        <th nowrap>name</th>
     14                                        <th nowrap>study</th>
     15                                        <th nowrap>other runs</th>
     16                                </tr>
     17                        </thead>                               
     18                        <tbody>
     19                                <g:each in="${writableAssays}" var="assay">
    1020                                        <tr>
    11                                                 <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
    12                                                 <th nowrap>name</th>
    13                                                 <th nowrap>study</th>
    14                                                 <th nowrap>other runs</th>
     21                                                <td><g:checkBox name="assays" value="${assay.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
     22                                                <td>${assay.name}</td>
     23                                                <td>${assay.study?.name}</td>
     24                                                <td>
     25                                                        <g:if test="${assay.runs?.size() == 0}">
     26                                                                -
     27                                                        </g:if>
     28                                                        <g:else>
     29                                                                <g:each in="${assay.runs}" var="otherRun">
     30                                                                        <g:link action="show" id="${otherRun.id}">${otherRun.name}</g:link><br />
     31                                                                </g:each>
     32                                                        </g:else>
     33                                                </td>
    1534                                        </tr>
    16                                 </thead>                               
    17                                 <tbody>
    18                                         <g:each in="${writableAssays}" var="assay">
    19                                                 <tr>
    20                                                         <td><g:checkBox name="assays" value="${assay.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
    21                                                         <td>${assay.name}</td>
    22                                                         <td>${assay.study?.name}</td>
    23                                                         <td>
    24                                                                 <g:if test="${assay.runs?.size() == 0}">
    25                                                                         -
    26                                                                 </g:if>
    27                                                                 <g:else>
    28                                                                         <g:each in="${assay.runs}" var="otherRun">
    29                                                                                 <g:link action="show" id="${otherRun.id}">${otherRun.name}</g:link><br />
    30                                                                         </g:each>
    31                                                                 </g:else>
    32                                                         </td>
    33                                                 </tr>
    34                                         </g:each>
    35                                 </tbody>
    36                         </table>               
    37                 </g:form>       
     35                                </g:each>
     36                        </tbody>
     37                </table>               
    3838        </div>
    3939</div>
  • trunk/grails-app/views/run/_addSamplesDialog.gsp

    r15 r23  
    77       
    88        <g:form name="addSamples" controller="run" action="addSamples" id="${run.id}">
    9        
    10                 <table class="paginate">
    11                         <thead>
    12                                 <tr>
    13                                         <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
    14                                         <th>Sample</th>
    15                                         <th>Assay</th>
    16                                         <th>Run</th>
    17                                 </tr>
    18                         </thead>
    19                         <g:each in="${run.assays}" var="assay">
    20                                 <g:if test="${assay.study.canWrite(session.user)}">
    21                                         <g:each in="${assay.assaySamples}" var="assaySample">
    22                                                 <g:if test="${!assaySample.run?.equals(run)}">
    23                                                         <tr>
    24                                                                 <td><g:checkBox name="assaySamples" value="${assaySample.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
    25                                                                 <td>${assaySample.sample.name}</td>
    26                                                                 <td>${assaySample.assay.name}</td>
    27                                                                 <td>${assaySample.run?.name}</td>
    28                                                         </tr>
    29                                                 </g:if>
    30                                         </g:each>
    31                                 </g:if>
    32                         </g:each>
    33                 </table>       
    349        </g:form>
     10        <table class="paginate" id="addSamplesTable">
     11                <thead>
     12                        <tr>
     13                                <th class="nonsortable"><input type="checkbox" id="checkAll" onClick="checkAllPaginated(this);" /></th>
     14                                <th>Sample</th>
     15                                <th>Assay</th>
     16                                <th>Run</th>
     17                        </tr>
     18                </thead>
     19                <g:each in="${run.assays}" var="assay">
     20                        <g:if test="${assay.study.canWrite(session.user)}">
     21                                <g:each in="${assay.assaySamples}" var="assaySample">
     22                                        <g:if test="${!assaySample.run?.equals(run)}">
     23                                                <tr>
     24                                                        <td><g:checkBox name="assaySamples" value="${assaySample.id}" checked="${false}" onClick="updateCheckAll(this);" /></td>
     25                                                        <td>${assaySample.sample.name}</td>
     26                                                        <td>${assaySample.assay.name}</td>
     27                                                        <td>${assaySample.run?.name}</td>
     28                                                </tr>
     29                                        </g:if>
     30                                </g:each>
     31                        </g:if>
     32                </g:each>
     33        </table>       
    3534</div>
  • trunk/web-app/js/assay.show.runDialogs.js

    r9 r23  
    1717                                        $( 'form[name=addRun]' ).submit();
    1818                                } else if( selectedTab == 1 ) { // Tab 'existing' selected
    19                                         $( 'form[name=addExistingRuns]' ).submit();
     19                                        submitPaginatedForm(
     20                                                $( 'form[name=addExistingRuns]'  ),
     21                                                '',
     22                                                '#addRunsTable',
     23                                                'Please select a run to associate with this run'
     24                                        );
    2025                                }
    2126                        },
  • trunk/web-app/js/forms.js

    r13 r23  
    3535        }
    3636       
    37         form.attr( 'action', url );
     37        if( url != '' )
     38                form.attr( 'action', url );
     39       
    3840        form.submit();
    3941       
  • trunk/web-app/js/run.show.addSamplesDialog.js

    r12 r23  
    77                buttons: {
    88                        "Save": function() {
    9                                 $( 'form[name=addSamples]' ).submit();
     9                                submitPaginatedForm(
     10                                        $( 'form[name=addSamples]'  ),
     11                                        '',
     12                                        '#addSamplesTable',
     13                                        'Please select a sample to add to this run'
     14                                );
    1015                        },
    1116                        "Close": function() { $(this).dialog( "close" ) }
  • trunk/web-app/js/run.show.assayDialog.js

    r7 r23  
    77                buttons: {
    88                        "Save": function() {
    9                                 $( 'form[name=addAssays]' ).submit();
     9                                submitPaginatedForm(
     10                                        $( 'form[name=addAssays]'  ),
     11                                        '',
     12                                        '#addAssaysTable',
     13                                        'Please select an assay to add to this run'
     14                                );                             
    1015                        },
    1116                        "Close": function() { $(this).dialog( "close" ) }
Note: See TracChangeset for help on using the changeset viewer.