Module: AssertedDistributionsHelper

Defined in:
app/helpers/asserted_distributions_helper.rb

Instance Method Summary (collapse)

Instance Method Details



17
18
19
20
# File 'app/helpers/asserted_distributions_helper.rb', line 17

def asserted_distribution_link(asserted_distribution)
  return nil if asserted_distribution.nil?
  link_to(asserted_distribution_tag(asserted_distribution).html_safe, asserted_distribution)
end

- (Object) asserted_distribution_tag(asserted_distribution)



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

- (Object) asserted_distributions_search_form



22
23
24
# File 'app/helpers/asserted_distributions_helper.rb', line 22

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

- (Boolean) no_geographic_items?

Returns:

  • (Boolean)


26
27
28
# File 'app/helpers/asserted_distributions_helper.rb', line 26

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