source: trunk/grails-app/views/wizard/pages/_subjects.gsp @ 512

Last change on this file since 512 was 469, checked in by duh, 12 years ago
  • bugfix #59, #60 & #61 --> all related to eachother
  • refactored internal handling of storing, adding and deleting of subjects
  • Property svn:keywords set to Date Author Rev
File size: 4.0 KB
Line 
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: 469 $
13 * $Author: duh $
14 * $Date: 2010-05-26 10:10:54 +0000 (wo, 26 mei 2010) $
15 */
16%>
17<wizard:pageContent>
18        <span class="info">
19                <span class="title">Add subjects to your study</span>
20                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).
21                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.
22                As multiple species may be studied within one study, there is no hard link between the template and the species.
23                <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>
24                <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>         
25        </span>
26
27        <wizard:textFieldElement name="addNumber" description="Number of subjects to add" error="addNumber" value="1" size="4" maxlength="4">
28                The number of subjects to add to your study
29        </wizard:textFieldElement>
30        <wizard:termElement name="species" description="of species" value="" ontologies="1132">
31                The species of the subjects you would like to add to your study
32        </wizard:termElement>
33        <wizard:templateElement name="template" description="with template" value="" error="template" entity="${dbnp.studycapturing.Subject}" >
34                The template to use for these subjects
35        </wizard:templateElement>
36        <wizard:ajaxButtonElement name="add" value="Add" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" afterSuccess="onWizardPage()">
37        </wizard:ajaxButtonElement>
38
39
40<g:if test="${subjects}">
41        <g:each var="sTemplate" in="${subjectTemplates}">
42                <g:set var="showHeader" value="${true}" />
43                <g:set var="subjectTemplate" value="${sTemplate.getValue()}" />
44                <h1>${subjectTemplate.name} template</h1>
45                <div class="table">
46                <g:each status="i" var="sId" in="${subjectTemplate.subjects}">
47                  <g:set var="subjectId" value="${sId.getValue()}" />
48                  <g:if test="${subjects[ subjectId ]}">
49                        <g:if test="${showHeader}">
50                        <g:set var="showHeader" value="${false}" />
51                        <div class="header">
52                                <div class="firstColumn">#</div>
53                                <div class="firstColumn"></div>
54                                <wizard:templateColumnHeaders entity="${subjects[ subjectId ]}" class="column" />                               
55                        </div>
56                        </g:if>
57                        <div class="row">
58                                <div class="firstColumn">${subjectId + 1}</div>
59                                <div class="firstColumn">
60                                        <wizard:ajaxButton name="delete" src="../images/icons/famfamfam/delete.png" alt="delete this subject" class="famfamfam" value="-" url="[controller:'wizard',action:'pages']" update="[success:'wizardPage',failure:'wizardError']" before="\$(\'input[name=do]\').val(${subjectId});" afterSuccess="onWizardPage()" />
61                                </div>
62                                <wizard:templateColumns id="${subjectId}" entity="${subjects[ subjectId ]}" template="${subjects[ subjectId ].template}" name="subject_${subjectId}" class="column" subject="${subjects[ subjectId ]}" />
63                        </div>
64                  </g:if>
65                </g:each>
66                </div>
67                <div class="sliderContainer">
68                        <div class="slider" ></div>
69                </div>
70        </g:each>
71</g:if>
72
73        <g:if env="development">
74        <span class="info">
75                <span class="known">Known issues</span>
76                <ul>
77                        <li>autocomplete fields (like ontologies) deselect the selected rows and hence don't replicate</li>
78                        <li>ontology fields should replicate value <i>and</i> hidden fields</li>
79                        <li>ontology hidden fields should be processed by the back-end as well (not yet implemented)</li>
80                        <li>ontology fields now show suggestions for <i>all</i> available ontologies. This has to be narrowed down in the future.</li>
81                        <li>ontology hidden fields should be handled by the taglibrary / controller as well</li>
82                </ul>
83        </span>
84        </g:if>
85
86</wizard:pageContent>
Note: See TracBrowser for help on using the repository browser.