presenting 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. data/app/controllers/presentation/assets_controller.rb +1 -1
  2. data/app/views/presentations/_details.erb +1 -1
  3. data/app/views/presentations/_field_search.erb +1 -1
  4. data/app/views/presentations/_form.erb +1 -1
  5. data/app/views/presentations/_grid.erb +1 -1
  6. data/app/views/presentations/_search.erb +1 -1
  7. data/config/routes.rb +7 -2
  8. data/lib/presentation/base.rb +10 -27
  9. data/lib/presentation/details.rb +2 -0
  10. data/lib/presentation/field_search.rb +2 -0
  11. data/lib/presentation/grid.rb +1 -1
  12. data/lib/presenting/engine.rb +7 -0
  13. data/lib/presenting/form_helpers.rb +1 -1
  14. data/lib/presenting/helpers.rb +7 -3
  15. data/lib/presenting/view.rb +3 -3
  16. data/lib/presenting.rb +38 -5
  17. data/test/assets_test.rb +5 -7
  18. data/test/details_test.rb +1 -1
  19. data/test/field_search_test.rb +1 -1
  20. data/test/form_test.rb +316 -287
  21. data/test/grid_test.rb +28 -8
  22. data/test/helpers_test.rb +2 -2
  23. data/test/presenting_test.rb +1 -1
  24. data/test/r3/Gemfile +7 -0
  25. data/test/r3/Gemfile.lock +82 -0
  26. data/test/r3/config/application.rb +12 -0
  27. data/test/r3/config/boot.rb +6 -0
  28. data/test/{rails → r3}/config/database.yml +6 -1
  29. data/test/r3/config/environment.rb +5 -0
  30. data/test/r3/config/environments/test.rb +35 -0
  31. data/test/r3/config.ru +4 -0
  32. data/test/r3/db/test.sqlite3 +0 -0
  33. data/test/r3/log/test.log +2354 -0
  34. data/test/r3/public/javascripts/presenting/grid.js +0 -0
  35. data/test/r3/public/javascripts/presenting/search.js +13 -0
  36. data/test/r3/public/stylesheets/presenting/details-color.css +7 -0
  37. data/test/r3/public/stylesheets/presenting/details.css +10 -0
  38. data/test/r3/public/stylesheets/presenting/form.css +1 -0
  39. data/test/r3/public/stylesheets/presenting/grid-color.css +71 -0
  40. data/test/r3/public/stylesheets/presenting/grid.css +64 -0
  41. data/test/r3/public/stylesheets/presenting/search-color.css +16 -0
  42. data/test/r3/public/stylesheets/presenting/search.css +45 -0
  43. data/test/search_conditions_test.rb +2 -2
  44. data/test/search_test.rb +1 -1
  45. data/test/test_helper.rb +8 -39
  46. metadata +45 -79
  47. data/rails/init.rb +0 -12
  48. data/test/rails/app/controllers/application_controller.rb +0 -15
  49. data/test/rails/app/controllers/users_controller.rb +0 -36
  50. data/test/rails/app/helpers/application_helper.rb +0 -3
  51. data/test/rails/app/helpers/users_helper.rb +0 -2
  52. data/test/rails/app/models/user.rb +0 -2
  53. data/test/rails/app/views/layouts/application.html.erb +0 -15
  54. data/test/rails/app/views/users/index.html.erb +0 -10
  55. data/test/rails/app/views/users/new.html.erb +0 -2
  56. data/test/rails/app/views/users/show.html.erb +0 -1
  57. data/test/rails/config/boot.rb +0 -109
  58. data/test/rails/config/environment.rb +0 -13
  59. data/test/rails/config/environments/development.rb +0 -17
  60. data/test/rails/config/environments/production.rb +0 -24
  61. data/test/rails/config/environments/test.rb +0 -22
  62. data/test/rails/config/locales/en.yml +0 -5
  63. data/test/rails/config/routes.rb +0 -5
  64. data/test/rails/db/development.sqlite3 +0 -0
  65. data/test/rails/db/migrate/20090213085444_create_users.rb +0 -13
  66. data/test/rails/db/migrate/20090213085607_populate_users.rb +0 -13
  67. data/test/rails/db/schema.rb +0 -23
  68. data/test/rails/db/test.sqlite3 +0 -0
  69. data/test/rails/log/development.log +0 -858
  70. data/test/rails/public/404.html +0 -30
  71. data/test/rails/public/422.html +0 -30
  72. data/test/rails/public/500.html +0 -33
  73. data/test/rails/public/javascripts/application.js +0 -2
  74. data/test/rails/public/javascripts/jquery.livequery.min.js +0 -11
  75. data/test/rails/public/javascripts/prototype.js +0 -4320
  76. data/test/rails/script/console +0 -3
  77. data/test/rails/script/dbconsole +0 -3
  78. data/test/rails/script/destroy +0 -3
  79. data/test/rails/script/generate +0 -3
  80. data/test/rails/script/plugin +0 -3
  81. data/test/rails/script/runner +0 -3
  82. data/test/rails/script/server +0 -3
  83. /data/app/assets/{javascript → javascripts}/grid.js +0 -0
  84. /data/app/assets/{javascript → javascripts}/search.js +0 -0
File without changes
@@ -0,0 +1,13 @@
1
+ $('.presentation-search .compact fieldset label').livequery(function() {
2
+ var label = $(this);
3
+ var field = label.siblings('input');
4
+ if (!field[0] || field.attr('type') == 'checkbox') return;
5
+
6
+ label.addClass('overlabel');
7
+
8
+ var hide_label = function() { label.css('text-indent', '-1000px') };
9
+ var show_label = function() { this.value || label.css('text-indent', '0px') };
10
+
11
+ $(field).focus(hide_label).blur(show_label).each(hide_label).each(show_label);
12
+ $(label).click(function() {field.focus()});
13
+ });
@@ -0,0 +1,7 @@
1
+ .presentation-details dt {
2
+ color: #444;
3
+ }
4
+
5
+ .presentation-details dd {
6
+ border-color: #888;
7
+ }
@@ -0,0 +1,10 @@
1
+ .presentation-details dt {
2
+ font-weight: bold;
3
+ }
4
+
5
+ .presentation-details dd {
6
+ margin-left: 0;
7
+ padding-bottom: 0.5em;
8
+ border-bottom: 1px dotted;
9
+ margin-bottom: 0.5em;
10
+ }
@@ -0,0 +1 @@
1
+ .presentation-form {}
@@ -0,0 +1,71 @@
1
+ .presentation-grid a {
2
+ color: #06c;
3
+ }
4
+
5
+ .presentation-grid {
6
+ font-family: sans-serif;
7
+ background-color: #fff;
8
+ }
9
+
10
+ .presentation-grid caption {
11
+ background-color: transparent;
12
+ }
13
+
14
+ .presentation-grid thead {
15
+ background-color: transparent;
16
+ }
17
+
18
+ .presentation-grid thead th {
19
+ border-bottom: 2px solid #aaa;
20
+ font-weight: normal;
21
+ color: #666;
22
+ background-color: transparent;
23
+ }
24
+
25
+ .presentation-grid tbody tr.even {
26
+ background-color: #e6f2ff;
27
+ border-bottom: 1px solid #c5dbf7;
28
+ border-top: 1px solid #c5dbf7;
29
+ }
30
+
31
+ .presentation-grid tbody td.sorted {
32
+ background-color: #f5f5f5;
33
+ }
34
+
35
+ .presentation-grid tbody tr.even td.sorted {
36
+ background-color: #c5dbf7;
37
+ }
38
+
39
+ .presentation-grid tfoot .pagination {
40
+ margin-top: 0.5em;
41
+ }
42
+
43
+ .presentation-grid tfoot .pagination a {
44
+ text-decoration: none;
45
+ }
46
+
47
+ .presentation-grid tfoot .pagination .prev_page,
48
+ .presentation-grid tfoot .pagination .next_page {
49
+ padding: 0.1em 0.5em;
50
+ background-color: #eee;
51
+ border: 1px solid #e5e5e5;
52
+ }
53
+
54
+ .presentation-grid tfoot .pagination a.prev_page:hover,
55
+ .presentation-grid tfoot .pagination a.next_page:hover {
56
+ background-color: #e6f2ff;
57
+ border-color: #c5dbf7;
58
+ }
59
+
60
+ .presentation-grid tfoot .pagination .prev_page {
61
+ margin-right: 0.7em;
62
+ }
63
+
64
+ .presentation-grid tfoot .pagination .next_page {
65
+ margin-left: 0.7em;
66
+ }
67
+
68
+ .presentation-grid tfoot .pagination .current {
69
+ padding: 0.1em 0.5em;
70
+ border: 1px solid #e5e5e5;
71
+ }
@@ -0,0 +1,64 @@
1
+ /** cellspacing **/
2
+ .presentation-grid table,
3
+ .presentation-grid td,
4
+ .presentation-grid th {
5
+ border: 0;
6
+ border-collapse: collapse;
7
+ }
8
+
9
+ .presentation-grid table {
10
+ width: 100%;
11
+ }
12
+
13
+ .presentation-grid caption {
14
+ text-align: left;
15
+ font-weight: bold;
16
+ padding-left: 0.2em;
17
+ }
18
+
19
+ .presentation-grid th {
20
+ padding: 0.2em 0.5em 0em 0.2em;
21
+ text-align: left;
22
+ vertical-align: bottom;
23
+ }
24
+
25
+ .presentation-grid th a {
26
+ text-decoration: none;
27
+ }
28
+
29
+ .presentation-grid td {
30
+ padding: 0.4em 0.5em 0.4em 0.2em;
31
+ vertical-align: top;
32
+ }
33
+
34
+ .presentation-grid ul.actions {
35
+ overflow: auto;
36
+ zoom: 1;
37
+ float: right;
38
+ list-style: none;
39
+ margin: 0;
40
+ padding: 0;
41
+ }
42
+
43
+ .presentation-grid ul.actions li {
44
+ float: left;
45
+ }
46
+
47
+ .presentation-grid ul.actions li a {
48
+ font-weight: normal;
49
+ display: block;
50
+ padding: 0em 0.3em;
51
+ text-decoration: none;
52
+ }
53
+
54
+ .presentation-grid ul.actions li a:hover {
55
+ text-decoration: underline;
56
+ }
57
+
58
+ .presentation-grid ul.actions li a {
59
+ outline: none;
60
+ }
61
+
62
+ .presentation-grid caption ul.actions {
63
+ margin-right: 0.5em;
64
+ }
@@ -0,0 +1,16 @@
1
+ .presentation-search label {
2
+ color: #666;
3
+ }
4
+
5
+ .presentation-search fieldset {
6
+ border: 1px solid #c5dbf7;
7
+ background-color: #e6f2ff;
8
+ padding: 2px;
9
+ }
10
+
11
+ .presentation-search fieldset.submit {
12
+ border: 0px;
13
+ padding: 0px;
14
+ background-color: transparent;
15
+ }
16
+
@@ -0,0 +1,45 @@
1
+ .presentation-search {
2
+ overflow: hidden;
3
+ zoom: 1;
4
+ }
5
+
6
+ .presentation-search fieldset {
7
+ border: 0;
8
+ margin: 0 0.5em 1em 0;
9
+ padding: 0;
10
+ float: left;
11
+ width: 145px;
12
+ }
13
+
14
+ .presentation-search fieldset label {
15
+ font-weight: normal;
16
+ margin: 0;
17
+ padding: 0;
18
+ text-transform: none;
19
+ }
20
+
21
+ .presentation-search fieldset input,
22
+ .presentation-search fieldset select {
23
+ padding: 0px;
24
+ margin: 0px;
25
+ }
26
+
27
+ /* for overlabels (requires javascript) */
28
+
29
+ .presentation-search .compact label {
30
+ display: inline;
31
+ }
32
+
33
+ .presentation-search .compact fieldset {
34
+ position: relative;
35
+ width: auto;
36
+ }
37
+
38
+ .presentation-search .compact fieldset label.overlabel {
39
+ display: block;
40
+ position: absolute;
41
+ top: 0.2em;
42
+ left: 0.5em;
43
+ z-index: 1;
44
+ cursor: text;
45
+ }
@@ -127,11 +127,11 @@ class SearchConditionsFieldTest < Presenting::Test
127
127
 
128
128
  def test_bind_with_typecast_to_date
129
129
  @f.type = :date
130
- assert_equal Time.parse('Apr 20, 2009').to_date, @f.bind('Apr 20, 2009')
130
+ assert_equal Time.zone.parse('Apr 20, 2009').to_date, @f.bind('Apr 20, 2009')
131
131
  end
132
132
 
133
133
  def test_bind_with_typecast_to_time
134
134
  @f.type = :time
135
- assert_equal Time.parse('Apr 20, 2009 11:00am'), @f.bind('Apr 20, 2009 11:00am')
135
+ assert_equal Time.zone.parse('Apr 20, 2009 11:00am'), @f.bind('Apr 20, 2009 11:00am')
136
136
  end
137
137
  end
data/test/search_test.rb CHANGED
@@ -11,7 +11,7 @@ end
11
11
  class SearchRenderTest < Presentation::RenderTest
12
12
  def setup
13
13
  @presentation = Presentation::Search.new
14
- @presentation.controller = TestController.new
14
+ @presentation.controller = ActionView::TestCase::TestController.new
15
15
  @presentation.controller.request.path = '/users'
16
16
  end
17
17
 
data/test/test_helper.rb CHANGED
@@ -1,44 +1,13 @@
1
- ENV["RAILS_ENV"] = "test"
2
-
3
- # load the support libraries
4
- require 'test/unit'
1
+ # bootstrap
5
2
  require 'rubygems'
6
- gem 'rails', '2.3.11'
7
- require 'active_support'
8
- require 'action_pack'
9
- require 'action_controller'
10
- require 'action_view'
3
+ require 'test/unit'
11
4
  require 'mocha'
12
- require 'will_paginate'
13
- WillPaginate.enable_actionpack
14
-
15
- PLUGIN_ROOT = File.join(File.dirname(__FILE__), '..')
16
-
17
- # prepare for autoloading
18
- ActiveSupport::Dependencies.autoload_paths << File.join(PLUGIN_ROOT, 'lib')
19
- $LOAD_PATH.unshift File.join(PLUGIN_ROOT, 'lib')
20
- ActionController::Base.view_paths << File.join(PLUGIN_ROOT, 'app', 'views')
21
- ActiveSupport::Dependencies.autoload_paths << File.join(PLUGIN_ROOT, 'app', 'controllers')
22
- $LOAD_PATH.unshift File.join(PLUGIN_ROOT, 'app', 'controllers')
23
5
 
24
- # set up the asset routes, and an extra resource for tests that generate normal routes
25
- require File.join(PLUGIN_ROOT, 'config', 'routes')
26
- ActionController::Routing::Routes.draw do |map| map.resources :users end
27
-
28
- # load the code
29
- require 'rails/init'
30
-
31
- class TestController < ActionController::Base
32
- attr_accessor :request, :response, :params
33
-
34
- def initialize
35
- @request = ActionController::TestRequest.new
36
- @response = ActionController::TestResponse.new
37
-
38
- @params = {}
39
- send(:initialize_current_url)
40
- end
41
- end
6
+ # load the test app, which will load gems
7
+ ENV['RAILS_ENV'] = 'test'
8
+ require File.join(File.dirname(__FILE__), 'r3', 'config', 'environment.rb')
9
+ require 'rails/test_help'
10
+ Rails.backtrace_cleaner.remove_silencers!
42
11
 
43
12
  # a way to customize syntax for our tests
44
13
  class Presenting::Test < Test::Unit::TestCase
@@ -48,7 +17,7 @@ end
48
17
 
49
18
  # inheriting tests should target rendering behavior given certain configurations
50
19
  class Presentation::RenderTest < Presenting::Test
51
- include ActionController::Assertions::SelectorAssertions
20
+ include ActionDispatch::Assertions::SelectorAssertions
52
21
 
53
22
  protected
54
23
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presenting
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
- - 1
7
+ - 2
8
8
  - 0
9
9
  - 0
10
- version: 1.0.0
10
+ version: 2.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Lance Ivy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-05 00:00:00 -07:00
18
+ date: 2011-10-19 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -50,6 +50,7 @@ files:
50
50
  - lib/presenting/sanitize.rb
51
51
  - lib/presenting/configurable.rb
52
52
  - lib/presenting/defaults.rb
53
+ - lib/presenting/engine.rb
53
54
  - lib/presenting/attribute.rb
54
55
  - lib/presentation/form.rb
55
56
  - lib/presentation/base.rb
@@ -63,8 +64,8 @@ files:
63
64
  - app/views/presentations/_form.erb
64
65
  - app/views/presentations/_search.erb
65
66
  - app/views/presentations/_field_search.erb
66
- - app/assets/javascript/search.js
67
- - app/assets/javascript/grid.js
67
+ - app/assets/javascripts/search.js
68
+ - app/assets/javascripts/grid.js
68
69
  - app/assets/stylesheets/search-color.css
69
70
  - app/assets/stylesheets/grid.css
70
71
  - app/assets/stylesheets/grid-color.css
@@ -76,7 +77,6 @@ files:
76
77
  - LICENSE
77
78
  - README
78
79
  - Rakefile
79
- - rails/init.rb
80
80
  - config/routes.rb
81
81
  - test/test_helper.rb
82
82
  - test/field_set_test.rb
@@ -88,46 +88,29 @@ files:
88
88
  - test/attribute_test.rb
89
89
  - test/sanitize_test.rb
90
90
  - test/search_conditions_test.rb
91
- - test/rails/script/generate
92
- - test/rails/script/console
93
- - test/rails/script/destroy
94
- - test/rails/script/dbconsole
95
- - test/rails/script/plugin
96
- - test/rails/script/server
97
- - test/rails/script/runner
98
- - test/rails/app/views/layouts/application.html.erb
99
- - test/rails/app/views/users/new.html.erb
100
- - test/rails/app/views/users/index.html.erb
101
- - test/rails/app/views/users/show.html.erb
102
- - test/rails/app/helpers/users_helper.rb
103
- - test/rails/app/helpers/application_helper.rb
104
- - test/rails/app/controllers/users_controller.rb
105
- - test/rails/app/controllers/application_controller.rb
106
- - test/rails/app/models/user.rb
107
- - test/rails/log/development.log
108
- - test/rails/db/schema.rb
109
- - test/rails/db/development.sqlite3
110
- - test/rails/db/migrate/20090213085444_create_users.rb
111
- - test/rails/db/migrate/20090213085607_populate_users.rb
112
- - test/rails/db/test.sqlite3
113
- - test/rails/config/environment.rb
114
- - test/rails/config/locales/en.yml
115
- - test/rails/config/database.yml
116
- - test/rails/config/boot.rb
117
- - test/rails/config/environments/production.rb
118
- - test/rails/config/environments/development.rb
119
- - test/rails/config/environments/test.rb
120
- - test/rails/config/routes.rb
121
- - test/rails/public/javascripts/application.js
122
- - test/rails/public/javascripts/jquery.livequery.min.js
123
- - test/rails/public/javascripts/prototype.js
124
- - test/rails/public/422.html
125
- - test/rails/public/404.html
126
- - test/rails/public/500.html
127
91
  - test/form_test.rb
128
92
  - test/configurable_test.rb
129
93
  - test/presenting_test.rb
130
94
  - test/helpers_test.rb
95
+ - test/r3/Gemfile.lock
96
+ - test/r3/log/test.log
97
+ - test/r3/Gemfile
98
+ - test/r3/config.ru
99
+ - test/r3/db/test.sqlite3
100
+ - test/r3/config/environment.rb
101
+ - test/r3/config/application.rb
102
+ - test/r3/config/database.yml
103
+ - test/r3/config/boot.rb
104
+ - test/r3/config/environments/test.rb
105
+ - test/r3/public/javascripts/presenting/search.js
106
+ - test/r3/public/javascripts/presenting/grid.js
107
+ - test/r3/public/stylesheets/presenting/search-color.css
108
+ - test/r3/public/stylesheets/presenting/grid.css
109
+ - test/r3/public/stylesheets/presenting/grid-color.css
110
+ - test/r3/public/stylesheets/presenting/search.css
111
+ - test/r3/public/stylesheets/presenting/details.css
112
+ - test/r3/public/stylesheets/presenting/details-color.css
113
+ - test/r3/public/stylesheets/presenting/form.css
131
114
  - test/search_test.rb
132
115
  has_rdoc: true
133
116
  homepage: http://github.com/cainlevy/presenting
@@ -174,44 +157,27 @@ test_files:
174
157
  - test/attribute_test.rb
175
158
  - test/sanitize_test.rb
176
159
  - test/search_conditions_test.rb
177
- - test/rails/script/generate
178
- - test/rails/script/console
179
- - test/rails/script/destroy
180
- - test/rails/script/dbconsole
181
- - test/rails/script/plugin
182
- - test/rails/script/server
183
- - test/rails/script/runner
184
- - test/rails/app/views/layouts/application.html.erb
185
- - test/rails/app/views/users/new.html.erb
186
- - test/rails/app/views/users/index.html.erb
187
- - test/rails/app/views/users/show.html.erb
188
- - test/rails/app/helpers/users_helper.rb
189
- - test/rails/app/helpers/application_helper.rb
190
- - test/rails/app/controllers/users_controller.rb
191
- - test/rails/app/controllers/application_controller.rb
192
- - test/rails/app/models/user.rb
193
- - test/rails/log/development.log
194
- - test/rails/db/schema.rb
195
- - test/rails/db/development.sqlite3
196
- - test/rails/db/migrate/20090213085444_create_users.rb
197
- - test/rails/db/migrate/20090213085607_populate_users.rb
198
- - test/rails/db/test.sqlite3
199
- - test/rails/config/environment.rb
200
- - test/rails/config/locales/en.yml
201
- - test/rails/config/database.yml
202
- - test/rails/config/boot.rb
203
- - test/rails/config/environments/production.rb
204
- - test/rails/config/environments/development.rb
205
- - test/rails/config/environments/test.rb
206
- - test/rails/config/routes.rb
207
- - test/rails/public/javascripts/application.js
208
- - test/rails/public/javascripts/jquery.livequery.min.js
209
- - test/rails/public/javascripts/prototype.js
210
- - test/rails/public/422.html
211
- - test/rails/public/404.html
212
- - test/rails/public/500.html
213
160
  - test/form_test.rb
214
161
  - test/configurable_test.rb
215
162
  - test/presenting_test.rb
216
163
  - test/helpers_test.rb
164
+ - test/r3/Gemfile.lock
165
+ - test/r3/log/test.log
166
+ - test/r3/Gemfile
167
+ - test/r3/config.ru
168
+ - test/r3/db/test.sqlite3
169
+ - test/r3/config/environment.rb
170
+ - test/r3/config/application.rb
171
+ - test/r3/config/database.yml
172
+ - test/r3/config/boot.rb
173
+ - test/r3/config/environments/test.rb
174
+ - test/r3/public/javascripts/presenting/search.js
175
+ - test/r3/public/javascripts/presenting/grid.js
176
+ - test/r3/public/stylesheets/presenting/search-color.css
177
+ - test/r3/public/stylesheets/presenting/grid.css
178
+ - test/r3/public/stylesheets/presenting/grid-color.css
179
+ - test/r3/public/stylesheets/presenting/search.css
180
+ - test/r3/public/stylesheets/presenting/details.css
181
+ - test/r3/public/stylesheets/presenting/details-color.css
182
+ - test/r3/public/stylesheets/presenting/form.css
217
183
  - test/search_test.rb
data/rails/init.rb DELETED
@@ -1,12 +0,0 @@
1
- ActionView::Base.class_eval { include Presenting::Helpers }
2
- ActionController::Base.const_set(:Search, Presenting::Search)
3
- ActionController::Base.const_set(:Sorting, Presenting::Sorting)
4
- ActionView::Helpers::FormBuilder.class_eval { include Presenting::FormHelpers }
5
-
6
- if defined? Rails # because tests don't define the Rails module
7
- if Rails.version.match(/^2\.2/)
8
- ActionController::Base.view_paths << File.join(File.dirname(__FILE__), 'app', 'views')
9
- ActiveSupport::Dependencies.load_paths << File.dirname(__FILE__) + '/app/controllers'
10
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/app/controllers/'
11
- end
12
- end
@@ -1,15 +0,0 @@
1
- # Filters added to this controller apply to all controllers in the application.
2
- # Likewise, all the methods added will be available for all controllers.
3
-
4
- class ApplicationController < ActionController::Base
5
- helper :all # include all helpers, all the time
6
-
7
- # See ActionController::RequestForgeryProtection for details
8
- # Uncomment the :secret if you're not using the cookie session store
9
- protect_from_forgery # :secret => '0ede37e7d2f6d8445f151b0a38ee0539'
10
-
11
- # See ActionController::Base for details
12
- # Uncomment this to filter the contents of submitted sensitive data parameters
13
- # from your application log (in this case, all fields with names like "password").
14
- # filter_parameter_logging :password
15
- end
@@ -1,36 +0,0 @@
1
- class UsersController < ApplicationController
2
- def index
3
- @users = User.paginate(
4
- :page => params[:page],
5
- :per_page => 2,
6
- :conditions => Presenting::Search.new(:fields => {
7
- 'first_name' => :equals,
8
- 'last_name' => :begins_with,
9
- 'email' => :not_null
10
- }).to_sql(params[:search], :field),
11
- :order => Presenting::Sorting.new(:fields => [
12
- :prefix,
13
- :first_name,
14
- :last_name,
15
- :email
16
- ]).to_sql(params[:sort])
17
- )
18
- end
19
-
20
- def new
21
- @user = User.new
22
- end
23
-
24
- def create
25
- @user = User.new(params[:user])
26
- @user.save!
27
-
28
- redirect_to users_path
29
- rescue ActiveRecord::RecordInvalid
30
- render :action => :new
31
- end
32
-
33
- def show
34
- @user = User.find(params[:id])
35
- end
36
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1,2 +0,0 @@
1
- module UsersHelper
2
- end
@@ -1,2 +0,0 @@
1
- class User < ActiveRecord::Base
2
- end
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
- <title>Demo Application</title>
6
- <%= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" %>
7
- <%= javascript_include_tag 'jquery.livequery.min' %>
8
- <%= presentation_stylesheets('grid', 'search', 'details', 'grid-color', 'search-color', 'details-color') %>
9
- <%= presentation_javascript('search') %>
10
- <head>
11
- <body>
12
- <%= yield %>
13
- </body>
14
- </html>
15
-
@@ -1,10 +0,0 @@
1
- <%= present :field_search, :fields => [:first_name, :last_name, {:email => :checkbox}] %>
2
- <%= present @users, :grid, :id => "users",
3
- :fields => [:prefix, :first_name, :last_name, :email],
4
- :links => [link_to('add', new_user_path)],
5
- :record_links => [
6
- proc{|r| link_to 'edit', edit_user_path(r)},
7
- proc{|r| link_to 'delete', user_path(r), :method => :destroy},
8
- proc{|r| link_to 'show', user_path(r)}
9
- ]
10
- %>
@@ -1,2 +0,0 @@
1
- <h2>New User</h2>
2
- <%= present @user, :form, :groups => [{"Name" => [:prefix, :first_name, :last_name]}, [:email]] %>
@@ -1 +0,0 @@
1
- <%= present @user, :details, :title => "User ##{@user.id}", :fields => [:prefix, :first_name, :last_name, :email] %>