Sha256: daac11fa3b106507816d8a27f603206bd936e0ef44a96f7bf7844362b2ae937d
Contents?: true
Size: 1.56 KB
Versions: 9
Compression:
Stored size: 1.56 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 content_tag :strong, class: "text-large" do t("final_proposal", scope: "decidim.proposals.collaborative_drafts.show") end end def link_help_text content_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 content_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
9 entries across 9 versions & 1 rubygems