module NavigationHelpers
NavigationHelpers
provides methods for navigating the course. This is used in the nav bar along the top of the page. Called by main_navbar.html.erb
Public Instance Methods
link_to_background(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 19 def link_to_background(item_symbol) link_to_section :background, item_symbol end
link_to_cribsheet(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 23 def link_to_cribsheet(item_symbol) link_to_section :cribsheets, item_symbol end
link_to_homework(citem, attrs = {})
click to toggle source
def link_to_homework_2(citem)
unless citem.hwref.nil? "<div class=\"btn btn-sm btn-primary\">" + "<i class=\"fad fa-backpack\"></i>" + link_to_section(:homework, citem.hwref.to_sym) + "</div>" end
end
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 97 def link_to_homework(citem, attrs = {}) return "" if citem.hwref.nil? the_item = @items[lookup_nitem("homework", citem.hwref).identifier] # link_to(the_item[:title], the_item, attrs) link_to("homework", the_item, attrs) end
link_to_inclusion(item)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 66 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)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 31 def link_to_incubator(item_symbol) link_to_section :incubator, item_symbol end
link_to_intro(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 27 def link_to_intro(item_symbol) link_to_section :intro, item_symbol end
link_to_lab(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 35 def link_to_lab(item_symbol) link_to_section :lab, item_symbol end
link_to_lecture(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 5 def link_to_lecture(item_symbol) link_to_section :lectures, item_symbol end
link_to_next(toc, item, attrs = {})
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 56 def link_to_next(toc, item, attrs = {}) next_nitem = toc.find_next_forn(item).identifier link_to 'next', @items[next_nitem].path, attrs end
link_to_next_lecture()
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 9 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)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 39 def link_to_pa(item_symbol) link_to_section :pa, item_symbol end
link_to_page(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 43 def link_to_page(item_symbol) link_to_section :pages, item_symbol end
link_to_prev(toc, item, attrs = {})
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 61 def link_to_prev(toc, item, attrs = {}) prev_nitem = toc.find_previous_forn(item).identifier link_to 'previous', @items[prev_nitem].path, attrs end
link_to_project(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 47 def link_to_project(item_symbol) link_to_section :projects, item_symbol end
link_to_section(section_symbol, item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 51 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_slides(attrs = {})
click to toggle source
def link_to_slides_2
'<a
class="btn btn-sm btn-primary"
href="./slides.html"
title="slides">
<i class="fas fa-chalkboard-teacher"></i> Slides
</a>'
end
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 84 def link_to_slides(attrs = {}) link_to("slides", "./slides.html", attrs) end
link_to_topic(item_symbol)
click to toggle source
# File lib/coursegen/course/helpers/navigation_helpers.rb, line 15 def link_to_topic(item_symbol) link_to_section :topics, item_symbol end