Class: Sufia::WorkShowPresenter
- Inherits:
-
CurationConcerns::WorkShowPresenter
- Object
- CurationConcerns::WorkShowPresenter
- Sufia::WorkShowPresenter
- Defined in:
- app/presenters/sufia/work_show_presenter.rb
Instance Method Summary collapse
- #display_feature_link? ⇒ Boolean
- #display_unfeature_link? ⇒ Boolean
- #editor? ⇒ Boolean
- #stats_path ⇒ Object
- #tweeter ⇒ Object
Instance Method Details
#display_feature_link? ⇒ Boolean
20 21 22 |
# File 'app/presenters/sufia/work_show_presenter.rb', line 20 def display_feature_link? user_can_feature_works? && solr_document.public? && FeaturedWork.can_create_another? && !featured? end |
#display_unfeature_link? ⇒ Boolean
24 25 26 |
# File 'app/presenters/sufia/work_show_presenter.rb', line 24 def display_unfeature_link? user_can_feature_works? && solr_document.public? && featured? end |
#editor? ⇒ Boolean
7 8 9 |
# File 'app/presenters/sufia/work_show_presenter.rb', line 7 def editor? current_ability.can?(:edit, solr_document) end |
#stats_path ⇒ Object
28 29 30 |
# File 'app/presenters/sufia/work_show_presenter.rb', line 28 def stats_path Sufia::Engine.routes.url_helpers.stats_work_path(self) end |
#tweeter ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/presenters/sufia/work_show_presenter.rb', line 11 def tweeter 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 |