bizarroids_settings 0.1.2
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/README.rdoc +77 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/bizarroids/application.js +13 -0
- data/app/assets/stylesheets/bizarroids/application.css +15 -0
- data/app/controllers/bizarroids/settings/application_controller.rb +4 -0
- data/app/controllers/bizarroids/settings/options_controller.rb +33 -0
- data/app/helpers/bizarroids/settings/options_helper.rb +15 -0
- data/app/helpers/bizarroids/settings/settings_helper.rb +27 -0
- data/app/models/bizarroids/settings/option.rb +65 -0
- data/app/views/bizarroids/settings/options/edit.html.erb +21 -0
- data/app/views/bizarroids/settings/options/index.html.erb +42 -0
- data/app/views/layouts/bizarroids/settings/application.html.erb +14 -0
- data/config/routes.rb +7 -0
- data/db/schema.rb +38 -0
- data/lib/bizarroids/settings/bizarroids_settings_option_uploader.rb +29 -0
- data/lib/bizarroids/settings/config_error.rb +4 -0
- data/lib/bizarroids/settings/engine.rb +7 -0
- data/lib/bizarroids/settings/helpers/settings_helper.rb +27 -0
- data/lib/bizarroids/settings/version.rb +5 -0
- data/lib/bizarroids/settings.rb +123 -0
- data/lib/bizarroids.rb +4 -0
- data/lib/bizarroids_settings.rb +1 -0
- data/lib/generators/bizarroids/settings/install/USAGE +14 -0
- data/lib/generators/bizarroids/settings/install/install_generator.rb +23 -0
- data/lib/generators/bizarroids/settings/install/templates/bizarroids_settings.en.yml +30 -0
- data/lib/generators/bizarroids/settings/install/templates/bizarroids_settings.ru.yml +31 -0
- data/lib/generators/bizarroids/settings/install/templates/initializer.rb +34 -0
- data/lib/generators/bizarroids/settings/install/templates/options_migration.rb +29 -0
- data/lib/tasks/bizarroids_tasks.rake +4 -0
- data/test/bizarroids_test.rb +7 -0
- data/test/controllers/bizarroids/settings/options_controller_test.rb +9 -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 +11 -0
- data/test/dummy/app/controllers/home_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/ability.rb +9 -0
- data/test/dummy/app/views/home/index.html.erb +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +21 -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/config/application.rb +23 -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 +37 -0
- data/test/dummy/config/environments/production.rb +82 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/bizarroids_settings.rb +39 -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/bizarroids_settings.en.yml +30 -0
- data/test/dummy/config/locales/bizarroids_settings.ru.yml +31 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +7 -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/db/migrate/20140731121008_create_bizarroids_settings_options.rb +29 -0
- data/test/dummy/db/schema.rb +39 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +51360 -0
- data/test/dummy/log/test.log +94685 -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/dummy/public/system/settings/file_option/0_832a7_af94124e_-1-L.jpg +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/48917139f539fdb146b469bb51d3d8a9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/51ba48ea70bfd46c0656e1d96ef04eab +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9ce90cea0febc5c40bd72ea48e76bff7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dd426b5348faf19a98e0326dc07bec37 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e7a8c6fc20a213fe7e6dbe204e74166b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/edabf3e4354e52066357ed9706cc6b9c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/generators/config/initializers/bizarroids_settings.rb +34 -0
- data/test/dummy/tmp/generators/config/locales/bizarroids_settings.en.yml +30 -0
- data/test/dummy/tmp/generators/config/locales/bizarroids_settings.ru.yml +31 -0
- data/test/dummy/tmp/generators/config/routes.rb +7 -0
- data/test/dummy/tmp/generators/db/migrate/20140802143121_create_bizarroids_settings_options.rb +29 -0
- data/test/fixtures/bizarroids/settings/options.yml +5 -0
- data/test/helpers/bizarroids/settings/options_helper_test.rb +17 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/lib/bizarroids/settings_test.rb +151 -0
- data/test/lib/generators/bizarroids/bizarroids/settings/install_generator_test.rb +35 -0
- data/test/models/bizarroids/settings/option_test.rb +48 -0
- data/test/test_helper.rb +47 -0
- metadata +316 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
11
|
+
# To enable root element in JSON for ActiveRecord objects.
|
12
|
+
# ActiveSupport.on_load(:active_record) do
|
13
|
+
# self.include_root_in_json = true
|
14
|
+
# end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
bizarroids/settings/option:
|
5
|
+
one: Option
|
6
|
+
other: Options
|
7
|
+
attributes:
|
8
|
+
bizarroids/settings/option:
|
9
|
+
name: Name
|
10
|
+
value_type: Type
|
11
|
+
value: Value
|
12
|
+
remove_file_value: Remove file
|
13
|
+
|
14
|
+
bizarroids:
|
15
|
+
settings:
|
16
|
+
name: Options
|
17
|
+
option_updated: Option updated
|
18
|
+
types:
|
19
|
+
string: String
|
20
|
+
integer: Integer
|
21
|
+
float: Float
|
22
|
+
boolean: Boolean
|
23
|
+
text: Text
|
24
|
+
date: Date
|
25
|
+
datetime: Date and Time
|
26
|
+
file: File
|
27
|
+
cancel: Cancel
|
28
|
+
edit: Edit
|
29
|
+
save: Save
|
30
|
+
not_set: Not set
|
@@ -0,0 +1,31 @@
|
|
1
|
+
ru:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
bizarroids/settings/option:
|
5
|
+
one: Настройка
|
6
|
+
few: Настройки
|
7
|
+
other: Настроек
|
8
|
+
attributes:
|
9
|
+
bizarroids/settings/option:
|
10
|
+
name: Название
|
11
|
+
value_type: Тип
|
12
|
+
value: Значение
|
13
|
+
remove_file_value: Удалить файл
|
14
|
+
|
15
|
+
bizarroids:
|
16
|
+
settings:
|
17
|
+
name: Настройки
|
18
|
+
option_updated: Настройка обновлена
|
19
|
+
types:
|
20
|
+
string: Строка
|
21
|
+
integer: Целое число
|
22
|
+
float: Вещественное число
|
23
|
+
boolean: Логическое
|
24
|
+
text: Текстовое
|
25
|
+
date: Дата
|
26
|
+
datetime: Дата и время
|
27
|
+
file: Файл
|
28
|
+
cancel: Отмена
|
29
|
+
edit: Редактировать
|
30
|
+
save: Сохранить
|
31
|
+
not_set: Не установлено
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
6
|
+
# Make sure the secret is at least 30 characters and all random,
|
7
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure the secrets in this file are kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
|
13
|
+
development:
|
14
|
+
secret_key_base: 5fbe92afdf900d18f230a7507b4024fd3b3163490db38d289157b9210c1461bf6e5125e7b11bcdd300501ed13d56459a4b65e400485f2d0c0b5a15c3b9b9a7a2
|
15
|
+
|
16
|
+
test:
|
17
|
+
secret_key_base: 70d23254be98a964d72983aafb54026a01e7a5a32230176b839f85f5cf0d4f34ca5e8c207870c232aa73e4e27f1368eb798a904aaadb6ed74e7463fa59759fdd
|
18
|
+
|
19
|
+
# Do not keep production secrets in the repository,
|
20
|
+
# instead read values from the environment.
|
21
|
+
production:
|
22
|
+
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|
Binary file
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class CreateBizarroidsSettingsOptions < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :bizarroids_settings_options do |t|
|
4
|
+
t.string :key
|
5
|
+
|
6
|
+
t.string :value_type, limit: 10
|
7
|
+
t.string :name
|
8
|
+
t.string :description
|
9
|
+
t.boolean :required, default: false
|
10
|
+
t.boolean :hidden, default: false
|
11
|
+
t.boolean :collection, default: false
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
# values
|
15
|
+
t.string :string_value
|
16
|
+
t.integer :integer_value
|
17
|
+
t.float :float_value
|
18
|
+
t.boolean :boolean_value, default: false
|
19
|
+
t.text :text_value
|
20
|
+
t.date :date_value
|
21
|
+
t.datetime :datetime_value
|
22
|
+
t.string :file_value
|
23
|
+
|
24
|
+
t.timestamps
|
25
|
+
end
|
26
|
+
|
27
|
+
add_index :bizarroids_settings_options, :key
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
# This file is auto-generated from the current state of the database. Instead
|
3
|
+
# of editing this file, please use the migrations feature of Active Record to
|
4
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
5
|
+
#
|
6
|
+
# Note that this schema.rb definition is the authoritative source for your
|
7
|
+
# database schema. If you need to create the application database on another
|
8
|
+
# system, you should be using db:schema:load, not running all the migrations
|
9
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
|
+
#
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
|
+
|
14
|
+
ActiveRecord::Schema.define(version: 20140731121008) do
|
15
|
+
|
16
|
+
create_table "bizarroids_settings_options", force: true do |t|
|
17
|
+
t.string "key"
|
18
|
+
t.string "value_type", limit: 10
|
19
|
+
t.string "name"
|
20
|
+
t.string "description"
|
21
|
+
t.boolean "required", default: false
|
22
|
+
t.boolean "hidden", default: false
|
23
|
+
t.boolean "collection", default: false
|
24
|
+
t.integer "position"
|
25
|
+
t.string "string_value"
|
26
|
+
t.integer "integer_value"
|
27
|
+
t.float "float_value"
|
28
|
+
t.boolean "boolean_value", default: false
|
29
|
+
t.text "text_value"
|
30
|
+
t.date "date_value"
|
31
|
+
t.datetime "datetime_value"
|
32
|
+
t.string "file_value"
|
33
|
+
t.datetime "created_at"
|
34
|
+
t.datetime "updated_at"
|
35
|
+
end
|
36
|
+
|
37
|
+
add_index "bizarroids_settings_options", ["key"], name: "index_bizarroids_settings_options_on_key"
|
38
|
+
|
39
|
+
end
|
Binary file
|