thecore 1.3.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +37 -0
  4. data/app/controllers/application_controller.rb +2 -0
  5. data/app/controllers/pages_controller.rb +37 -0
  6. data/app/jobs/application_job.rb +2 -0
  7. data/app/models/ability.rb +48 -0
  8. data/app/models/user.rb +158 -0
  9. data/app/uploaders/attachment_uploader.rb +27 -0
  10. data/app/uploaders/image_uploader.rb +27 -0
  11. data/config/initializers/rails_admin.rb +42 -0
  12. data/config/initializers/rails_application_config.rb +28 -0
  13. data/config/initializers/thecore_concern.rb +113 -0
  14. data/config/locales/en.activerecord.yml +6 -0
  15. data/config/locales/en.contact_mailer.custom.yml +5 -0
  16. data/config/locales/en.devise.custom.yml +15 -0
  17. data/config/locales/en.rails_admin.yml +34 -0
  18. data/config/locales/en.rollincode.yml +5 -0
  19. data/config/locales/en.simple_form.yml +31 -0
  20. data/config/locales/en.yml +31 -0
  21. data/config/locales/it.activerecord.yml +20 -0
  22. data/config/locales/it.contact_mailer.custom.yml +5 -0
  23. data/config/locales/it.devise.custom.yml +15 -0
  24. data/config/locales/it.rails_admin.yml +34 -0
  25. data/config/locales/it.rollincode.yml +5 -0
  26. data/config/locales/it.simple_form.yml +31 -0
  27. data/config/locales/it.yml +38 -0
  28. data/config/routes.rb +14 -0
  29. data/db/migrate/20131103142222_create_friendly_id_slugs.rb +15 -0
  30. data/db/migrate/20141010133701_devise_create_users.rb +54 -0
  31. data/db/migrate/20150806091039_add_authentication_token_to_users.rb +6 -0
  32. data/db/migrate/20150825101810_add_roles_mask_to_users.rb +5 -0
  33. data/db/migrate/20151201145832_add_external_to_user.rb +5 -0
  34. data/db/migrate/20160331101901_add_code_to_user.rb +6 -0
  35. data/db/migrate/20160331101902_add_admin_user.rb +162 -0
  36. data/db/migrate/20161029154134_remove_friendly_id_slugs.rb +5 -0
  37. data/db/seeds.rb +1 -0
  38. data/lib/abilities.rb +20 -0
  39. data/lib/active_record_extension.rb +145 -0
  40. data/lib/activerecord_paperclip_extension.rb +21 -0
  41. data/lib/application_configs.rb +26 -0
  42. data/lib/application_record_loader.rb +3 -0
  43. data/lib/backtrace_silencers.rb +7 -0
  44. data/lib/constants.rb +0 -0
  45. data/lib/date_format.rb +27 -0
  46. data/lib/devise_initializer.rb +275 -0
  47. data/lib/generators/thecore/add_git/USAGE +8 -0
  48. data/lib/generators/thecore/add_git/add_git_generator.rb +269 -0
  49. data/lib/generators/thecore/thecorize_app/USAGE +8 -0
  50. data/lib/generators/thecore/thecorize_app/thecorize_app_generator.rb +37 -0
  51. data/lib/generators/thecore/thecorize_models/USAGE +9 -0
  52. data/lib/generators/thecore/thecorize_models/thecorize_models_generator.rb +255 -0
  53. data/lib/generators/thecore/thecorize_plugin/USAGE +9 -0
  54. data/lib/generators/thecore/thecorize_plugin/thecorize_plugin_generator.rb +166 -0
  55. data/lib/inflections.rb +16 -0
  56. data/lib/integer_extensions.rb +26 -0
  57. data/lib/kaminari_config.rb +12 -0
  58. data/lib/mime_types.rb +5 -0
  59. data/lib/postgresql_drop_replacement.rb +11 -0
  60. data/lib/string_extensions.rb +14 -0
  61. data/lib/tasks/thecore_tasks.rake +4 -0
  62. data/lib/thecore/engine.rb +35 -0
  63. data/lib/thecore/version.rb +3 -0
  64. data/lib/thecore.rb +63 -0
  65. data/lib/thecore_actions.rb +2 -0
  66. data/lib/thecore_base_roles.rb +2 -0
  67. data/lib/thecore_rails_admin_bulk_delete_concern.rb +19 -0
  68. data/lib/thecore_rails_admin_export_concern.rb +19 -0
  69. data/lib/thecore_rails_admin_main_controller_concern.rb +11 -0
  70. data/test/dummy/README.rdoc +28 -0
  71. data/test/dummy/Rakefile +6 -0
  72. data/test/dummy/app/assets/javascripts/application.js +13 -0
  73. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  74. data/test/dummy/app/controllers/application_controller.rb +5 -0
  75. data/test/dummy/app/helpers/application_helper.rb +2 -0
  76. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  77. data/test/dummy/bin/bundle +3 -0
  78. data/test/dummy/bin/rails +4 -0
  79. data/test/dummy/bin/rake +4 -0
  80. data/test/dummy/bin/setup +29 -0
  81. data/test/dummy/config/application.rb +25 -0
  82. data/test/dummy/config/boot.rb +5 -0
  83. data/test/dummy/config/database.yml +25 -0
  84. data/test/dummy/config/environment.rb +5 -0
  85. data/test/dummy/config/environments/development.rb +41 -0
  86. data/test/dummy/config/environments/production.rb +79 -0
  87. data/test/dummy/config/environments/test.rb +42 -0
  88. data/test/dummy/config/initializers/assets.rb +11 -0
  89. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  90. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  91. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  92. data/test/dummy/config/initializers/inflections.rb +16 -0
  93. data/test/dummy/config/initializers/mime_types.rb +4 -0
  94. data/test/dummy/config/initializers/session_store.rb +3 -0
  95. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  96. data/test/dummy/config/locales/en.yml +23 -0
  97. data/test/dummy/config/routes.rb +56 -0
  98. data/test/dummy/config/secrets.yml +22 -0
  99. data/test/dummy/config.ru +4 -0
  100. data/test/dummy/db/development.sqlite3 +0 -0
  101. data/test/dummy/log/development.log +6 -0
  102. data/test/dummy/public/404.html +67 -0
  103. data/test/dummy/public/422.html +67 -0
  104. data/test/dummy/public/500.html +66 -0
  105. data/test/dummy/public/favicon.ico +0 -0
  106. data/test/fixtures/users.yml +11 -0
  107. data/test/integration/navigation_test.rb +8 -0
  108. data/test/lib/generators/make_associations_complete_generator_test.rb +14 -0
  109. data/test/lib/generators/thecoreize_rails_plugin_generator_test.rb +14 -0
  110. data/test/lib/generators/thecorize_app_generator_test.rb +14 -0
  111. data/test/models/user_test.rb +7 -0
  112. data/test/test_helper.rb +20 -0
  113. data/test/thecore_test.rb +7 -0
  114. metadata +494 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,11 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one: {}
8
+ # column: value
9
+ #
10
+ two: {}
11
+ # column: value
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
8
+
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+ require 'generators/make_associations_complete/make_associations_complete_generator'
3
+
4
+ class MakeAssociationsCompleteGeneratorTest < Rails::Generators::TestCase
5
+ tests MakeAssociationsCompleteGenerator
6
+ destination Rails.root.join('tmp/generators')
7
+ setup :prepare_destination
8
+
9
+ # test "generator runs without errors" do
10
+ # assert_nothing_raised do
11
+ # run_generator ["arguments"]
12
+ # end
13
+ # end
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+ require 'generators/thecoreize_rails_plugin/thecoreize_rails_plugin_generator'
3
+
4
+ class ThecoreizeRailsPluginGeneratorTest < Rails::Generators::TestCase
5
+ tests ThecoreizeRailsPluginGenerator
6
+ destination Rails.root.join('tmp/generators')
7
+ setup :prepare_destination
8
+
9
+ # test "generator runs without errors" do
10
+ # assert_nothing_raised do
11
+ # run_generator ["arguments"]
12
+ # end
13
+ # end
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+ require 'generators/thecorize_app/thecorize_app_generator'
3
+
4
+ class ThecorizeAppGeneratorTest < Rails::Generators::TestCase
5
+ tests ThecorizeAppGenerator
6
+ destination Rails.root.join('tmp/generators')
7
+ setup :prepare_destination
8
+
9
+ # test "generator runs without errors" do
10
+ # assert_nothing_raised do
11
+ # run_generator ["arguments"]
12
+ # end
13
+ # end
14
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,20 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
+ require "rails/test_help"
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11
+
12
+ # Load support files
13
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14
+
15
+ # Load fixtures from the engine
16
+ if ActiveSupport::TestCase.respond_to?(:fixture_path=)
17
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18
+ ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
19
+ ActiveSupport::TestCase.fixtures :all
20
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ThecoreTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, Thecore
6
+ end
7
+ end