From 48fddd2883e8ad08268bd41d229465ffff5d02db Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Tue, 30 May 2023 18:00:41 -0700 Subject: [PATCH] Restore display of abstract length requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Accidentally lost during 81853d1ef91c2328e28ea676079428adbba33765 Resolves: 1) Event as a participant not signed_in user submits proposal Failure/Error: expect(page).to have_text 'Abstracts must be between 0 and 500 words.' expected to find text "Abstracts must be between 0 and 500 words." in "…Abstracts must be between 0 and 250 words.…" # ./spec/features/proposals_spec.rb:94 250 is the initial value hard-coded in app/views/proposals/_form.html.haml --- app/helpers/event_types_helper.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/helpers/event_types_helper.rb b/app/helpers/event_types_helper.rb index e200e33c..996717a9 100644 --- a/app/helpers/event_types_helper.rb +++ b/app/helpers/event_types_helper.rb @@ -8,6 +8,13 @@ module EventTypesHelper # ====Returns # * +String+ -> number of registrations / max allowed registrations def event_type_select_options(event_types = {}) - event_types.map { |type| ["#{type.title} - #{show_time(type.length)}", type.id] } + event_types.map do |type| + content = "#{type.title} - #{show_time(type.length)}" + value = type.id + attributes = { data: { min_words: type.minimum_abstract_length, + max_words: type.maximum_abstract_length } } + + [content, value, attributes] + end end end