source: trunk/grails-app/views/templateEditor/index.gsp @ 538

Last change on this file since 538 was 538, checked in by roberth, 12 years ago

Improved template editor. Moving fields and basic editing works already.

File size: 2.0 KB
Line 
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  <script type="text/javascript">
27         $(function() {
28                 $("#templateFields").sortable({
29                         placeholder: 'ui-state-highlight',
30                         update: updateTemplateFieldPosition
31                 });
32                 $("#templateFields").disableSelection();
33                 $('#templateFields li').bind('dblclick', showTemplateFormEvent);
34
35         });
36  </script>
37
38 <p>Please select a template to edit or create a new template</p>
39 <g:form action="index" name="templateChoice">
40    <g:hiddenField name="entity" value="${encryptedEntity}" />
41    <select name="template" id="templateSelect" onChange="this.form.submit();">
42      <option value=""></option>
43      <g:each in="${templates}" var="currentTemplate">
44        <g:if test="${currentTemplate.id==template?.id}">
45          <option selected value="${currentTemplate.id}">${currentTemplate.name}</option>
46        </g:if>
47        <g:else>
48          <option value="${currentTemplate.id}">${currentTemplate.name}</option>
49        </g:else>
50      </g:each>
51    </select>
52 </g:form>
53
54 <g:if test="${template}">
55  <p>Currently, this template contains the following fields. Drag fields to reorder and double click fields to edit.</p>
56  <ul id="templateFields">
57    <g:render template="elements/all" collection="${template.fields}" />
58  </ul>
59 </g:if>
60
61 add a new field:
62 <!-- g:select from="${templateFields}" //-->
63 
64 </body>
65</html>
Note: See TracBrowser for help on using the repository browser.