Module: Workbench::LayoutHelper

Defined in:
app/helpers/workbench/layout_helper.rb

Overview

helpers specifically use in /views/layouts only

Instance Method Summary collapse

Instance Method Details

#development_header_tagObject



13
14
15
16
17
# File 'app/helpers/workbench/layout_helper.rb', line 13

def development_header_tag
  if Rails.env.development? 
    (:span, 'DEVELOPMENT', class: 'subtle')
  end 
end

#issue_tracker_tagObject



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'
    ),
    (('div','', id: 'curation-issue-tracker-container') if sessions_current_project&.data_curation_issue_tracker_url)
  ].join().html_safe
end


9
10
11
# File 'app/helpers/workbench/layout_helper.rb', line 9

def navbar_css
  Rails.env.production? ? 'header_production' : 'header_development'
end

#sandbox_cssObject



5
6
7
# File 'app/helpers/workbench/layout_helper.rb', line 5

def sandbox_css
  Settings.sandbox_mode? ? 'sandbox' : nil
end

#sandbox_details_tagObject



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? 
    (: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_tagObject



40
41
42
43
44
# File 'app/helpers/workbench/layout_helper.rb', line 40

def sandbox_warning_tag
  if Settings.sandbox_mode?
    (:i, 'All data may be deleted at any time without warning', class: 'text-white-color')
  end
end

#taxonworks_version_tagObject



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