Sha256: 7dd238b5d711ac39a4560cbc8375301c147ae5511fdb50ef70cdf76585901a5d

Contents?: true

Size: 680 Bytes

Versions: 60

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Proposals
    #
    # Decorator for collaborative drafts
    #
    class CollaborativeDraftPresenter < ProposalPresenter
      def author
        coauthorship = __getobj__.coauthorships.first
        @author ||= if coauthorship.user_group
                      Decidim::UserGroupPresenter.new(coauthorship.user_group)
                    else
                      Decidim::UserPresenter.new(coauthorship.author)
                    end
      end

      alias collaborative_draft proposal

      def collaborative_draft_path
        Decidim::ResourceLocatorPresenter.new(collaborative_draft).path
      end
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
decidim-proposals-0.25.0.rc4 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.25.0.rc3 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.25.0.rc2 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.25.0.rc1 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.3 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.6 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.2 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.5 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.1 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.0 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.0.rc2 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.4 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.24.0.rc1 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.3 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.2 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.1 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.1.rc1 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.23.0 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.22.0 app/presenters/decidim/proposals/collaborative_draft_presenter.rb
decidim-proposals-0.21.0 app/presenters/decidim/proposals/collaborative_draft_presenter.rb