Class: Hyrax::TransfersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hyrax::TransfersController
- Defined in:
- app/controllers/hyrax/transfers_controller.rb
Instance Method Summary collapse
-
#accept ⇒ Object
Kicks of a job that completes the transfer.
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #reject ⇒ Object
Instance Method Details
#accept ⇒ Object
Kicks of a job that completes the transfer. If params is set, it will revoke any existing edit permissions on the work.
48 49 50 51 52 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 48 def accept @proxy_deposit_request.transfer!(params[:reset]) current_user.can_receive_deposits_from << @proxy_deposit_request.sending_user if params[:sticky] redirect_to hyrax.transfers_path, notice: "Transfer complete" end |
#create ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 29 def create @proxy_deposit_request.sending_user = current_user if @proxy_deposit_request.save redirect_to hyrax.transfers_path, notice: "Transfer request created" else @work = Hyrax::WorkRelation.new.find(params[:id]) render :new end end |
#destroy ⇒ Object
59 60 61 62 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 59 def destroy @proxy_deposit_request.cancel! redirect_to hyrax.transfers_path, notice: "Transfer canceled" end |
#index ⇒ Object
39 40 41 42 43 44 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 39 def index t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.admin.sidebar.transfers'), hyrax.transfers_path @presenter = TransfersPresenter.new(current_user, view_context) end |
#new ⇒ Object
22 23 24 25 26 27 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 22 def new t(:'hyrax.controls.home'), root_path t(:'hyrax.dashboard.breadcrumbs.admin'), hyrax.dashboard_path t(:'hyrax.transfers.new.header'), hyrax.new_work_transfer_path @work = Hyrax::WorkRelation.new.find(params[:id]) end |
#reject ⇒ Object
54 55 56 57 |
# File 'app/controllers/hyrax/transfers_controller.rb', line 54 def reject @proxy_deposit_request.reject! redirect_to hyrax.transfers_path, notice: "Transfer rejected" end |