kbaum-munger 0.1.5 → 0.1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/munger/render/html.rb +31 -30
  2. metadata +1 -1
@@ -24,46 +24,47 @@ module Munger #:nodoc:
24
24
 
25
25
  def render
26
26
  x = Builder::XmlMarkup.new
27
-
28
27
  x.table(:class => @classes[:table], :id=>'report-table') do
29
-
30
- x.tr do
31
- @report.columns.each do |column|
32
- x.th(:class => 'columnTitle') { x << @report.column_title(column) }
28
+ x.thead do
29
+ x.tr do
30
+ @report.columns.each do |column|
31
+ x.th(:class => 'columnTitle') { x << @report.column_title(column) }
32
+ end
33
33
  end
34
34
  end
35
-
36
- @report.process_data.each do |row|
35
+ x.tbody do
36
+ @report.process_data.each do |row|
37
37
 
38
- classes = []
39
- classes << row[:meta][:row_styles]
40
- classes << 'group' + row[:meta][:group].to_s if row[:meta][:group]
41
- classes << cycle('even', 'odd')
42
- classes.compact!
38
+ classes = []
39
+ classes << row[:meta][:row_styles]
40
+ classes << 'group' + row[:meta][:group].to_s if row[:meta][:group]
41
+ classes << cycle('even', 'odd')
42
+ classes.compact!
43
43
 
44
- if row[:meta][:group_header]
45
- classes << 'groupHeader' + row[:meta][:group_header].to_s
46
- end
44
+ if row[:meta][:group_header]
45
+ classes << 'groupHeader' + row[:meta][:group_header].to_s
46
+ end
47
47
 
48
- row_attrib = {}
49
- row_attrib = {:class => classes.join(' ')} if classes.size > 0
48
+ row_attrib = {}
49
+ row_attrib = {:class => classes.join(' ')} if classes.size > 0
50
50
 
51
- x.tr(row_attrib) do
52
- if row[:meta][:group_header]
53
- header = row[:meta][:group_value].to_s
54
- x.th(:colspan => @report.columns.size) { x << header }
55
- else
56
- @report.columns.each do |column|
51
+ x.tr(row_attrib) do
52
+ if row[:meta][:group_header]
53
+ header = row[:meta][:group_value].to_s
54
+ x.th(:colspan => @report.columns.size) { x << header }
55
+ else
56
+ @report.columns.each do |column|
57
57
 
58
- cell_attrib = {}
59
- if cst = row[:meta][:cell_styles]
60
- cst = Item.ensure(cst)
61
- if cell_styles = cst[column]
62
- cell_attrib = {:class => cell_styles.join(' ')}
58
+ cell_attrib = {}
59
+ if cst = row[:meta][:cell_styles]
60
+ cst = Item.ensure(cst)
61
+ if cell_styles = cst[column]
62
+ cell_attrib = {:class => cell_styles.join(' ')}
63
+ end
63
64
  end
64
- end
65
65
 
66
- x.td(cell_attrib) { x << row[:data][column].to_s }
66
+ x.td(cell_attrib) { x << row[:data][column].to_s }
67
+ end
67
68
  end
68
69
  end
69
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kbaum-munger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Baum