Sha256: 13ed25828885b5ad2cda800e2aa1e547b4eb14cc0d572b0816829abab57ef6cd
Contents?: true
Size: 1.2 KB
Versions: 10
Compression:
Stored size: 1.2 KB
Contents
# frozen_string_literal: true module Decidim module Proposals # Custom helpers, scoped to the proposals engine. # module ApplicationHelper include Decidim::Comments::CommentsHelper include PaginateHelper include ProposalVotesHelper include Decidim::MapHelper include Decidim::Proposals::MapHelper # Public: The state of a proposal in a way a human can understand. # # state - The String state of the proposal. # # Returns a String. def humanize_proposal_state(state) value = if state == "accepted" "accepted" elsif state == "rejected" "rejected" else "not_answered" end I18n.t(value, scope: "decidim.proposals.answers") end # Public: The css class applied based on the proposal state. # # state - The String state of the proposal. # # Returns a String. def proposal_state_css_class(state) if state == "accepted" "text-success" elsif state == "rejected" "text-alert" else "text-warning" end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems