app/cells/decidim/budgets/limit_announcement_cell.rb in decidim-budgets-0.24.0.rc1 vs app/cells/decidim/budgets/limit_announcement_cell.rb in decidim-budgets-0.24.0.rc2
- old
+ new
@@ -7,11 +7,11 @@
alias budget model
delegate :voted?, :vote_allowed?, :discardable, :limit_reached?, to: :current_workflow
delegate :voting_open?, to: :controller
def show
- cell("decidim/announcement", announcement_args) if announce?
+ cell("decidim/announcement", announcement_message, callout_class: "warning") if announce?
end
private
def announce?
@@ -19,16 +19,9 @@
return unless current_user
return if vote_allowed?(budget)
return if voted?(budget)
discardable.any? || !vote_allowed?(budget, consider_progress: false)
- end
-
- def announcement_args
- {
- callout_class: "warning",
- announcement: announcement_message
- }
end
def announcement_message
if discardable.any?
t(:limit_reached, scope: i18n_scope,