Class: Sufia::FileSetPresenter
- Inherits:
-
CurationConcerns::FileSetPresenter
- Object
- CurationConcerns::FileSetPresenter
- Sufia::FileSetPresenter
show all
- Includes:
- CharacterizationBehavior
- Defined in:
- app/presenters/sufia/file_set_presenter.rb
Instance Method Summary
collapse
#additional_characterization_metadata, #characterization_metadata, #characterized?, #label_for_term, #primary_characterization_values, #secondary_characterization_values
Instance Method Details
#audit_service ⇒ Object
47
48
49
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 47
def audit_service
@audit_service ||= CurationConcerns::FileSetAuditService.new(id)
end
|
#audit_status ⇒ Object
34
35
36
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 34
def audit_status
audit_service.logged_audit_status
end
|
#editor? ⇒ Boolean
8
9
10
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 8
def editor?
current_ability.can?(:edit, solr_document)
end
|
#events ⇒ Object
30
31
32
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 30
def events
@events ||= solr_document.to_model.events(100)
end
|
#parent ⇒ Object
38
39
40
41
42
43
44
45
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 38
def parent
ids = ActiveFedora::SolrService.query("{!field f=member_ids_ssim}#{id}",
fl: ActiveFedora.id_field)
.map { |x| x.fetch(ActiveFedora.id_field) }
@parent_presenter ||= CurationConcerns::PresenterFactory.build_presenters(ids,
WorkShowPresenter,
current_ability).first
end
|
#rights ⇒ Object
21
22
23
24
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 21
def rights
return if solr_document.rights.nil?
solr_document.rights.first
end
|
#stats_path ⇒ Object
26
27
28
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 26
def stats_path
Sufia::Engine.routes.url_helpers.stats_file_path(self)
end
|
12
13
14
15
16
17
18
19
|
# File 'app/presenters/sufia/file_set_presenter.rb', line 12
def
user = ::User.find_by_user_key(depositor)
if user.try(:twitter_handle).present?
"@#{user.twitter_handle}"
else
I18n.translate('sufia.product_twitter_handle')
end
end
|