source: trunk/grails-app/views/templateEditor/elements/_fieldForm.gsp @ 1430

Last change on this file since 1430 was 1430, checked in by work@…, 10 years ago
  • set keyword expansion
  • Property svn:keywords set to Rev Author Date
File size: 2.7 KB
Line 
1  <g:hiddenField name="id" value="${templateField?.id}" />
2  <g:hiddenField name="version" value="${templateField?.version}" />
3  <g:if test="${is_new}"><g:hiddenField name="entity" value="${encryptedEntity}" /></g:if>
4  <g:if test="${is_selected}"><g:hiddenField name="renderTemplate" value="selected" /></g:if>
5  <g:if test="${template}"><g:hiddenField name="templateId" value="${template.id}" /></g:if>
6<label for="name">Name:</label> <g:textField name="name" value="${templateField?.name}" /><br />
7        <label for="type">Type:</label>
8          <%
9                /* Create a list of field types grouped on category */
10                def grouped = [:]
11                fieldTypes.each {
12                  if( !grouped[ it.category ] )
13                        grouped[ it.category ] = []
14
15                        grouped[ it.category ].add( it )
16                }
17          %>
18          <select name="type" onChange="showExtraFields( ${templateField ? templateField.id : '\'new\''} );">
19                <g:each in="${grouped}" var="group">
20                  <optgroup label="${group.key}">
21                        <g:each in="${group.value}" var="field">
22                          <option
23                                <g:if test="${templateField?.type == field}">selected="selected"</g:if>
24                                value="${field}">${field.name} <g:if test="${field.example}">(${field.example})</g:if></option>
25                        </g:each>
26                  </optgroup>
27                </g:each>
28          </select>
29
30                <br />
31
32        <div class="extra stringlist_options" <g:if test="${templateField?.type.toString() == 'STRINGLIST'}">style='display: block;'</g:if>>
33          <label for="type">Items (every item on a new line):</label>
34                <g:textArea name="listEntries" value="${templateField?.listEntries?.name?.join( '\n' )}" />
35        </div>
36        <div class="extra ontologyterm_options" <g:if test="${templateField?.type.toString() == 'ONTOLOGYTERM'}">style='display: block;'</g:if>>
37          <label for="type">Ontology:<br /><br /><a href="#" style="text-decoration: underline;" onClick="openOntologyDialog();">Add new</a></label>
38                <g:select multiple="yes" size="5" from="${ontologies}" class="ontologySelect" optionValue="name" optionKey="id" name="ontologies" id="ontologies_${templateField?.id}" value="${templateField?.ontologies}" /><br />
39        </div>
40
41        <label for="unit">Unit:</label> <g:textField name="unit" value="${templateField?.unit}" /><br />
42        <label for="comment">Comment:</label> <g:textArea name="comment" value="${templateField?.comment}" /><br />
43        <label for="required">Required:</label> <g:checkBox name="required" value="${templateField?.required}" /><br />
44
45        <div class="templateFieldButtons">
46          <g:if test="${is_new}">
47                <input type="button" value="Save" onClick="createTemplateField( 'new' );">
48                <input type="button" value="Cancel" onClick="hideTemplateFieldForm( 'new' );">
49          </g:if>
50          <g:else>
51                <input type="button" value="Save" onClick="updateTemplateField( ${templateField?.id} );">
52                <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField?.id} );">
53          </g:else>
54        </div>
Note: See TracBrowser for help on using the repository browser.