Ignore:
Timestamp:
Nov 17, 2010, 4:20:33 PM (12 years ago)
Author:
robert@…
Message:

Improved the template editor so that template fields can be removed from templates, even if the templates are in use, but only if the template fields are never filled. (see ticket #74)

Also changed the user registration so that the administrator confirmation mails will be sent to the administrators in production environment, but still to gscfproject@… in other environments.

File:
1 edited

Legend:

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

    r1136 r1159  
    11<span class="listButtons">
    2   <img onClick="showTemplateFieldForm( 'templateField_' + ${templateField.id}); this.blur(); return false;" src="${createLinkTo( dir: 'images/icons', file: 'application_edit.png', plugin: 'famfamfam' )}" alt="Show template field properties" title="Show template field properties">
    3 
    4   <g:if test="${template.inUse()}">
    5         <img class="disabled" src="${createLinkTo( dir: 'images/icons', file: 'delete.png', plugin: 'famfamfam' )}" alt="This field can not be removed from the template, as the template is still in use." title="This field can not be removed from the template, as the template is still in use.">
     2  <img onClick="showTemplateFieldForm( 'templateField_' + ${templateField.id}); this.blur(); return false;" src="${resource( dir: 'images/icons', file: 'application_edit.png', plugin: 'famfamfam' )}" alt="Show template field properties" title="Show template field properties">
     3  <g:if test="${templateField.isFilledInTemplate(template)}">
     4        <img class="disabled" src="${resource( dir: 'images/icons', file: 'delete.png', plugin: 'famfamfam' )}" alt="This field can not be removed from the template, as this field is already in use." title="This field can not be removed from the template, as this field is already in use.">
    65  </g:if>
    76  <g:else>
    8         <img onClick="removeTemplateField( ${templateField.id} ); moveFieldListItem( ${templateField.id}, '#availableTemplateFields' );" src="${createLinkTo( dir: 'images/icons', file: 'delete.png', plugin: 'famfamfam' )}" alt="Remove this template field from the template" title="Remove this template field from the template">
     7        <img onClick="removeTemplateField( ${templateField.id} ); moveFieldListItem( ${templateField.id}, '#availableTemplateFields' );" src="${resource( dir: 'images/icons', file: 'delete.png', plugin: 'famfamfam' )}" alt="Remove this template field from the template" title="Remove this template field from the template">
    98  </g:else>
    109</span>
     
    1413  (<g:if test="${templateField.unit}">${templateField.unit}, </g:if><g:render template="elements/${templateField.type.toString().toLowerCase().replaceAll(/ /,'_')}" model="[templateField: templateField]"/>)
    1514
    16   <form class="templateField_form" id="templateField_${templateField.id}_form">
    17           <g:render template="elements/disabledFieldForm" model="['templateField': templateField, 'ontologies': ontologies, 'fieldTypes': fieldTypes]"/>
    18           <div class="templateFieldButtons">
    19                   <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField.id} );">
    20           </div>
     15  <form class="templateField_form" id="templateField_${templateField.id}_form" action="updateField">
     16          <g:if test="${templateField.isEditable()}">
     17                <g:hiddenField name="id" value="${templateField.id}" />
     18                <g:hiddenField name="version" value="${templateField.version}" />
     19                <g:hiddenField name="renderTemplate" value="selected" />
     20                <g:hiddenField name="templateId" value="${template.id}" />
     21                <g:render template="elements/fieldForm" model="['templateField': templateField, 'ontologies': ontologies, 'fieldTypes': fieldTypes]"/>
     22                <div class="templateFieldButtons">
     23                        <input type="button" value="Save" onClick="updateTemplateField( ${templateField.id} );">
     24                        <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField.id} );">
     25                </div>
     26          </g:if>
     27        <g:else>
     28                <g:render template="elements/disabledFieldForm" model="['templateField': templateField, 'ontologies': ontologies, 'fieldTypes': fieldTypes]"/>
     29                <div class="templateFieldButtons">
     30                        <input type="button" value="Close" onClick="hideTemplateFieldForm( ${templateField.id} );">
     31                </div>
     32        </g:else>
    2133  </form>
Note: See TracChangeset for help on using the changeset viewer.