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_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
11 12 13 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 11 def link_to_background item_symbol link_to_section :background, item_symbol end |
#link_to_cribsheet(item_symbol) ⇒ Object
15 16 17 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 15 def link_to_cribsheet item_symbol link_to_section :cribsheets, item_symbol end |
#link_to_inclusion(item) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 49 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
23 24 25 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 23 def link_to_incubator item_symbol link_to_section :incubator, item_symbol end |
#link_to_intro(item_symbol) ⇒ Object
19 20 21 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 19 def link_to_intro item_symbol link_to_section :intro, item_symbol end |
#link_to_lab(item_symbol) ⇒ Object
27 28 29 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 27 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
41 42 43 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 41 def link_to_next toc, item nav_markup "", toc.find_next_forn(item).nitem.path, "glyphicon glyphicon-chevron-right", "next page" end |
#link_to_pa(item_symbol) ⇒ Object
31 32 33 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 31 def link_to_pa item_symbol link_to_section :pa, item_symbol end |
#link_to_prev(toc, item) ⇒ Object
45 46 47 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 45 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
36 37 38 39 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 36 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
7 8 9 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 7 def link_to_topic item_symbol link_to_section :topics, item_symbol end |