Show
Ignore:
Timestamp:
19-11-10 11:51:09 (3 years ago)
Author:
robert@…
Message:

The templateeditor is now capable of adding new items to a stringlist (that is in use), or adding new ontologies to a ontologyterm field that is in use. See ticket #74

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/templateEditor/elements/_disabledFieldForm.gsp

    r959 r1175  
     1        <g:hiddenField name="id" value="${templateField?.id}" /> 
     2        <g:hiddenField name="version" value="${templateField?.version}" /> 
     3        <g:hiddenField name="is_disabled" value="1" /> 
     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 
    17        <label for="name">Name:</label> <g:textField disabled="disabled" name="name" value="${templateField?.name}" /><br /> 
    28        <label for="type">Type:</label> <g:textField disabled="disabled" name="type" value="${templateField?.type}" /><br /> 
    39 
    410        <div class="extra stringlist_options" <g:if test="${templateField?.type.toString() == 'STRINGLIST'}">style='display: block;'</g:if>> 
    5           <label for="type">Items:</label> 
    6                 <g:textArea name="listEntries" disabled="disabled" value="${templateField?.listEntries?.name?.join( '\n' )}" /> 
     11          <label for="type">Used items:</label> 
     12                <g:textArea name="usedListEntries" disabled="disabled" value="${templateField?.getUsedListEntries().name?.join( '\n' )}" /> 
     13          <label for="type">Extra Items (every item on a new line):</label> 
     14                <g:textArea name="listEntries" value="${templateField?.getNonUsedListEntries().name?.join( '\n' )}" /> 
    715        </div> 
    816        <div class="extra ontologyterm_options" <g:if test="${templateField?.type.toString() == 'ONTOLOGYTERM'}">style='display: block;'</g:if>> 
    9           <label for="type">Ontology:</label> <g:textArea name="ontology" disabled="disabled" value="${templateField?.ontologies?.name?.join( '\n' )}" /><br /> 
     17          <label for="type">Used ontologies:</label> <g:textArea name="ontology" disabled="disabled" value="${templateField?.getUsedOntologies().name?.join( '\n' )}" /><br /> 
     18 
     19          <label for="type">Extra ontologies:<br /><br /><a href="#" style="text-decoration: underline;" onClick="openOntologyDialog();">Add new</a></label> 
     20                <g:select multiple="yes" size="5" from="${ontologies - templateField?.getUsedOntologies()}" class="ontologySelect" optionValue="name" optionKey="id" name="ontologies" id="ontologies_${templateField?.id}" value="${templateField?.getNonUsedOntologies()}" /><br /> 
     21 
    1022        </div> 
    1123         
     
    1325        <label for="comment">Comment:</label> <g:textArea disabled="disabled" name="comment" value="${templateField?.comment}" /><br /> 
    1426        <label for="required">Required:</label> <input type="checkbox" disabled <g:if test="${templateField?.required}">checked</g:if><br /> 
     27 
     28        <div class="templateFieldButtons"> 
     29          <g:if test="${ templateField?.type.toString() == 'STRINGLIST' || templateField?.type.toString() == 'ONTOLOGYTERM' }"> 
     30                <input type="button" value="Save" onClick="updateTemplateField( ${templateField?.id} );"> 
     31                <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField?.id} );"> 
     32          </g:if> 
     33          <g:else> 
     34                <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField?.id} );"> 
     35          </g:else> 
     36        </div>