Show
Ignore:
Timestamp:
05-03-10 15:21:52 (4 years ago)
Author:
duh
Message:

Refectored version of the wizard

- initial template page has been removed, now is a generic 'start' page where one (in the future) may create a new study, or load and modify an already stored study
- study page incorporates study template select element, but does not yet incorporate the study template fields
- subjects page now allows creation of subjects based on a template. This change also implied the study page altogether had to change into a seperate table entity. Now the the page lists as many tables as unique templates have been selected. These tables contain all subjects that were added using that particular template. NOTE: data is not stored yet, due to the fact that templateEntity does not work properly yey (key/value pairs need to be set correctly when calling the setTemplate method)
- the JavaScript? now handles multiple tables in a page as well, and automatically initializes any underlying slider div if that is required

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/wizard/pages/_subjects.gsp

    r213 r238  
    2525        subjects of species 
    2626        <wizard:speciesSelect name="addSpecies" /> 
     27        using the 
     28        <wizard:templateSelect name="template" description="Template" value="${study?.template}" entity="${dbnp.studycapturing.Subject}" /> 
     29        template 
     30 
    2731<g:if test="${subjects}"> 
    28         <div class="table"> 
    29                 <div class="header"> 
    30                         <div class="firstColumn">#</div> 
    31                         <div class="column">name</div> 
    32                         <div class="column">species</div> 
    33                         <wizard:templateColumnHeaders template="${study.template}" class="column" /> 
     32        <g:each var="subjectTemplate" in="${subjectTemplates}"> 
     33                <h1>${subjectTemplate.getValue().name} template</h1> 
     34                <div class="table"> 
     35                        <div class="header"> 
     36                                <div class="firstColumn">#</div> 
     37                                <div class="column">name</div> 
     38                                <div class="column">species</div> 
     39                                <wizard:templateColumnHeaders template="${subjectTemplate.getValue().template}" class="column" /> 
     40                        </div>   
     41                <g:each var="subjectId" in="${subjectTemplate.getValue().subjects}"> 
     42                        <div class="row"> 
     43                                <div class="firstColumn">${subjectId}</div> 
     44                                <div class="column"><g:textField name="subject_${subjectId}_name" value="${subjects[ subjectId ].name}" size="12" maxlength="12" /></div> 
     45                                <div class="column"> 
     46                                        <wizard:speciesSelect value="${subjects[ subjectId ].species}" name="subject_${subjectId}_species" /> 
     47                                </div> 
     48                                <wizard:templateColumns id="${subjectId}" template="${subjects[ subjectId ].template}" name="subject_${subjectId}" class="column" subject="${subjects[ subjectId ]}" />                          
     49                        </div> 
     50                </g:each> 
    3451                </div> 
    35         <g:each var="subject" status="i" in="${subjects}"> 
    36                 <div class="row"> 
    37                         <div class="firstColumn">${i}</div> 
    38                         <div class="column"><g:textField name="subject_${i}_name" value="${subject.name}" size="12" maxlength="12" /></div> 
    39                         <div class="column"> 
    40                                 <wizard:speciesSelect value="${subject.species}" name="subject_${i}_species" /> 
    41                         </div> 
    42                         <wizard:templateColumns id="${i}" template="${study.template}" name="subject_${i}" class="column" subject="${subject}" /> 
     52                <div class="sliderContainer"> 
     53                        <div class="slider" ></div> 
    4354                </div> 
    4455        </g:each> 
    45         </div> 
    46         <div class="sliderContainer"> 
    47                 <div class="slider"/> 
    48         </div> 
    4956</g:if> 
     57 
    5058</wizard:pageContent>