Extract method to get support confirmation message
This commit is contained in:
@@ -15,8 +15,7 @@
|
||||
title: t("budgets.investments.investment.support_title"),
|
||||
method: "post",
|
||||
remote: !display_support_alert?,
|
||||
data: (display_support_alert? ? {
|
||||
confirm: t("budgets.investments.investment.confirm_group", count: investment.group.max_votable_headings) } : nil),
|
||||
data: ({ confirm: confirm_vote_message } if display_support_alert?),
|
||||
"aria-hidden" => css_for_aria_hidden do %>
|
||||
<%= t("budgets.investments.investment.give_support") %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,6 +29,10 @@ class Budgets::Investments::VotesComponent < ApplicationComponent
|
||||
investment.group.headings.count > 1
|
||||
end
|
||||
|
||||
def confirm_vote_message
|
||||
t("budgets.investments.investment.confirm_group", count: investment.group.max_votable_headings)
|
||||
end
|
||||
|
||||
def css_for_aria_hidden
|
||||
reason.present? ? "true" : ""
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user