From 900d069ed5a8fd3aff688732b876bc60ab397a77 Mon Sep 17 00:00:00 2001 From: tworrall Date: Wed, 7 Dec 2011 17:03:57 +0000 Subject: [PATCH] NIHVIVO-3445 template changes to use subjectName and propertyNameForDisplay; js change to ensure submit is disabled when there is no selected object in the autocomplete field --- .../edit/forms/css/customFormWithAutocomplete.css | 5 ++++- .../edit/forms/js/customFormWithAutocomplete.js | 7 +++++-- .../edit/forms/autoCompleteObjectPropForm.ftl | 14 ++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/productMods/edit/forms/css/customFormWithAutocomplete.css b/productMods/edit/forms/css/customFormWithAutocomplete.css index aa5dc66c..7c66f21b 100644 --- a/productMods/edit/forms/css/customFormWithAutocomplete.css +++ b/productMods/edit/forms/css/customFormWithAutocomplete.css @@ -27,4 +27,7 @@ form.customForm h4 { border-width: 0; background: none; color: #000; -} \ No newline at end of file +} +.disabledSubmit { + cursor: default ! important; +} diff --git a/productMods/edit/forms/js/customFormWithAutocomplete.js b/productMods/edit/forms/js/customFormWithAutocomplete.js index 8ada5c74..4b4d92f8 100644 --- a/productMods/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/edit/forms/js/customFormWithAutocomplete.js @@ -185,6 +185,7 @@ var customForm = { } //Disable submit button until selection made this.button.attr('disabled', 'disabled'); + this.button.addClass('disabledSubmit'); // tlw }, // Bind event listeners that persist over the life of the page. Event listeners @@ -378,6 +379,7 @@ var customForm = { if(this.supportEdit) { //On initialization in this mode, submit button is disabled this.button.removeAttr('disabled'); + this.button.removeClass('disabledSubmit'); // tlw } this.setButtonText('existing'); @@ -408,10 +410,11 @@ var customForm = { if (this.formSteps > 1) { this.acSelection.find('label').html('Selected '); } - + //Resetting so disable submit button again for object property autocomplete if(this.supportEdit) { - //this.button.attr('disabled', 'disabled'); + this.button.attr('disabled', 'disabled'); + this.button.addClass('disabledSubmit'); } } diff --git a/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl b/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl index c8ea8e49..87f04025 100644 --- a/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl +++ b/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl @@ -23,8 +23,13 @@ <#assign selectedObjectUri = ""/> +<#if editConfiguration.formTitle?contains("collaborator") > + <#assign formTitle = "Select an existing Collaborator for ${editConfiguration.subjectName}" /> +<#else> + <#assign formTitle = editConfiguration.formTitle /> + -

${editConfiguration.formTitle}

+

${formTitle}

<#if editConfiguration.propertySelectFromExisting = true> <#if rangeOptionsExist = true > @@ -34,11 +39,9 @@

${editConfiguration.propertyPublicDescription}

- - <#---This section should become autocomplete instead-->

- +

@@ -68,7 +71,7 @@

There are no entries in the system from which to select.

- +

 

<#if editConfiguration.propertyOfferCreateNewOption = true> <#include "defaultOfferCreateNewOptionForm.ftl"> @@ -102,7 +105,6 @@ - ${stylesheets.add('')} ${stylesheets.add('')} ${stylesheets.add('')}