1 | <html> |
---|
2 | <head> |
---|
3 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> |
---|
4 | <meta name="layout" content="main"/> |
---|
5 | <title>Simple study wizard</title> |
---|
6 | |
---|
7 | <g:render template="javascripts" /> |
---|
8 | </head> |
---|
9 | <body> |
---|
10 | <div class="simpleWizard"> |
---|
11 | <h1> |
---|
12 | Imported file |
---|
13 | <span class="stepNumber">(step 2 of 4)</span> |
---|
14 | </h1> |
---|
15 | |
---|
16 | <g:if test="${error}"> |
---|
17 | <div class="errormessage"> |
---|
18 | ${error.toString().encodeAsHTML()} |
---|
19 | </div> |
---|
20 | </g:if> |
---|
21 | <g:if test="${message}"> |
---|
22 | <div class="message"> |
---|
23 | ${message.toString().encodeAsHTML()} |
---|
24 | </div> |
---|
25 | </g:if> |
---|
26 | |
---|
27 | <g:form class="simpleWizard" name="columns" action="simpleWizard"> |
---|
28 | <input type="hidden" name="_eventId" value="refresh" /> |
---|
29 | |
---|
30 | <span class="info"> |
---|
31 | <span class="title">Assign columns to template fields</span> |
---|
32 | You uploaded: ${excel.filename}. This list shows the first ${excel.data.dataMatrix?.size()} rows of the uploaded file for reference. |
---|
33 | Please match the columns from the excel file with the fields in the database. |
---|
34 | </span> |
---|
35 | <g:if test="${excel.numDataRows > 300}"> |
---|
36 | <span class="info"> |
---|
37 | <span class="error" style="background-position: 0 50%;">Many samples in excel file</span> |
---|
38 | Your uploaded excel file contains more than 300 samples. This wizard might become less responsive when importing that many samples, but |
---|
39 | will still be working properly.<br /> |
---|
40 | Please be patient when importing the data and saving your study. |
---|
41 | </span> |
---|
42 | </g:if> |
---|
43 | |
---|
44 | <div class="importcolumns"> |
---|
45 | <table cellspacing="0"> |
---|
46 | <tr class="headerrow"> |
---|
47 | <td nowrap class="explanation">Excel columns</td> |
---|
48 | <g:each in="${excel.data.header}" var="header"> |
---|
49 | <th>${header.name}</th> |
---|
50 | </g:each> |
---|
51 | </tr> |
---|
52 | <g:each in="${excel.data.dataMatrix}" var="exampleRow" status="i"> |
---|
53 | <tr class="example"> |
---|
54 | <g:if test="${i == 0}"> |
---|
55 | <td nowrap class="explanation">Example data</td> |
---|
56 | </g:if> |
---|
57 | <g:else> |
---|
58 | <td class="explanation"></td> |
---|
59 | </g:else> |
---|
60 | <g:each in="${exampleRow}" var="exampleCell"> |
---|
61 | <td class="exampleCell"><div> |
---|
62 | ${exampleCell} |
---|
63 | </div> |
---|
64 | </td> |
---|
65 | </g:each> |
---|
66 | </tr> |
---|
67 | </g:each> |
---|
68 | |
---|
69 | <tr class="matchWith"> |
---|
70 | <td nowrap class="explanation">Template field</td> |
---|
71 | |
---|
72 | <g:each in="${excel.data.header}" var="mappingcolumn" status="i"> |
---|
73 | <% |
---|
74 | def selectedValue; |
---|
75 | if( mappingcolumn.entityclass?.name && mappingcolumn.property ) |
---|
76 | selectedValue = mappingcolumn.entityclass.name[ mappingcolumn.entityclass.name.lastIndexOf( "." ) + 1 .. -1 ] + "||" + mappingcolumn.property; |
---|
77 | %> |
---|
78 | <td> |
---|
79 | <g:set var="selected" value="${mappingcolumn.property}"/> |
---|
80 | <% /* Put a select box with template fields of multiple entities */ %> |
---|
81 | <select name="matches.index.${mappingcolumn.index}" style="font-size: 10px;"> |
---|
82 | <option value="dontimport">Don't import</option> |
---|
83 | <g:each in="${sampleForm.template}" var="entityTemplates"> |
---|
84 | <g:if test="${entityTemplates.value}"> |
---|
85 | <optgroup label="${entityTemplates.key}"> |
---|
86 | <% |
---|
87 | def allFields = [] + domainFields[ entityTemplates.key ] + entityTemplates.value?.fields; |
---|
88 | %> |
---|
89 | <g:each in="${allFields}" var="field"> |
---|
90 | <g:if test="${field}"> |
---|
91 | <% |
---|
92 | def value = entityTemplates.key + "||" + field.name |
---|
93 | def selected = ( value == selectedValue ); |
---|
94 | %> |
---|
95 | <option value="${value}" <g:if test="${selected}">selected="selected"</g:if>> |
---|
96 | ${field.name} <g:if test="${field.preferredIdentifier}">[identifier]</g:if> |
---|
97 | </option> |
---|
98 | </g:if> |
---|
99 | |
---|
100 | </g:each> |
---|
101 | </optgroup> |
---|
102 | </g:if> |
---|
103 | </g:each> |
---|
104 | </select> |
---|
105 | </td> |
---|
106 | </g:each> |
---|
107 | </tr> |
---|
108 | |
---|
109 | </table> |
---|
110 | </div> |
---|
111 | |
---|
112 | <p> |
---|
113 | <input type="checkbox" name="editAfterwards" value="1" /> Edit data after importing |
---|
114 | </p> |
---|
115 | </g:form> |
---|
116 | |
---|
117 | <p class="options"> |
---|
118 | <a href="#" onClick="submitForm( 'columns', 'previous' ); return false;" class="previous">Previous</a> |
---|
119 | <a href="#" onClick="submitForm( 'columns', 'next' ); return false;" class="next">Next</a> |
---|
120 | </p> |
---|
121 | </div> |
---|
122 | </body> |
---|
123 | </html> |
---|