From 1389b91d4faadfd1d16b0a50de4540097e1fb265 Mon Sep 17 00:00:00 2001 From: moveson Date: Sat, 2 Dec 2023 07:05:58 -0700 Subject: [PATCH] Add a banner to the top of the home screen for 2024 Hardrock lottery --- app/views/visitors/_hardrock_lottery_link.html.erb | 14 ++++++++++++++ app/views/visitors/index.html.erb | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 app/views/visitors/_hardrock_lottery_link.html.erb diff --git a/app/views/visitors/_hardrock_lottery_link.html.erb b/app/views/visitors/_hardrock_lottery_link.html.erb new file mode 100644 index 000000000..429c5616a --- /dev/null +++ b/app/views/visitors/_hardrock_lottery_link.html.erb @@ -0,0 +1,14 @@ +<% hardrock = Organization.find_by(slug: "hardrock") %> +<% lottery = hardrock.present? ? hardrock.lotteries.find_by(scheduled_start_date: "2023-12-02") : nil %> + +<% if hardrock.present? && lottery.present? && Date.today == lottery.scheduled_start_date %> + +<% end %> diff --git a/app/views/visitors/index.html.erb b/app/views/visitors/index.html.erb index 713daae47..5dd76140d 100644 --- a/app/views/visitors/index.html.erb +++ b/app/views/visitors/index.html.erb @@ -2,6 +2,9 @@ <% end %> <% content_for(:container_type) do %>skip <% end %> + +<%= render partial: "hardrock_lottery_link" %> +