Module: NavigationHelpers
- Defined in:
- lib/coursegen/course/helpers/navigation_helpers.rb
Instance Method Summary collapse
- #link_to_background(item_symbol) ⇒ Object
- #link_to_cribsheet(item_symbol) ⇒ Object
- #link_to_inclusion(item) ⇒ Object
- #link_to_incubator(item_symbol) ⇒ Object
- #link_to_intro(item_symbol) ⇒ Object
- #link_to_lab(item_symbol) ⇒ Object
- #link_to_lecture(item_symbol) ⇒ Object
- #link_to_next(toc, item) ⇒ Object
- #link_to_next_lecture ⇒ Object
- #link_to_pa(item_symbol) ⇒ Object
- #link_to_prev(toc, item) ⇒ Object
- #link_to_section(section_symbol, item_symbol) ⇒ Object
- #link_to_topic(item_symbol) ⇒ Object
Instance Method Details
#link_to_background(item_symbol) ⇒ Object
16 17 18 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 16 def link_to_background item_symbol link_to_section :background, item_symbol end |
#link_to_cribsheet(item_symbol) ⇒ Object
20 21 22 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 20 def link_to_cribsheet item_symbol link_to_section :cribsheets, item_symbol end |
#link_to_inclusion(item) ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 53 def link_to_inclusion item inclusion = Toc.instance.lookup_inclusion(item) if inclusion.nil? "(never included)" else " (#{inclusion.identifier})" end end |
#link_to_incubator(item_symbol) ⇒ Object
28 29 30 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 28 def link_to_incubator item_symbol link_to_section :incubator, item_symbol end |
#link_to_intro(item_symbol) ⇒ Object
24 25 26 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 24 def link_to_intro item_symbol link_to_section :intro, item_symbol end |
#link_to_lab(item_symbol) ⇒ Object
32 33 34 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 32 def link_to_lab item_symbol link_to_section :lab, item_symbol end |
#link_to_lecture(item_symbol) ⇒ Object
3 4 5 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 3 def link_to_lecture item_symbol link_to_section :lectures, item_symbol end |
#link_to_next(toc, item) ⇒ Object
45 46 47 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 45 def link_to_next toc, item nav_markup "", toc.find_next_forn(item).nitem.path, "glyphicon glyphicon-chevron-right", "next page" end |
#link_to_next_lecture ⇒ Object
7 8 9 10 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 7 def link_to_next_lecture the_item = Toc.instance.find_next_forn(@item) link_to(the_item.title, the_item.identifier) end |
#link_to_pa(item_symbol) ⇒ Object
36 37 38 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 36 def link_to_pa item_symbol link_to_section :pa, item_symbol end |
#link_to_prev(toc, item) ⇒ Object
49 50 51 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 49 def link_to_prev toc, item nav_markup "", toc.find_previous_forn(item).nitem.path, "glyphicon glyphicon-chevron-left", "previous page" end |
#link_to_section(section_symbol, item_symbol) ⇒ Object
40 41 42 43 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 40 def link_to_section section_symbol, item_symbol the_item = lookup_nitem(section_symbol.to_s, item_symbol.to_s) link_to_unless_current(the_item[:title], the_item.identifier) end |
#link_to_topic(item_symbol) ⇒ Object
12 13 14 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 12 def link_to_topic item_symbol link_to_section :topics, item_symbol end |