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 | <g:if test="${templateData.template.fields?.size() > 0}"> |
---|
32 | <ol class="fields"> |
---|
33 | <g:each in="${templateData.template.fields}" var="field"> |
---|
34 | <li>${field.name} (<g:if test="${field.unit}">${field.unit}, </g:if>${field.type})</li> |
---|
35 | </g:each> |
---|
36 | </ol> |
---|
37 | </g:if> |
---|
38 | <g:else> |
---|
39 | (no fields) |
---|
40 | </g:else> |
---|
41 | </td> |
---|
42 | <td> |
---|
43 | <g:if test="${templateData.alternatives.size() > 0}"> |
---|
44 | <ul> |
---|
45 | <g:each in="${templateData.alternatives}" var="alternative"> |
---|
46 | <li>${alternative.name}</li> |
---|
47 | </g:each> |
---|
48 | </ul> |
---|
49 | </g:if> |
---|
50 | <g:else> |
---|
51 | No alternatives found |
---|
52 | </g:else> |
---|
53 | </td> |
---|
54 | </g:if> |
---|
55 | <g:else> |
---|
56 | <td></td> |
---|
57 | <td class="error">${templateData.error}</td> |
---|
58 | <td colspan="2"></td> |
---|
59 | </g:else> |
---|
60 | </tr> |
---|
61 | </g:each> |
---|
62 | </table> |
---|
63 | <input type="submit" /> |
---|
64 | </form> |
---|
65 | </g:if> |
---|
66 | <g:else> |
---|
67 | No correctly formatted templates found in the XML file. Please use the export functionality to create XML files. |
---|
68 | </g:else> |
---|
69 | </body> |
---|
70 | </html> |
---|