manage 1.3.40 → 1.3.41

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/Rakefile +31 -31
  4. data/app/assets/javascripts/manage/collection_actions.js.coffee +30 -30
  5. data/app/assets/javascripts/manage/handlers.js.coffee +46 -46
  6. data/app/assets/javascripts/manage/table_checkboxes.js.coffee +11 -11
  7. data/app/controllers/manage/application_controller.rb +13 -13
  8. data/app/controllers/manage/dashboards_controller.rb +4 -4
  9. data/app/controllers/manage/responder.rb +11 -11
  10. data/app/controllers/manage/sessions_controller.rb +11 -11
  11. data/app/helpers/manage/application_helper.rb +42 -42
  12. data/app/helpers/manage/form_helper.rb +21 -21
  13. data/app/helpers/manage/resource_helper.rb +77 -77
  14. data/app/models/admin_user.rb +4 -4
  15. data/app/views/layouts/manage/_main_menu.html.slim +52 -52
  16. data/app/views/layouts/manage/sign_in.html.slim +30 -30
  17. data/app/views/manage/resource/_form.html.slim +4 -4
  18. data/app/views/manage/resource/index/_collection_actions.html.slim +2 -2
  19. data/app/views/manage/resource/index/_count.html.slim +6 -6
  20. data/app/views/manage/resource/show.html.slim +10 -10
  21. data/app/views/manage/sessions/new.html.slim +10 -10
  22. data/config/initializers/devise.rb +247 -247
  23. data/config/initializers/session_store.rb +3 -3
  24. data/config/initializers/simple_form.rb +145 -145
  25. data/config/initializers/simple_form_foundation.rb +26 -26
  26. data/config/locales/devise.en.yml +59 -59
  27. data/config/locales/en.yml +20 -20
  28. data/config/routes.rb +10 -10
  29. data/db/migrate/20131204142720_create_admin_users.rb +24 -24
  30. data/lib/manage/engine.rb +21 -21
  31. data/lib/manage/fields.rb +6 -6
  32. data/lib/manage/version.rb +1 -1
  33. data/lib/manage.rb +5 -5
  34. data/lib/tasks/manage_tasks.rake +15 -15
  35. data/lib/templates/erb/scaffold/_form.html.erb +13 -13
  36. data/spec/controllers/manage/resource_controller_spec.rb +29 -29
  37. data/spec/dummy/README.rdoc +28 -28
  38. data/spec/dummy/Rakefile +6 -6
  39. data/spec/dummy/app/assets/javascripts/application.js +13 -13
  40. data/spec/dummy/app/assets/stylesheets/application.css +13 -13
  41. data/spec/dummy/app/controllers/application_controller.rb +5 -5
  42. data/spec/dummy/app/controllers/manage/posts_controller.rb +4 -4
  43. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  44. data/spec/dummy/app/models/post.rb +3 -3
  45. data/spec/dummy/app/models/user.rb +5 -5
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  47. data/spec/dummy/bin/bundle +3 -3
  48. data/spec/dummy/bin/rails +4 -4
  49. data/spec/dummy/bin/rake +4 -4
  50. data/spec/dummy/config/application.rb +24 -24
  51. data/spec/dummy/config/boot.rb +5 -5
  52. data/spec/dummy/config/database.yml +25 -25
  53. data/spec/dummy/config/environment.rb +5 -5
  54. data/spec/dummy/config/environments/development.rb +29 -29
  55. data/spec/dummy/config/environments/production.rb +80 -80
  56. data/spec/dummy/config/environments/test.rb +36 -36
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  58. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
  59. data/spec/dummy/config/initializers/inflections.rb +16 -16
  60. data/spec/dummy/config/initializers/mime_types.rb +5 -5
  61. data/spec/dummy/config/initializers/secret_token.rb +12 -12
  62. data/spec/dummy/config/initializers/session_store.rb +3 -3
  63. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  64. data/spec/dummy/config/locales/en.yml +23 -23
  65. data/spec/dummy/config/routes.rb +10 -10
  66. data/spec/dummy/config.ru +4 -4
  67. data/spec/dummy/db/migrate/20130716083410_init_migration.rb +21 -21
  68. data/spec/dummy/db/schema.rb +53 -53
  69. data/spec/dummy/public/404.html +58 -58
  70. data/spec/dummy/public/422.html +58 -58
  71. data/spec/dummy/public/500.html +57 -57
  72. data/spec/fields/reader_spec.rb +79 -79
  73. data/spec/spec_helper.rb +24 -24
  74. metadata +30 -30
@@ -1,58 +1,58 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style>
6
- body {
7
- background-color: #EFEFEF;
8
- color: #2E2F30;
9
- text-align: center;
10
- font-family: arial, sans-serif;
11
- }
12
-
13
- div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
- border: 1px solid #CCC;
17
- border-right-color: #999;
18
- border-left-color: #999;
19
- border-bottom-color: #BBB;
20
- border-top: #B00100 solid 4px;
21
- border-top-left-radius: 9px;
22
- border-top-right-radius: 9px;
23
- background-color: white;
24
- padding: 7px 4em 0 4em;
25
- }
26
-
27
- h1 {
28
- font-size: 100%;
29
- color: #730E15;
30
- line-height: 1.5em;
31
- }
32
-
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
37
- background-color: #F7F7F7;
38
- border: 1px solid #CCC;
39
- border-right-color: #999;
40
- border-bottom-color: #999;
41
- border-bottom-left-radius: 4px;
42
- border-bottom-right-radius: 4px;
43
- border-top-color: #DADADA;
44
- color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
- }
47
- </style>
48
- </head>
49
-
50
- <body>
51
- <!-- This file lives in public/404.html -->
52
- <div class="dialog">
53
- <h1>The page you were looking for doesn't exist.</h1>
54
- <p>You may have mistyped the address or the page may have moved.</p>
55
- </div>
56
- <p>If you are the application owner check the logs for more information.</p>
57
- </body>
58
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -1,58 +1,58 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style>
6
- body {
7
- background-color: #EFEFEF;
8
- color: #2E2F30;
9
- text-align: center;
10
- font-family: arial, sans-serif;
11
- }
12
-
13
- div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
- border: 1px solid #CCC;
17
- border-right-color: #999;
18
- border-left-color: #999;
19
- border-bottom-color: #BBB;
20
- border-top: #B00100 solid 4px;
21
- border-top-left-radius: 9px;
22
- border-top-right-radius: 9px;
23
- background-color: white;
24
- padding: 7px 4em 0 4em;
25
- }
26
-
27
- h1 {
28
- font-size: 100%;
29
- color: #730E15;
30
- line-height: 1.5em;
31
- }
32
-
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
37
- background-color: #F7F7F7;
38
- border: 1px solid #CCC;
39
- border-right-color: #999;
40
- border-bottom-color: #999;
41
- border-bottom-left-radius: 4px;
42
- border-bottom-right-radius: 4px;
43
- border-top-color: #DADADA;
44
- color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
- }
47
- </style>
48
- </head>
49
-
50
- <body>
51
- <!-- This file lives in public/422.html -->
52
- <div class="dialog">
53
- <h1>The change you wanted was rejected.</h1>
54
- <p>Maybe you tried to change something you didn't have access to.</p>
55
- </div>
56
- <p>If you are the application owner check the logs for more information.</p>
57
- </body>
58
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -1,57 +1,57 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style>
6
- body {
7
- background-color: #EFEFEF;
8
- color: #2E2F30;
9
- text-align: center;
10
- font-family: arial, sans-serif;
11
- }
12
-
13
- div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
- border: 1px solid #CCC;
17
- border-right-color: #999;
18
- border-left-color: #999;
19
- border-bottom-color: #BBB;
20
- border-top: #B00100 solid 4px;
21
- border-top-left-radius: 9px;
22
- border-top-right-radius: 9px;
23
- background-color: white;
24
- padding: 7px 4em 0 4em;
25
- }
26
-
27
- h1 {
28
- font-size: 100%;
29
- color: #730E15;
30
- line-height: 1.5em;
31
- }
32
-
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
37
- background-color: #F7F7F7;
38
- border: 1px solid #CCC;
39
- border-right-color: #999;
40
- border-bottom-color: #999;
41
- border-bottom-left-radius: 4px;
42
- border-bottom-right-radius: 4px;
43
- border-top-color: #DADADA;
44
- color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
- }
47
- </style>
48
- </head>
49
-
50
- <body>
51
- <!-- This file lives in public/500.html -->
52
- <div class="dialog">
53
- <h1>We're sorry, but something went wrong.</h1>
54
- </div>
55
- <p>If you are the application owner check the logs for more information.</p>
56
- </body>
57
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
@@ -1,79 +1,79 @@
1
- require 'spec_helper'
2
-
3
- module Manage
4
- module Fields
5
- describe Reader do
6
-
7
- it 'gets the right field value by using the field name represented as symbol' do
8
- test_object = Object.new
9
-
10
- mock_value = 'I am here!!!'
11
- test_object.stub(:me) {mock_value}
12
-
13
- value = Reader.field_value(test_object, :me)
14
- value.should eq(mock_value)
15
- end
16
-
17
- it 'gets the right field value by using the field name represented as string' do
18
- test_object = Object.new
19
-
20
- mock_value = 'I am you and you are me'
21
- test_object.stub(:me) {mock_value}
22
-
23
- value = Reader.field_value(test_object, 'me')
24
- value.should eq(mock_value)
25
- end
26
-
27
- it 'gets the right field value by using the composite field of the type "a.b.c"' do
28
- test_object = Object.new
29
-
30
- mock_value = 'Deep hidden stuff!'
31
- test_object.stub(:me) do
32
- test_object_level_two = Object.new
33
- test_object_level_two.stub(:you) do
34
- test_object_level_three = Object.new
35
- test_object_level_three.stub(:we) {mock_value}
36
- test_object_level_three
37
- end
38
-
39
- test_object_level_two
40
- end
41
-
42
- value = Reader.field_value(test_object, 'me.you.we')
43
- value.should eq(mock_value)
44
- end
45
-
46
- it 'can work with relations one level deep' do
47
- Reader.stub(:'_is_field_relation?') {true}
48
-
49
- test_object = Object.new
50
- test_object.stub(:list) {[Struct.new(:id).new(5), Struct.new(:id).new(6)]}
51
-
52
- value = Reader.field_value(test_object, 'list')
53
- value.should_not be_nil
54
- value.should be_a(String)
55
- value.should include('5', '6')
56
- end
57
-
58
- it 'displays relation values in custom format' do
59
- Reader.stub(:'_is_field_relation?') {true}
60
-
61
- test_object = Object.new
62
- test_object.stub(:list) {[
63
- Struct.new(:id, :name).new(5, 'meddle'),
64
- Struct.new(:id, :name).new(6, 'nickolay')
65
- ]}
66
-
67
- field_data = {'list' => {
68
- format: ->(obj) { obj.name }
69
- }}
70
-
71
- value = Reader.field_value(test_object, field_data)
72
- value.should_not be_nil
73
- value.should be_a(String)
74
- value.should include('meddle', 'nickolay')
75
- end
76
-
77
- end
78
- end
79
- end
1
+ require 'spec_helper'
2
+
3
+ module Manage
4
+ module Fields
5
+ describe Reader do
6
+
7
+ it 'gets the right field value by using the field name represented as symbol' do
8
+ test_object = Object.new
9
+
10
+ mock_value = 'I am here!!!'
11
+ test_object.stub(:me) {mock_value}
12
+
13
+ value = Reader.field_value(test_object, :me)
14
+ value.should eq(mock_value)
15
+ end
16
+
17
+ it 'gets the right field value by using the field name represented as string' do
18
+ test_object = Object.new
19
+
20
+ mock_value = 'I am you and you are me'
21
+ test_object.stub(:me) {mock_value}
22
+
23
+ value = Reader.field_value(test_object, 'me')
24
+ value.should eq(mock_value)
25
+ end
26
+
27
+ it 'gets the right field value by using the composite field of the type "a.b.c"' do
28
+ test_object = Object.new
29
+
30
+ mock_value = 'Deep hidden stuff!'
31
+ test_object.stub(:me) do
32
+ test_object_level_two = Object.new
33
+ test_object_level_two.stub(:you) do
34
+ test_object_level_three = Object.new
35
+ test_object_level_three.stub(:we) {mock_value}
36
+ test_object_level_three
37
+ end
38
+
39
+ test_object_level_two
40
+ end
41
+
42
+ value = Reader.field_value(test_object, 'me.you.we')
43
+ value.should eq(mock_value)
44
+ end
45
+
46
+ it 'can work with relations one level deep' do
47
+ Reader.stub(:'_is_field_relation?') {true}
48
+
49
+ test_object = Object.new
50
+ test_object.stub(:list) {[Struct.new(:id).new(5), Struct.new(:id).new(6)]}
51
+
52
+ value = Reader.field_value(test_object, 'list')
53
+ value.should_not be_nil
54
+ value.should be_a(String)
55
+ value.should include('5', '6')
56
+ end
57
+
58
+ it 'displays relation values in custom format' do
59
+ Reader.stub(:'_is_field_relation?') {true}
60
+
61
+ test_object = Object.new
62
+ test_object.stub(:list) {[
63
+ Struct.new(:id, :name).new(5, 'meddle'),
64
+ Struct.new(:id, :name).new(6, 'nickolay')
65
+ ]}
66
+
67
+ field_data = {'list' => {
68
+ format: ->(obj) { obj.name }
69
+ }}
70
+
71
+ value = Reader.field_value(test_object, field_data)
72
+ value.should_not be_nil
73
+ value.should be_a(String)
74
+ value.should include('meddle', 'nickolay')
75
+ end
76
+
77
+ end
78
+ end
79
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,24 +1,24 @@
1
- ENV['RAILS_ENV'] ||= 'test'
2
-
3
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
- load_schema = lambda {
5
- load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
6
- }
7
- silence_stream(STDOUT, &load_schema)
8
-
9
-
10
- require 'rspec/rails'
11
- require 'rspec/autorun'
12
-
13
- Rails.backtrace_cleaner.remove_silencers!
14
-
15
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
16
-
17
- RSpec.configure do |config|
18
- config.mock_with :rspec
19
- config.use_transactional_fixtures = true
20
- config.infer_base_class_for_anonymous_controllers = false
21
- config.order = "random"
22
- config.include Devise::TestHelpers, :type => :controller
23
- config.include Manage::Engine.routes.url_helpers
24
- end
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+ load_schema = lambda {
5
+ load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
6
+ }
7
+ silence_stream(STDOUT, &load_schema)
8
+
9
+
10
+ require 'rspec/rails'
11
+ require 'rspec/autorun'
12
+
13
+ Rails.backtrace_cleaner.remove_silencers!
14
+
15
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
16
+
17
+ RSpec.configure do |config|
18
+ config.mock_with :rspec
19
+ config.use_transactional_fixtures = true
20
+ config.infer_base_class_for_anonymous_controllers = false
21
+ config.order = "random"
22
+ config.include Devise::TestHelpers, :type => :controller
23
+ config.include Manage::Engine.routes.url_helpers
24
+ end