From e59375c0152afb54425814baab12b00a4bc59887 Mon Sep 17 00:00:00 2001 From: tiffanylamm Date: Sun, 28 Apr 2024 14:20:29 -0700 Subject: [PATCH] fixed user_params and added visible_event_types to view --- app/controllers/proposals_controller.rb | 2 +- app/views/proposals/_submission_type_content_form.haml | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/proposals_controller.rb b/app/controllers/proposals_controller.rb index 23087362d..48d62c817 100644 --- a/app/controllers/proposals_controller.rb +++ b/app/controllers/proposals_controller.rb @@ -216,6 +216,6 @@ def event_params end def user_params - params.require(:user).permit(:email, :password, :password_confirmation, :username, :is_admin) + params.require(:user).permit(:email, :password, :password_confirmation, :username) end end diff --git a/app/views/proposals/_submission_type_content_form.haml b/app/views/proposals/_submission_type_content_form.haml index c7b947e25..76b915047 100644 --- a/app/views/proposals/_submission_type_content_form.haml +++ b/app/views/proposals/_submission_type_content_form.haml @@ -3,10 +3,8 @@ .form-group = f.label :event_type_id, "Type" - - if current_user&.is_admin - = f.select :event_type_id, event_type_select_options(@conference.program.event_types), { include_blank: false }, { class: 'select-help-toggle form-control' } - - else - = f.select :event_type_id, event_type_select_options(@conference.program.event_types.available_for_public), { include_blank: false }, { class: 'select-help-toggle form-control' } + - visible_event_types = current_user&.is_admin ? @conference.program.event_types : @conference.program.event_types.available_for_public + = f.select :event_type_id, event_type_select_options(visible_event_types), { include_blank: false }, { class: 'select-help-toggle form-control' } - program.event_types.each do |event_type| .help-block.event_event_type_id.collapse{ id: "#{dom_id(event_type)}-help" }