diff --git a/config/application.rb b/config/application.rb index 477c57e..d4fac8e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -80,17 +80,17 @@ # in the next version. Devise appears to be using those callbacks. # To accept the new behaviour use 'true' otherwise use 'false' config.active_record.raise_in_transactional_callbacks = true - + # Load Branded terminology (e.g. organization name, application name, etc.) config.branding = config_for(:branding).deep_symbolize_keys - + # The default visibility setting for new plans # organisationally_visible - Any member of the user's org can view, export and duplicate the plan # publicly_visibile - (NOT advisable because plans will show up in Public DMPs page by default) # is_test - (NOT advisable because test plans are excluded from statistics) # privately_visible - Only the owner and people they invite can access the plan config.default_plan_visibility = 'privately_visible' - + # The percentage of answered questions needed to enable the plan visibility section of the Share plan page config.default_plan_percentage_answered = 50.00 end diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index c3f0124..14bb431 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -1,3 +1,4 @@ LANGUAGES = (ActiveRecord::Base.connection.table_exists? 'languages') ? Language.sorted_by_abbreviation : [] MANY_LANGUAGES = LANGUAGES.length > 1 TABLE_FILTER_MIN_ROWS = 10 + diff --git a/lib/assets/javascripts/constants.js b/lib/assets/javascripts/constants.js index f0a7673..376f2e5 100644 --- a/lib/assets/javascripts/constants.js +++ b/lib/assets/javascripts/constants.js @@ -7,6 +7,7 @@ export const VALIDATION_MESSAGE_PASSWORD = 'The password must be between 8 and 128 characters.'; export const VALIDATION_MESSAGE_PASSWORDS_MATCH = 'The passwords must match.'; export const VALIDATION_MESSAGE_RADIO = 'Please choose one of the options.'; +export const VALIDATION_MESSAGE_CHECKBOX = 'Please check the box to continue.'; export const VALIDATION_MESSAGE_SELECT = 'Please select a value from the list.'; export const VALIDATION_MESSAGE_TEXT = 'This field is required.'; diff --git a/lib/assets/javascripts/utils/ariatiseForm.js b/lib/assets/javascripts/utils/ariatiseForm.js index 41071cd..2f08078 100644 --- a/lib/assets/javascripts/utils/ariatiseForm.js +++ b/lib/assets/javascripts/utils/ariatiseForm.js @@ -94,6 +94,8 @@ return $(el).find(':selected').val(); case 'tinymce': return Tinymce.findEditorById($(el).attr('id')).getContent(); + case 'checkbox': + return ($(el).is(':checked') ? 'checked' : ''); default: return $(el).val(); } @@ -121,6 +123,7 @@ case 'radio': return validator.isValidText(value); case 'select': + case 'checkbox': return validator.isValidText(value); case 'js-combobox': return validator.isValidText(value); @@ -143,6 +146,8 @@ return constants.VALIDATION_MESSAGE_PASSWORD; case 'radio': return constants.VALIDATION_MESSAGE_RADIO; + case 'checkbox': + return constants.VALIDATION_MESSAGE_CHECKBOX; case 'js-combobox': return constants.VALIDATION_MESSAGE_SELECT; default: