From 0c2ccf46f76e1880d38235d30a5bf032b52c6bc2 Mon Sep 17 00:00:00 2001 From: Andrew Kvalheim Date: Tue, 28 Feb 2023 17:10:10 -0800 Subject: [PATCH] Restore detailed event form for admins In #2987 the detailed view of the event form was inadvertently lost, presumably due to #2975 masking the problem. --- app/views/proposals/_form.html.haml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/proposals/_form.html.haml b/app/views/proposals/_form.html.haml index 1e1186c62e..a15163f5ff 100644 --- a/app/views/proposals/_form.html.haml +++ b/app/views/proposals/_form.html.haml @@ -1,5 +1,7 @@ - action_is_edit = @event.persisted? -- display_registration = current_user&.is_admin? || @program.cfp&.enable_registrations? +- user_is_admin = current_user&.is_admin? +- display_details = user_is_admin || action_is_edit +- display_registration = user_is_admin || @program.cfp&.enable_registrations? %h4 Proposal Information @@ -8,7 +10,7 @@ = f.label :title %abbr{title: 'This field is required'} * = f.text_field :title, autofocus: true, required: true, class: 'form-control' -- if action_is_edit +- if display_details .form-group = f.label :subtitle = f.text_field :subtitle, class: 'form-control' @@ -31,7 +33,7 @@ - @conference.program.event_types.each do |event_type| %span{ class: 'help-block select-help-text event_event_type_id collapse', id: "#{event_type.id}-help" } = event_type.description -- if action_is_edit +- if display_details - if @conference.program.difficulty_levels.any? = f.label :difficulty_level = f.select :difficulty_level_id, @conference.program.difficulty_levels.map{|level| [level.title, level.id ] }, {include_blank: false}, { class: 'select-help-toggle form-control' } @@ -53,7 +55,7 @@ %span#abstract-maximum-word-count 250 words. - - if display_registration && action_is_edit + - if display_registration && display_details %h4 Event Registration %hr @@ -62,14 +64,14 @@ %label = f.check_box :require_registration Require participants to register to your event - - if display_registration && action_is_edit + - if display_registration && display_details .form-group = f.label :max_attendees = f.number_field :max_attendees, class: 'form-control' %span.help-block - message = @event.room ? "Value must be between 1 and #{@event.room.size}" : 'Check room capacity after scheduling.' = 'The maximum number of participants. ' + message - - if action_is_edit && current_user.has_any_role?(:admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }) + - if display_details && current_user.has_any_role?(:admin, { name: :organizer, resource: @conference }, { name: :cfp, resource: @conference }) .checkbox %label = f.check_box :is_highlight