Module: Slideshow::TableHelper

Included in:
Gen
Defined in:
lib/slideshow/helpers/table_helper.rb

Instance Method Summary collapse

Instance Method Details

#left(opts = {}, &blk) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/slideshow/helpers/table_helper.rb', line 7

def left( opts={}, &blk )
   
  width = opts.fetch( :width, "50%" )
  clazz = opts.fetch( :class, nil )
   
  puts "  Adding HTML for left column (using table layout)..."
    
  text = capture_erb(&blk)
      
  before  = "<!-- begin left #{opts.inspect} -->\n"
  before << "<div class='#{clazz}'>\n"  if clazz  
  before << "<table width='100%'><tr><td width='#{width}' markdown='block' style='vertical-align: top;'>\n"
    
  after   = "</td>\n"  
  after  << "<!-- end left -->\n"

  html  = ""
  html << guard_block( before )
  html << text
  html << guard_block( after )

  concat_erb( html, blk.binding )
  return
end

#right(opts = {}, &blk) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/slideshow/helpers/table_helper.rb', line 32

def right( opts={}, &blk )

  width = opts.fetch( :width, "50%" )
  clazz = opts.fetch( :class, nil )
   
  puts "  Adding HTML for right column (using table layout)..."
    
  text = capture_erb(&blk)
    
  before  = "<!-- begin right #{opts.inspect} -->\n" 
  before << "<td width='#{width}' markdown='block' style='vertical-align: top;'>\n"  
    
  after   = "</td></tr></table>\n"
  after  << "</div>\n"  if clazz    
  after  << "<!-- end right -->\n"

  html  = ""
  html << guard_block( before )
  html << text
  html << guard_block( after )
      
  concat_erb( html, blk.binding )
  return
end