Changeset 258 for trunk/grails-app/views
- Timestamp:
- Mar 12, 2010, 11:51:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/study/show.gsp
r247 r258 30 30 31 31 <% protocolList = dbnp.studycapturing.Protocol.list() %> 32 <% def study_eventsDescription = [] %> 33 <% study_eventsDescription = studyInstance.events.eventDescription.unique() %> 34 <% study_eventsDescription.addAll(studyInstance.samplingEvents.eventDescription.unique()) %> 35 <% def study_events = [] %> 36 <% study_events = studyInstance.events.unique() %> 37 <% study_events.addAll(studyInstance.samplingEvents.unique()) %> 32 38 33 39 <div id="tabs"> … … 49 55 <b> Start </b>:<g:formatDate date="${studyInstance?.startDate}" /> <br> 50 56 <b> Events </b>: 51 <% def eventList = [] %> 52 53 <g:each in="${studyInstance.events}" var="s"> 54 <% eventList.add(s.eventDescription) %> 55 </g:each> 56 57 <g:if test="${eventList.size()==0}"> 58 - 59 </g:if> 60 61 <g:else> 62 <% def sampEvent = eventList.get(0).name %> 63 ${sampEvent} 64 <g:each in="${eventList}" var="samplingEvent"> 65 <g:if test="${(samplingEvent.name!=sampEvent)}"> 66 ${samplingEvent.name} 67 </g:if> 68 </g:each> 69 </g:else> 57 <g:if test="${studyInstance.events.eventDescription.size()==0}"> 58 - 59 </g:if> 60 <g:else> 61 ${studyInstance.events.eventDescription.unique().toString().replaceAll("]"," "). 62 substring(1,studyInstance.events.eventDescription.unique().toString().size())} 63 </g:else> 70 64 <br> 71 72 73 65 <b>Sampling Events </b>: 74 <% def tmpList = [] %> 75 76 <g:each in="${studyInstance.samplingEvents}" var="s"> 77 <% tmpList.add(s.eventDescription) %> 78 </g:each> 79 80 <g:if test="${tmpList.size()==0}"> 81 - 82 </g:if> 83 84 <g:else> 85 <% def sampEvent = tmpList.get(0).name %> 86 ${sampEvent} 87 <g:each in="${tmpList}" var="samplingEvent"> 88 <g:if test="${(samplingEvent.name!=sampEvent)}"> 89 ${samplingEvent.name} 90 </g:if> 91 </g:each> 92 </g:else> 66 <g:if test="${studyInstance.samplingEvents.eventDescription.size()==0}"> 67 - 68 </g:if> 69 <g:else> 70 ${studyInstance.samplingEvents.eventDescription.unique().toString().replaceAll("]"," "). 71 substring(1,studyInstance.samplingEvents.eventDescription.unique().toString().size())} 72 </g:else> 93 73 <br> 94 74 <b>Last Updated </b>:<g:formatDate date="${studyInstance?.lastUpdated}" /><br> … … 142 122 </tr> 143 123 144 <g:each in="${studyInstance.subjects.findAll { 124 <g:each in="${studyInstance.subjects.findAll {it.template == template}}" var="s"> 145 125 <tr> 146 126 <td><g:link controller="subject" action="show" id="${s.id}">${s.id}</g:link></td> … … 172 152 173 153 <div id="protocols"> 174 <table> 154 <% def protocol_list = [] %> 155 <% protocol_list= studyInstance.events.eventDescription.protocol.unique() %> 156 <g:if test="${protocol_list.size()==0}"> 157 No protocols in this study 158 </g:if> 159 <g:else> 160 <table> 175 161 <tr> 176 162 <td><b>Id </b></td> … … 179 165 <td><b>Reference</b></td> 180 166 </tr> 181 182 <% def protocol_list = [] %>183 <% def tmp_protocol = studyInstance.events.eventDescription.protocol.get(0) %>184 <% def tmpBis_protocol = studyInstance.samplingEvents.eventDescription.protocol.get(0) %>185 <% protocol_list.add(tmp_protocol) %>186 <% protocol_list.add(tmpBis_protocol) %>187 188 <g:each in="${studyInstance.events.eventDescription.protocol}" var="s">189 <% if (!(protocol_list.contains(s))) {%>190 <% protocol_list.add(s) %>191 <%}%>192 </g:each>193 194 <g:each in="${studyInstance.samplingEvents.eventDescription.protocol}" var="g">195 <% if (!(protocol_list.contains(g))) { %>196 <% protocol_list.add(g) %>197 <%}%>198 </g:each>199 200 167 <g:each in="${protocol_list}" var="protocol"> 201 168 <tr> 202 169 <td><g:link controller="protocol" action="show" id="${protocol.id}">${protocol.id}</g:link></td> 203 170 <td>${protocol.name}</td> 204 171 <td> 205 <g:each in="${protocol.parameters}" var="p"> <ul><li>172 <g:each in="${protocol.parameters}" var="p"> 206 173 <g:link controller="protocolParameter" action="show" id="${p.id}">${p.name}</g:link> 207 </li></ul>208 174 </g:each> 209 175 </td> … … 213 179 </g:each> 214 180 </table> 181 </g:else> 215 182 </div> 216 183 217 184 <div id="events"> 185 <g:if test="${study_events.size()==0}"> 186 No events in this study 187 </g:if> 188 <g:else> 218 189 <table> 219 190 <tr> 220 221 191 <td><b>Subject</b></td> 222 192 <td><b>Start Time</b></td> … … 226 196 <td><b>Parameters</b></td> 227 197 </tr> 228 <g:each in="${study Instance.events}" var="e">198 <g:each in="${study_events}" var="e"> 229 199 <tr> 230 200 <td>-</td> … … 232 202 <td>${e.getPrettyDuration()}</td> 233 203 <td><g:link controller="event" action="show" id="${e.id}"> ${e.eventDescription.name}</g:link></td> 234 <td><g:checkBox name="event" disabled="${true}" value="${false}"/></td>235 236 204 <td> 237 <g:if test="${e.parameterStringValues.size()>0}"> 238 ${e.parameterStringValues} 205 <g:if test="${e instanceof dbnp.studycapturing.SamplingEvent}"> 206 <g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/> 207 </g:if> 208 <g:else> 209 <g:checkBox name="event" disabled="${true}" value="${false}"/> 210 </g:else> 211 </td> 212 <td> 213 <g:if test="${e.parameterStringValues.size()>0}"> 214 <% def stringValues = e.parameterStringValues.toString().replaceAll("}"," ") %> 215 <% print stringValues.substring(1,stringValues.size()) %> 239 216 </g:if> 240 217 <g:elseif test="${e.parameterIntegerValues.size()>0}"> 241 ${e.parameterIntegerValues} 218 <% def integerValues = e.parameterInteger.toString().replaceAll("}"," ") %> 219 <% print integerValues.substring(1,integerValues.size()) %> 242 220 </g:elseif> 243 221 <g:elseif test="${e.parameterFloatValues.size()>0}"> 244 ${e.parameterFloatValues} 245 </g:elseif> 246 </td> 247 248 </tr> 249 </g:each> 250 251 <g:each in="${studyInstance.samplingEvents}" var="e"> 252 <tr> 253 <td>-</td> 254 <td>${e.getPrettyDuration(studyInstance.startDate,e.startTime)}</td> 255 <td>${e.getPrettyDuration()}</td> 256 <td><g:link controller="event" action="show" id="${e.id}"> ${e.eventDescription.name}</g:link></td> 257 <td><g:checkBox name="samplingEvent" disabled="${true}" value="${true}"/></td> 258 <td> 259 <g:if test="${e.parameterStringValues.size()>0}"> 260 ${e.parameterStringValues} 261 </g:if> 262 <g:elseif test="${e.parameterIntegerValues.size()>0}"> 263 ${e.parameterIntegerValues} 264 </g:elseif> 265 <g:elseif test="${e.parameterFloatValues.size()>0}"> 266 ${e.parameterFloatValues} 222 <% def floatValues = e.parameterFloatValues.toString().replaceAll("}"," ") %> 223 <% print floatValues.substring(1,floatValues.size()) %> 267 224 </g:elseif> 268 225 </td> 269 226 </tr> 270 227 </g:each> 271 272 228 </table> 229 </g:else> 273 230 </div> 274 231 275 232 <div id="event-description"> 276 <table> 277 <tr> 278 233 <g:if test="${study_eventsDescription.size()==0}"> 234 No events description in this study 235 </g:if> 236 <g:else> 237 <table> 238 <tr> 279 239 <td><b>Event Name</b></td> 280 240 <td><b>Parameters </b></td> … … 288 248 <td><b>Options</b></td> 289 249 <td><b>Type</b></td> 290 </tr> 291 <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e"> 292 <g:if test="${(studyInstance.events.eventDescription.contains(e))}" > 250 </tr> 251 <g:each in="${study_eventsDescription}" var="e"> 293 252 <tr> 294 <td>${e.name} </td> </tr><tr>253 <td>${e.name} </td> 295 254 <g:each in="${e.protocol.parameters}" var="p"> 296 <td></td>297 255 <td>${p.name}</td> 298 256 <td>${p.description}</td> … … 303 261 </g:if> 304 262 <g:else> 305 <td>${p.listEntries }</td>263 <td>${p.listEntries.toString().replaceAll("]"," ").substring(1,p.listEntries.toString().size())}</td> 306 264 </g:else> 307 265 <td>${p.type}</td> 308 266 </tr> 309 267 </g:each> 310 </g:if> 311 </g:each> 312 313 <g:each in="${dbnp.studycapturing.EventDescription.list()}" var="e"> 314 <g:if test="${(studyInstance.samplingEvents.eventDescription.contains(e))}" > 315 <tr> 316 <td>${e.name} </td></tr><tr> 317 <g:each in="${e.protocol.parameters}" var="p"> 318 <td></td> 319 <td>${p.name}</td> 320 <td>${p.description}</td> 321 <td>${p.unit}</td> 322 <td>${p.reference}</td> 323 <g:if test="${(p.listEntries.size()==0)}" > 324 <td>-</td> 325 </g:if> 326 <g:else> 327 <td>${p.listEntries}</td> 328 </g:else> 329 <td>${p.type}</td> 330 </tr> 331 </g:each> 332 </g:if> 333 </g:each> 334 268 </g:each> 335 269 </table> 336 270 … … 338 272 <INPUT TYPE=submit name=submit Value="New Event Description"> 339 273 </g:form> 340 274 </g:else> 341 275 </div> 342 276 343 277 <div id="event-group"> 278 <g:if test="${studyInstance.eventGroups.size()==0}"> 279 No event groups in this study 280 </g:if> 281 <g:else> 344 282 <table> 345 283 <tr> 346 284 <td><b>Name</b></td> 347 <td ><b>Events</b></td>285 <td colspan="${study_eventsDescription.size()}"><b>Events</b></td> 348 286 <td><b>Subjects</b></td> 349 287 </tr> 288 <tr> 289 <td></td> 290 <g:each in="${study_eventsDescription}" var="list"> 291 <td> 292 <b>${list}</b> 293 </td> 294 </g:each> 295 </tr> 350 296 <g:each in="${studyInstance.eventGroups}" var="eventGroup"> 351 297 <tr> 352 298 <td>${eventGroup.name}</td> 353 <td>${eventGroup.events}</td> 354 <td>${eventGroup.subjects.name}</td> 299 300 <g:each in="${study_eventsDescription}" var="des"> 301 <td> 302 <g:each in="${eventGroup.events}" var="e"> 303 <g:if test="${e.eventDescription==des}"> 304 <g:if test="${e.parameterStringValues.size()>0}"> 305 <% def stringValues = e.parameterStringValues.toString().replaceAll("}"," ") %> 306 <% print stringValues.substring(1,stringValues.size()) %> 307 </g:if> 308 <g:elseif test="${e.parameterIntegerValues.size()>0}"> 309 <% def integerValues = e.parameterInteger.toString().replaceAll("}"," ") %> 310 <% print integerValues.substring(1,integerValues.size()) %> 311 </g:elseif> 312 <g:elseif test="${e.parameterFloatValues.size()>0}"> 313 <% def floatValues = e.parameterFloatValues.toString().replaceAll("}"," ") %> 314 <% print floatValues.substring(1,floatValues.size()) %> 315 </g:elseif> 316 </g:if> 317 </g:each> 318 </td> 319 </g:each> 320 321 <td>${eventGroup.subjects.name.toString().replaceAll("]"," "). 322 substring(1,eventGroup.subjects.name.toString().size())}</td> 355 323 </tr> 356 324 </g:each> 357 325 </table> 358 326 </g:else> 359 327 </div> 360 328
Note: See TracChangeset
for help on using the changeset viewer.