Module: Workbench::LayoutHelper
- Defined in:
- app/helpers/workbench/layout_helper.rb
Overview
helpers specifically use in /views/layouts only
Instance Method Summary collapse
- #development_header_tag ⇒ Object
- #issue_tracker_tag ⇒ Object
- #navbar_css ⇒ Object
- #sandbox_css ⇒ Object
- #sandbox_details_tag ⇒ Object
- #sandbox_warning_tag ⇒ Object
- #taxonworks_version_tag ⇒ Object
Instance Method Details
#development_header_tag ⇒ Object
13 14 15 16 17 |
# File 'app/helpers/workbench/layout_helper.rb', line 13 def development_header_tag if Rails.env.development? content_tag(:span, 'DEVELOPMENT', class: 'subtle') end end |
#issue_tracker_tag ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'app/helpers/workbench/layout_helper.rb', line 46 def issue_tracker_tag [ link_to( 'Issues', 'https://github.com/SpeciesFileGroup/taxonworks/issues', target: '_blank', data: { 'curation-issue-tracker': sessions_current_project&.data_curation_issue_tracker_url }, rel: 'noopener' ), (content_tag('div','', id: 'curation-issue-tracker-container') if sessions_current_project&.data_curation_issue_tracker_url) ].join().html_safe end |
#navbar_css ⇒ Object
9 10 11 |
# File 'app/helpers/workbench/layout_helper.rb', line 9 def Rails.env.production? ? 'header_production' : 'header_development' end |
#sandbox_css ⇒ Object
5 6 7 |
# File 'app/helpers/workbench/layout_helper.rb', line 5 def sandbox_css Settings.sandbox_mode? ? 'sandbox' : nil end |
#sandbox_details_tag ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/helpers/workbench/layout_helper.rb', line 25 def sandbox_details_tag if Settings.sandbox_mode? content_tag(:span, class: 'subtle') do [ '<span data-icon="warning"></span> SANDBOX - TEMPORARY <span data-icon="warning"></span> build', (Settings.sandbox_short_commit_sha ? link_to(Settings.sandbox_short_commit_sha, 'https://github.com/SpeciesFileGroup/taxonworks/tree/' + Settings.sandbox_commit_sha, class: [:font_subtitle]) : 'unknown SHA' ), 'on', ( Settings.sandbox_commit_date ? Settings.sandbox_commit_date : 'date unknown') ].join(' ').html_safe end end end |
#sandbox_warning_tag ⇒ Object
40 41 42 43 44 |
# File 'app/helpers/workbench/layout_helper.rb', line 40 def sandbox_warning_tag if Settings.sandbox_mode? content_tag(:i, 'All data may be deleted at any time without warning', class: 'text-white-color') end end |
#taxonworks_version_tag ⇒ Object
19 20 21 22 23 |
# File 'app/helpers/workbench/layout_helper.rb', line 19 def taxonworks_version_tag unless Settings.sandbox_mode? link_to("v#{TaxonWorks::VERSION}", "https://github.com/SpeciesFileGroup/taxonworks/releases/tag/v#{TaxonWorks::VERSION}", id: 'taxonworks_version') end end |