thecore_settings 1.1.15 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +20 -0
- data/.devcontainer/devcontainer.json +33 -0
- data/.github/workflows/gempush.yml +34 -0
- data/.gitignore +542 -0
- data/.rakeTasks +7 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +31 -0
- data/CHANGELOG.md +81 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +275 -0
- data/LICENSE.txt +22 -0
- data/README.md +169 -0
- data/README.rdoc +68 -0
- data/Rakefile +6 -34
- data/app/{assets/config/thecore_settings_manifest.js → models/.keep} +0 -0
- data/app/models/thecore_settings/setting.rb +77 -0
- data/app/views/.keep +0 -0
- data/app/views/rails_admin/main/_setting_value.html.haml +41 -0
- data/bin/rails +13 -0
- data/config/locales/en.yml +29 -0
- data/config/locales/{thecore_settings.it.yml → it.yml} +2 -2
- data/config/locales/pt-BR.yml +28 -0
- data/config/locales/ru.yml +29 -0
- data/db/migrate/20161227101954_create_rails_admin_settings.rb +4 -4
- data/gemfiles/mongoid-6.0.gemfile +5 -0
- data/gemfiles/mongoid-6.3.gemfile +5 -0
- data/lib/generators/thecore_settings/migration_generator.rb +15 -0
- data/lib/generators/thecore_settings/templates/db/migrate/20161227101954_create_thecore_settings.rb +29 -0
- data/lib/generators/thecore_settings/templates/migration.rb +29 -0
- data/lib/thecore_settings/determine_mime_type.rb +193 -0
- data/lib/thecore_settings/dumper.rb +12 -0
- data/lib/thecore_settings/engine.rb +17 -3
- data/lib/thecore_settings/fallback.rb +21 -0
- data/lib/thecore_settings/hex_color_validator.rb +11 -0
- data/lib/thecore_settings/kinds.rb +34 -0
- data/lib/thecore_settings/mongoid.rb +19 -0
- data/lib/thecore_settings/namespaced.rb +210 -0
- data/lib/thecore_settings/processing.rb +217 -0
- data/lib/thecore_settings/rails_admin_config.rb +71 -0
- data/lib/thecore_settings/require_helpers.rb +86 -0
- data/lib/thecore_settings/settings.rb +95 -0
- data/lib/thecore_settings/storage/carrier_wave_uploader.rb +9 -0
- data/lib/thecore_settings/storage/shrine_uploader.rb +14 -0
- data/lib/thecore_settings/tasks.rb +35 -0
- data/lib/thecore_settings/uploads.rb +57 -0
- data/lib/thecore_settings/validation.rb +126 -0
- data/lib/thecore_settings/version.rb +1 -1
- data/lib/thecore_settings.rb +115 -123
- data/spec/advanced_usage_spec.rb +11 -0
- data/spec/carrierwave_spec.rb +41 -0
- data/spec/database_trickery_spec.rb +48 -0
- data/spec/defaults_spec.rb +87 -0
- data/spec/enabling_spec.rb +29 -0
- data/spec/factories/setting.rb +8 -0
- data/spec/label_spec.rb +16 -0
- data/spec/migration_spec.rb +20 -0
- data/spec/model_spec.rb +105 -0
- data/spec/namespaced_spec.rb +67 -0
- data/spec/paperclip_spec.rb +38 -0
- data/spec/settings_spec.rb +75 -0
- data/spec/shrine_spec.rb +34 -0
- data/spec/spec_helper.rb +85 -0
- data/spec/support/1024x768.gif +0 -0
- data/spec/support/database_cleaner.rb +10 -0
- data/spec/support/defaults.yml +23 -0
- data/spec/support/defaults_w_file.yml +19 -0
- data/spec/support/mongoid.rb +6 -0
- data/spec/support/mongoid.yml +6 -0
- data/spec/types_spec.rb +101 -0
- data/thecore_settings.gemspec +44 -0
- metadata +326 -63
- data/app/assets/stylesheets/rich/editor.css +0 -20
- data/config/initializers/rails_admin_requirements.rb +0 -22
- data/config/initializers/thecore_settings_abilities.rb +0 -22
- data/config/initializers/thecore_settings_post_init.rb +0 -9
- data/config/routes.rb +0 -3
- data/db/migrate/20161227101956_add_app_name.rb +0 -5
- data/lib/tasks/thecore_settings_tasks.rake +0 -4
@@ -1,20 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
This file defines the default set of CSS styles available in the Rich editor
|
3
|
-
*/
|
4
|
-
|
5
|
-
p.caption {
|
6
|
-
font-style: italic;
|
7
|
-
color: grey;
|
8
|
-
}
|
9
|
-
|
10
|
-
span.highlight {
|
11
|
-
background: yellow;
|
12
|
-
}
|
13
|
-
|
14
|
-
img.left {
|
15
|
-
float: left;
|
16
|
-
}
|
17
|
-
|
18
|
-
img.right {
|
19
|
-
float: right;
|
20
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module RailsAdminSettings
|
2
|
-
module RailsAdminExtensionConfig
|
3
|
-
def self.included(base)
|
4
|
-
# IMPORTANT: To extend rails admin section in model, directly, instead of using concerns, I can
|
5
|
-
# extend the included method. Be sure to use a different module name, otherwis it will be overwritten
|
6
|
-
# See thecore_settings_rails_admin_model_extensions.rb initializer for a reference
|
7
|
-
# on how to extend rails_admin section of a model previously defined (say it's defined in another gem)
|
8
|
-
if base.respond_to?(:rails_admin)
|
9
|
-
base.rails_admin do
|
10
|
-
navigation_icon 'fa fa-cogs'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def display_name
|
15
|
-
"#{I18n.t "settings.namespaces.#{ns}", default: ns.titleize}: #{I18n.t "settings.names.#{name}", default: name.titleize}"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# include the extension (loving mixins)
|
22
|
-
RailsAdminSettings::Setting.send(:include, RailsAdminSettings::RailsAdminExtensionConfig)
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
|
-
module TheCoreSettingsAbilitiesConcern
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
included do
|
6
|
-
def thecore_settings_abilities user
|
7
|
-
# Rails.logger.debug "Cannot Create"
|
8
|
-
cannot :create, RailsAdminSettings::Setting
|
9
|
-
# Rails.logger.debug "Cannot Delete"
|
10
|
-
cannot :destroy, RailsAdminSettings::Setting
|
11
|
-
cannot :show, RailsAdminSettings::Setting
|
12
|
-
|
13
|
-
# cannot :manage, [RailsAdminSettings::Setting]
|
14
|
-
# cannot :dashboard, [RailsAdminSettings::Setting]
|
15
|
-
# # Pay attention to this errorTypeError (can't convert Class to Array (Class#to_ary gives String)):
|
16
|
-
# can [:index, :update], [RailsAdminSettings::Setting] if user && user.admin?
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# include the extension
|
22
|
-
TheCoreAbilities.send(:include, TheCoreSettingsAbilitiesConcern)
|
data/config/routes.rb
DELETED