source: trunk/grails-app/views/searchable/selectsample.gsp @ 199

Last change on this file since 199 was 199, checked in by jahn, 14 years ago

Still trying to build a proper overview of the samples. jquery's (stadnard) accordion is not a good solution because it does not allow to open two items at time.

File size: 3.5 KB
Line 
1<html>
2
3  <head>
4      <title>Generic Study Capture Framework - Query studies</title>
5      <meta name="layout" content="main" />
6      <g:setProvider library="jquery"/>
7      <script src = ${createLinkTo(dir: 'js/jquery_combobox', file: 'ui.core.js')}></script>
8      <script src = ${createLinkTo(dir: 'js/jquery_combobox', file: 'ui.combobox')}></script
9    </head>
10
11<body>
12
13  <h1>Advanced query - select samples</h1>
14  <br>
15
16
17  <g:form action="selectsample" url >
18
19
20   <br> <%= params %>
21   <br> <%= selectedStudyIds.each{ println it } %>
22   <br> <%= subgroups%>
23   <input type="hidden" name="selectedStudyIds" value="${selectedStudyIds}"   </div>
24
25
26  <% if (selectedStudies.size()>0) {%>
27       <table >
28         <tr>
29           <td></td>
30           <td><b> Study </b></td>
31           <td><b> Subject </b></td>
32           <td><b> Sampling Events </b></td>
33           <td><b> Sample Name </b></td>
34           <td><b> Sample Material </b></td>
35           <td><b> Start Time </b></td>
36           <g:if test="${subgroups.size>0}"> <td><b> Subgroups </b></td> </g:if>
37         </tr>
38
39  <g:each in="${selectedStudies}" status="j" var="studyIns">
40  <tr>
41  <td> <input type="checkbox" name="${studyIns.title}" id="${studyIns.title}" class="checkbox1${studyIns.id}"> </td>
42          <td> ${studyIns.title} </td>
43  </tr>
44
45
46
47  <g:if test="${studyIns.samplingEvents.size ()>0}" >
48  <g:each in ="${studyIns.samplingEvents}" var="event">
49     <g:each in ="${event.samples}" var="sample">
50        <tr>
51          <td></td><td></td>
52          <td> <input type="checkbox" name="${studyIns.id}.${event.subject.name}" id="${event.subject.name}" class="checkbox2${studyIns.id}" >
53               ${event.subject.name} </td>
54          <td> ${studyIns.samplingEvents} </td>
55          <td> ${sample.name}</td>
56          <td> ${sample.material}</td>
57          <td> ${event.getPrettyDuration( studyIns.startDate, event.startTime)} </td>
58
59          <g:if test="${subgroups.size>0}">
60          <td> <select id="demo">
61              <g:each in ="${subgroups}" var="p">
62                  <option value = "${p}"> "${p}" </option>
63              </g:each>
64          </select> </td>
65          </g:if>
66        </tr>
67     </g:each>
68    </g:each>
69  </g:if>
70
71
72  <g:else>
73        <tr>
74            <td></td> <td>Study does not cotain any samples. </td>
75            <td></td> <td></td> <td></td> <td></td> <td></td>
76            <g:if test="${subgroups.size>0}"> <td></td> </g:if>
77        </tr>
78    </g:else>
79    </g:each>
80
81     </table>
82
83
84
85    <g:each in="${selectedStudies}" status="j" var="studyIns">
86        <% def cb1 = '\'.checkbox1' + studyIns.id + '\''  %>
87        <% def cb2 = '\'.checkbox2' + studyIns.id + '\''  %>
88        <script>
89              $(${cb1}).click(function () {
90                  if($(this).attr("checked")==true)
91                     $(${cb2}).attr("checked", "checked");
92                  });
93              $(${cb2}).click(function () {
94                  if($(this).attr("checked")==false)
95                         $(${cb1}).attr("checked", false);
96                  });
97        </script>
98    </g:each>
99
100  <%}%>
101
102
103     Infer subgroups:
104    <INPUT TYPE=submit name=submit Value="Subject Groups">
105    <INPUT TYPE=submit name=submit Value="Event Groups">
106    <INPUT TYPE=submit name=submit Value="Starting Time Groups">
107
108    <% if (selectedStudies.size()==0) { %>
109    <br> Please select studies to query samples.
110    <% } %>
111
112    <br>
113    <INPUT TYPE=submit name=submit Value="<< Back to study selection">
114    <INPUT TYPE=submit name=submit Value=">> Execute and continue with biomarker selection">
115
116    </g:form>
117
118
119
120  </body>
121</html>
Note: See TracBrowser for help on using the repository browser.