thecore 1.3.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +37 -0
- data/app/controllers/application_controller.rb +2 -0
- data/app/controllers/pages_controller.rb +37 -0
- data/app/jobs/application_job.rb +2 -0
- data/app/models/ability.rb +48 -0
- data/app/models/user.rb +158 -0
- data/app/uploaders/attachment_uploader.rb +27 -0
- data/app/uploaders/image_uploader.rb +27 -0
- data/config/initializers/rails_admin.rb +42 -0
- data/config/initializers/rails_application_config.rb +28 -0
- data/config/initializers/thecore_concern.rb +113 -0
- data/config/locales/en.activerecord.yml +6 -0
- data/config/locales/en.contact_mailer.custom.yml +5 -0
- data/config/locales/en.devise.custom.yml +15 -0
- data/config/locales/en.rails_admin.yml +34 -0
- data/config/locales/en.rollincode.yml +5 -0
- data/config/locales/en.simple_form.yml +31 -0
- data/config/locales/en.yml +31 -0
- data/config/locales/it.activerecord.yml +20 -0
- data/config/locales/it.contact_mailer.custom.yml +5 -0
- data/config/locales/it.devise.custom.yml +15 -0
- data/config/locales/it.rails_admin.yml +34 -0
- data/config/locales/it.rollincode.yml +5 -0
- data/config/locales/it.simple_form.yml +31 -0
- data/config/locales/it.yml +38 -0
- data/config/routes.rb +14 -0
- data/db/migrate/20131103142222_create_friendly_id_slugs.rb +15 -0
- data/db/migrate/20141010133701_devise_create_users.rb +54 -0
- data/db/migrate/20150806091039_add_authentication_token_to_users.rb +6 -0
- data/db/migrate/20150825101810_add_roles_mask_to_users.rb +5 -0
- data/db/migrate/20151201145832_add_external_to_user.rb +5 -0
- data/db/migrate/20160331101901_add_code_to_user.rb +6 -0
- data/db/migrate/20160331101902_add_admin_user.rb +162 -0
- data/db/migrate/20161029154134_remove_friendly_id_slugs.rb +5 -0
- data/db/seeds.rb +1 -0
- data/lib/abilities.rb +20 -0
- data/lib/active_record_extension.rb +145 -0
- data/lib/activerecord_paperclip_extension.rb +21 -0
- data/lib/application_configs.rb +26 -0
- data/lib/application_record_loader.rb +3 -0
- data/lib/backtrace_silencers.rb +7 -0
- data/lib/constants.rb +0 -0
- data/lib/date_format.rb +27 -0
- data/lib/devise_initializer.rb +275 -0
- data/lib/generators/thecore/add_git/USAGE +8 -0
- data/lib/generators/thecore/add_git/add_git_generator.rb +269 -0
- data/lib/generators/thecore/thecorize_app/USAGE +8 -0
- data/lib/generators/thecore/thecorize_app/thecorize_app_generator.rb +37 -0
- data/lib/generators/thecore/thecorize_models/USAGE +9 -0
- data/lib/generators/thecore/thecorize_models/thecorize_models_generator.rb +255 -0
- data/lib/generators/thecore/thecorize_plugin/USAGE +9 -0
- data/lib/generators/thecore/thecorize_plugin/thecorize_plugin_generator.rb +166 -0
- data/lib/inflections.rb +16 -0
- data/lib/integer_extensions.rb +26 -0
- data/lib/kaminari_config.rb +12 -0
- data/lib/mime_types.rb +5 -0
- data/lib/postgresql_drop_replacement.rb +11 -0
- data/lib/string_extensions.rb +14 -0
- data/lib/tasks/thecore_tasks.rake +4 -0
- data/lib/thecore/engine.rb +35 -0
- data/lib/thecore/version.rb +3 -0
- data/lib/thecore.rb +63 -0
- data/lib/thecore_actions.rb +2 -0
- data/lib/thecore_base_roles.rb +2 -0
- data/lib/thecore_rails_admin_bulk_delete_concern.rb +19 -0
- data/lib/thecore_rails_admin_export_concern.rb +19 -0
- data/lib/thecore_rails_admin_main_controller_concern.rb +11 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +29 -0
- data/test/dummy/config/application.rb +25 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +41 -0
- data/test/dummy/config/environments/production.rb +79 -0
- data/test/dummy/config/environments/test.rb +42 -0
- data/test/dummy/config/initializers/assets.rb +11 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +56 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/development.log +6 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fixtures/users.yml +11 -0
- data/test/integration/navigation_test.rb +8 -0
- data/test/lib/generators/make_associations_complete_generator_test.rb +14 -0
- data/test/lib/generators/thecoreize_rails_plugin_generator_test.rb +14 -0
- data/test/lib/generators/thecorize_app_generator_test.rb +14 -0
- data/test/models/user_test.rb +7 -0
- data/test/test_helper.rb +20 -0
- data/test/thecore_test.rb +7 -0
- 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,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
|
data/test/test_helper.rb
ADDED
@@ -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
|