1 | <% |
---|
2 | /** |
---|
3 | * Template Editor overview template |
---|
4 | * |
---|
5 | * @author Jeroen Wesbeek |
---|
6 | * @since 20100422 |
---|
7 | * @package wizard |
---|
8 | * @see dbnp.studycapturing.TemplateEditorController |
---|
9 | * |
---|
10 | * Revision information: |
---|
11 | * $Rev: 428 $ |
---|
12 | * $Author: duh $ |
---|
13 | * $Date: 2010-05-18 11:09:55 +0200 (di, 18 mei 2010) $ |
---|
14 | */ |
---|
15 | %> |
---|
16 | <%@ page contentType="text/html;charset=UTF-8" %> |
---|
17 | <html> |
---|
18 | <head> |
---|
19 | <meta name="layout" content="dialog"/> |
---|
20 | <title>template editor</title> |
---|
21 | <script src="${createLinkTo(dir: 'js', file: 'templateEditor.js')}" type="text/javascript"></script> |
---|
22 | <link rel="stylesheet" href="${createLinkTo(dir: 'css', file: 'templateEditor.css')}" /> |
---|
23 | </head> |
---|
24 | <body> |
---|
25 | |
---|
26 | <div class="templateEditorStep" id="step1_template"> |
---|
27 | <h3>Select template</h3> |
---|
28 | <p>Showing templates for <b>${humanReadableEntity}</b>.</p> |
---|
29 | <p>Please select a template to edit or create a new template</p> |
---|
30 | |
---|
31 | <ul id="templates"> |
---|
32 | <li class="empty ui-state-default" <g:if test="${templates.size() > 0 }">style='display: none;'</g:if>>There are no templates for ${humanReadableEntity}. Use the 'Add template' button to add fields.</li> |
---|
33 | <g:each in="${templates}" var="currentTemplate"> |
---|
34 | <li id="template_${currentTemplate.id}"class="ui-state-default"> |
---|
35 | <g:if test="${currentTemplate.inUse()}"> |
---|
36 | <g:render template="elements/liTemplateNonEditable" model="['template': currentTemplate]"/> |
---|
37 | </g:if> |
---|
38 | <g:else> |
---|
39 | <g:render template="elements/liTemplateEditable" model="['template': currentTemplate]"/> |
---|
40 | </g:else> |
---|
41 | </li> |
---|
42 | </g:each> |
---|
43 | </ul> |
---|
44 | |
---|
45 | <div id="addNew"> |
---|
46 | <a href="#" onClick="editTemplate( 'new' ); this.blur(); return false;"> |
---|
47 | <b>Create new template</b> |
---|
48 | </a> |
---|
49 | |
---|
50 | <form class="templateField_form" id="template_new_form" action="createTemplate"> |
---|
51 | <g:hiddenField name="entity" value="${encryptedEntity}" /> |
---|
52 | <g:render template="elements/templateForm" model="['template': null]"/> |
---|
53 | <div class="templateFieldButtons"> |
---|
54 | <input type="button" value="Save" onClick="createTemplate( 'new' );"> |
---|
55 | <input type="button" value="Cancel" onClick="hideTemplateForm( 'new' );"> |
---|
56 | </div> |
---|
57 | </form> |
---|
58 | </div> |
---|
59 | |
---|
60 | <g:form action="template" name="templateChoice" method="GET"> |
---|
61 | <g:hiddenField name="entity" value="${encryptedEntity}" /> |
---|
62 | <input type="hidden" name="template" id="templateSelect" value="${template?.id}"> |
---|
63 | </g:form> |
---|
64 | </div> |
---|
65 | |
---|
66 | </body> |
---|
67 | </html> |
---|