Module: FieldOccurrencesHelper

Defined in:
app/helpers/field_occurrences_helper.rb

Instance Method Summary collapse

Instance Method Details

#field_occurrence_autocomplete_tag(field_occurrence) ⇒ Object



40
41
42
43
44
45
# File 'app/helpers/field_occurrences_helper.rb', line 40

def field_occurrence_autocomplete_tag(field_occurrence)
  return nil if field_occurrence.nil?
  [
    field_occurrence_tag(field_occurrence)
  ].join(' ').html_safe
end

#field_occurrence_collecting_event_tag(field_occurrence) ⇒ Object



20
21
22
23
24
# File 'app/helpers/field_occurrences_helper.rb', line 20

def field_occurrence_collecting_event_tag(field_occurrence)
  return nil if field_occurrence.nil? 
  # TODO: ranged lot extension
  tag.span(collecting_event_tag(field_occurrence.collecting_event), class: [:feedback, 'feedback-thin', 'feedback-secondary'])
end

#field_occurrence_tag(field_occurrence) ⇒ Object

Return [String, nil]

a descriptor including the identifier and determination


5
6
7
8
9
10
11
12
# File 'app/helpers/field_occurrences_helper.rb', line 5

def field_occurrence_tag(field_occurrence)
  return nil if field_occurrence.nil?
 [ 
   field_occurrence_total_tag(field_occurrence),
   field_occurrence_taxon_determination_tag(field_occurrence),
   field_occurrence_collecting_event_tag(field_occurrence),
 ].compact.join(' ').html_safe
end

#field_occurrence_taxon_determination_tag(field_occurrence) ⇒ Object



26
27
28
29
30
# File 'app/helpers/field_occurrences_helper.rb', line 26

def field_occurrence_taxon_determination_tag(field_occurrence)
  return nil if field_occurrence.nil? 
  # TODO: ranged lot extension
  tag.span(taxon_determination_tag(field_occurrence.taxon_determination), class: [:feedback, 'feedback-thin'])
end

#field_occurrence_total_tag(field_occurrence) ⇒ Object



14
15
16
17
18
# File 'app/helpers/field_occurrences_helper.rb', line 14

def field_occurrence_total_tag(field_occurrence)
  return nil if field_occurrence.nil? 
  # TODO: ranged lot extension
  tag.span(field_occurrence.total, class: [:feedback, 'feedback-thin', 'feedback-info'])
end

#field_occurrences_search_formObject



47
48
49
# File 'app/helpers/field_occurrences_helper.rb', line 47

def field_occurrences_search_form
  render('/field_occurrences/quick_search_form')
end

#label_for_field_occurrence(field_occurrence) ⇒ Object



32
33
34
35
36
37
38
# File 'app/helpers/field_occurrences_helper.rb', line 32

def label_for_field_occurrence(field_occurrence)
  return nil if field_occurrence.nil?
  [ 'FieldOccurrence ' + field_occurrence.id.to_s,
    identifier_list_labels(field_occurrence),
    label_for_collecting_event(field_occurrence.collecting_event)
  ].compact.join('; ')
end