app/helpers/decidim/proposals/application_helper.rb in decidim-proposals-0.23.6 vs app/helpers/decidim/proposals/application_helper.rb in decidim-proposals-0.24.0.rc1
- old
+ new
@@ -28,13 +28,16 @@
I18n.t(state, scope: "decidim.proposals.answers", default: :not_answered)
end
# Public: The css class applied based on the proposal state.
#
- # state - The String state of the proposal.
+ # proposal - The proposal to evaluate.
#
# Returns a String.
- def proposal_state_css_class(state)
+ def proposal_state_css_class(proposal)
+ state = proposal.state
+ state = proposal.internal_state if proposal.answered? && !proposal.published_state?
+
case state
when "accepted"
"text-success"
when "rejected"
"text-alert"