Module: NavigationHelpers
- Defined in:
- lib/coursegen/course/helpers/navigation_helpers.rb
Overview
Used in the nav bar along the top of the page. Called by main_navbar.html.erb
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_page(item_symbol) ⇒ Object
- #link_to_prev(toc, item) ⇒ Object
- #link_to_project(item_symbol) ⇒ Object
- #link_to_section(section_symbol, item_symbol) ⇒ Object
- #link_to_topic(item_symbol) ⇒ Object
Instance Method Details
#link_to_background(item_symbol) ⇒ Object
17 18 19 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 17 def link_to_background item_symbol link_to_section :background, item_symbol end |
#link_to_cribsheet(item_symbol) ⇒ Object
21 22 23 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 21 def link_to_cribsheet item_symbol link_to_section :cribsheets, item_symbol end |
#link_to_inclusion(item) ⇒ Object
64 65 66 67 68 69 70 71 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 64 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
29 30 31 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 29 def link_to_incubator item_symbol link_to_section :incubator, item_symbol end |
#link_to_intro(item_symbol) ⇒ Object
25 26 27 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 25 def link_to_intro item_symbol link_to_section :intro, item_symbol end |
#link_to_lab(item_symbol) ⇒ Object
33 34 35 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 33 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
54 55 56 57 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 54 def link_to_next toc, item next_nitem = toc.find_next_forn(item).identifier nav_markup "", @items[next_nitem].path, "glyphicon glyphicon-arrow-right", "next page" end |
#link_to_next_lecture ⇒ Object
7 8 9 10 11 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 7 def link_to_next_lecture the_citem = Toc.instance.find_next_forn(@item) the_item = @items[the_citem.identifier] link_to(the_citem.title, the_item) end |
#link_to_pa(item_symbol) ⇒ Object
37 38 39 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 37 def link_to_pa item_symbol link_to_section :pa, item_symbol end |
#link_to_page(item_symbol) ⇒ Object
41 42 43 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 41 def link_to_page item_symbol link_to_section :pages, item_symbol end |
#link_to_prev(toc, item) ⇒ Object
59 60 61 62 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 59 def link_to_prev toc, item prev_nitem = toc.find_previous_forn(item).identifier nav_markup "", @items[prev_nitem].path, "glyphicon glyphicon-arrow-left", "previous page" end |
#link_to_project(item_symbol) ⇒ Object
45 46 47 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 45 def link_to_project item_symbol link_to_section :projects, item_symbol end |
#link_to_section(section_symbol, item_symbol) ⇒ Object
49 50 51 52 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 49 def link_to_section section_symbol, item_symbol the_item = @items[lookup_nitem(section_symbol.to_s, item_symbol.to_s).identifier] link_to(the_item[:title], the_item) end |
#link_to_topic(item_symbol) ⇒ Object
13 14 15 |
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 13 def link_to_topic item_symbol link_to_section :topics, item_symbol end |