Sha256: 31be55df427d8d76403965c8632ab55dc0aa9e28ab2c139d0e607f151e57856d
Contents?: true
Size: 981 Bytes
Versions: 36
Compression:
Stored size: 981 Bytes
Contents
module Hyrax module Admin # Displays a single workflow role class WorkflowRolePresenter def initialize(workflow_role) @workflow = workflow_role.workflow @role = workflow_role.role @source_id = workflow.permission_template.source_id end # @todo This is a hack; I don't want to include reference to the admin set; # However based on the current UI, in which we list all workflows (spanning all admin sets) this is required. # @return [String] A meaningful label for the given WorkflowRole def label "#{admin_set_label(source_id)} - #{role.name} (#{workflow.name})" end private attr_accessor :workflow, :role, :source_id def admin_set_label(id) result = ActiveFedora::Base.search_by_id(id, fl: 'title_tesim') result['title_tesim'].first rescue ActiveFedora::ObjectNotFoundError "[AdminSet ID=#{id}]" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems