Module: ThinkFeelDoEngine::SlidesHelper

Defined in:
app/helpers/think_feel_do_engine/slides_helper.rb

Overview

Provides helpers for slide creation.

Instance Method Summary collapse

Instance Method Details

#slide_panel(slide, slideshow, arm) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app/helpers/think_feel_do_engine/slides_helper.rb', line 32

def slide_panel(slide, slideshow, arm)
  if slide.slideshow.has_table_of_contents && slide.position == 1
    render "/think_feel_do_engine/bit_maker/slideshows/toc_panel",
           slide: slide,
           slideshow: slideshow,
           arm: arm
  else
    render "/think_feel_do_engine/bit_maker/slideshows/slide_panel",
           slide: slide,
           slideshow: slideshow,
           arm: arm
  end
end

#table_of_contents_display(slide) ⇒ Object



25
26
27
28
29
30
# File 'app/helpers/think_feel_do_engine/slides_helper.rb', line 25

def table_of_contents_display(slide)
  if slide.slideshow && slide.slideshow.has_table_of_contents &&
     slide.position == 1
    render "think_feel_do_engine/slides/table_of_contents", slide: slide
  end
end

Returns table of contents creation or destroy button based on slideshow attributes.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/helpers/think_feel_do_engine/slides_helper.rb', line 7

def table_of_contents_link(arm, slideshow)
  if slideshow.has_table_of_contents?
    link_to "Destroy Table of Contents",
            arm_bit_maker_slideshow_destroy_table_of_contents_path(
              arm,
              slideshow
            ),
            class: "btn btn-default toc"
  else
    link_to "Add Table of Contents",
            arm_bit_maker_slideshow_create_table_of_contents_path(
              arm,
              slideshow
            ),
            class: "btn btn-default toc"
  end
end