source: trunk/grails-app/views/template/handleImportedFile.gsp @ 1257

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

Added an export and import functionality for templates, as described in ticket #76

File size: 2.3 KB
Line 
1<%@ page contentType="text/html;charset=UTF-8" %>
2
3<html>
4  <head>
5        <meta name="layout" content="main"/>
6    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7        <link rel="stylesheet" href="${resource(dir: 'css', file: 'templateEditor.css')}" />
8    <title>Select templates to import</title>
9  </head>
10  <body>
11    <h1>Select templates to import</h1>
12        <g:if test="${templates?.size() > 0}">
13          <form method="post" action="<g:createLink action="saveImportedTemplates" />">
14                <table id="importTemplates">
15                  <thead>
16                        <tr>
17                          <th></th><th>Templates in file</th><th>Fields</th><th>Alternative (equal) templates</th>
18                        </tr>
19                  </thead>
20                  <g:each in="${templates}" var="templateData" status="i">
21                        <tr class="${ i % 2 == 0 ? 'even' : 'odd'}">
22                          <g:if test="${!templateData.error}">
23                                <td><input type="checkbox" name="selectedTemplate" <g:if test="${templateData.alternatives == null || templateData.alternatives.size() == 0}">checked="checked"</g:if> value="${templateData.key}" /></td>
24                                <td>
25                                  <h3>${templateData.template.name} <a href="#" onClick="$(this).parent().hide(); $('.otherTemplateName', $(this).parent().parent()).show()">(change)</a></h3>
26                                  <span class="otherTemplateName"><g:textField name="templateNames_${templateData.key}" value="${templateData.template.name}" /></span>
27                                  <p>${templateData.template.entity?.getName()}</p>
28                                  <p>${templateData.template.description}</p>
29                                </td>
30                                <td>
31                                  <ol class="fields">
32                                        <g:each in="${templateData.template.fields}" var="field">
33                                          <li>${field.name} (<g:if test="${field.unit}">${field.unit}, </g:if>${field.type})</li>
34                                        </g:each>
35                                  </ol>
36                                </td>
37                                <td>
38                                  <g:if test="${templateData.alternatives.size() > 0}">
39                                        <ul>
40                                          <g:each in="${templateData.alternatives}" var="alternative">
41                                                  <li>${alternative.name}</li>
42                                          </g:each>
43                                        </ul>
44                                  </g:if>
45                                  <g:else>
46                                        No alternatives found
47                                  </g:else>
48                                </td>
49                          </g:if>
50                          <g:else>
51                                <td></td>
52                                <td class="error">${templateData.error}</td>
53                                <td colspan="2"></td>
54                          </g:else>
55                        </tr>
56                  </g:each>
57                </table>
58                <input type="submit" />
59          </form>
60        </g:if>
61        <g:else>
62          No correctly formatted templates found in the XML file. Please use the export functionality to create XML files.
63        </g:else>
64  </body>
65</html>
Note: See TracBrowser for help on using the repository browser.