From 6fd3c88f76fece20d00f4aa1c037b82691b63b50 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 1 Apr 2021 13:14:31 +0800 Subject: [PATCH] [feat]Add include_happening_now checkbox to the admin splashpage --- app/controllers/admin/splashpages_controller.rb | 2 +- app/views/admin/splashpages/_form.html.haml | 3 +++ app/views/admin/splashpages/show.html.haml | 3 +++ spec/factories/splashpages.rb | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/splashpages_controller.rb b/app/controllers/admin/splashpages_controller.rb index fd432cde..fc7e3299 100644 --- a/app/controllers/admin/splashpages_controller.rb +++ b/app/controllers/admin/splashpages_controller.rb @@ -50,7 +50,7 @@ module Admin :include_venue, :include_registrations, :include_tickets, :include_lodgings, :include_sponsors, :include_social_media, - :include_booths) + :include_booths, :include_happening_now) end end end diff --git a/app/views/admin/splashpages/_form.html.haml b/app/views/admin/splashpages/_form.html.haml index 3db1e9ea..bf689200 100644 --- a/app/views/admin/splashpages/_form.html.haml +++ b/app/views/admin/splashpages/_form.html.haml @@ -44,6 +44,9 @@ %li = f.input :include_social_media, label: 'Display social media links', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_social_media) } + %li + = f.input :include_happening_now, label: 'Display events happening now', input_html: { checked: params[:action] == 'new' || @splashpage.try(:include_happening_now) } + = f.inputs name: 'Access' do %ul.fa-ul %li diff --git a/app/views/admin/splashpages/show.html.haml b/app/views/admin/splashpages/show.html.haml index a9046fdc..14c64e82 100644 --- a/app/views/admin/splashpages/show.html.haml +++ b/app/views/admin/splashpages/show.html.haml @@ -45,6 +45,9 @@ %li %i{ class: "fa-li #{icon_for_todo @splashpage.include_social_media?}" } Display social media links + %li + %i{ class: "fa-li #{icon_for_todo @splashpage.include_happening_now?}" } + Display events happening now %li - if @conference.splashpage && @conference.splashpage.public %i{ class: "fa-li #{icon_for_todo @splashpage.public?}" } diff --git a/spec/factories/splashpages.rb b/spec/factories/splashpages.rb index 340155c6..ffc38dfa 100644 --- a/spec/factories/splashpages.rb +++ b/spec/factories/splashpages.rb @@ -45,6 +45,7 @@ FactoryBot.define do include_sponsors { true } include_lodgings { true } include_cfp { true } + include_happening_now { true } end end end