1 | |
---|
2 | <%@ page import="dbnp.studycapturing.Study" %> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
6 | <meta name="layout" content="main" /> |
---|
7 | <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" /> |
---|
8 | <title><g:message code="default.list.label" args="[entityName]" /></title> |
---|
9 | |
---|
10 | <my:jqueryui/> |
---|
11 | <script type="text/javascript"> |
---|
12 | $(function() { |
---|
13 | $("#accordions").accordion(); |
---|
14 | }); |
---|
15 | </script> |
---|
16 | |
---|
17 | </head> |
---|
18 | <body> |
---|
19 | |
---|
20 | <% studyList = dbnp.studycapturing.Study.list() %> |
---|
21 | <% def att_list = ['template','startDate','samplingEvents','lastUpdated','readers','code','editors','ecCode','researchQuestion','title','description','owner','dateCreated'] %> |
---|
22 | <% def selectedStudies = [] %> |
---|
23 | <% def tmpList = [] %> |
---|
24 | |
---|
25 | <div class="nav"> |
---|
26 | <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> |
---|
27 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
28 | <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> |
---|
29 | </div> |
---|
30 | |
---|
31 | <div class="body"> |
---|
32 | <h1>Studies Comparison</h1> |
---|
33 | <g:if test="${flash.message}"> |
---|
34 | <div class="message">${flash.message}</div> |
---|
35 | </g:if> |
---|
36 | |
---|
37 | <% params.each{key,values-> %> |
---|
38 | <% if (values=="on"){ %> |
---|
39 | <% tmpList.add(key) %> |
---|
40 | <% } }%> |
---|
41 | |
---|
42 | <% for (i in studyList) {%> |
---|
43 | <% if (tmpList.contains(i.getTitle())) { %> |
---|
44 | <% selectedStudies.add(i) %> |
---|
45 | <% }} %> |
---|
46 | |
---|
47 | <% if (selectedStudies.size()>0) {%> |
---|
48 | |
---|
49 | <div id="accordions"> |
---|
50 | |
---|
51 | <a href="#"> Study Information </a> |
---|
52 | <div> |
---|
53 | <br> |
---|
54 | <table> |
---|
55 | <tr> |
---|
56 | <td></td> |
---|
57 | <g:each in="${selectedStudies}" status="j" var="studyIns"> |
---|
58 | <td><b>${studyIns.title}</b></td> |
---|
59 | </g:each> |
---|
60 | </tr> |
---|
61 | <tr> |
---|
62 | <td><b>Id</b></td> |
---|
63 | <g:each in="${selectedStudies}" status="k" var="studyIns"> |
---|
64 | <td><g:link action="show" id="${studyIns.id}"> |
---|
65 | ${fieldValue(bean: studyIns, field: "id")}</g:link></td> |
---|
66 | </g:each> |
---|
67 | </tr> |
---|
68 | |
---|
69 | <g:each in="${att_list}" var="att"> |
---|
70 | <tr> |
---|
71 | <td><b>${att}</b></td> |
---|
72 | <g:each in="${selectedStudies}" status="k" var="studyIns"> |
---|
73 | <td>${fieldValue(bean: studyIns, field: att)}</td> |
---|
74 | </g:each> |
---|
75 | </tr> |
---|
76 | </g:each> |
---|
77 | |
---|
78 | </table> |
---|
79 | </div> |
---|
80 | |
---|
81 | <a href="#"> Subjects </a><div> |
---|
82 | |
---|
83 | <table border="2"> |
---|
84 | <tr> |
---|
85 | <g:each in="${selectedStudies}" var="study"> |
---|
86 | <td><center><b>${study.title}</b></center></td> |
---|
87 | </g:each> |
---|
88 | </tr> |
---|
89 | |
---|
90 | <tr> |
---|
91 | <g:each in="${selectedStudies}" var="stud"> |
---|
92 | <td> |
---|
93 | |
---|
94 | <table> |
---|
95 | <tr> |
---|
96 | <td><b>Id </b></td> |
---|
97 | <td><b>Species</b></td> |
---|
98 | <td><b>Name</b></td> |
---|
99 | <g:each in="${stud.template.subjectFields}" var="g"> |
---|
100 | <td><b> |
---|
101 | <g:link controller="templateSubjectField" action="show" id="${g.id}"> |
---|
102 | ${g}</b></td> |
---|
103 | </g:link> |
---|
104 | </g:each> |
---|
105 | </tr> |
---|
106 | |
---|
107 | <g:each in="${stud.subjects}" var="s"> |
---|
108 | <tr> |
---|
109 | <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> |
---|
110 | <td>${s.species}</td> |
---|
111 | <td>${s.name}</td> |
---|
112 | |
---|
113 | <g:each in="${stud.template.subjectFields}" var="g"> |
---|
114 | <td> |
---|
115 | <% if (g.type==dbnp.studycapturing.TemplateFieldType.INTEGER){ %> |
---|
116 | <% print s.templateIntegerFields.get(g.toString()) %> |
---|
117 | <% } %> |
---|
118 | <% if (g.type==dbnp.studycapturing.TemplateFieldType.STRINGLIST){ %> |
---|
119 | <% print s.templateStringFields.get(g.toString()) %> |
---|
120 | <% } %> |
---|
121 | |
---|
122 | </td> |
---|
123 | </g:each> |
---|
124 | </tr> |
---|
125 | </g:each> |
---|
126 | </table> |
---|
127 | |
---|
128 | </td> |
---|
129 | </g:each> |
---|
130 | </tr> |
---|
131 | </table> |
---|
132 | |
---|
133 | </div> |
---|
134 | |
---|
135 | <a href="#"> Groups </a> <div> |
---|
136 | |
---|
137 | </div> |
---|
138 | |
---|
139 | <a href="#"> Protocols </a><div> |
---|
140 | <table border="2"> |
---|
141 | <tr> |
---|
142 | <g:each in="${selectedStudies}" var="study"> |
---|
143 | <td><center><b>${study.title}</b></center></td> |
---|
144 | </g:each> |
---|
145 | </tr> |
---|
146 | |
---|
147 | <tr> |
---|
148 | <g:each in="${selectedStudies}" var="stud"> |
---|
149 | <td> |
---|
150 | <table> |
---|
151 | <tr> |
---|
152 | <td><b>Id </b></td> |
---|
153 | <td><b>Name</b></td> |
---|
154 | <td><b>Parameters</b></td> |
---|
155 | <td><b>Reference</b></td> |
---|
156 | </tr> |
---|
157 | |
---|
158 | <% def protocol_list = [] %> |
---|
159 | <% def tmp_protocol = stud.events.eventDescription.protocol.get(0) %> |
---|
160 | <% protocol_list.add(tmp_protocol) %> |
---|
161 | <g:each in="${stud.events.eventDescription.protocol}" var="s"> |
---|
162 | |
---|
163 | <% if (tmp_protocol!=s) { %> |
---|
164 | <% protocol_list.add(s) %> |
---|
165 | <%}%> |
---|
166 | </g:each> |
---|
167 | |
---|
168 | <g:each in="${protocol_list}" var="protocol"> |
---|
169 | <tr> |
---|
170 | <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td> |
---|
171 | <td>${protocol.name}</td> |
---|
172 | <td> |
---|
173 | <g:each in="${protocol.parameters}" var="p"><ul><li> |
---|
174 | <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link> |
---|
175 | </li></ul> |
---|
176 | </g:each> |
---|
177 | </td> |
---|
178 | <td>${protocol.reference}</td> |
---|
179 | </tr> |
---|
180 | </g:each> |
---|
181 | </table> |
---|
182 | |
---|
183 | </td> |
---|
184 | </g:each> |
---|
185 | </tr> |
---|
186 | </table> |
---|
187 | </div> |
---|
188 | |
---|
189 | <a href="#"> Events </a><div> |
---|
190 | <table border="2"> |
---|
191 | <tr> |
---|
192 | <g:each in="${selectedStudies}" var="study"> |
---|
193 | <td><center><b>${study.title}</b></center></td> |
---|
194 | </g:each> |
---|
195 | </tr> |
---|
196 | |
---|
197 | <tr> |
---|
198 | <g:each in="${selectedStudies}" var="stud"> |
---|
199 | <td> |
---|
200 | |
---|
201 | <table> |
---|
202 | <tr> |
---|
203 | <td><b>Event Description</b></td> |
---|
204 | <td><b>Subject</b></td> |
---|
205 | <td><b>Start Time</b></td> |
---|
206 | <td><b>End Time</b></td> |
---|
207 | <td><b>Duration</b></td> |
---|
208 | </tr> |
---|
209 | <g:each in="${stud.events}" var="e"> |
---|
210 | <tr> |
---|
211 | <td><g:link controller="event" action="show" id="${e.id}"> ${e.eventDescription.name}</g:link></td> |
---|
212 | <td>${e.subject.id}</td> |
---|
213 | <td>${e.startTime}</td> |
---|
214 | <td>${e.endTime}</td> |
---|
215 | <td>${e.getDurationString()}</td> |
---|
216 | </tr> |
---|
217 | </g:each> |
---|
218 | </table> |
---|
219 | </td> |
---|
220 | </g:each> |
---|
221 | </tr> |
---|
222 | </table> |
---|
223 | |
---|
224 | </div> |
---|
225 | |
---|
226 | <a href="#"> Assays </a><div> |
---|
227 | </div> |
---|
228 | |
---|
229 | </div> |
---|
230 | |
---|
231 | |
---|
232 | |
---|
233 | <% } %> |
---|
234 | |
---|
235 | <% if (selectedStudies.size()==0) {%> |
---|
236 | Please select studies to compare. |
---|
237 | <% } %> |
---|
238 | |
---|
239 | </div> |
---|
240 | |
---|
241 | |
---|
242 | </body> |
---|
243 | </html> |
---|