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

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

Changed template editor to be more user friendly with selecting field types (see ticket #154)

  • Property svn:keywords set to Author Date Rev
File size: 1.9 KB
Line 
1        <label for="name">Name:</label> <g:textField name="name" value="${templateField?.name}" /><br />
2        <label for="type">Type:</label>
3          <%
4                /* Create a list of field types grouped on category */
5                def grouped = [:]
6                fieldTypes.each {
7                  if( !grouped[ it.category ] )
8                        grouped[ it.category ] = []
9
10                        grouped[ it.category ].add( it )
11                }
12          %>
13          <select name="type" onChange="showExtraFields( ${templateField ? templateField.id : '\'new\''} );">
14                <g:each in="${grouped}" var="group">
15                  <optgroup label="${group.key}">
16                        <g:each in="${group.value}" var="field">
17                          <option
18                                <g:if test="${templateField?.type == field}">selected="selected"</g:if>
19                                value="${field}">${field} <g:if test="${field.example}">(${field.example})</g:if></option>
20                        </g:each>
21                  </optgroup>
22                </g:each>
23          </select>
24
25                <br />
26
27        <div class="extra stringlist_options" <g:if test="${templateField?.type.toString() == 'STRINGLIST'}">style='display: block;'</g:if>>
28          <label for="type">Items (every item on a new line):</label>
29                <g:textArea name="listEntries" value="${templateField?.listEntries?.name?.join( '\n' )}" />
30        </div>
31        <div class="extra ontologyterm_options" <g:if test="${templateField?.type.toString() == 'ONTOLOGYTERM'}">style='display: block;'</g:if>>
32          <label for="type">Ontology:<br /><br /><a href="#" style="text-decoration: underline;" onClick="openOntologyDialog();">Add new</a></label>
33                <g:select multiple="yes" size="5" from="${ontologies}" class="ontologySelect" optionValue="name" optionKey="id" name="ontologies" id="ontologies_${templateField?.id}" value="${templateField?.ontologies}" /><br />
34        </div>
35
36        <label for="unit">Unit:</label> <g:textField name="unit" value="${templateField?.unit}" /><br />
37        <label for="comment">Comment:</label> <g:textArea name="comment" value="${templateField?.comment}" /><br />
38        <label for="required">Required:</label> <g:checkBox name="required" value="${templateField?.required}" /><br />
Note: See TracBrowser for help on using the repository browser.