Sha256: edb45d0b62af2337d918b18e66637dc26570d75957f52f512743057114de9abf

Contents?: true

Size: 1 KB

Versions: 25

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true
module Hyrax
  class TransfersPresenter
    def initialize(current_user, view_context)
      @current_user = current_user
      @view_context = view_context
    end

    def render_sent_transfers
      if outgoing_proxy_deposits.present?
        render 'hyrax/transfers/sent', outgoing_proxy_deposits: outgoing_proxy_deposits
      else
        t('hyrax.dashboard.no_transfers')
      end
    end

    def render_received_transfers
      if incoming_proxy_deposits.present?
        render 'hyrax/transfers/received', incoming_proxy_deposits: incoming_proxy_deposits
      else
        t('hyrax.dashboard.no_transfer_requests')
      end
    end

    private

    attr_reader :current_user, :view_context, :since
    delegate :render, :t, to: :view_context

    def incoming_proxy_deposits
      @incoming ||= ProxyDepositRequest.incoming_for(user: current_user)
    end

    def outgoing_proxy_deposits
      @outgoing ||= ProxyDepositRequest.outgoing_for(user: current_user)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
hyrax-5.0.1 app/presenters/hyrax/transfers_presenter.rb
hyrax-5.0.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-5.0.0.rc3 app/presenters/hyrax/transfers_presenter.rb
hyrax-5.0.0.rc2 app/presenters/hyrax/transfers_presenter.rb
hyrax-5.0.0.rc1 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.6.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0.rc3 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0.rc2 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0.rc1 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.5.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0.beta2 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.4.2 app/presenters/hyrax/transfers_presenter.rb
hyrax-4.0.0.beta1 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.4.1 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.4.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.3.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.2.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.1.0 app/presenters/hyrax/transfers_presenter.rb
hyrax-3.0.2 app/presenters/hyrax/transfers_presenter.rb