Module: NavigationHelpers

Defined in:
lib/coursegen/course/helpers/navigation_helpers.rb

Instance Method Summary collapse

Instance Method Details



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


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


48
49
50
51
52
53
54
55
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 48

def link_to_inclusion item
  inclusion = Toc.instance.lookup_inclusion(item)
  if inclusion.nil?
    "(never included)"
  else
    " (#{inclusion.identifier})"
  end
end


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


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


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


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


40
41
42
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 40

def link_to_next toc, item
  nav_markup "", toc.find_next_forn(item).nitem.path, "glyphicon glyphicon-chevron-right", "next page"
end


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


44
45
46
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 44

def link_to_prev toc, item
  nav_markup "", toc.find_previous_forn(item).nitem.path, "glyphicon glyphicon-chevron-left", "previous page"
end


35
36
37
38
# File 'lib/coursegen/course/helpers/navigation_helpers.rb', line 35

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


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