Module: Tasks::People::AuthorHelper
- Defined in:
- app/helpers/tasks/people/author_helper.rb
Instance Method Summary collapse
- #cite_count(source) ⇒ Object
- #letter_color(letter) ⇒ Object
- #select_author_count(letter) ⇒ Object
-
#select_authors(letter) ⇒ Object
TODO: @mjy.
- #source_color(source) ⇒ Object
Instance Method Details
#cite_count(source) ⇒ Object
20 21 22 |
# File 'app/helpers/tasks/people/author_helper.rb', line 20 def cite_count(source) source.citations.where(project_id: sessions_current_project_id).count end |
#letter_color(letter) ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/helpers/tasks/people/author_helper.rb', line 4 def letter_color(letter) style = '' if (letter) == 0 style = " style='color:lightgrey;'" end "<h3#{style}>#{letter}</h3>" end |
#select_author_count(letter) ⇒ Object
12 13 14 |
# File 'app/helpers/tasks/people/author_helper.rb', line 12 def (letter) (letter).count end |
#select_authors(letter) ⇒ Object
TODO: @mjy
16 17 18 |
# File 'app/helpers/tasks/people/author_helper.rb', line 16 def (letter) # TODO: @mjy Person.with_role('SourceAuthor').where('last_name ilike ?', letter).order(:last_name).select(:last_name) end |
#source_color(source) ⇒ Object
24 25 26 27 28 29 30 |
# File 'app/helpers/tasks/people/author_helper.rb', line 24 def source_color(source) style = ' style="color:lightgrey:" ' unless cite_count(source) == 0 style = '' end "<span#{style}>#{source.cached}</span>" end |