Module: CurationConcerns::PresentsAttributes
- Included in:
- CollectionPresenter, FileSetPresenter, WorkShowPresenter
- Defined in:
- app/presenters/curation_concerns/presents_attributes.rb
Instance Method Summary collapse
-
#attribute_to_html(field, options = {}) ⇒ Object
Present the attribute as an HTML table row.
- #display_microdata? ⇒ Boolean
- #microdata_type_to_html ⇒ Object
- #permission_badge ⇒ Object
- #permission_badge_class ⇒ Object
Instance Method Details
#attribute_to_html(field, options = {}) ⇒ Object
Present the attribute as an HTML table row.
12 13 14 15 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 12 def attribute_to_html(field, = {}) return unless respond_to?(field) AttributeRenderer.new(field, send(field), ).render end |
#display_microdata? ⇒ Boolean
25 26 27 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 25 def display_microdata? CurationConcerns.config.display_microdata end |
#microdata_type_to_html ⇒ Object
29 30 31 32 33 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 29 def microdata_type_to_html return "" unless display_microdata? value = I18n.t(microdata_type_key, default: CurationConcerns.config.microdata_default_type) " itemscope itemtype=\"#{value}\"".html_safe end |
#permission_badge ⇒ Object
17 18 19 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 17 def .new(solr_document).render end |
#permission_badge_class ⇒ Object
21 22 23 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 21 def PermissionBadge end |