source: trunk/grails-app/views/simpleWizard/simpleWizard/columns.gsp @ 1609

Last change on this file since 1609 was 1609, checked in by robert@…, 12 years ago

Improved simple editing wizard

File size: 3.2 KB
Line 
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>Columns</h1>
12               
13                <g:if test="${error}">
14                        <div class="errormessage">
15                                ${error.toString().encodeAsHTML()}
16                        </div>
17                </g:if>
18                <g:if test="${message}">
19                        <div class="message">
20                                ${message.toString().encodeAsHTML()}
21                        </div>
22                </g:if>                 
23       
24                <g:form class="simpleWizard" name="columns" action="simpleWizard">
25                        <input type="hidden" name="_eventId" value="refresh" />
26       
27                        <span class="info">
28                                <span class="title">Assign properties to columns</span>
29                                You uploaded: ${excel.filename}. This list shows the first ${excel.data.dataMatrix?.size()} rows of the uploaded file for reference.
30                                Please match the columns from the excel file with the fields in the database.
31                        </span>
32                           
33                        <div class="importcolumns">
34                                <table>
35                                        <thead>
36                                                <tr>
37                                                        <g:each in="${excel.data.header}" var="header">
38                                                                <th>${header.name}</th>
39                                                        </g:each>
40                                                </tr>
41                                        </thead>
42                                        <tr class="matchWith">
43                                                <g:each in="${excel.data.header}" var="mappingcolumn" status="i">
44                                                        <%
45                                                                def selectedValue;
46                                                                if( mappingcolumn.entityclass?.name && mappingcolumn.property )
47                                                                        selectedValue = mappingcolumn.entityclass.name[ mappingcolumn.entityclass.name.lastIndexOf( "." ) + 1 .. -1 ] + "||"  + mappingcolumn.property;
48                                                        %>
49                                                        <td>
50                                                                <g:set var="selected" value="${mappingcolumn.property}"/>
51                                                                <% /* Put a select box with template fields of multiple entities */ %>
52                                                                <select name="matches.index.${mappingcolumn.index}" style="font-size: 10px;">
53                                                                        <option value="dontimport">Don't import</option>
54                                                                        <g:each in="${sampleForm.template}" var="entityTemplates">
55                                                                                <g:if test="${entityTemplates.value}">
56                                                                                        <optgroup label="${entityTemplates.key}">
57                                                                                                <%
58                                                                                                        def allFields = [] + domainFields[ entityTemplates.key ] + entityTemplates.value?.fields;
59                                                                                                %>
60                                                                                                <g:each in="${allFields}" var="field">
61                                                                                                        <g:if test="${field}">
62                                                                                                                <%
63                                                                                                                        def value = entityTemplates.key + "||" + field.name
64                                                                                                                        def selected = ( value == selectedValue );
65                                                                                                                %>
66                                                                                                                <option value="${value}" <g:if test="${selected}">selected="selected"</g:if>>
67                                                                                                                        ${field.name} <g:if test="${field.preferredIdentifier}">[identifier]</g:if>
68                                                                                                                </option>
69                                                                                                        </g:if>
70                                                                                                       
71                                                                                                </g:each>
72                                                                                        </optgroup>
73                                                                                </g:if>
74                                                                        </g:each>
75                                                                </select>
76                                                        </td>
77                                                </g:each>
78                                        </tr>
79                                        <g:each in="${excel.data.dataMatrix}" var="exampleRow">
80                                                <tr class="example">
81                                                        <g:each in="${exampleRow}" var="exampleCell">
82                                                                <td>
83                                                                        ${exampleCell}
84                                                                </td>
85                                                        </g:each>
86                                                </tr>
87                                        </g:each>
88                                </table>
89                        </div>
90                </g:form>
91                       
92                <p class="options">
93                        <a href="#" onClick="submitForm( 'columns', 'previous' ); return false;" class="previous">Previous</a>
94                        <a href="#" onClick="submitForm( 'columns', 'next' ); return false;" class="next">Next</a>
95                </p>
96        </div>
97</body>
98</html>
Note: See TracBrowser for help on using the repository browser.