1 | <%@ page import="org.dbnp.gdt.GdtService" %> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
---|
5 | <meta name="layout" content="main"/> |
---|
6 | <title>Simple study wizard</title> |
---|
7 | |
---|
8 | <g:render template="javascripts" /> |
---|
9 | |
---|
10 | </head> |
---|
11 | <body> |
---|
12 | <div class="simpleWizard samplespage"> |
---|
13 | <h1>Study data</h1> |
---|
14 | |
---|
15 | <g:if test="${flash.error}"> |
---|
16 | <div class="errormessage"> |
---|
17 | ${flash.error.toString().encodeAsHTML()} |
---|
18 | </div> |
---|
19 | </g:if> |
---|
20 | <g:if test="${flash.message}"> |
---|
21 | <div class="message"> |
---|
22 | ${flash.message.toString().encodeAsHTML()} |
---|
23 | </div> |
---|
24 | </g:if> |
---|
25 | |
---|
26 | <g:form class="simpleWizard" name="samples" action="simpleWizard"> |
---|
27 | <input type="hidden" name="_eventId" value="refresh" /> |
---|
28 | |
---|
29 | <div id="samplesDialog"> |
---|
30 | <span class="info"> |
---|
31 | <span class="title">Import study data</span> |
---|
32 | You can import your Excel data to the server by choosing a file from your local harddisk in the form below. The excel sheet should contain |
---|
33 | data on the first sheet, and the sheet should contain one row with headers. |
---|
34 | </span> |
---|
35 | |
---|
36 | <table border="0"> |
---|
37 | <tr> |
---|
38 | <td width="30%"> |
---|
39 | Choose your Excel file to import: |
---|
40 | </td> |
---|
41 | <td width="25%"> |
---|
42 | <af:fileField name="importfile" value="${sampleForm?.importFile}"/> |
---|
43 | </td> |
---|
44 | <td width="40%"></td> |
---|
45 | </tr> |
---|
46 | <tr> |
---|
47 | <td> |
---|
48 | <div id="datatemplate">Choose type of sample template:</div> |
---|
49 | </td> |
---|
50 | <td> |
---|
51 | <% /* The select is written manually, since the grails select tag can't handle option titles */ %> |
---|
52 | <select rel="template" entity="${encodedEntity.Sample}" onChange="showTemplateDescription( 'templateDescription_sample', $( 'option:selected', $(this) ).attr( 'title' ) ); " name="sample_template_id"> |
---|
53 | <g:each in="${templates.Sample}" var="templ"> |
---|
54 | <option |
---|
55 | value="${templ.id}" |
---|
56 | <g:if test="${templ.id == sampleForm?.templateId?.Sample}">selected="selected"</g:if> |
---|
57 | title="${templ.description?.encodeAsHTML()}" |
---|
58 | >${templ.name?.encodeAsHTML()}</option> |
---|
59 | </g:each> |
---|
60 | </select> |
---|
61 | </td> |
---|
62 | <td> |
---|
63 | <% |
---|
64 | def sampleTemplate = sampleForm?.template?.Sample ?: templates.Sample?.getAt(0) |
---|
65 | def sampleTemplateDescription = sampleTemplate?.description |
---|
66 | %> |
---|
67 | <div class="templatedescription" id="templateDescription_sample" <g:if test="${!sampleTemplateDescription}">style="display: none;"</g:if>> |
---|
68 | ${sampleTemplateDescription?.encodeAsHTML()} |
---|
69 | </div> |
---|
70 | </td> |
---|
71 | </tr> |
---|
72 | <tr> |
---|
73 | <td> |
---|
74 | <div id="datatemplate">Choose type of subject template:</div> |
---|
75 | </td> |
---|
76 | <td> |
---|
77 | <% /* The select is written manually, since the grails select tag can't handle option titles */ %> |
---|
78 | <select rel="template" entity="${encodedEntity.Subject}" onChange="showTemplateDescription( 'templateDescription_subject', $( 'option:selected', $(this) ).attr( 'title' ) ); " name="subject_template_id"> |
---|
79 | <option value="">- no subject template -</option> |
---|
80 | <g:each in="${templates.Subject}" var="templ"> |
---|
81 | <option |
---|
82 | value="${templ.id}" |
---|
83 | <g:if test="${templ.id == sampleForm?.templateId?.Subject}">selected="selected"</g:if> |
---|
84 | title="${templ.description?.encodeAsHTML()}" |
---|
85 | >${templ.name?.encodeAsHTML()}</option> |
---|
86 | </g:each> |
---|
87 | </select> |
---|
88 | </td> |
---|
89 | <td> |
---|
90 | <% |
---|
91 | def subjectTemplateDescription = sampleForm?.template?.Subject?.description |
---|
92 | %> |
---|
93 | <div class="templatedescription" id="templateDescription_subject" <g:if test="${!subjectTemplateDescription}">style="display: none;"</g:if>> |
---|
94 | ${subjectTemplateDescription?.encodeAsHTML()} |
---|
95 | </div> |
---|
96 | </td> |
---|
97 | </tr> |
---|
98 | <tr> |
---|
99 | <td> |
---|
100 | <div id="datatemplate">Choose type of event template:</div> |
---|
101 | </td> |
---|
102 | <td> |
---|
103 | <% /* The select is written manually, since the grails select tag can't handle option titles */ %> |
---|
104 | <select rel="template" entity="${encodedEntity.Event}" onChange="showTemplateDescription( 'templateDescription_event', $( 'option:selected', $(this) ).attr( 'title' ) ); " name="event_template_id"> |
---|
105 | <option value="">- no event template -</option> |
---|
106 | <g:each in="${templates.Event}" var="templ"> |
---|
107 | <option |
---|
108 | value="${templ.id}" |
---|
109 | <g:if test="${templ.id == sampleForm?.templateId?.Event}">selected="selected"</g:if> |
---|
110 | title="${templ.description?.encodeAsHTML()}" |
---|
111 | >${templ.name?.encodeAsHTML()}</option> |
---|
112 | </g:each> |
---|
113 | </select> |
---|
114 | </td> |
---|
115 | <td> |
---|
116 | <% |
---|
117 | def eventTemplateDescription = sampleForm?.template?.Event?.description |
---|
118 | %> |
---|
119 | <div class="templatedescription" id="templateDescription_event" <g:if test="${!eventTemplateDescription}">style="display: none;"</g:if>> |
---|
120 | ${eventTemplateDescription?.encodeAsHTML()} |
---|
121 | </div> |
---|
122 | </td> |
---|
123 | </tr> |
---|
124 | <tr> |
---|
125 | <td> |
---|
126 | <div id="datatemplate">Choose type of sampling event template:</div> |
---|
127 | </td> |
---|
128 | <td> |
---|
129 | <% /* The select is written manually, since the grails select tag can't handle option titles */ %> |
---|
130 | <select rel="template" entity="${encodedEntity.SamplingEvent}" onChange="showTemplateDescription( 'templateDescription_samplingEvent', $( 'option:selected', $(this) ).attr( 'title' ) ); " name="samplingEvent_template_id"> |
---|
131 | <option value="">- no sampling event template -</option> |
---|
132 | <g:each in="${templates.SamplingEvent}" var="templ"> |
---|
133 | <option |
---|
134 | value="${templ.id}" |
---|
135 | <g:if test="${templ.id == sampleForm?.templateId?.SamplingEvent}">selected="selected"</g:if> |
---|
136 | title="${templ.description?.encodeAsHTML()}" |
---|
137 | >${templ.name?.encodeAsHTML()}</option> |
---|
138 | </g:each> |
---|
139 | </select> |
---|
140 | </td> |
---|
141 | <td> |
---|
142 | <% |
---|
143 | def samplingEventTemplateDescription = sampleForm?.template?.SamplingEvent?.description |
---|
144 | %> |
---|
145 | <div class="templatedescription" id="templateDescription_samplingEvent" <g:if test="${!samplingEventTemplateDescription}">style="display: none;"</g:if>> |
---|
146 | ${samplingEventTemplateDescription?.encodeAsHTML()} |
---|
147 | </div> |
---|
148 | </td> |
---|
149 | </tr> |
---|
150 | </table> |
---|
151 | </div> |
---|
152 | |
---|
153 | </g:form> |
---|
154 | |
---|
155 | <p class="options"> |
---|
156 | <a href="#" onClick="submitForm( 'samples', 'previous' ); return false;" class="previous">Previous</a> |
---|
157 | <a href="#" onClick="submitForm( 'samples', 'next' ); return false;" class="next">Next</a> |
---|
158 | <a class="skip" href="#" onClick="submitForm( 'samples', 'skip' ); return false;">Skip</a> |
---|
159 | </p> |
---|
160 | </div> |
---|
161 | |
---|
162 | </body> |
---|
163 | </html> |
---|