Skip to content

Commit

Permalink
Show service form callout on lottery entrants page
Browse files Browse the repository at this point in the history
  • Loading branch information
moveson committed Dec 18, 2024
1 parent 7b74df0 commit 1cfdfb3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
13 changes: 13 additions & 0 deletions app/views/lotteries/_service_form_callout.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<%# locals: (presenter:) %>

<% if presenter.lottery.finished? && presenter.lottery.service_form.attached? %>
<%= render partial: "shared/callout_with_link",
locals: {
icon_name: "info-circle",
icon_color: "info",
callout_color: "info",
main_text: t("lotteries.show.callout_main_text"),
detail_paragraphs: t("lotteries.show.callout_detail_1"),
link: link_to("Learn more", docs_user_info_path, class: "btn btn-outline-primary")
} %>
<% end %>
13 changes: 2 additions & 11 deletions app/views/lotteries/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<article class="ost-article container">
<% case @presenter.display_style %>
<% when "entrants" %>
<%= render partial: "service_form_callout", locals: { presenter: @presenter } %>
<h4 class="mt-5">
<span class="fw-bold"><%= "Lottery Entrants" %></span><span class="px-1 h5 fw-light text-muted"><%= " #{pluralize_with_delimiter(@presenter.lottery_entrants.count, 'total entrant')}" %></span>
</h4>
Expand Down Expand Up @@ -130,17 +131,7 @@
<% end %>

<% when "results" %>
<% if @presenter.lottery.finished? && @presenter.lottery.service_form.attached? %>
<%= render partial: "shared/callout_with_link",
locals: {
icon_name: "info-circle",
icon_color: "info",
callout_color: "info",
main_text: t(".callout_main_text"),
detail_paragraphs: t(".callout_detail_paragraph_1"),
link: link_to("Learn more", docs_user_info_path, class: "btn btn-outline-primary")
} %>
<% end %>
<%= render partial: "service_form_callout", locals: { presenter: @presenter } %>
<h4 class="mt-5">
<span class="fw-bold">Lottery Results</span><span class="px-1 h5 fw-light text-muted"><%= " Last updated #{time_ago_in_words(@presenter.lottery.updated_at)} ago" %></span>
</h4>
Expand Down
2 changes: 1 addition & 1 deletion config/locales/views.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ en:
lotteries:
show:
callout_main_text: "Service form is now available for download"
callout_detail_paragraph_1: "For those accepted to the lottery or waitlisted, the service form is now available for download from your Manage Service page. When the form is complete with all signatures in place, you will upload the form from the same Manage Service page."
callout_detail_1: "For those accepted to the lottery or waitlisted, the service form is now available for download from your Manage Service page. When the form is complete with all signatures in place, you will upload the form from the same Manage Service page."

people:
show:
Expand Down

0 comments on commit 1cfdfb3

Please sign in to comment.