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.
14 15 16 17 18 19 20 21 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 14 def attribute_to_html(field, = {}) unless respond_to?(field) Rails.logger.warn("#{self.class} attempted to render #{field}, but no method exists with that name.") return end renderer_for(field, ).new(field, send(field), ).render end |
#display_microdata? ⇒ Boolean
31 32 33 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 31 def display_microdata? CurationConcerns.config.display_microdata end |
#microdata_type_to_html ⇒ Object
35 36 37 38 39 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 35 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
23 24 25 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 23 def .new(solr_document).render end |
#permission_badge_class ⇒ Object
27 28 29 |
# File 'app/presenters/curation_concerns/presents_attributes.rb', line 27 def PermissionBadge end |