Module: PeopleHelper

Defined in:
app/helpers/people_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) author_annotation_tag(author)



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

def author_annotation_tag(author)
  return nil if author.nil?
  (:span, author.name, class: [:annotation__author])
end

- (Object) author_list_tag(object)



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

def author_list_tag(object)
  return nil unless object.authors.any?
  (:h3, 'Authors') +
      (:ul, class: 'annotations_author_list') do
        object.authors.collect{|a| (:li, author_annotation_tag(a)) }.join.html_safe
      end
end

- (Object) editor_list_tag(object)



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

def editor_list_tag(object)
  return nil unless object.editors.any?
  (:h3, 'Editors') +
      (:ul, class: 'annotations_editor_list') do
        object.editors.collect{|a| (:li, author_annotation_tag(a)) }.join.html_safe
      end
end

- (String) people_names(people)

Returns a formatted list of people

Returns:

  • (String)

    a formatted list of people



23
24
25
# File 'app/helpers/people_helper.rb', line 23

def people_names(people)
  people.collect{ |a| a.full_last_name }.to_sentence(last_word_connector: ' & ')
end

- (Object) people_search_form



12
13
14
# File 'app/helpers/people_helper.rb', line 12

def people_search_form
  render('/people/quick_search_form')
end


16
17
18
19
# File 'app/helpers/people_helper.rb', line 16

def person_link(person)
  return nil if person.nil?
  link_to(person_tag(person), person.metamorphosize)
end

- (Object) person_tag(person)



3
4
5
6
7
8
9
10
# File 'app/helpers/people_helper.rb', line 3

def person_tag(person)
  return nil if person.nil?
  if person.new_record?
    person.bibtex_name 
  else
    person.cached ? person.cached : 'CACHED VALUE NOT BUILT, CONTACT AN ADMIN.'
  end
end