tableficate 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/README.markdown +6 -4
  2. data/app/views/tableficate/_data.html.erb +7 -1
  3. data/app/views/tableficate/_header.html.erb +2 -2
  4. data/app/views/tableficate/_table.html.erb +16 -23
  5. data/app/views/tableficate/_table_for.html.erb +9 -0
  6. data/app/views/tableficate/filters/_check_box_choice.html.erb +3 -0
  7. data/app/views/tableficate/filters/_form.html.erb +16 -0
  8. data/app/views/tableficate/filters/_radio_choice.html.erb +3 -0
  9. data/changelog.markdown +17 -0
  10. data/lib/generators/tableficate/theme/theme_generator.rb +17 -1
  11. data/lib/tableficate.rb +3 -0
  12. data/lib/tableficate/action_column.rb +2 -2
  13. data/lib/tableficate/caption.rb +29 -0
  14. data/lib/tableficate/column.rb +13 -7
  15. data/lib/tableficate/empty.rb +34 -0
  16. data/lib/tableficate/filters/base.rb +7 -5
  17. data/lib/tableficate/filters/check_box.rb +1 -1
  18. data/lib/tableficate/filters/choice.rb +2 -2
  19. data/lib/tableficate/filters/collection_base.rb +13 -0
  20. data/lib/tableficate/filters/input.rb +2 -2
  21. data/lib/tableficate/filters/input_range.rb +6 -6
  22. data/lib/tableficate/filters/radio.rb +1 -1
  23. data/lib/tableficate/filters/select.rb +1 -1
  24. data/lib/tableficate/filters/select_range.rb +4 -4
  25. data/lib/tableficate/finder.rb +70 -28
  26. data/lib/tableficate/helper.rb +44 -47
  27. data/lib/tableficate/table.rb +64 -24
  28. data/lib/tableficate/utils.rb +27 -2
  29. data/lib/tableficate/version.rb +1 -1
  30. data/spec/action_column_spec.rb +9 -1
  31. data/spec/base_spec.rb +10 -0
  32. data/spec/caption_spec.rb +33 -0
  33. data/spec/column_spec.rb +29 -0
  34. data/spec/empty_spec.rb +45 -0
  35. data/spec/filters/base_spec.rb +6 -5
  36. data/spec/filters/choice_spec.rb +5 -2
  37. data/spec/filters/collection_spec.rb +4 -4
  38. data/spec/filters/input_range_spec.rb +10 -8
  39. data/spec/filters/select_range_spec.rb +79 -0
  40. data/spec/finder_spec.rb +48 -1
  41. data/spec/generators/tableficate_theme_spec.rb +14 -0
  42. data/spec/table_spec.rb +114 -3
  43. data/spec/test_app/app/controllers/filters_controller.rb +1 -1
  44. data/spec/test_app/app/controllers/tests_controller.rb +5 -0
  45. data/spec/test_app/app/controllers/themes_controller.rb +7 -0
  46. data/spec/test_app/app/views/filters/html5_input_types.html.erb +31 -0
  47. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box_choice.html.erb +2 -0
  48. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio_choice.html.erb +2 -0
  49. data/spec/test_app/app/views/tests/index.html.erb +13 -0
  50. data/spec/test_app/app/views/themes/caption.html.erb +9 -0
  51. data/spec/test_app/app/views/themes/column_attrs.html.erb +7 -0
  52. data/spec/test_app/app/views/themes/column_cell_attrs.html.erb +7 -0
  53. data/spec/test_app/app/views/themes/column_cell_attrs_with_proc.html.erb +7 -0
  54. data/spec/test_app/app/views/themes/column_header_attrs.html.erb +7 -0
  55. data/spec/test_app/app/views/themes/empty_with_data.html.erb +9 -0
  56. data/spec/test_app/app/views/themes/empty_with_no_data.html.erb +9 -0
  57. data/spec/test_app/app/views/themes/no_caption.html.erb +7 -0
  58. data/spec/test_app/app/views/themes/no_column_attrs.html.erb +7 -0
  59. data/spec/test_app/config/application.rb +1 -1
  60. data/spec/test_app/config/routes.rb +2 -0
  61. data/spec/test_app/db/migrate/20111227224959_additional_columns.rb +73 -0
  62. data/spec/test_app/db/migrate/20111230203456_created_at_specific_dates.rb +11 -0
  63. data/spec/test_app/db/schema.rb +10 -3
  64. data/spec/test_app/db/test.sqlite3 +0 -0
  65. data/spec/theme/caption_spec.rb +15 -0
  66. data/spec/theme/column_spec.rb +35 -0
  67. data/spec/theme/empty_spec.rb +15 -0
  68. data/spec/utils_spec.rb +44 -4
  69. metadata +69 -58
  70. data/spec/test_app/app/views/tableficate/custom_check_box_block/_data.html.erb +0 -1
  71. data/spec/test_app/app/views/tableficate/custom_check_box_block/_header.html.erb +0 -8
  72. data/spec/test_app/app/views/tableficate/custom_check_box_block/_row.html.erb +0 -5
  73. data/spec/test_app/app/views/tableficate/custom_check_box_block/_table.html.erb +0 -36
  74. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box.html.erb +0 -7
  75. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input.html.erb +0 -4
  76. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input_range.html.erb +0 -6
  77. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_radio.html.erb +0 -4
  78. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select.html.erb +0 -4
  79. data/spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select_range_filter.html.erb +0 -6
  80. data/spec/test_app/app/views/tableficate/custom_radio_block/_data.html.erb +0 -1
  81. data/spec/test_app/app/views/tableficate/custom_radio_block/_header.html.erb +0 -8
  82. data/spec/test_app/app/views/tableficate/custom_radio_block/_row.html.erb +0 -5
  83. data/spec/test_app/app/views/tableficate/custom_radio_block/_table.html.erb +0 -36
  84. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_check_box.html.erb +0 -4
  85. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_input.html.erb +0 -4
  86. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_input_range.html.erb +0 -6
  87. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio.html.erb +0 -7
  88. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_select.html.erb +0 -4
  89. data/spec/test_app/app/views/tableficate/custom_radio_block/filters/_select_range_filter.html.erb +0 -6
  90. data/spec/test_app/public/index.html +0 -241
@@ -0,0 +1,5 @@
1
+ class TestsController < ApplicationController
2
+ def index
3
+ @files = Dir[File.join(Rails.root, 'app', 'views', '**', '*.html.erb')].reject{|file| File.dirname(file) =~ /views\/(tableficate|layouts|tests)/}
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ class ThemesController < ApplicationController
2
+ before_filter :get_npw
3
+
4
+ def get_npw
5
+ @npw = NobelPrizeWinner.select('nobel_prize_winners.*, nobel_prizes.category, nobel_prizes.year').joins(:nobel_prizes).tableficate(params[:nobel_prize_winners])
6
+ end
7
+ end
@@ -0,0 +1,31 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :created_at
4
+ t.column :updated_at
5
+ t.column :first_name
6
+ t.column :last_name
7
+ t.column :birthdate
8
+ t.column :category
9
+ t.column :year
10
+ t.column :shared do |record|
11
+ record.shared? ? 'Yes' : 'No'
12
+ end
13
+ t.column :meaningless_time
14
+ t.column :meaningless_decimal
15
+ t.column :meaningless_float
16
+
17
+ t.filter :id
18
+ t.filter :created_at
19
+ t.filter :updated_at
20
+ t.filter :first_name
21
+ t.filter :last_name
22
+ t.filter :birthdate
23
+ t.filter :category,
24
+ collection: ['Chemistry', 'Literature', 'Peace', 'Physics', 'Physiology or Medicine'],
25
+ include_blank: true
26
+ t.filter :year
27
+ t.filter :shared
28
+ t.filter :meaningless_time
29
+ t.filter :meaningless_decimal
30
+ t.filter :meaningless_float
31
+ end %>
@@ -0,0 +1,2 @@
1
+ <%= label_tag("#{filter.field_name}[#{choice.value}]", choice.name) %>
2
+ <%= check_box_tag("#{filter.field_name}[#{choice.value}]", choice.value, choice.checked?, choice.attrs.reverse_merge(name: "#{filter.field_name}[]")) %>
@@ -0,0 +1,2 @@
1
+ <%= label_tag("#{filter.field_name}[#{choice.value}]", choice.name) %>
2
+ <%= radio_button_tag(filter.field_name, choice.value, choice.checked?, choice.attrs) %>
@@ -0,0 +1,13 @@
1
+ <h1>Tests</h1>
2
+
3
+ <ul>
4
+ <% @files.group_by{|file| File.dirname(file)}.each do |dir_group| %>
5
+ <li><%= dir_group.first.split('/').last %><ul>
6
+ <% dir_group.last.each do |file| %>
7
+ <li>
8
+ <%= link_to(file.split('/').last.split('.').first, file.gsub(File.join(Rails.root, 'app', 'views'), '').gsub('.html.erb', '')) %>
9
+ </li>
10
+ <% end %>
11
+ </ul></li>
12
+ <% end %>
13
+ </ul>
@@ -0,0 +1,9 @@
1
+ <%= table_for @npw do |t|
2
+ t.caption 'Nobel Prize Winners'
3
+
4
+ t.column :id
5
+ t.column :first_name
6
+ t.column :last_name
7
+ t.column :category
8
+ t.column :year
9
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category, style: 'background-color: red;'
6
+ t.column :year
7
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category, cell_attrs: {style: 'background-color: red;'}
6
+ t.column :year
7
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category
6
+ t.column :year, cell_attrs: {style: ->(row){"color: #{row.year > 1950 ? 'green' : 'red'};"}}
7
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category, header_attrs: {style: 'background-color: red;'}
6
+ t.column :year
7
+ end %>
@@ -0,0 +1,9 @@
1
+ <%= table_for @npw do |t|
2
+ t.empty 'There is no data.'
3
+
4
+ t.column :id
5
+ t.column :first_name
6
+ t.column :last_name
7
+ t.column :category
8
+ t.column :year
9
+ end %>
@@ -0,0 +1,9 @@
1
+ <%= table_for @npw.limit(0) do |t|
2
+ t.empty 'There is no data.'
3
+
4
+ t.column :id
5
+ t.column :first_name
6
+ t.column :last_name
7
+ t.column :category
8
+ t.column :year
9
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category
6
+ t.column :year
7
+ end %>
@@ -0,0 +1,7 @@
1
+ <%= table_for @npw do |t|
2
+ t.column :id
3
+ t.column :first_name
4
+ t.column :last_name
5
+ t.column :category
6
+ t.column :year
7
+ end %>
@@ -27,7 +27,7 @@ module TestApp
27
27
 
28
28
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
29
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
- # config.time_zone = 'Central Time (US & Canada)'
30
+ config.time_zone = 'Central Time (US & Canada)'
31
31
 
32
32
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
33
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
@@ -1,3 +1,5 @@
1
1
  TestApp::Application.routes.draw do
2
+ root controller: 'tests', action: 'index'
3
+
2
4
  match ':controller(/:action(/:id(.:format)))'
3
5
  end
@@ -0,0 +1,73 @@
1
+ class AdditionalColumns < ActiveRecord::Migration
2
+ def up
3
+ add_column :nobel_prize_winners, :birthdate, :date
4
+ add_column :nobel_prize_winners, :created_at, :datetime
5
+ add_column :nobel_prize_winners, :updated_at, :timestamp
6
+ add_column :nobel_prize_winners, :meaningless_time, :time
7
+ add_column :nobel_prizes, :shared, :boolean
8
+ add_column :nobel_prizes, :meaningless_decimal, :decimal
9
+ add_column :nobel_prizes, :meaningless_float, :float
10
+
11
+ npw_updates = {
12
+ 1 => {birthdate: '19140325'},
13
+ 2 => {birthdate: '19100619'},
14
+ 3 => {birthdate: '18790314'},
15
+ 4 => {birthdate: '19060413'},
16
+ 5 => {birthdate: '18851007'},
17
+ 6 => {birthdate: '18870812'},
18
+ 7 => {birthdate: '19020808'},
19
+ 8 => {birthdate: '19010929'},
20
+ 9 => {birthdate: '19180511'},
21
+ 10 => {birthdate: '18671107'},
22
+ 11 => {birthdate: '19280406'},
23
+ 12 => {birthdate: '18720518'},
24
+ 13 => {birthdate: '19020227'},
25
+ 14 => {birthdate: '19180718'},
26
+ 15 => {birthdate: '19100209'}
27
+ }
28
+
29
+ np_updates = {
30
+ 1 => {shared: false},
31
+ 2 => {shared: false},
32
+ 3 => {shared: false},
33
+ 4 => {shared: false},
34
+ 5 => {shared: false},
35
+ 6 => {shared: true},
36
+ 7 => {shared: true},
37
+ 8 => {shared: false},
38
+ 9 => {shared: true},
39
+ 10 => {shared: true},
40
+ 16 => {shared: false},
41
+ 11 => {shared: true},
42
+ 12 => {shared: false},
43
+ 13 => {shared: false},
44
+ 14 => {shared: true},
45
+ 15 => {shared: true}
46
+ }
47
+
48
+ npw_updates.each do |id, attrs|
49
+ NobelPrizeWinner.find(id).update_attributes(attrs.merge(
50
+ created_at: Time.now,
51
+ updated_at: Time.now,
52
+ meaningless_time: "#{id}:#{id}:#{id}"
53
+ ))
54
+ end
55
+
56
+ np_updates.each do |id, attrs|
57
+ NobelPrize.find(id).update_attributes(attrs.merge(
58
+ meaningless_decimal: "#{id}.#{id}",
59
+ meaningless_float: "#{id}.#{id}"
60
+ ))
61
+ end
62
+ end
63
+
64
+ def down
65
+ remove_column :nobel_prize_winners, :birthdate
66
+ remove_column :nobel_prize_winners, :created_at
67
+ remove_column :nobel_prize_winners, :updated_at
68
+ remove_column :nobel_prize_winners, :meaningless_time
69
+ remove_column :nobel_prizes, :shared
70
+ remove_column :nobel_prizes, :meaningless_decimal
71
+ remove_column :nobel_prizes, :meaningless_float
72
+ end
73
+ end
@@ -0,0 +1,11 @@
1
+ class CreatedAtSpecificDates < ActiveRecord::Migration
2
+ def up
3
+ NobelPrizeWinner.all.each do |npw|
4
+ npw.created_at = DateTime.new(2011, 1, npw.id, 11, npw.id, 12)
5
+ npw.save
6
+ end
7
+ end
8
+
9
+ def down
10
+ end
11
+ end
@@ -11,17 +11,24 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20111010191626) do
14
+ ActiveRecord::Schema.define(:version => 20111230203456) do
15
15
 
16
16
  create_table "nobel_prize_winners", :force => true do |t|
17
- t.string "first_name"
18
- t.string "last_name"
17
+ t.string "first_name"
18
+ t.string "last_name"
19
+ t.date "birthdate"
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ t.time "meaningless_time"
19
23
  end
20
24
 
21
25
  create_table "nobel_prizes", :force => true do |t|
22
26
  t.integer "nobel_prize_winner_id"
23
27
  t.string "category"
24
28
  t.integer "year"
29
+ t.boolean "shared"
30
+ t.decimal "meaningless_decimal"
31
+ t.float "meaningless_float"
25
32
  end
26
33
 
27
34
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Theme', type: :request do
4
+ describe 'Caption' do
5
+ it 'should display a caption if one is specified' do
6
+ visit '/themes/caption'
7
+ page.should have_xpath('//caption[text()="Nobel Prize Winners"]')
8
+ end
9
+
10
+ it 'should display no caption if no caption is specified' do
11
+ visit '/themes/no_caption'
12
+ page.should have_no_xpath('//caption')
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Theme', type: :request do
4
+ describe 'Column' do
5
+ before(:all) do
6
+ @npw = NobelPrizeWinner.select('nobel_prize_winners.*, nobel_prizes.category, nobel_prizes.year').joins(:nobel_prizes)
7
+ end
8
+ it 'should accept :header_attrs as an option' do
9
+ visit '/themes/column_header_attrs'
10
+ page.should have_xpath('//th[4][@style="background-color: red;"]')
11
+ end
12
+
13
+ it 'should accept :cell_attrs as an option' do
14
+ visit '/themes/column_cell_attrs'
15
+ @npw.count.times do |i|
16
+ page.should have_xpath("//tr[#{i+1}]/td[4][@style=\"background-color: red;\"]")
17
+ end
18
+ end
19
+ it 'should allow :cell_attrs to take a Proc' do
20
+ visit '/themes/column_cell_attrs_with_proc'
21
+ @npw.each_with_index do |n, i|
22
+ page.should have_xpath("//tr[#{i + 1}]/td[5][@style=\"color: #{n.year > 1950 ? 'green' : 'red'};\"]")
23
+ end
24
+ end
25
+
26
+ it 'should take all non-specialized options as attrs on the `col` tag' do
27
+ visit '/themes/column_attrs'
28
+ page.html.should match /<col span="3">\n<col style="background-color: red;">\n<col>/
29
+ end
30
+ it 'should only create `col` tags if needed' do
31
+ visit '/themes/no_column_attrs'
32
+ page.should have_no_xpath("//cols")
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Theme', type: :request do
4
+ describe 'Empty' do
5
+ it 'should display text when the table has no data' do
6
+ visit '/themes/empty_with_no_data'
7
+ page.should have_xpath('//td[1][text()="There is no data."]')
8
+ end
9
+
10
+ it 'should not display text when the table has data' do
11
+ visit '/themes/empty_with_data'
12
+ page.should have_no_xpath('//td[1][text()="There is no data."]')
13
+ end
14
+ end
15
+ end
@@ -1,11 +1,51 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Tableficate::Utils do
4
- it 'should construct a path with no theme' do
5
- Tableficate::Utils::template_path('template.rb').should == 'tableficate/template.rb'
4
+ describe 'template_path' do
5
+ before(:each) do
6
+ @template = mock('Template')
7
+ @template.stub!(:lookup_context).and_return(ActionView::LookupContext.new([]))
8
+ end
9
+
10
+ it 'should construct a path with no theme' do
11
+ @template.lookup_context.stub(:exists?).and_return(true)
12
+
13
+ Tableficate::Utils::template_path(@template, 'table').should == 'tableficate/table'
14
+ end
15
+
16
+ it 'should construct a path with a theme' do
17
+ @template.lookup_context.stub(:exists?).and_return(true)
18
+
19
+ Tableficate::Utils::template_path(@template, 'table', 'futuristic').should == 'tableficate/futuristic/table'
20
+ end
21
+
22
+ it 'should fallback to a path with no theme if the theme does not have the requested partial' do
23
+ @template.lookup_context.should_receive(:exists?) do |*args|
24
+ (args.first == 'tableficate/table')
25
+ end
26
+
27
+ Tableficate::Utils::template_path(@template, 'table', 'futuristic').should == 'tableficate/table'
28
+ end
6
29
  end
7
30
 
8
- it 'should construct a path with a theme' do
9
- Tableficate::Utils::template_path('template.rb', 'futuristic').should == 'tableficate/futuristic/template.rb'
31
+ describe 'find_column_type' do
32
+ it 'should find the column type' do
33
+ Tableficate::Utils::find_column_type(NobelPrizeWinner, :first_name).should == :string
34
+ end
35
+
36
+ it 'should find the column in a join' do
37
+ Tableficate::Utils::find_column_type(NobelPrizeWinner.joins(:nobel_prizes), :year).should == :integer
38
+
39
+ # pluralization of the join type should be accounted for
40
+ Tableficate::Utils::find_column_type(NobelPrize.joins(:nobel_prize_winner), :birthdate).should == :date
41
+ end
42
+
43
+ it 'should find the column for manual joins' do
44
+ Tableficate::Utils::find_column_type(NobelPrizeWinner.joins('JOIN nobel_prizes ON nobel_prizes.nobel_prize_winner_id = nobel_prize_winners.id'), :shared).should == :boolean
45
+ end
46
+
47
+ it 'should return `nil` for unknown columns' do
48
+ Tableficate::Utils::find_column_type(NobelPrizeWinner, :foo).should == nil
49
+ end
10
50
  end
11
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tableficate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-23 00:00:00.000000000Z
12
+ date: 2012-01-02 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70146560550740 !ruby/object:Gem::Requirement
16
+ requirement: &70355461259820 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70146560550740
24
+ version_requirements: *70355461259820
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70146560548780 !ruby/object:Gem::Requirement
27
+ requirement: &70355461255640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70146560548780
35
+ version_requirements: *70355461255640
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70146560545380 !ruby/object:Gem::Requirement
38
+ requirement: &70355461255140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70146560545380
46
+ version_requirements: *70355461255140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: genspec
49
- requirement: &70146560538760 !ruby/object:Gem::Requirement
49
+ requirement: &70355461254700 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70146560538760
57
+ version_requirements: *70355461254700
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: sqlite3
60
- requirement: &70146560536940 !ruby/object:Gem::Requirement
60
+ requirement: &70355461254200 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70146560536940
68
+ version_requirements: *70355461254200
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: capybara
71
- requirement: &70146560534160 !ruby/object:Gem::Requirement
71
+ requirement: &70355461253760 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70146560534160
79
+ version_requirements: *70355461253760
80
80
  description: A DSL for Rails that provides easy table creation with sorting and filtering.
81
81
  email:
82
82
  - alasseigne@sei-mi.com
@@ -93,10 +93,14 @@ files:
93
93
  - app/views/tableficate/_header.html.erb
94
94
  - app/views/tableficate/_row.html.erb
95
95
  - app/views/tableficate/_table.html.erb
96
+ - app/views/tableficate/_table_for.html.erb
96
97
  - app/views/tableficate/filters/_check_box.html.erb
98
+ - app/views/tableficate/filters/_check_box_choice.html.erb
99
+ - app/views/tableficate/filters/_form.html.erb
97
100
  - app/views/tableficate/filters/_input.html.erb
98
101
  - app/views/tableficate/filters/_input_range.html.erb
99
102
  - app/views/tableficate/filters/_radio.html.erb
103
+ - app/views/tableficate/filters/_radio_choice.html.erb
100
104
  - app/views/tableficate/filters/_select.html.erb
101
105
  - app/views/tableficate/filters/_select_range.html.erb
102
106
  - changelog.markdown
@@ -107,13 +111,16 @@ files:
107
111
  - lib/tableficate/action_column.rb
108
112
  - lib/tableficate/active_record_extension.rb
109
113
  - lib/tableficate/base.rb
114
+ - lib/tableficate/caption.rb
110
115
  - lib/tableficate/column.rb
116
+ - lib/tableficate/empty.rb
111
117
  - lib/tableficate/engine.rb
112
118
  - lib/tableficate/exceptions.rb
113
119
  - lib/tableficate/filters/base.rb
114
120
  - lib/tableficate/filters/check_box.rb
115
121
  - lib/tableficate/filters/choice.rb
116
122
  - lib/tableficate/filters/collection.rb
123
+ - lib/tableficate/filters/collection_base.rb
117
124
  - lib/tableficate/filters/input.rb
118
125
  - lib/tableficate/filters/input_range.rb
119
126
  - lib/tableficate/filters/radio.rb
@@ -127,12 +134,15 @@ files:
127
134
  - spec/action_column_spec.rb
128
135
  - spec/active_record_extension_spec.rb
129
136
  - spec/base_spec.rb
137
+ - spec/caption_spec.rb
130
138
  - spec/column_spec.rb
139
+ - spec/empty_spec.rb
131
140
  - spec/filters/base_spec.rb
132
141
  - spec/filters/choice_spec.rb
133
142
  - spec/filters/collection_spec.rb
134
143
  - spec/filters/input_range_spec.rb
135
144
  - spec/filters/input_spec.rb
145
+ - spec/filters/select_range_spec.rb
136
146
  - spec/finder_spec.rb
137
147
  - spec/generators/tableficate_table_spec.rb
138
148
  - spec/generators/tableficate_theme_spec.rb
@@ -148,38 +158,33 @@ files:
148
158
  - spec/test_app/app/assets/stylesheets/application.css
149
159
  - spec/test_app/app/controllers/application_controller.rb
150
160
  - spec/test_app/app/controllers/filters_controller.rb
161
+ - spec/test_app/app/controllers/tests_controller.rb
162
+ - spec/test_app/app/controllers/themes_controller.rb
151
163
  - spec/test_app/app/helpers/application_helper.rb
152
164
  - spec/test_app/app/mailers/.gitkeep
153
165
  - spec/test_app/app/models/.gitkeep
154
166
  - spec/test_app/app/models/nobel_prize.rb
155
167
  - spec/test_app/app/models/nobel_prize_winner.rb
156
168
  - spec/test_app/app/views/filters/check_box_tags.html.erb
169
+ - spec/test_app/app/views/filters/html5_input_types.html.erb
157
170
  - spec/test_app/app/views/filters/multi_select_from_string.html.erb
158
171
  - spec/test_app/app/views/filters/multi_select_tag.html.erb
159
172
  - spec/test_app/app/views/filters/radio_tags.html.erb
160
173
  - spec/test_app/app/views/filters/select_from_string.html.erb
161
174
  - spec/test_app/app/views/filters/select_tag.html.erb
162
175
  - spec/test_app/app/views/layouts/application.html.erb
163
- - spec/test_app/app/views/tableficate/custom_check_box_block/_data.html.erb
164
- - spec/test_app/app/views/tableficate/custom_check_box_block/_header.html.erb
165
- - spec/test_app/app/views/tableficate/custom_check_box_block/_row.html.erb
166
- - spec/test_app/app/views/tableficate/custom_check_box_block/_table.html.erb
167
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box.html.erb
168
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input.html.erb
169
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input_range.html.erb
170
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_radio.html.erb
171
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select.html.erb
172
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select_range_filter.html.erb
173
- - spec/test_app/app/views/tableficate/custom_radio_block/_data.html.erb
174
- - spec/test_app/app/views/tableficate/custom_radio_block/_header.html.erb
175
- - spec/test_app/app/views/tableficate/custom_radio_block/_row.html.erb
176
- - spec/test_app/app/views/tableficate/custom_radio_block/_table.html.erb
177
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_check_box.html.erb
178
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_input.html.erb
179
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_input_range.html.erb
180
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio.html.erb
181
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_select.html.erb
182
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_select_range_filter.html.erb
176
+ - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box_choice.html.erb
177
+ - spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio_choice.html.erb
178
+ - spec/test_app/app/views/tests/index.html.erb
179
+ - spec/test_app/app/views/themes/caption.html.erb
180
+ - spec/test_app/app/views/themes/column_attrs.html.erb
181
+ - spec/test_app/app/views/themes/column_cell_attrs.html.erb
182
+ - spec/test_app/app/views/themes/column_cell_attrs_with_proc.html.erb
183
+ - spec/test_app/app/views/themes/column_header_attrs.html.erb
184
+ - spec/test_app/app/views/themes/empty_with_data.html.erb
185
+ - spec/test_app/app/views/themes/empty_with_no_data.html.erb
186
+ - spec/test_app/app/views/themes/no_caption.html.erb
187
+ - spec/test_app/app/views/themes/no_column_attrs.html.erb
183
188
  - spec/test_app/config.ru
184
189
  - spec/test_app/config/application.rb
185
190
  - spec/test_app/config/boot.rb
@@ -198,6 +203,8 @@ files:
198
203
  - spec/test_app/config/routes.rb
199
204
  - spec/test_app/db/migrate/20111007154222_create_nobel_prize_winners.rb
200
205
  - spec/test_app/db/migrate/20111010191626_create_nobel_prizes.rb
206
+ - spec/test_app/db/migrate/20111227224959_additional_columns.rb
207
+ - spec/test_app/db/migrate/20111230203456_created_at_specific_dates.rb
201
208
  - spec/test_app/db/schema.rb
202
209
  - spec/test_app/db/seeds.rb
203
210
  - spec/test_app/db/test.sqlite3
@@ -209,11 +216,13 @@ files:
209
216
  - spec/test_app/public/422.html
210
217
  - spec/test_app/public/500.html
211
218
  - spec/test_app/public/favicon.ico
212
- - spec/test_app/public/index.html
213
219
  - spec/test_app/public/robots.txt
214
220
  - spec/test_app/script/rails
215
221
  - spec/test_app/vendor/assets/stylesheets/.gitkeep
216
222
  - spec/test_app/vendor/plugins/.gitkeep
223
+ - spec/theme/caption_spec.rb
224
+ - spec/theme/column_spec.rb
225
+ - spec/theme/empty_spec.rb
217
226
  - spec/utils_spec.rb
218
227
  - tableficate.gemspec
219
228
  homepage: https://github.com/sei-mi/tableficate
@@ -230,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
230
239
  version: '0'
231
240
  segments:
232
241
  - 0
233
- hash: -4029356526350698911
242
+ hash: -3947316157518683488
234
243
  required_rubygems_version: !ruby/object:Gem::Requirement
235
244
  none: false
236
245
  requirements:
@@ -239,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
239
248
  version: '0'
240
249
  segments:
241
250
  - 0
242
- hash: -4029356526350698911
251
+ hash: -3947316157518683488
243
252
  requirements: []
244
253
  rubyforge_project: tableficate
245
254
  rubygems_version: 1.8.6
@@ -250,12 +259,15 @@ test_files:
250
259
  - spec/action_column_spec.rb
251
260
  - spec/active_record_extension_spec.rb
252
261
  - spec/base_spec.rb
262
+ - spec/caption_spec.rb
253
263
  - spec/column_spec.rb
264
+ - spec/empty_spec.rb
254
265
  - spec/filters/base_spec.rb
255
266
  - spec/filters/choice_spec.rb
256
267
  - spec/filters/collection_spec.rb
257
268
  - spec/filters/input_range_spec.rb
258
269
  - spec/filters/input_spec.rb
270
+ - spec/filters/select_range_spec.rb
259
271
  - spec/finder_spec.rb
260
272
  - spec/generators/tableficate_table_spec.rb
261
273
  - spec/generators/tableficate_theme_spec.rb
@@ -271,38 +283,33 @@ test_files:
271
283
  - spec/test_app/app/assets/stylesheets/application.css
272
284
  - spec/test_app/app/controllers/application_controller.rb
273
285
  - spec/test_app/app/controllers/filters_controller.rb
286
+ - spec/test_app/app/controllers/tests_controller.rb
287
+ - spec/test_app/app/controllers/themes_controller.rb
274
288
  - spec/test_app/app/helpers/application_helper.rb
275
289
  - spec/test_app/app/mailers/.gitkeep
276
290
  - spec/test_app/app/models/.gitkeep
277
291
  - spec/test_app/app/models/nobel_prize.rb
278
292
  - spec/test_app/app/models/nobel_prize_winner.rb
279
293
  - spec/test_app/app/views/filters/check_box_tags.html.erb
294
+ - spec/test_app/app/views/filters/html5_input_types.html.erb
280
295
  - spec/test_app/app/views/filters/multi_select_from_string.html.erb
281
296
  - spec/test_app/app/views/filters/multi_select_tag.html.erb
282
297
  - spec/test_app/app/views/filters/radio_tags.html.erb
283
298
  - spec/test_app/app/views/filters/select_from_string.html.erb
284
299
  - spec/test_app/app/views/filters/select_tag.html.erb
285
300
  - spec/test_app/app/views/layouts/application.html.erb
286
- - spec/test_app/app/views/tableficate/custom_check_box_block/_data.html.erb
287
- - spec/test_app/app/views/tableficate/custom_check_box_block/_header.html.erb
288
- - spec/test_app/app/views/tableficate/custom_check_box_block/_row.html.erb
289
- - spec/test_app/app/views/tableficate/custom_check_box_block/_table.html.erb
290
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box.html.erb
291
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input.html.erb
292
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_input_range.html.erb
293
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_radio.html.erb
294
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select.html.erb
295
- - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_select_range_filter.html.erb
296
- - spec/test_app/app/views/tableficate/custom_radio_block/_data.html.erb
297
- - spec/test_app/app/views/tableficate/custom_radio_block/_header.html.erb
298
- - spec/test_app/app/views/tableficate/custom_radio_block/_row.html.erb
299
- - spec/test_app/app/views/tableficate/custom_radio_block/_table.html.erb
300
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_check_box.html.erb
301
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_input.html.erb
302
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_input_range.html.erb
303
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio.html.erb
304
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_select.html.erb
305
- - spec/test_app/app/views/tableficate/custom_radio_block/filters/_select_range_filter.html.erb
301
+ - spec/test_app/app/views/tableficate/custom_check_box_block/filters/_check_box_choice.html.erb
302
+ - spec/test_app/app/views/tableficate/custom_radio_block/filters/_radio_choice.html.erb
303
+ - spec/test_app/app/views/tests/index.html.erb
304
+ - spec/test_app/app/views/themes/caption.html.erb
305
+ - spec/test_app/app/views/themes/column_attrs.html.erb
306
+ - spec/test_app/app/views/themes/column_cell_attrs.html.erb
307
+ - spec/test_app/app/views/themes/column_cell_attrs_with_proc.html.erb
308
+ - spec/test_app/app/views/themes/column_header_attrs.html.erb
309
+ - spec/test_app/app/views/themes/empty_with_data.html.erb
310
+ - spec/test_app/app/views/themes/empty_with_no_data.html.erb
311
+ - spec/test_app/app/views/themes/no_caption.html.erb
312
+ - spec/test_app/app/views/themes/no_column_attrs.html.erb
306
313
  - spec/test_app/config.ru
307
314
  - spec/test_app/config/application.rb
308
315
  - spec/test_app/config/boot.rb
@@ -321,6 +328,8 @@ test_files:
321
328
  - spec/test_app/config/routes.rb
322
329
  - spec/test_app/db/migrate/20111007154222_create_nobel_prize_winners.rb
323
330
  - spec/test_app/db/migrate/20111010191626_create_nobel_prizes.rb
331
+ - spec/test_app/db/migrate/20111227224959_additional_columns.rb
332
+ - spec/test_app/db/migrate/20111230203456_created_at_specific_dates.rb
324
333
  - spec/test_app/db/schema.rb
325
334
  - spec/test_app/db/seeds.rb
326
335
  - spec/test_app/db/test.sqlite3
@@ -332,9 +341,11 @@ test_files:
332
341
  - spec/test_app/public/422.html
333
342
  - spec/test_app/public/500.html
334
343
  - spec/test_app/public/favicon.ico
335
- - spec/test_app/public/index.html
336
344
  - spec/test_app/public/robots.txt
337
345
  - spec/test_app/script/rails
338
346
  - spec/test_app/vendor/assets/stylesheets/.gitkeep
339
347
  - spec/test_app/vendor/plugins/.gitkeep
348
+ - spec/theme/caption_spec.rb
349
+ - spec/theme/column_spec.rb
350
+ - spec/theme/empty_spec.rb
340
351
  - spec/utils_spec.rb