1 | <% |
---|
2 | /** |
---|
3 | * Subjects page |
---|
4 | * |
---|
5 | * @author Jeroen Wesbeek |
---|
6 | * @since 20100113 |
---|
7 | * @package wizard |
---|
8 | * @see dbnp.studycapturing.WizardTagLib::previousNext |
---|
9 | * @see dbnp.studycapturing.WizardController |
---|
10 | * |
---|
11 | * Revision information: |
---|
12 | * $Rev: 1791 $ |
---|
13 | * $Author: work@osx.eu $ |
---|
14 | * $Date: 2011-04-27 10:10:16 +0000 (wo, 27 apr 2011) $ |
---|
15 | */ |
---|
16 | |
---|
17 | def speciesOntologies = dbnp.studycapturing.Subject.giveDomainFields().find { it.name == 'species' }.ontologies.collect { it.ncboId } |
---|
18 | %> |
---|
19 | <af:page> |
---|
20 | <span class="info"> |
---|
21 | <span class="title">Add subjects to your study</span> |
---|
22 | Describe the subjects studied with all details available. Use the template that contains the necessary fields. New templates can be defined (based on existing templates). |
---|
23 | To add subjects to the study, select the correct species and template, input the number of subjects you want to add, and click 'Add'. They will appear below the 'Add' button. |
---|
24 | As multiple species may be studied within one study, there is no hard link between the template and the species. |
---|
25 | <br/><i>Note that you can edit multiple subjects at once by selecting multiple rows by either ctrl-clicking them or dragging a selection over them in the space between the fields.</i> |
---|
26 | <br/><i>Note that depending on the size of your browser window and the template, additional fields can be reached by the slider at the bottom of the page.</i> |
---|
27 | </span> |
---|
28 | |
---|
29 | <af:textFieldElement name="addNumber" description="Number of subjects to add" error="addNumber" value="${values?.addNumber}" size="4" maxlength="4"> |
---|
30 | The number of subjects to add to your study |
---|
31 | </af:textFieldElement> |
---|
32 | <af:termElement name="species" description="of species" value="${values?.species}" ontologies="1132" addDummy="true"> |
---|
33 | The species of the subjects you would like to add to your study |
---|
34 | </af:termElement> |
---|
35 | <af:templateElement name="template" description="with template" value="${values?.template}" error="template" entity="${dbnp.studycapturing.Subject}" ontologies="${speciesOntologies.join( ',' )}" addDummy="true"> |
---|
36 | The template to use for these subjects |
---|
37 | </af:templateElement> |
---|
38 | <af:ajaxButtonElement name="add" value="Add" afterSuccess="onPage()"> |
---|
39 | </af:ajaxButtonElement> |
---|
40 | |
---|
41 | <g:if test="${study.subjects}"> |
---|
42 | <g:each var="template" in="${study.giveSubjectTemplates()}"> |
---|
43 | <g:set var="showHeader" value="${true}" /> |
---|
44 | <h1>${template} template</h1> |
---|
45 | <div class="tableEditor"> |
---|
46 | <g:each var="subject" status="s" in="${study.giveSubjectsForTemplate(template)}"> |
---|
47 | <g:if test="${showHeader}"> |
---|
48 | <g:set var="showHeader" value="${false}" /> |
---|
49 | <div class="header"> |
---|
50 | <div class="firstColumn"></div> |
---|
51 | <af:templateColumnHeaders class="column" entity="${subject}" columnWidths="[Name:200, Species: 150]" /> |
---|
52 | </div> |
---|
53 | </g:if> |
---|
54 | <div class="row"> |
---|
55 | <div class="firstColumn"> |
---|
56 | <af:ajaxButton name="delete" src="${resource(dir: 'images/icons', file: 'delete.png', plugin: 'famfamfam')}" alt="delete this subject" class="famfamfam" value="-" before="\$(\'input[name=do]\').val(${subject.getIdentifier()});" afterSuccess="onPage()" /> |
---|
57 | </div> |
---|
58 | <af:templateColumns class="column" entity="${subject}" name="subject_${subject.getIdentifier()}" /> |
---|
59 | </div> |
---|
60 | </g:each> |
---|
61 | </div> |
---|
62 | <div class="sliderContainer"> |
---|
63 | <div class="slider" ></div> |
---|
64 | </div> |
---|
65 | </g:each> |
---|
66 | </g:if> |
---|
67 | </af:page> |
---|