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.show.label" args="[entityName]" /></title> |
---|
9 | <script type="text/javascript"> |
---|
10 | $(function() { |
---|
11 | $("#tabs").tabs(); |
---|
12 | }); |
---|
13 | </script> |
---|
14 | |
---|
15 | </head> |
---|
16 | <body> |
---|
17 | |
---|
18 | <div class="nav"> |
---|
19 | <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span> |
---|
20 | <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
---|
21 | <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span> |
---|
22 | </div> |
---|
23 | |
---|
24 | <div class="body"> |
---|
25 | <h1><g:message code="default.show.label" args="[entityName]" /></h1> |
---|
26 | <g:if test="${flash.message}"> |
---|
27 | <div class="message">${flash.message}</div> |
---|
28 | </g:if> |
---|
29 | <div class="dialog"> |
---|
30 | |
---|
31 | <div id="tabs"> |
---|
32 | <ul> |
---|
33 | <li><a href="#study">Study Information</a></li> |
---|
34 | <li><a href="#subjects">Subjects</a></li> |
---|
35 | <li><a href="#events">Events</a></li> |
---|
36 | <li><a href="#event-group">Event Groups</a></li> |
---|
37 | <li><a href="#assays">Assays</a></li> |
---|
38 | <li><a href="#persons">Persons</a></li> |
---|
39 | </ul> |
---|
40 | |
---|
41 | <div id="study"> |
---|
42 | |
---|
43 | <b> Id </b>: ${fieldValue(bean: studyInstance, field: "id")} <br> |
---|
44 | <b>Template </b>:<g:link controller="template" action="show" id="${studyInstance?.template?.id}">${studyInstance?.template?.encodeAsHTML()}</g:link><br> |
---|
45 | <b> Start </b>:<g:formatDate date="${studyInstance?.startDate}" /> <br> |
---|
46 | <b> Events </b>: |
---|
47 | <g:if test="${studyInstance.giveEventTemplates().size()==0}"> |
---|
48 | - |
---|
49 | </g:if> |
---|
50 | <g:else> |
---|
51 | ${studyInstance.giveEventTemplates().name} |
---|
52 | </g:else> |
---|
53 | <br> |
---|
54 | <b>Sampling Events </b>: |
---|
55 | <g:if test="${studyInstance.giveSamplingEventTemplates().size()==0}"> |
---|
56 | - |
---|
57 | </g:if> |
---|
58 | <g:else> |
---|
59 | ${studyInstance.giveSamplingEventTemplates().name} |
---|
60 | </g:else> |
---|
61 | <br> |
---|
62 | <b>Last Updated </b>:<g:formatDate date="${studyInstance?.lastUpdated}" /><br> |
---|
63 | <b>Readers </b>: |
---|
64 | |
---|
65 | <g:if test="${studyInstance.readers.size()==0}"> |
---|
66 | - |
---|
67 | </g:if> |
---|
68 | <g:else> |
---|
69 | <ul> |
---|
70 | <g:each in="${studyInstance.readers}" var="r"> |
---|
71 | <li><g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li> |
---|
72 | </g:each> |
---|
73 | </ul> |
---|
74 | </g:else> |
---|
75 | <br> |
---|
76 | |
---|
77 | <!-- All template fields --> |
---|
78 | <g:each in="${studyInstance.giveFields()}" var="field"> |
---|
79 | <b>${field.name}</b>: ${studyInstance.getFieldValue(field.name)}<br /> |
---|
80 | </g:each> |
---|
81 | |
---|
82 | <b>Editors </b>: |
---|
83 | <g:if test="${studyInstance.editors.size()==0}"> |
---|
84 | - |
---|
85 | </g:if> |
---|
86 | <g:else> |
---|
87 | <ul> |
---|
88 | <g:each in="${studyInstance.editors}" var="e"> |
---|
89 | <li><g:link controller="user" action="show" id="${e.id}">${e?.encodeAsHTML()}</g:link></li> |
---|
90 | </g:each> |
---|
91 | </ul> |
---|
92 | </g:else> |
---|
93 | <br> |
---|
94 | <b>Title </b>: ${fieldValue(bean: studyInstance, field: "title")} <br> |
---|
95 | <b>Owner </b>:<g:link controller="user" action="show" id="${studyInstance?.owner?.id}">${studyInstance?.owner?.encodeAsHTML()}</g:link> <br> |
---|
96 | <b>Date Created </b>:<g:formatDate date="${studyInstance?.dateCreated}" /> <br> |
---|
97 | </div> |
---|
98 | |
---|
99 | <div id="subjects"> |
---|
100 | <g:each in="${studyInstance.giveSubjectTemplates()}" var="template"> |
---|
101 | <table> |
---|
102 | <tr> |
---|
103 | <td><b>Id </b></td> |
---|
104 | <td><b>Species</b></td> |
---|
105 | <td><b>Name</b></td> |
---|
106 | <g:each in="${template.fields}" var="g"> |
---|
107 | <td><b> |
---|
108 | <g:link controller="templateField" action="show" id="${g.id}"> |
---|
109 | ${g}</b></td> |
---|
110 | </g:link> |
---|
111 | </g:each> |
---|
112 | </tr> |
---|
113 | |
---|
114 | <g:each in="${studyInstance.subjects.findAll {it.template == template}}" var="s"> |
---|
115 | <tr> |
---|
116 | <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> |
---|
117 | <td>${s.species}</td> |
---|
118 | <td>${s.name}</td> |
---|
119 | <g:each in="${template.fields}" var="g"> |
---|
120 | <td> |
---|
121 | <% print s.getFieldValue(g.toString()) %> |
---|
122 | </td> |
---|
123 | </g:each> |
---|
124 | </tr> |
---|
125 | </g:each> |
---|
126 | |
---|
127 | </table> |
---|
128 | |
---|
129 | </g:each> |
---|
130 | </div> |
---|
131 | |
---|
132 | |
---|
133 | <div id="events"> |
---|
134 | <g:if test="${studyInstance.events.size()==0}"> |
---|
135 | No events in this study |
---|
136 | </g:if> |
---|
137 | <g:else> |
---|
138 | |
---|
139 | <table> |
---|
140 | <tr> |
---|
141 | <td><b>Id </b></td> |
---|
142 | <td><b>Start time</b></td> |
---|
143 | <td><b>Duration</b></td> |
---|
144 | <td><b>Type</b></td> |
---|
145 | <td><b>Sampling event</b></td> |
---|
146 | <td><b>Parameters</b></td> |
---|
147 | </tr> |
---|
148 | |
---|
149 | <g:each in="${studyInstance.events + studyInstance.samplingEvents}" var="event"> |
---|
150 | <tr> |
---|
151 | <td><g:link controller="event" action="show" id="${event.id}">${event.id}</g:link></td> |
---|
152 | <td>${event.getPrettyDuration(studyInstance.startDate,event.startTime)}</td> |
---|
153 | <td>${event.getPrettyDuration()}</td> |
---|
154 | <td>${event.template.name}</td> |
---|
155 | <td> |
---|
156 | <g:if test="${event instanceof dbnp.studycapturing.SamplingEvent}"> |
---|
157 | <g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/> |
---|
158 | </g:if> |
---|
159 | <g:else> |
---|
160 | <g:checkBox name="event" disabled="${true}" value="${false}" /> |
---|
161 | </g:else> |
---|
162 | </td> |
---|
163 | <td> |
---|
164 | <g:set var="fieldCounter" value="${1}" /> |
---|
165 | <g:each in="${event.giveFields()}" var="field"> |
---|
166 | <g:if test="${event.getFieldValue(field.name)}"> |
---|
167 | <g:if test="${fieldCounter > 1}">, </g:if> |
---|
168 | ${field.name} = ${event.getFieldValue( field.name )} |
---|
169 | <g:set var="fieldCounter" value="${fieldCounter + 1}" /> |
---|
170 | </g:if> |
---|
171 | </g:each> |
---|
172 | </td> |
---|
173 | </tr> |
---|
174 | </g:each> |
---|
175 | |
---|
176 | </table> |
---|
177 | |
---|
178 | </g:else> |
---|
179 | </div> |
---|
180 | |
---|
181 | <div id="event-group"> |
---|
182 | <g:if test="${studyInstance.eventGroups.size()==0}"> |
---|
183 | No event groups in this study |
---|
184 | </g:if> |
---|
185 | <g:else> |
---|
186 | <table> |
---|
187 | <tr> |
---|
188 | <td><b>Name</b></td> |
---|
189 | <td colspan="${studyInstance.giveAllEventTemplates().size()}"><b>Events</b></td> |
---|
190 | <td><b>Subjects</b></td> |
---|
191 | </tr> |
---|
192 | <tr> |
---|
193 | <td></td> |
---|
194 | <g:each in="${studyInstance.giveAllEventTemplates()}" var="eventTemplate"> |
---|
195 | <td><b>${eventTemplate.name}</b></td> |
---|
196 | </g:each> |
---|
197 | <td></td> |
---|
198 | </tr> |
---|
199 | <g:each in="${studyInstance.eventGroups}" var="eventGroup"> |
---|
200 | <tr> |
---|
201 | <td>${eventGroup.name}</td> |
---|
202 | |
---|
203 | <g:each in="${studyInstance.giveAllEventTemplates()}" var="currentEventTemplate"> |
---|
204 | <td> |
---|
205 | <g:each in="${eventGroup.events}" var="event"> |
---|
206 | <g:if test="${event.template.name==currentEventTemplate.name}"> |
---|
207 | |
---|
208 | <g:set var="fieldCounter" value="${1}" /> |
---|
209 | <g:each in="${event.giveFields()}" var="field"> |
---|
210 | <g:if test="${event.getFieldValue(field.name)}"> |
---|
211 | <g:if test="${fieldCounter > 1}">, </g:if> |
---|
212 | ${field.name} = ${event.getFieldValue( field.name )} |
---|
213 | <g:set var="fieldCounter" value="${fieldCounter + 1}" /> |
---|
214 | </g:if> |
---|
215 | </g:each> |
---|
216 | </g:if> |
---|
217 | </g:each> |
---|
218 | </td> |
---|
219 | </g:each> |
---|
220 | <td>${eventGroup.subjects.name.join( ', ' )}</td> |
---|
221 | </tr> |
---|
222 | </g:each> |
---|
223 | </table> |
---|
224 | </g:else> |
---|
225 | </div> |
---|
226 | |
---|
227 | <div id="assays"> |
---|
228 | <g:if test="${studyInstance.assays.size()==0}"> |
---|
229 | No assays in this study |
---|
230 | </g:if> |
---|
231 | <g:else> |
---|
232 | <table> |
---|
233 | <tr> |
---|
234 | <td width="100"><b>Assay Name</b></td> |
---|
235 | <td width="100"><b>Module</b></td> |
---|
236 | <td><b>Type</b></td> |
---|
237 | <td width="150"><b>Platform</b></td> |
---|
238 | <td><b>Url</b></td> |
---|
239 | <td><b>Samples</b></td> |
---|
240 | </tr> |
---|
241 | <g:each in="${studyInstance.assays}" var="assay"> |
---|
242 | <tr> |
---|
243 | <td>${assay.name}</td> |
---|
244 | <td>${assay.module.name}</td> |
---|
245 | <td>${assay.module.type}</td> |
---|
246 | <td>${assay.module.platform}</td> |
---|
247 | <td>${assay.module.url}</td> |
---|
248 | <td> |
---|
249 | <g:each in="${assay.samples}" var="assaySample"> |
---|
250 | ${assaySample.name}<br> |
---|
251 | </g:each> |
---|
252 | </td> |
---|
253 | </tr> |
---|
254 | </g:each> |
---|
255 | |
---|
256 | </table> |
---|
257 | </g:else> |
---|
258 | </div> |
---|
259 | |
---|
260 | <div id="persons"> |
---|
261 | <g:if test="${studyInstance.persons.size()==0}"> |
---|
262 | No persons involved in this study |
---|
263 | </g:if> |
---|
264 | <g:else> |
---|
265 | <table> |
---|
266 | <tr> |
---|
267 | <td><b>Name</b></td> |
---|
268 | <td><b>Affiliations</b></td> |
---|
269 | <td><b>Role</b></td> |
---|
270 | <td><b>Phone</b></td> |
---|
271 | <td><b>Email</b></td> |
---|
272 | </tr> |
---|
273 | <g:each in="${studyInstance.persons}" var="studyperson"> |
---|
274 | <tr> |
---|
275 | <td>${studyperson.person.firstName} ${studyperson.person.prefix} ${studyperson.person.lastName}</td> |
---|
276 | <td> |
---|
277 | ${studyperson.person.affiliations.name.join(', ')} |
---|
278 | </td> |
---|
279 | <td>${studyperson.role.name}</td> |
---|
280 | <td>${studyperson.person.phone}</td> |
---|
281 | <td>${studyperson.person.email}</td> |
---|
282 | </tr> |
---|
283 | </g:each> |
---|
284 | </table> |
---|
285 | </g:else> |
---|
286 | </div> |
---|
287 | </div> |
---|
288 | </div> |
---|
289 | <br> |
---|
290 | <div class="buttons"> |
---|
291 | <g:form> |
---|
292 | <g:hiddenField name="id" value="${studyInstance?.id}" /> |
---|
293 | <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span> |
---|
294 | <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span> |
---|
295 | </g:form> |
---|
296 | </div> |
---|
297 | </div> |
---|
298 | </body> |
---|
299 | </html> |
---|