source: trunk/grails-app/views/simpleWizard/simpleWizard/samples.gsp

Last change on this file was 1685, checked in by robert@…, 13 years ago

Save buttons in simple wizard

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