Sha256: d8f46447722cdb8fbb7b5d07d0db67cdbb5a99674e66d91fbf66051ca9af06f5
Contents?: true
Size: 1.54 KB
Versions: 37
Compression:
Stored size: 1.54 KB
Contents
# frozen_string_literal: true require "cell/partial" module Decidim module Proposals # This cell renders the link to the published proposal of a collaborative draft. class CollaborativeDraftLinkToProposalCell < Decidim::ViewModel def show render if proposal end private def proposal @proposal ||= model.linked_resources(:proposal, "created_from_collaborative_draft").first end def link_to_resource link_to resource_locator(proposal).path, class: "button secondary light expanded button--sc mt-s" do t("published_proposal", scope: "decidim.proposals.collaborative_drafts.show") end end def link_header tag.strong(class: "text-large") do t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show") end end def link_help_text tag.span(class: "text-medium") do t("final_proposal_help_text", scope: "decidim.proposals.collaborative_drafts.show") end end def link_to_versions @path ||= decidim_proposals.collaborative_draft_versions_path( collaborative_draft_id: model.id ) link_to @path, class: "text-medium" do tag.u do t("version_history", scope: "decidim.proposals.collaborative_drafts.show") end end end def decidim Decidim::Core::Engine.routes.url_helpers end def decidim_proposals Decidim::EngineRouter.main_proxy(model.component) end end end end
Version data entries
37 entries across 37 versions & 1 rubygems