Changeset 442 for trunk/grails-app/views
- Timestamp:
- May 19, 2010, 6:12:42 PM (13 years ago)
- Location:
- trunk/grails-app/views
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/views/person/edit.gsp
r382 r442 132 132 </td> 133 133 <td valign="top" class="value ${hasErrors(bean: personInstance, field: 'affiliations', 'errors')}"> 134 <g:select name="affiliations" from="${dbnp.studycapturing.PersonAffiliation.list()}" multiple="yes" optionKey="id" optionValue="name"size="5" value="${personInstance?.affiliations}" />134 <g:select name="affiliations" from="${dbnp.studycapturing.PersonAffiliation.list()}" multiple="yes" optionKey="id" size="5" value="${personInstance?.affiliations}" /> 135 135 </td> 136 136 </tr> -
trunk/grails-app/views/person/list.gsp
r382 r442 49 49 <g:each in="${personInstance.affiliations}" var="affiliation" status="affiliationNr"> 50 50 <g:if test="${affiliationNr>0}">,</g:if> 51 ${affiliation .name}51 ${affiliation} 52 52 </g:each> 53 53 </td> -
trunk/grails-app/views/person/show.gsp
r382 r442 97 97 <ul> 98 98 <g:each in="${personInstance.affiliations}" var="a"> 99 <li><g:link controller="personAffiliation" action="show" id="${a.id}">${a?. name.encodeAsHTML()}</g:link></li>99 <li><g:link controller="personAffiliation" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li> 100 100 </g:each> 101 101 </ul> -
trunk/grails-app/views/personAffiliation/create.gsp
r379 r442 26 26 <tr class="prop"> 27 27 <td valign="top" class="name"> 28 <label for="name"><g:message code="personAffiliation. name.label" default="Name" /></label>28 <label for="name"><g:message code="personAffiliation.institute.label" default="Institute" /></label> 29 29 </td> 30 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: ' name', 'errors')}">31 <g:textField name=" name" value="${personAffiliationInstance?.name}" />30 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: 'institute', 'errors')}"> 31 <g:textField name="institute" value="${personAffiliationInstance?.institute}" /> 32 32 </td> 33 33 </tr> 34 34 35 <tr class="prop"> 36 <td valign="top" class="name"> 37 <label for="name"><g:message code="personAffiliation.department.label" default="Department" /></label> 38 </td> 39 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: 'department', 'errors')}"> 40 <g:textField name="department" value="${personAffiliationInstance?.department}" /> 41 </td> 42 </tr> 35 43 </tbody> 36 44 </table> -
trunk/grails-app/views/personAffiliation/edit.gsp
r379 r442 28 28 <tr class="prop"> 29 29 <td valign="top" class="name"> 30 <label for="name"><g:message code="personAffiliation. name.label" default="Name" /></label>30 <label for="name"><g:message code="personAffiliation.institute.label" default="Institute" /></label> 31 31 </td> 32 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: ' name', 'errors')}">33 <g:textField name=" name" value="${personAffiliationInstance?.name}" />32 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: 'institute', 'errors')}"> 33 <g:textField name="institute" value="${personAffiliationInstance?.institute}" /> 34 34 </td> 35 35 </tr> 36 36 <tr class="prop"> 37 <td valign="top" class="name"> 38 <label for="name"><g:message code="personAffiliation.department.label" default="Department" /></label> 39 </td> 40 <td valign="top" class="value ${hasErrors(bean: personAffiliationInstance, field: 'department', 'errors')}"> 41 <g:textField name="department" value="${personAffiliationInstance?.department}" /> 42 </td> 43 </tr> 37 44 </tbody> 38 45 </table> -
trunk/grails-app/views/personAffiliation/list.gsp
r382 r442 19 19 <tr> 20 20 21 <g:sortableColumn property="name" title="${message(code: 'personAffiliation.name.label', default: 'Name')}" /> 21 <g:sortableColumn property="institute" title="${message(code: 'personAffiliation.institute.label', default: 'Institute')}" /> 22 <g:sortableColumn property="department" title="${message(code: 'personAffiliation.department.label', default: 'Department')}" /> 22 23 23 24 </tr> … … 27 28 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 28 29 29 <td><g:link action="show" id="${personAffiliationInstance.id}">${fieldValue(bean: personAffiliationInstance, field: " name")}</g:link></td>30 30 <td><g:link action="show" id="${personAffiliationInstance.id}">${fieldValue(bean: personAffiliationInstance, field: "institute")}</g:link></td> 31 <td>${fieldValue(bean: personAffiliationInstance, field: "department")}</td> 31 32 </tr> 32 33 </g:each> -
trunk/grails-app/views/personAffiliation/show.gsp
r379 r442 19 19 20 20 <tr class="prop"> 21 <td valign="top" class="name"><g:message code="personAffiliation. name.label" default="Name" /></td>21 <td valign="top" class="name"><g:message code="personAffiliation.institute.label" default="Institute" /></td> 22 22 23 <td valign="top" class="value">${fieldValue(bean: personAffiliationInstance, field: " name")}</td>23 <td valign="top" class="value">${fieldValue(bean: personAffiliationInstance, field: "institute")}</td> 24 24 25 25 </tr> 26 26 27 <tr class="prop"> 28 <td valign="top" class="name"><g:message code="personAffiliation.department.label" default="Department" /></td> 29 30 <td valign="top" class="value">${fieldValue(bean: personAffiliationInstance, field: "department")}</td> 31 32 </tr> 27 33 </tbody> 28 34 </table> -
trunk/grails-app/views/study/list.gsp
r389 r442 5 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 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>7 <g:set var="entityName" value="${message(code: 'study.label', default: 'Study')}" /> 8 <title><g:message code="default.list.label" args="[entityName]" /></title> 9 9 </head> 10 10 <body> … … 12 12 <g:form action="list_extended"> 13 13 14 <div class="nav">15 <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>16 <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>17 </div>18 14 <div class="body"> 19 15 <h1><g:message code="default.list.label" args="[entityName]" /></h1> … … 22 18 </g:if> 23 19 24 <g:each in="${studyInstanceList}" var="studyInstance"> 20 <div class="list"> 21 <table> 22 <thead> 23 <tr> 24 <th></th> 25 <g:sortableColumn property="title" title="${message(code: 'study.title.label', default: 'Title')}" /> 26 <th>Subjects</th> 27 <th>Events</th> 28 <th>Assays</th> 29 </tr> 30 </thead> 31 <tbody> 32 <g:each in="${studyInstanceList}" var="studyInstance" status="i" > 33 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 34 35 <td><input type="checkbox" name="${studyInstance.title}" id="${studyInstance.title}"></td> 36 37 <td><g:link action="show" id="${studyInstance.id}">${fieldValue(bean: studyInstance, field: "title")}</g:link></td> 38 39 <td> 40 <g:if test="${studyInstance.subjects.species.size()==0}"> 41 - 42 </g:if> 43 <g:else> 44 <g:each in="${studyInstance.subjects.species.unique()}" var="currentSpecies" status="j"> 45 <g:if test="${j > 0}">, </g:if> 46 <%= studyInstance.subjects.findAll { return it.species == currentSpecies; }.size() %> 47 ${currentSpecies} 48 </g:each> 49 </g:else> 50 </td> 51 52 <td> 53 <g:if test="${studyInstance.giveEventTemplates().size()==0}"> 54 - 55 </g:if> 56 <g:else> 57 ${studyInstance.giveEventTemplates().name.join( ', ' )} 58 </g:else> 59 </td> 60 61 <td> 62 <g:if test="${studyInstance.assays.size()==0}"> 63 - 64 </g:if> 65 <g:else> 66 ${studyInstance.assays.module.platform.unique().join( ', ' )} 67 </g:else> 68 </td> 69 70 </tr> 71 </g:each> 72 </tbody> 73 </table> 74 </div> 75 <div class="buttons"> 76 <span class="button"><g:link controller="wizard" class="create" action="index"><g:message code="default.new.label" args="[entityName]" /></g:link></span> 77 </div> 78 <div class="paginateButtons"> 79 <g:paginate total="${studyInstanceTotal}" prev="« Previous" next="» Next" /> 25 80 <br> 26 <table> 27 <tr> 28 <td width="50"></td> 29 <td colspan="3"> 30 <center><b>${studyInstance.title}</b></center> 31 </td> 32 </tr> 33 <tr> 34 <td> 35 36 <input type="checkbox" name="${studyInstance.title}" id="${studyInstance.title}"></td> 37 38 <td width="150"> 39 <g:link action="show" id="${studyInstance.id}"> 40 ${message(code: 'study.id.label', default: 'Id')} : 41 ${fieldValue(bean: studyInstance, field: "id")}</g:link></td> 42 43 <td width="300"> 44 <b>${message(code: 'study.template.label', default: 'Template')} </b>: 45 ${fieldValue(bean: studyInstance, field: "template")}</td> 46 47 <td > 48 <b>${message(code: 'study.subjects.label', default: 'Subjects')} </b>: 49 ${studyInstance.subjects.size()} subjects</td> 50 51 </tr> 52 <tr> 53 <td></td> 54 <td > 55 <b>${message(code: 'study.owner.label', default: 'Owner')} </b>: 56 ${fieldValue(bean: studyInstance, field: "owner")}</td> 57 58 <td > 59 <b>Assays </b>: 60 <g:each in="${studyInstance.assays}" var="assay"> 61 ${assay.name} 62 </g:each> 63 </td> 64 65 <td><b> Samples </b>: 66 <g:each in="${studyInstance.assays.samples}" var="samples"> 67 ${samples.name} 68 </g:each> 69 </td> 70 71 72 </tr> 73 <g:if test="${studyInstance.fieldExists( 'Description' )}"> 74 <tr> 75 <td></td> 76 <td colspan="3"> 77 <b>${message(code: 'study.description.label', default: 'Description')} </b>: 78 ${studyInstance.getFieldValue( 'Description' )} 79 80 </td> 81 </tr> 82 </g:if> 83 </table> 84 </g:each> 85 86 <div class="paginateButtons"> 87 <g:paginate total="${studyInstanceTotal}" /> 88 <br> 89 <INPUT TYPE=submit name=submit Value="Compare selected studies"> 81 <INPUT TYPE=submit name=submit Value="Compare selected studies"> 90 82 </div> 91 83 </div> -
trunk/grails-app/views/study/show.gsp
r421 r442 16 16 <body> 17 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 18 <div class="body"> 25 19 <h1><g:message code="default.show.label" args="[entityName]" /></h1> … … 37 31 <li><a href="#assays">Assays</a></li> 38 32 <li><a href="#persons">Persons</a></li> 33 <li><a href="#publications">Publications</a></li> 39 34 </ul> 40 35 41 36 <div id="study"> 42 37 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> 38 <table> 39 <!-- Show all template and domain fields, if filled --> 40 <g:each in="${studyInstance.giveFields()}" var="field"> 41 <g:if test="${studyInstance.getFieldValue(field.name)}"> 42 <tr> 43 <td>${field}</td> 44 <td>${studyInstance.getFieldValue(field.name)}</td> 45 </tr> 46 </g:if> 47 </g:each> 48 49 <!-- Add some extra fields --> 50 <tr> 51 <td>Events</td> 52 <td> 53 <g:if test="${studyInstance.giveEventTemplates().size()==0}"> 54 - 55 </g:if> 56 <g:else> 57 ${studyInstance.giveEventTemplates().name.join(", ")} 58 </g:else> 59 </td> 60 </tr> 61 <tr> 62 <td>Sampling events</td> 63 <td> 64 <g:if test="${studyInstance.giveSamplingEventTemplates().size()==0}"> 65 - 66 </g:if> 67 <g:else> 68 ${studyInstance.giveSamplingEventTemplates().name.join(", ")} 69 </g:else> 70 </td> 71 </tr> 72 <tr> 73 <td>Readers</td> 74 <td> 75 <g:if test="${studyInstance.readers.size()==0}"> 76 - 77 </g:if> 78 <g:else> 79 <g:each in="${studyInstance.readers}" var="r" status="i"> 80 <g:if test="${i > 0}">, </g:if> 81 <g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link> 82 </g:each> 83 </g:else> 84 </td> 85 </tr> 86 <tr> 87 <td>Editors</td> 88 <td> 89 <g:if test="${studyInstance.editors.size()==0}"> 90 - 91 </g:if> 92 <g:else> 93 <g:each in="${studyInstance.editors}" var="r" status="i"> 94 <g:if test="${i > 0}">, </g:if> 95 <g:link controller="user" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link> 96 </g:each> 97 </g:else> 98 </td> 99 </tr> 100 101 </table> 97 102 </div> 98 103 … … 100 105 <g:each in="${studyInstance.giveSubjectTemplates()}" var="template"> 101 106 <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"> 107 <thead> 115 108 <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> 109 <g:each in="${new dbnp.studycapturing.Subject().giveDomainFields()}" var="field"> 110 <th>${field}</th> 111 </g:each> 112 <g:each in="${template.fields}" var="field"> 113 <th>${field}</th> 114 </g:each> 115 </tr> 116 </thead> 117 118 <% 119 subjects = studyInstance.subjects.findAll {it.template == template}; 120 sortedSubjects = subjects.sort( { a, b -> a.name <=> b.name } as Comparator ) 121 %> 122 <g:each in="${sortedSubjects}" var="s" status="i"> 123 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 124 <g:each in="${s.giveDomainFields()}" var="field"> 125 <td>${s.getFieldValue(field.name)}</td> 126 </g:each> 127 <g:each in="${template.fields}" var="field"> 128 <td> 129 ${s.getFieldValue(field.name)} 130 </td> 123 131 </g:each> 124 132 </tr> … … 129 137 </g:each> 130 138 </div> 131 132 139 133 140 <div id="events"> … … 138 145 139 146 <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"> 147 <thead> 150 148 <tr> 151 <td><g:link controller="event" action="show" id="${event.id}">${event.id}</g:link></td> 149 <th>Start time</th> 150 <th>Duration</th> 151 <th>Type</th> 152 <th>Sampling event</th> 153 <th>Parameters</th> 154 </tr> 155 </thead> 156 157 <% 158 // Sort events by starttime and duration 159 events = studyInstance.events + studyInstance.samplingEvents; 160 sortedEvents = events.sort( { a, b -> 161 a.startTime == b.startTime ? 162 a.getDuration().toMilliseconds() <=> b.getDuration().toMilliseconds() : 163 a.startTime <=> b.startTime 164 } as Comparator ) 165 %> 166 167 <g:each in="${sortedEvents}" var="event" status="i"> 168 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 152 169 <td>${event.getPrettyDuration(studyInstance.startDate,event.startTime)}</td> 153 170 <td>${event.getPrettyDuration()}</td> … … 163 180 <td> 164 181 <g:set var="fieldCounter" value="${1}" /> 165 <g:each in="${event.give Fields()}" var="field">182 <g:each in="${event.giveTemplateFields()}" var="field"> 166 183 <g:if test="${event.getFieldValue(field.name)}"> 167 184 <g:if test="${fieldCounter > 1}">, </g:if> … … 207 224 208 225 <g:set var="fieldCounter" value="${1}" /> 209 <g:each in="${event.give Fields()}" var="field">226 <g:each in="${event.giveTemplateFields()}" var="field"> 210 227 <g:if test="${event.getFieldValue(field.name)}"> 211 228 <g:if test="${fieldCounter > 1}">, </g:if> … … 218 235 </td> 219 236 </g:each> 220 <td>${eventGroup.subjects.name.join( ', ' )}</td> 237 <td> 238 <% sortedGroupSubjects = eventGroup.subjects.sort( { a, b -> a.name <=> b.name } as Comparator ) %> 239 ${sortedGroupSubjects.name.join( ', ' )} 240 </td> 221 241 </tr> 222 242 </g:each> … … 231 251 <g:else> 232 252 <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"> 253 <thead> 242 254 <tr> 255 <th width="100">Assay Name</th> 256 <th width="100">Module</th> 257 <th>Type</th> 258 <th width="150">Platform</th> 259 <th>Url</th> 260 <th>Samples</th> 261 </tr> 262 </thead> 263 <g:each in="${studyInstance.assays}" var="assay" status="i"> 264 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 243 265 <td>${assay.name}</td> 244 266 <td>${assay.module.name}</td> … … 247 269 <td>${assay.module.url}</td> 248 270 <td> 249 <g:each in="${assay.samples}" var="assaySample"> 250 ${assaySample.name}<br> 251 </g:each> 252 </td> 271 <% sortedAssaySamples = assay.samples.sort( { a, b -> a.name <=> b.name } as Comparator ) %> 272 ${sortedAssaySamples.name.join( ', ' )} 273 </td> 253 274 </tr> 254 275 </g:each> … … 265 286 <table> 266 287 <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> 288 <thead> 289 <th>Name</th> 290 <th>Affiliations</th> 291 <th>Role</th> 292 <th>Phone</th> 293 <th>Email</th> 294 </thead> 272 295 </tr> 273 <g:each in="${studyInstance.persons}" var="studyperson" >274 <tr >296 <g:each in="${studyInstance.persons}" var="studyperson" status="i"> 297 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 275 298 <td>${studyperson.person.firstName} ${studyperson.person.prefix} ${studyperson.person.lastName}</td> 276 299 <td> 277 ${studyperson.person.affiliations. name.join(', ')}300 ${studyperson.person.affiliations.join(', ')} 278 301 </td> 279 302 <td>${studyperson.role.name}</td> … … 285 308 </g:else> 286 309 </div> 310 311 <div id="publications"> 312 <g:if test="${studyInstance.publications.size()==0}"> 313 No publications attached to this study 314 </g:if> 315 <g:else> 316 <table> 317 <tr> 318 <thead> 319 <th>Title</th> 320 <th>Authors</th> 321 <th>Comments</th> 322 </thead> 323 </tr> 324 <g:each in="${studyInstance.publications}" var="publication" status="i"> 325 <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> 326 <td>${publication.title}</td> 327 <td> 328 ${publication.authorlist} 329 </td> 330 <td>${publication.comment}</td> 331 </tr> 332 </g:each> 333 </table> 334 </g:else> 335 </div> 336 287 337 </div> 288 338 </div> … … 293 343 <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span> 294 344 <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> 345 <span class="button"><g:link class="backToList" action="list">Back to list</g:link></span> 295 346 </g:form> 296 347 </div>
Note: See TracChangeset
for help on using the changeset viewer.