Module: AssertedDistributionsHelper

Defined in:
app/helpers/asserted_distributions_helper.rb

Instance Method Summary collapse

Instance Method Details



17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/asserted_distributions_helper.rb', line 17

def asserted_distribution_link(asserted_distribution)
  return nil if asserted_distribution.nil?
  [
    link_to(otu_tag(asserted_distribution.otu).html_safe, asserted_distribution.otu),
    (asserted_distribution.is_absent ? (:span,
                                                   ' not in ',
                                                   class: :warning) : ' in '),
    link_to(geographic_area_tag(asserted_distribution.geographic_area).html_safe, asserted_distribution)
  ].join(' ')
  #link_to(asserted_distribution_tag(asserted_distribution).html_safe, asserted_distribution)
end

#asserted_distribution_tag(asserted_distribution) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/asserted_distributions_helper.rb', line 3

def asserted_distribution_tag(asserted_distribution)
  return nil if asserted_distribution.nil?
  [
    otu_tag(asserted_distribution.otu),
    (asserted_distribution.is_absent ? (:span,
                                                   ' not in ',
                                                   class: :warning) : ' in '),
    geographic_area_tag(asserted_distribution.geographic_area) #,
  # ' by ',
  # (asserted_distribution.source.cached_author_string ? asserted_distribution.source.cached_author_string
  # : content_tag(:span, '[source authors must be updated]', class: :warning))
  ].join(' ')
end

#asserted_distributions_search_formObject



29
30
31
# File 'app/helpers/asserted_distributions_helper.rb', line 29

def asserted_distributions_search_form
  render('/asserted_distributions/quick_search_form')
end

#no_geographic_items?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'app/helpers/asserted_distributions_helper.rb', line 33

def no_geographic_items?
  ' (has no geographic items)' if @asserted_distribution.geographic_area.geographic_items.empty?
end