source: trunk/grails-app/views/assay/_addRunDialog.gsp @ 4

Last change on this file since 4 was 4, checked in by robert@…, 12 years ago

Implemented trash in order to prevent deletion of data

File size: 2.9 KB
Line 
1<div id="addRunDialog" class="tabbedDialog">
2        <div id="runTabs">
3                <ul>
4                        <li><a href="#newRun">New</a></li>
5                        <li><a href="#existingRun">Existing</a></li>
6                </ul>
7                <div id="newRun">
8                        <h2>Add a new run</h2>
9                        <p>
10                                Enter data about the new run below. Only the name is required.
11                        </p>
12                        <g:form name="addRun" controller="run" action="create" id="${assay.id}">
13                                <label for="name">Name</label><g:textField name="run.name" value="" id="add_run_name" /><br />
14                                <label for="date">Date</label><g:textField name="run_date" value="" /><br />
15                                <label for="supplier">Supplier</label><g:textField name="run.supplier" value="" /><br />
16                                <label for="machine">Machine</label><g:textField name="run.machine" value="" /><br />
17                                <label for="parameters">Parameters</label><g:fileUpload name="parameterFile" value="" /><br />
18                        </g:form>
19                </div>
20                <div id="existingRun">
21                        <h2>Choose existing run to associate with this study</h2>
22                        <p>
23                                Choose one of the runs below to associate with this study.
24                        </p>           
25                        <g:form name="addExistingRuns" action="addExistingRuns" id="${assay.id}">
26                                <table class="paginate">
27                                        <thead>
28                                                <tr>
29                                                        <th class="nonsortable"></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}"/></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                                                                                -
45                                                                        </g:if>
46                                                                        <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.sequenceData?.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>       
70                </div>
71        </div>
72</div>
Note: See TracBrowser for help on using the repository browser.