bizarroids_settings 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +77 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/bizarroids/application.js +13 -0
  6. data/app/assets/stylesheets/bizarroids/application.css +15 -0
  7. data/app/controllers/bizarroids/settings/application_controller.rb +4 -0
  8. data/app/controllers/bizarroids/settings/options_controller.rb +33 -0
  9. data/app/helpers/bizarroids/settings/options_helper.rb +15 -0
  10. data/app/helpers/bizarroids/settings/settings_helper.rb +27 -0
  11. data/app/models/bizarroids/settings/option.rb +65 -0
  12. data/app/views/bizarroids/settings/options/edit.html.erb +21 -0
  13. data/app/views/bizarroids/settings/options/index.html.erb +42 -0
  14. data/app/views/layouts/bizarroids/settings/application.html.erb +14 -0
  15. data/config/routes.rb +7 -0
  16. data/db/schema.rb +38 -0
  17. data/lib/bizarroids/settings/bizarroids_settings_option_uploader.rb +29 -0
  18. data/lib/bizarroids/settings/config_error.rb +4 -0
  19. data/lib/bizarroids/settings/engine.rb +7 -0
  20. data/lib/bizarroids/settings/helpers/settings_helper.rb +27 -0
  21. data/lib/bizarroids/settings/version.rb +5 -0
  22. data/lib/bizarroids/settings.rb +123 -0
  23. data/lib/bizarroids.rb +4 -0
  24. data/lib/bizarroids_settings.rb +1 -0
  25. data/lib/generators/bizarroids/settings/install/USAGE +14 -0
  26. data/lib/generators/bizarroids/settings/install/install_generator.rb +23 -0
  27. data/lib/generators/bizarroids/settings/install/templates/bizarroids_settings.en.yml +30 -0
  28. data/lib/generators/bizarroids/settings/install/templates/bizarroids_settings.ru.yml +31 -0
  29. data/lib/generators/bizarroids/settings/install/templates/initializer.rb +34 -0
  30. data/lib/generators/bizarroids/settings/install/templates/options_migration.rb +29 -0
  31. data/lib/tasks/bizarroids_tasks.rake +4 -0
  32. data/test/bizarroids_test.rb +7 -0
  33. data/test/controllers/bizarroids/settings/options_controller_test.rb +9 -0
  34. data/test/dummy/README.rdoc +28 -0
  35. data/test/dummy/Rakefile +6 -0
  36. data/test/dummy/app/assets/javascripts/application.js +13 -0
  37. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  38. data/test/dummy/app/controllers/application_controller.rb +11 -0
  39. data/test/dummy/app/controllers/home_controller.rb +4 -0
  40. data/test/dummy/app/helpers/application_helper.rb +2 -0
  41. data/test/dummy/app/models/ability.rb +9 -0
  42. data/test/dummy/app/views/home/index.html.erb +1 -0
  43. data/test/dummy/app/views/layouts/application.html.erb +21 -0
  44. data/test/dummy/bin/bundle +3 -0
  45. data/test/dummy/bin/rails +4 -0
  46. data/test/dummy/bin/rake +4 -0
  47. data/test/dummy/config/application.rb +23 -0
  48. data/test/dummy/config/boot.rb +5 -0
  49. data/test/dummy/config/database.yml +25 -0
  50. data/test/dummy/config/environment.rb +5 -0
  51. data/test/dummy/config/environments/development.rb +37 -0
  52. data/test/dummy/config/environments/production.rb +82 -0
  53. data/test/dummy/config/environments/test.rb +39 -0
  54. data/test/dummy/config/initializers/assets.rb +8 -0
  55. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  56. data/test/dummy/config/initializers/bizarroids_settings.rb +39 -0
  57. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  58. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  59. data/test/dummy/config/initializers/inflections.rb +16 -0
  60. data/test/dummy/config/initializers/mime_types.rb +4 -0
  61. data/test/dummy/config/initializers/session_store.rb +3 -0
  62. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  63. data/test/dummy/config/locales/bizarroids_settings.en.yml +30 -0
  64. data/test/dummy/config/locales/bizarroids_settings.ru.yml +31 -0
  65. data/test/dummy/config/locales/en.yml +23 -0
  66. data/test/dummy/config/routes.rb +7 -0
  67. data/test/dummy/config/secrets.yml +22 -0
  68. data/test/dummy/config.ru +4 -0
  69. data/test/dummy/db/development.sqlite3 +0 -0
  70. data/test/dummy/db/migrate/20140731121008_create_bizarroids_settings_options.rb +29 -0
  71. data/test/dummy/db/schema.rb +39 -0
  72. data/test/dummy/db/test.sqlite3 +0 -0
  73. data/test/dummy/log/development.log +51360 -0
  74. data/test/dummy/log/test.log +94685 -0
  75. data/test/dummy/public/404.html +67 -0
  76. data/test/dummy/public/422.html +67 -0
  77. data/test/dummy/public/500.html +66 -0
  78. data/test/dummy/public/favicon.ico +0 -0
  79. data/test/dummy/public/system/settings/file_option/0_832a7_af94124e_-1-L.jpg +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/48917139f539fdb146b469bb51d3d8a9 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/51ba48ea70bfd46c0656e1d96ef04eab +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/9ce90cea0febc5c40bd72ea48e76bff7 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/dd426b5348faf19a98e0326dc07bec37 +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/e7a8c6fc20a213fe7e6dbe204e74166b +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/edabf3e4354e52066357ed9706cc6b9c +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  92. data/test/dummy/tmp/generators/config/initializers/bizarroids_settings.rb +34 -0
  93. data/test/dummy/tmp/generators/config/locales/bizarroids_settings.en.yml +30 -0
  94. data/test/dummy/tmp/generators/config/locales/bizarroids_settings.ru.yml +31 -0
  95. data/test/dummy/tmp/generators/config/routes.rb +7 -0
  96. data/test/dummy/tmp/generators/db/migrate/20140802143121_create_bizarroids_settings_options.rb +29 -0
  97. data/test/fixtures/bizarroids/settings/options.yml +5 -0
  98. data/test/helpers/bizarroids/settings/options_helper_test.rb +17 -0
  99. data/test/integration/navigation_test.rb +10 -0
  100. data/test/lib/bizarroids/settings_test.rb +151 -0
  101. data/test/lib/generators/bizarroids/bizarroids/settings/install_generator_test.rb +35 -0
  102. data/test/models/bizarroids/settings/option_test.rb +48 -0
  103. data/test/test_helper.rb +47 -0
  104. 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,7 @@
1
+ Rails.application.routes.draw do
2
+
3
+ mount Bizarroids::Settings::Engine => '/admin'
4
+
5
+ root to: 'home#index'
6
+
7
+ end
@@ -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"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
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