Module: StudiesHelper
- Defined in:
- app/helpers/studies_helper.rb
Overview
rubocop:todo Style/Documentation
Instance Method Summary collapse
- #display_file_icon(document) ⇒ Object
- #display_owners(study) ⇒ Object
- #label_asset_state(asset) ⇒ Object
- #status_link_title(study) ⇒ Object
- #study_link(study, options) ⇒ Object
Instance Method Details
#display_file_icon(document) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/helpers/studies_helper.rb', line 22 def display_file_icon(document) return icon('fas', 'exclamation-circle', class: 'text-danger') unless document case document.content_type when /pdf/ icon('far', 'file-pdf', title: 'PDF') when /word/ icon('far', 'file-word', title: 'Word') when /excel/ icon('far', 'file-excel', title: 'Excel') else icon('far', 'file-alt') end end |
#display_owners(study) ⇒ Object
10 11 12 |
# File 'app/helpers/studies_helper.rb', line 10 def display_owners(study) owners_for_display(study.owners) end |
#label_asset_state(asset) ⇒ Object
37 38 39 |
# File 'app/helpers/studies_helper.rb', line 37 def label_asset_state(asset) asset.closed? ? 'closed' : 'open' end |
#status_link_title(study) ⇒ Object
2 3 4 5 6 7 8 |
# File 'app/helpers/studies_helper.rb', line 2 def status_link_title(study) if study.inactive? || study.pending? 'Open' else 'Close' end end |
#study_link(study, options) ⇒ Object
41 42 43 44 45 |
# File 'app/helpers/studies_helper.rb', line 41 def study_link(study, ) link_text = tag.strong(study.name) << ' ' << badge(study.state, type: 'study-state') link_to(link_text, study_path(study), ) end |