adminos 1.0.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +14 -0
- data/.gitignore +25 -0
- data/.gitlab-ci.yml +18 -0
- data/.rspec +2 -0
- data/.rubocop.yml +120 -0
- data/.rubocop_todo.yml +58 -0
- data/Gemfile +25 -0
- data/Guardfile +70 -0
- data/LICENSE.txt +22 -0
- data/README.md +88 -0
- data/Rakefile +20 -0
- data/adminos.gemspec +37 -0
- data/adminos.png +0 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/apple-touch-icon.png +0 -0
- data/app/assets/images/favicon-16x16.png +0 -0
- data/app/assets/images/favicon-32x32.png +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/safari-pinned-tab.svg +23 -0
- data/app/inputs/cropp_input.rb +45 -0
- data/bin/bundle +105 -0
- data/bin/gem +39 -0
- data/bin/rspec +29 -0
- data/exe/adminos +5 -0
- data/lib/adminos/cli.rb +71 -0
- data/lib/adminos/controllers/admin_extension.rb +34 -0
- data/lib/adminos/controllers/helpers.rb +24 -0
- data/lib/adminos/controllers/resource.rb +169 -0
- data/lib/adminos/extensions/globalize_actiontext.rb +28 -0
- data/lib/adminos/extensions/globalize_fields.rb +19 -0
- data/lib/adminos/extensions/nested_set.rb +27 -0
- data/lib/adminos/extensions/string.rb +5 -0
- data/lib/adminos/generators/gemfile_merge.rb +85 -0
- data/lib/adminos/generators/utilities.rb +87 -0
- data/lib/adminos/helpers/admin.rb +190 -0
- data/lib/adminos/helpers/bootstrap.rb +64 -0
- data/lib/adminos/helpers/models/apply_sortable_order.rb +10 -0
- data/lib/adminos/helpers/models/array_attrs.rb +17 -0
- data/lib/adminos/helpers/models/cropped.rb +20 -0
- data/lib/adminos/helpers/models/dom_id.rb +16 -0
- data/lib/adminos/helpers/models/flag_attrs.rb +43 -0
- data/lib/adminos/helpers/models/if_blank_set_to_nil_params.rb +19 -0
- data/lib/adminos/helpers/models/move_to.rb +17 -0
- data/lib/adminos/helpers/models/nested_set/duplication.rb +31 -0
- data/lib/adminos/helpers/models/nested_set/materialize_path.rb +50 -0
- data/lib/adminos/helpers/models/nested_set/place_to.rb +35 -0
- data/lib/adminos/helpers/models/nested_set/safe_destroy.rb +34 -0
- data/lib/adminos/helpers/models/recognizable.rb +28 -0
- data/lib/adminos/helpers/models/slugged.rb +20 -0
- data/lib/adminos/helpers/models/soft_destroy.rb +61 -0
- data/lib/adminos/helpers/models/wysiwyg.rb +105 -0
- data/lib/adminos/helpers/view.rb +137 -0
- data/lib/adminos/operations/check_environment.rb +18 -0
- data/lib/adminos/operations/extract_environment.rb +42 -0
- data/lib/adminos/operations/load_environment.rb +30 -0
- data/lib/adminos/stateful_link/action_any_of.rb +76 -0
- data/lib/adminos/stateful_link/helper.rb +31 -0
- data/lib/adminos.rb +42 -0
- data/lib/adminos_template.rb +15 -0
- data/lib/generators/adminos/adminos_generator.rb +164 -0
- data/lib/generators/adminos/ci_generator.rb +124 -0
- data/lib/generators/adminos/field_generator.rb +105 -0
- data/lib/generators/adminos/i18n_generator.rb +76 -0
- data/lib/generators/adminos/install_generator.rb +238 -0
- data/lib/generators/templates/adminos/adminos.ru.yml +15 -0
- data/lib/generators/templates/adminos/fields.slim +21 -0
- data/lib/generators/templates/adminos/locales/general_fields.slim +7 -0
- data/lib/generators/templates/adminos/locales/locale_fields.slim +10 -0
- data/lib/generators/templates/adminos/locales/migration.rb.erb +18 -0
- data/lib/generators/templates/adminos/locales/model.rb.erb +6 -0
- data/lib/generators/templates/adminos/sidebar.slim +2 -0
- data/lib/generators/templates/adminos/sorts/body.slim +3 -0
- data/lib/generators/templates/adminos/sorts/headers.slim +3 -0
- data/lib/generators/templates/adminos/types/default/controller.rb.erb +18 -0
- data/lib/generators/templates/adminos/types/default/migration.rb +5 -0
- data/lib/generators/templates/adminos/types/default/model.rb +20 -0
- data/lib/generators/templates/adminos/types/default/model_includes.rb +4 -0
- data/lib/generators/templates/adminos/types/default/views/index.slim +14 -0
- data/lib/generators/templates/adminos/types/section/controller.rb.erb +10 -0
- data/lib/generators/templates/adminos/types/section/migration.rb +12 -0
- data/lib/generators/templates/adminos/types/section/model.rb +62 -0
- data/lib/generators/templates/adminos/types/section/model_includes.rb +7 -0
- data/lib/generators/templates/adminos/types/section/views/_object.slim +24 -0
- data/lib/generators/templates/adminos/types/section/views/_objects.slim +6 -0
- data/lib/generators/templates/adminos/types/section/views/index.slim +7 -0
- data/lib/generators/templates/adminos/types/sortable/controller.rb.erb +10 -0
- data/lib/generators/templates/adminos/types/sortable/migration.rb +9 -0
- data/lib/generators/templates/adminos/types/sortable/model.rb +35 -0
- data/lib/generators/templates/adminos/types/sortable/model_includes.rb +6 -0
- data/lib/generators/templates/adminos/types/sortable/views/_object.slim +17 -0
- data/lib/generators/templates/adminos/types/sortable/views/_objects.slim +6 -0
- data/lib/generators/templates/adminos/types/sortable/views/index.slim +7 -0
- data/lib/generators/templates/adminos/types/table/controller.rb.erb +19 -0
- data/lib/generators/templates/adminos/types/table/views/index.slim +31 -0
- data/lib/generators/templates/ci/.gitlab-ci.yml +40 -0
- data/lib/generators/templates/ci/audit/Gemfile +3 -0
- data/lib/generators/templates/ci/lint/Gemfile +3 -0
- data/lib/generators/templates/ci/lint/rubocop.yml +116 -0
- data/lib/generators/templates/ci/rakelib/audit.rake +13 -0
- data/lib/generators/templates/ci/rakelib/lint.rake +13 -0
- data/lib/generators/templates/ci/spec/Gemfile +9 -0
- data/lib/generators/templates/field/locales/locale_fields.slim +4 -0
- data/lib/generators/templates/field/locales/migration.rb.erb +13 -0
- data/lib/generators/templates/field/locales/model.rb.erb +6 -0
- data/lib/generators/templates/i18n/Gemfile +1 -0
- data/lib/generators/templates/i18n/add_translation_table_to_page.rb +15 -0
- data/lib/generators/templates/i18n/auto/app/validators/locale_validator.rb +23 -0
- data/lib/generators/templates/i18n/auto/app/views/admin/base/_fields.slim +1 -0
- data/lib/generators/templates/i18n/auto/app/views/admin/base/_pills.slim +19 -0
- data/lib/generators/templates/i18n/auto/app/views/admin/pages/_general_fields.slim +8 -0
- data/lib/generators/templates/i18n/auto/app/views/admin/pages/_locale_fields.slim +13 -0
- data/lib/generators/templates/i18n/auto/config/initializers/globalize_fields.rb +1 -0
- data/lib/generators/templates/i18n/controller.rb +12 -0
- data/lib/generators/templates/i18n/devise/devise.ru.yml +60 -0
- data/lib/generators/templates/i18n/devise/views/_links.erb +25 -0
- data/lib/generators/templates/i18n/devise/views/confirmations/new.slim +8 -0
- data/lib/generators/templates/i18n/devise/views/mailer/confirmation_instructions.slim +4 -0
- data/lib/generators/templates/i18n/devise/views/mailer/reset_password_instructions.slim +5 -0
- data/lib/generators/templates/i18n/devise/views/mailer/unlock_instructions.slim +4 -0
- data/lib/generators/templates/i18n/devise/views/passwords/edit.slim +7 -0
- data/lib/generators/templates/i18n/devise/views/passwords/new.slim +5 -0
- data/lib/generators/templates/i18n/devise/views/registrations/edit.slim +25 -0
- data/lib/generators/templates/i18n/devise/views/registrations/new.slim +7 -0
- data/lib/generators/templates/i18n/devise/views/sessions/new.slim +22 -0
- data/lib/generators/templates/i18n/devise/views/unlocks/new.slim +11 -0
- data/lib/generators/templates/i18n/locales.slim +3 -0
- data/lib/generators/templates/i18n/page.rb +5 -0
- data/lib/generators/templates/install/.gitignore +11 -0
- data/lib/generators/templates/install/Gemfile +57 -0
- data/lib/generators/templates/install/Procfile +1 -0
- data/lib/generators/templates/install/_sidebar.slim.erb +44 -0
- data/lib/generators/templates/install/add_authentications/authentication.rb +7 -0
- data/lib/generators/templates/install/add_authentications/authentications_controller.rb +95 -0
- data/lib/generators/templates/install/add_authentications/authentications_migration.rb +12 -0
- data/lib/generators/templates/install/add_authentications/views/authentications/_form.slim +5 -0
- data/lib/generators/templates/install/add_authentications/views/authentications/_modal.slim +7 -0
- data/lib/generators/templates/install/add_pages/page.rb +116 -0
- data/lib/generators/templates/install/add_pages/pages_controller.rb +6 -0
- data/lib/generators/templates/install/add_pages/pages_migration.rb +25 -0
- data/lib/generators/templates/install/add_pages/views/pages/show.slim +4 -0
- data/lib/generators/templates/install/admin.slim +36 -0
- data/lib/generators/templates/install/admin_panel/pages/admin_pages_controller.rb +9 -0
- data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_fields.slim +26 -0
- data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_object.slim +25 -0
- data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_objects.slim +6 -0
- data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/index.slim +7 -0
- data/lib/generators/templates/install/admin_panel/users/admin_users_controller.rb +29 -0
- data/lib/generators/templates/install/admin_panel/users/views/admin_users/_fields.slim +4 -0
- data/lib/generators/templates/install/admin_panel/users/views/admin_users/index.slim +33 -0
- data/lib/generators/templates/install/admin_panel/versions/admin_versions_controller.rb +29 -0
- data/lib/generators/templates/install/admin_panel/versions/views/admin_versions/index.slim +47 -0
- data/lib/generators/templates/install/admin_panel/versions/views/admin_versions/show.slim +18 -0
- data/lib/generators/templates/install/application.slim.erb +31 -0
- data/lib/generators/templates/install/auto/.editorconfig +14 -0
- data/lib/generators/templates/install/auto/.env.staging +2 -0
- data/lib/generators/templates/install/auto/Capfile +14 -0
- data/lib/generators/templates/install/auto/Guardfile +18 -0
- data/lib/generators/templates/install/auto/Procfile +1 -0
- data/lib/generators/templates/install/auto/Procfile.local +2 -0
- data/lib/generators/templates/install/auto/app/assets/javascripts/admin/application.js +3 -0
- data/lib/generators/templates/install/auto/app/assets/javascripts/admin/cocoon_fields.js +43 -0
- data/lib/generators/templates/install/auto/app/assets/javascripts/application.js +1 -0
- data/lib/generators/templates/install/auto/app/assets/stylesheets/admin/application.scss +1 -0
- data/lib/generators/templates/install/auto/app/controllers/admin/base_controller.rb +16 -0
- data/lib/generators/templates/install/auto/app/controllers/admin/helps_controller.rb +4 -0
- data/lib/generators/templates/install/auto/app/controllers/admin/settings_controller.rb +26 -0
- data/lib/generators/templates/install/auto/app/controllers/application_controller.rb +50 -0
- data/lib/generators/templates/install/auto/app/controllers/index_controller.rb +2 -0
- data/lib/generators/templates/install/auto/app/helpers/nested_helper.rb +75 -0
- data/lib/generators/templates/install/auto/app/helpers/versions_helper.rb +33 -0
- data/lib/generators/templates/install/auto/app/inputs/carrierwave_input.rb +52 -0
- data/lib/generators/templates/install/auto/app/inputs/checkbox_input.rb +13 -0
- data/lib/generators/templates/install/auto/app/inputs/rich_text_input.rb +9 -0
- data/lib/generators/templates/install/auto/app/mailers/notifier.rb +9 -0
- data/lib/generators/templates/install/auto/app/models/settings.rb +27 -0
- data/lib/generators/templates/install/auto/app/services/export_xlsx.rb +76 -0
- data/lib/generators/templates/install/auto/app/views/active_storage/blobs/_blob.html.erb +17 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/_form.slim +33 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/_object.slim +27 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/_objects.slim +19 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/drop.js.erb +1 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/edit.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/index.slim +14 -0
- data/lib/generators/templates/install/auto/app/views/admin/base/new.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/admin/helps/index.slim +29 -0
- data/lib/generators/templates/install/auto/app/views/admin/settings/edit.slim +27 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_first_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_gap.slim +7 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_last_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_next_page.slim +9 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_paginator.slim +16 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/_prev_page.slim +9 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_first_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_gap.slim +8 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_last_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_next_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_paginator.slim +16 -0
- data/lib/generators/templates/install/auto/app/views/kaminari/admin/_prev_page.slim +10 -0
- data/lib/generators/templates/install/auto/app/views/layouts/admin/base.slim +17 -0
- data/lib/generators/templates/install/auto/app/views/shared/admin/_back_button.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/admin/_footer.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/admin/_search_form.slim +6 -0
- data/lib/generators/templates/install/auto/app/views/shared/admin/_topbar.slim +11 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_alert_close.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_contacts_page_link_tag.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_link_button_to.slim +2 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_method_ajax_request_link_to.slim +2 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_method_link_to.slim +12 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_navigation_menu.html.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_print_tag.slim +2 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_search_tag_for.slim +16 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_show_breadcrumbs.slim +7 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_show_flash_alert.slim +9 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_sortable_column.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_span_link_to.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/_sub_navigation.slim +14 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_batch_actions_tag.slim +16 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_collection_button_new.slim +5 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_collection_header.slim +4 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_locked_sign.slim +3 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_nav_published_sign.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_children.slim +2 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_duplication.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_edit.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_new.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_page_header.slim +5 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_published_sign.slim +1 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_show_breadcrumbs.slim +6 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_top_menu_item.slim +5 -0
- data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_unpublished_sign.slim +1 -0
- data/lib/generators/templates/install/auto/browserslist +3 -0
- data/lib/generators/templates/install/auto/config/deploy/shared/database.yml.erb +10 -0
- data/lib/generators/templates/install/auto/config/deploy/shared/nginx.conf.erb +28 -0
- data/lib/generators/templates/install/auto/config/deploy/shared/unicorn.rb.erb +35 -0
- data/lib/generators/templates/install/auto/config/deploy/staging.rb +12 -0
- data/lib/generators/templates/install/auto/config/environments/staging.rb +84 -0
- data/lib/generators/templates/install/auto/config/initializers/awesome_nested_set.rb +1 -0
- data/lib/generators/templates/install/auto/config/initializers/content_security_policy.rb +26 -0
- data/lib/generators/templates/install/auto/config/initializers/friendly_id.rb +1 -0
- data/lib/generators/templates/install/auto/config/initializers/kaminari_config.rb +15 -0
- data/lib/generators/templates/install/auto/config/initializers/simple_form.rb +238 -0
- data/lib/generators/templates/install/auto/config/initializers/slim.rb +2 -0
- data/lib/generators/templates/install/auto/config/locales/adminos.en.yml +164 -0
- data/lib/generators/templates/install/auto/config/locales/adminos.ru.yml +292 -0
- data/lib/generators/templates/install/auto/lib/capistrano/substitute_strings.rb +12 -0
- data/lib/generators/templates/install/auto/lib/capistrano/tasks/setup_config.cap +39 -0
- data/lib/generators/templates/install/auto/lib/capistrano/template.rb +33 -0
- data/lib/generators/templates/install/auto/public/404.html +26 -0
- data/lib/generators/templates/install/auto/public/500.html +25 -0
- data/lib/generators/templates/install/database.yml +19 -0
- data/lib/generators/templates/install/deploy.rb.erb +21 -0
- data/lib/generators/templates/install/install_devise/ability.rb +49 -0
- data/lib/generators/templates/install/install_devise/application.rb +7 -0
- data/lib/generators/templates/install/install_devise/prepare_users.rb +1 -0
- data/lib/generators/templates/install/install_devise/user.rb +21 -0
- data/lib/generators/templates/install/prepare_settings.rb +4 -0
- data/lib/generators/templates/install/routes/pages.rb +18 -0
- data/lib/generators/templates/install/routes.rb.erb +53 -0
- data/lib/generators/templates/install/settings_migration.rb +16 -0
- data/lib/generators/templates/install/webpack/custom.js +36 -0
- data/lib/generators/templates/install/webpack/environment.js +4 -0
- data/lib/generators/templates/install/webpack/javascript/admin/js/index.js +2 -0
- data/lib/generators/templates/install/webpack/javascript/admin/styles/admin.scss +2 -0
- data/lib/generators/templates/install/webpack/javascript/packs/admin.js +2 -0
- data/package-lock.json +3 -0
- data/spec/config/database.yml +2 -0
- data/spec/db/schema.rb +0 -0
- data/spec/lib/adminos/helpers/models/apply_sortable_order.rb +26 -0
- data/spec/lib/adminos/helpers/models/array_attrs_spec.rb +38 -0
- data/spec/lib/adminos/helpers/models/dom_id_spec.rb +41 -0
- data/spec/lib/adminos/helpers/models/flag_attrs_spec.rb +115 -0
- data/spec/lib/adminos/helpers/models/if_blank_set_to_nil_params_spec.rb +36 -0
- data/spec/lib/adminos/helpers/models/recognizable_spec.rb +40 -0
- data/spec/lib/adminos/helpers/models/slugged.rb +40 -0
- data/spec/lib/generators/adminos/adminos_generator_spec.rb +106 -0
- data/spec/lib/generators/adminos/ci_generator_spec.rb +88 -0
- data/spec/lib/generators/adminos/i18n_generator_spec.rb +31 -0
- data/spec/lib/generators/adminos/install_generator_rspec.rb +322 -0
- data/spec/spec_helper.rb +122 -0
- data/spec/support/ammeter.rb +14 -0
- data/spec/support/database.rb +29 -0
- data/spec/support/generators.rb +99 -0
- data/spec/support/post.rb +8 -0
- data/spec/support/shared/generator.rb +35 -0
- metadata +632 -0
@@ -0,0 +1,292 @@
|
|
1
|
+
ru:
|
2
|
+
"true": Да
|
3
|
+
"false": Нет
|
4
|
+
|
5
|
+
time:
|
6
|
+
formats:
|
7
|
+
admin: '%e %B %Y, %H:%M'
|
8
|
+
announcement: '%e %B %Y'
|
9
|
+
announcement_index_page: '%d.%m.%Y'
|
10
|
+
announcement_slug: '%Y-%m-%d %H:%M'
|
11
|
+
event: '%d %B'
|
12
|
+
event_day: '%d'
|
13
|
+
event_year: '%d %B %Y'
|
14
|
+
event_full: '%d %B %Y, %A'
|
15
|
+
feedback_request: '%e %B %Y %H:%M'
|
16
|
+
feedback_request_admin_email_subject: '%e %B %Y %H:%M'
|
17
|
+
feedback_request_manageable: '%e %B %Y %H:%M'
|
18
|
+
primary: '%d.%m.%Y'
|
19
|
+
short: '%e %B %Y'
|
20
|
+
|
21
|
+
number:
|
22
|
+
currency:
|
23
|
+
format:
|
24
|
+
format: "%n %u"
|
25
|
+
unit: "руб."
|
26
|
+
separator: ","
|
27
|
+
delimiter: " "
|
28
|
+
precision: 2
|
29
|
+
significant: false
|
30
|
+
strip_insignificant_zeros: false
|
31
|
+
|
32
|
+
errors:
|
33
|
+
messages:
|
34
|
+
invalid: "Имеет неверное значение"
|
35
|
+
empty: "Не может быть пустым"
|
36
|
+
blank: "Не может быть пустым"
|
37
|
+
extension_white_list_error: Неверный формат файла
|
38
|
+
|
39
|
+
attributes:
|
40
|
+
name: Название
|
41
|
+
published: Опубликована
|
42
|
+
nav_name: Название для навигации
|
43
|
+
nav_published: Показывать в навигации
|
44
|
+
slug: URL
|
45
|
+
body: Текст
|
46
|
+
lead: Краткое описание
|
47
|
+
published_at: Дата публикации
|
48
|
+
created_at: Дата
|
49
|
+
meta_title: Title
|
50
|
+
meta_description: Description
|
51
|
+
parent: Родитель
|
52
|
+
|
53
|
+
activerecord:
|
54
|
+
errors:
|
55
|
+
messages:
|
56
|
+
inclusion: "Имеет непредусмотренное значение"
|
57
|
+
exclusion: "Имеет зарезервированное значение"
|
58
|
+
invalid: "Имеет неверное значение"
|
59
|
+
confirmation: "не совпадает с подтверждением"
|
60
|
+
accepted: "Нужно подтвердить"
|
61
|
+
empty: "Не может быть пустым"
|
62
|
+
blank: "Не может быть пустым"
|
63
|
+
too_much_nesting: Итоговая вложенность не может превышать %{count} уровней.
|
64
|
+
too_long:
|
65
|
+
one: "Слишком большой длины (не может быть больше чем %{count} символ)"
|
66
|
+
few: "Слишком большой длины (не может быть больше чем %{count} символа)"
|
67
|
+
many: "Слишком большой длины (не может быть больше чем %{count} символов)"
|
68
|
+
other: "Слишком большой длины (не может быть больше чем %{count} символа)"
|
69
|
+
too_short:
|
70
|
+
one: "Недостаточной длины (не может быть меньше %{count} символа)"
|
71
|
+
few: "Недостаточной длины (не может быть меньше %{count} символов)"
|
72
|
+
many: "Недостаточной длины (не может быть меньше %{count} символов)"
|
73
|
+
other: "Недостаточной длины (не может быть меньше %{count} символа)"
|
74
|
+
wrong_length:
|
75
|
+
one: "Неверной длины (может быть длиной ровно %{count} символ)"
|
76
|
+
few: "Неверной длины (может быть длиной ровно %{count} символа)"
|
77
|
+
many: "Неверной длины (может быть длиной ровно %{count} символов)"
|
78
|
+
other: "Неверной длины (может быть длиной ровно %{count} символа)"
|
79
|
+
taken: "Уже существует"
|
80
|
+
wrong_host: "Email должен принадлежать домену %{host} и должен сущестовать на сервере."
|
81
|
+
models:
|
82
|
+
page: Страница
|
83
|
+
user: Пользователь
|
84
|
+
settings: Настройки
|
85
|
+
attributes:
|
86
|
+
settings:
|
87
|
+
company_name: Название компании
|
88
|
+
contact_email: Контактный e-mail
|
89
|
+
email: E-mail для уведомлений
|
90
|
+
email_header_from: E-mail для FROM
|
91
|
+
index_meta_description: Description
|
92
|
+
index_meta_title: Title
|
93
|
+
per_page: Количество на странице
|
94
|
+
seo_google_analytics: Код Google Analytics
|
95
|
+
seo_yandex_metrika: Код Яндекс.Метрики
|
96
|
+
pr_email: E-mail PR-директора
|
97
|
+
test_emails: E-mail для тестовых писем
|
98
|
+
page:
|
99
|
+
behavior: Тип страницы
|
100
|
+
user:
|
101
|
+
email: E-mail
|
102
|
+
password: Пароль
|
103
|
+
roles: Роли
|
104
|
+
admin: Админ
|
105
|
+
paper_trail/version:
|
106
|
+
item: Объект
|
107
|
+
item_type: Тип
|
108
|
+
event: Событие
|
109
|
+
whodunnit: Юзер
|
110
|
+
|
111
|
+
social:
|
112
|
+
log_in: Войти через социальные сети
|
113
|
+
already_bound: Этот профиль социальной сети уже был привязан
|
114
|
+
bind_success: Вы успешно привязали профиль %{provider} к своей текущей учетной записи
|
115
|
+
login_success: Вы успешно вошли с помощью профиля %{provider}
|
116
|
+
email_bind_success: Профиль %{provider} был привязан к вашему основному аккаунту
|
117
|
+
signup_success: Вы вошли с помощью профиля социальной сети %{provider}
|
118
|
+
|
119
|
+
flash:
|
120
|
+
actions:
|
121
|
+
create:
|
122
|
+
notice: Объект успешно создан
|
123
|
+
alert: Заполните, пожалуйста, форму без ошибок
|
124
|
+
update:
|
125
|
+
notice: Объект успешно обновлен
|
126
|
+
alert: Заполните, пожалуйста, форму без ошибок
|
127
|
+
destroy:
|
128
|
+
notice: Объект успешно удален
|
129
|
+
alert: Объект не может быть удален
|
130
|
+
batch_action:
|
131
|
+
none: Выберите хотя бы один объект
|
132
|
+
notice: Операция завершена успешно
|
133
|
+
access_denied: Доступ запрещен
|
134
|
+
|
135
|
+
simple_form:
|
136
|
+
hints:
|
137
|
+
defaults:
|
138
|
+
slug: Сформируется автоматически, если не задан. Допустимы латинские символы, цифры и дефис.
|
139
|
+
required:
|
140
|
+
text: 'Обязательно'
|
141
|
+
|
142
|
+
views:
|
143
|
+
pagination:
|
144
|
+
first: Первая страница
|
145
|
+
last: Последняя страница
|
146
|
+
next: Следующая страница
|
147
|
+
previous: Предыдущая страница
|
148
|
+
truncate: '...'
|
149
|
+
admin:
|
150
|
+
first: Первая страница
|
151
|
+
last: Последняя страница
|
152
|
+
next: "»"
|
153
|
+
previous: "«"
|
154
|
+
truncate: '...'
|
155
|
+
|
156
|
+
labels:
|
157
|
+
application:
|
158
|
+
admin: Панель управления
|
159
|
+
admin:
|
160
|
+
add: Добавить
|
161
|
+
add_child: Добавить подраздел
|
162
|
+
back: Назад
|
163
|
+
cancel: Отменить
|
164
|
+
destroy: Удалить
|
165
|
+
edit: Редактировать
|
166
|
+
show: Просмотр изменений
|
167
|
+
go_to_root: Перейти на сайт
|
168
|
+
info: Справка
|
169
|
+
other: Другое
|
170
|
+
search: Поиск
|
171
|
+
legend:
|
172
|
+
common: Основное
|
173
|
+
seo: SEO
|
174
|
+
logout: Выйти
|
175
|
+
nav_published: В навигации
|
176
|
+
published: Опубликована
|
177
|
+
locked: Закреплена
|
178
|
+
server_restart: Перезагрузить сервер
|
179
|
+
unpublished: Не опубликована
|
180
|
+
batch_actions:
|
181
|
+
destroy: Удалить
|
182
|
+
set_nav_published_off: Убрать из навигации
|
183
|
+
set_nav_published_on: Опубликовать в навигации
|
184
|
+
set_published_off: Снять с публикации
|
185
|
+
set_published_on: Опубликовать
|
186
|
+
|
187
|
+
confirmations:
|
188
|
+
destroy:
|
189
|
+
one: Вы уверены что хотите удалить?
|
190
|
+
many: Вы уверены что хотите удалить эти объекты?
|
191
|
+
|
192
|
+
layouts:
|
193
|
+
application:
|
194
|
+
header: Главная
|
195
|
+
title: Molinos.Ru
|
196
|
+
admin:
|
197
|
+
header: &layouts_admin_header Панель управления
|
198
|
+
title: &layouts_admin_title Панель управления
|
199
|
+
|
200
|
+
admin:
|
201
|
+
actions:
|
202
|
+
create: Создание
|
203
|
+
update: Обновление
|
204
|
+
destroy: Удаление
|
205
|
+
helps:
|
206
|
+
actions:
|
207
|
+
index:
|
208
|
+
header: Панель управления
|
209
|
+
title: *layouts_admin_title
|
210
|
+
legend:
|
211
|
+
edit: Редактирование
|
212
|
+
delete: Удаление
|
213
|
+
move: Сортировка
|
214
|
+
published: Видимость на сайте
|
215
|
+
nav_published: Видимость в навигации
|
216
|
+
users:
|
217
|
+
actions:
|
218
|
+
index:
|
219
|
+
header: Пользователи
|
220
|
+
title: Пользователи
|
221
|
+
labels:
|
222
|
+
actions:
|
223
|
+
create: Добавить пользователя
|
224
|
+
edit: Сохранить пользователя
|
225
|
+
new: Добавить пользователя
|
226
|
+
update: Сохранить пользователя
|
227
|
+
form:
|
228
|
+
login: Войти
|
229
|
+
registration: Зарегистрироваться
|
230
|
+
forgot_password: Восстановить пароль
|
231
|
+
confirm: Я не получил инструкций о подтверждении аккаунта
|
232
|
+
oauth: Войти с помощью
|
233
|
+
remember_me: Запомнить меня
|
234
|
+
password: Пароль
|
235
|
+
password_confirmation: Подтверждение пароля
|
236
|
+
new_password: Новый пароль
|
237
|
+
new_password_confirmation: Подтверждение нового пароля
|
238
|
+
buttons:
|
239
|
+
password_reset: Выслать инструкции
|
240
|
+
password_edit: Изменить пароль
|
241
|
+
register: Зарегистрироваться
|
242
|
+
paper_trail/versions:
|
243
|
+
actions:
|
244
|
+
index:
|
245
|
+
header: Действия
|
246
|
+
title: Действия
|
247
|
+
labels:
|
248
|
+
actions:
|
249
|
+
show: Просмотр изменений
|
250
|
+
settings:
|
251
|
+
actions:
|
252
|
+
index:
|
253
|
+
header: Настройки
|
254
|
+
sets:
|
255
|
+
counters: Счётчики
|
256
|
+
index: Главная страница
|
257
|
+
contact_information: Контактная информация
|
258
|
+
labels:
|
259
|
+
actions:
|
260
|
+
create: Настройки
|
261
|
+
edit: Сохранить настройки
|
262
|
+
update: Сохранить настройки
|
263
|
+
contact_email: E-mail
|
264
|
+
pages:
|
265
|
+
actions:
|
266
|
+
index:
|
267
|
+
header: Страницы
|
268
|
+
title: Страницы
|
269
|
+
alerts:
|
270
|
+
category:
|
271
|
+
Страница является категорией и не может быть отредактирована
|
272
|
+
в визуальном редакторе.
|
273
|
+
behavior_not_default:
|
274
|
+
Страница типа «%{behavior}» не может быть отредактирована
|
275
|
+
в визуальном редакторе.
|
276
|
+
labels:
|
277
|
+
actions:
|
278
|
+
create: Добавить страницу
|
279
|
+
create_stay_in_place: Применить
|
280
|
+
edit: Сохранить страницу
|
281
|
+
edit_stay_in_place: Применить
|
282
|
+
new: Добавить страницу
|
283
|
+
newrak_stay_in_place: Применить
|
284
|
+
update: Сохранить страницу
|
285
|
+
update_stay_in_place: Применить
|
286
|
+
|
287
|
+
pages:
|
288
|
+
behaviors:
|
289
|
+
pages: Типовая страница
|
290
|
+
|
291
|
+
unauthorized:
|
292
|
+
default: Необходимо войти или зарегистрироваться.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# we often want to refer to variables which
|
2
|
+
# are defined in subsequent stage files. This
|
3
|
+
# let's us use the {{var}} to represent fetch(:var)
|
4
|
+
# in strings which are only evaluated at runtime.
|
5
|
+
|
6
|
+
def sub_strings(input_string)
|
7
|
+
output_string = input_string
|
8
|
+
input_string.scan(/{{(\w*)}}/).each do |var|
|
9
|
+
output_string.gsub!("{{#{var[0]}}}", fetch(var[0].to_sym))
|
10
|
+
end
|
11
|
+
output_string
|
12
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
task :setup_config do
|
3
|
+
on roles(:app) do
|
4
|
+
# make the config dir
|
5
|
+
execute :mkdir, "-p #{shared_path}/config"
|
6
|
+
full_app_name = fetch(:full_app_name)
|
7
|
+
|
8
|
+
# config files to be uploaded to shared/config, see the
|
9
|
+
# definition of smart_template for details of operation.
|
10
|
+
# Essentially looks for #{filename}.erb in deploy/#{full_app_name}/
|
11
|
+
# and if it isn't there, falls back to deploy/#{shared}. Generally
|
12
|
+
# everything should be in deploy/shared with params which differ
|
13
|
+
# set in the stage files
|
14
|
+
|
15
|
+
begin
|
16
|
+
config_files = fetch(:config_files)
|
17
|
+
config_files.each do |file|
|
18
|
+
smart_template file
|
19
|
+
end
|
20
|
+
|
21
|
+
# which of the above files should be marked as executable
|
22
|
+
executable_files = fetch(:executable_config_files)
|
23
|
+
|
24
|
+
#executable_files.each do |file|
|
25
|
+
# execute :chmod, "+x #{shared_path}/config/#{file}"
|
26
|
+
#end
|
27
|
+
|
28
|
+
# symlink stuff which should be... symlinked
|
29
|
+
symlinks = fetch(:symlinks)
|
30
|
+
|
31
|
+
symlinks.each do |symlink|
|
32
|
+
sudo "ln -nfs #{shared_path}/config/#{symlink[:source]} #{sub_strings(symlink[:link])}"
|
33
|
+
end
|
34
|
+
rescue Exception => e
|
35
|
+
log "ERROR: #{e.to_s}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# will first try and copy the file:
|
2
|
+
# config/deploy/#{full_app_name}/#{from}.erb
|
3
|
+
# to:
|
4
|
+
# shared/config/to
|
5
|
+
# if the original source path doesn exist then it will
|
6
|
+
# search in:
|
7
|
+
# config/deploy/shared/#{from}.erb
|
8
|
+
# this allows files which are common to all enviros to
|
9
|
+
# come from a single source while allowing specific
|
10
|
+
# ones to be over-ridden
|
11
|
+
# if the target file name is the same as the source then
|
12
|
+
# the second parameter can be left out
|
13
|
+
def smart_template(from, to = nil)
|
14
|
+
to ||= from
|
15
|
+
full_to_path = "#{shared_path}/#{to}"
|
16
|
+
from = from.split('/')[-1]
|
17
|
+
if (from_erb_path = template_file(from))
|
18
|
+
from_erb = StringIO.new(ERB.new(File.read(from_erb_path)).result(binding))
|
19
|
+
upload! from_erb, full_to_path
|
20
|
+
info "copying: #{from_erb} to: #{full_to_path}"
|
21
|
+
else
|
22
|
+
error "error #{from} not found"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def template_file(name)
|
27
|
+
if File.exist?((file = "config/deploy/#{fetch(:full_app_name)}/#{name}.erb"))
|
28
|
+
return file
|
29
|
+
elsif File.exist?((file = "config/deploy/shared/#{name}.erb"))
|
30
|
+
return file
|
31
|
+
end
|
32
|
+
return nil
|
33
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="ru">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Страница не найдена</title>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7
|
+
<link href="/favicon.ico" rel="shortcut icon">
|
8
|
+
<style>
|
9
|
+
* {margin: 0; padding: 0}
|
10
|
+
html, body, div, span, h1, h2, p, a, i, em, b, strong, img {display: block}
|
11
|
+
body {width: 100%; color: #000; font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 0.625em; line-height: 1; background-color: #fff}
|
12
|
+
h1 {color: #000; margin: 0 0 0.6em 0; font: normal 250%/1.1 Tahoma, Arial, Helvetica, sans-serif}
|
13
|
+
a {color: #009fe3; text-decoration: underline}
|
14
|
+
a:hover, a:active {color: #f7a900}
|
15
|
+
p {margin: 0 0 1em; font-size: 160%; line-height: 1.2}
|
16
|
+
div {padding: 4% 5%}
|
17
|
+
</style>
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<div>
|
21
|
+
<h1>Страница не найдена</h1>
|
22
|
+
<p>Неправильно набран адрес, или такой страницы не существует.</p>
|
23
|
+
<p><a href="/">Главная страница</a></p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="ru">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Внутренняя ошибка сервера</title>
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7
|
+
<link href="/favicon.ico" rel="shortcut icon">
|
8
|
+
<style>
|
9
|
+
* {margin: 0; padding: 0}
|
10
|
+
html, body, div, span, h1, h2, p, a, i, em, b, strong, img {display: block}
|
11
|
+
body {width: 100%; color: #000; font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 0.625em; line-height: 1; background-color: #fff}
|
12
|
+
h1 {color: #000; margin: 0 0 0.5em 0; font: normal 250%/1.1 Tahoma, Arial, Helvetica, sans-serif}
|
13
|
+
a {color: #009fe3; text-decoration: underline}
|
14
|
+
a:hover, a:active {color: #f7a900}
|
15
|
+
p {margin: 0 0 1em; font-size: 160%; line-height: 1.2}
|
16
|
+
div {padding: 4% 5%}
|
17
|
+
</style>
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<div>
|
21
|
+
<h1>Внутренняя ошибка сервера</h1>
|
22
|
+
<p>Что-то пошло не так. Попробуйте зайти позже.</p>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
staging:
|
2
|
+
adapter: postgresql
|
3
|
+
database: <%= application_name %>_staging
|
4
|
+
|
5
|
+
production:
|
6
|
+
adapter: postgresql
|
7
|
+
database: <%= ENV['PGDATABASE'] %>
|
8
|
+
username: <%= ENV['PGUSER'] %>
|
9
|
+
password: <%= ENV['PGPASSWORD'] %>
|
10
|
+
host: <%= ENV['PGHOST'] %>
|
11
|
+
|
12
|
+
development:
|
13
|
+
adapter: postgresql
|
14
|
+
database: <%= application_name %>_development
|
15
|
+
|
16
|
+
test:
|
17
|
+
adapter: postgresql
|
18
|
+
database: <%= application_name %>_test
|
19
|
+
min_messages: warning
|
@@ -0,0 +1,21 @@
|
|
1
|
+
set :application, :<%= application_name %>
|
2
|
+
set :repo_url, "git@gitlab.molinos.ru:studio/#{application}.git"
|
3
|
+
|
4
|
+
# Default value for :linked_files is []
|
5
|
+
set :linked_files, fetch(:linked_files, []).push('config/database.yml', '.env', 'config/master.key')
|
6
|
+
# Default value for linked_dirs is []
|
7
|
+
set :linked_dirs, fetch(:linked_dirs, []).push(
|
8
|
+
'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'storage'
|
9
|
+
)
|
10
|
+
|
11
|
+
set :rvm_ruby_version, Pathname(__dir__).join('../.ruby-version').read.chomp
|
12
|
+
|
13
|
+
set :db_local_clean, true
|
14
|
+
set :assets_dir, %w[public/system]
|
15
|
+
|
16
|
+
after 'deploy:publishing', 'deploy:restart'
|
17
|
+
namespace :deploy do
|
18
|
+
task :restart do
|
19
|
+
invoke 'unicorn:restart'
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class Ability
|
2
|
+
include CanCan::Ability
|
3
|
+
|
4
|
+
attr_reader :user
|
5
|
+
|
6
|
+
def initialize(user)
|
7
|
+
@user = user
|
8
|
+
|
9
|
+
if user.is?(:admin)
|
10
|
+
can :manage, :all
|
11
|
+
end
|
12
|
+
|
13
|
+
# if user.is?(:admin)
|
14
|
+
# can :manage, :all
|
15
|
+
# elsif user.is?(:hr)
|
16
|
+
# hr_abilities
|
17
|
+
# elsif user.is? :member
|
18
|
+
# user_abilities
|
19
|
+
# elsif user.is? :manager
|
20
|
+
# manager_abilities
|
21
|
+
# end
|
22
|
+
end
|
23
|
+
|
24
|
+
# def hr_abilities
|
25
|
+
# can :manage, [Page, Response, Vacancy, Department,
|
26
|
+
# Settings, Status, Comment, Post, Event,
|
27
|
+
# City, Office, EventRegistration]
|
28
|
+
# can :manage, User do |user|
|
29
|
+
# %i[member manager].include?(user.role_symbols.last)
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# def user_abilities
|
34
|
+
# can :manage, Comment
|
35
|
+
# can %i[read edit update], Response do |response|
|
36
|
+
# @user.department_ids.include?(response.vacancy.department_id)
|
37
|
+
# end
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# def manager_abilities
|
41
|
+
# user_abilities
|
42
|
+
#
|
43
|
+
# can :new, Vacancy
|
44
|
+
#
|
45
|
+
# can %i[read edit update create], Vacancy do |vacancy|
|
46
|
+
# @user.department_ids.include?(vacancy.department_id)
|
47
|
+
# end
|
48
|
+
# end
|
49
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
config.to_prepare do
|
2
|
+
Devise::SessionsController.layout 'admin'
|
3
|
+
Devise::RegistrationsController.layout proc { |controller| user_signed_in? ? 'application' : 'admin' }
|
4
|
+
Devise::ConfirmationsController.layout 'admin'
|
5
|
+
Devise::UnlocksController.layout 'admin'
|
6
|
+
Devise::PasswordsController.layout 'admin'
|
7
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
User.create email: 'studio@molinos.ru', password: 'changeme', roles: [:admin]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'role_model'
|
2
|
+
|
3
|
+
class User < ApplicationRecord
|
4
|
+
include RoleModel
|
5
|
+
|
6
|
+
devise :database_authenticatable, :registerable, :recoverable,
|
7
|
+
:rememberable, :validatable, :omniauthable
|
8
|
+
|
9
|
+
# has_many :authentications, dependent: :destroy
|
10
|
+
|
11
|
+
roles :admin
|
12
|
+
scoped_search on: :email
|
13
|
+
|
14
|
+
def reasonable_name
|
15
|
+
email
|
16
|
+
end
|
17
|
+
|
18
|
+
def translated_roles
|
19
|
+
role_symbols.map { |s| self.class.human_attribute_name(s) }.join ', '
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
begin
|
3
|
+
Page.for_routes.group_by(&:behavior).each do |behavior, pages|
|
4
|
+
pages.each do |page|
|
5
|
+
case behavior
|
6
|
+
when nil
|
7
|
+
else
|
8
|
+
resource( "#{page.class.name.underscore}_#{page.id}",
|
9
|
+
path: page.absolute_path,
|
10
|
+
controller: behavior,
|
11
|
+
only: :show,
|
12
|
+
page_id: page.id )
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
rescue
|
17
|
+
nil
|
18
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<%= application_name.camelize %>::Application.routes.draw do
|
2
|
+
devise_for :users, skip: [:session, :password, :registration, :confirmation],
|
3
|
+
controllers: { omniauth_callbacks: 'authentications' }
|
4
|
+
|
5
|
+
namespace :admin do
|
6
|
+
resources :helps, only: :index
|
7
|
+
resource :settings, only: [:edit, :update]
|
8
|
+
|
9
|
+
resources :users, except: :show do
|
10
|
+
collection { post :batch_action }
|
11
|
+
end
|
12
|
+
|
13
|
+
resources :versions, only: [:index, :show] do
|
14
|
+
collection { post :batch_action }
|
15
|
+
end
|
16
|
+
|
17
|
+
resources :pages, except: :show do
|
18
|
+
collection { post :batch_action }
|
19
|
+
member { put :drop }
|
20
|
+
member { post :duplication }
|
21
|
+
end
|
22
|
+
|
23
|
+
root to: 'pages#index', as: :root
|
24
|
+
end
|
25
|
+
|
26
|
+
devise_for :users, skip: :omniauth_callbacks
|
27
|
+
devise_scope :user do
|
28
|
+
get 'authentications/new', to: 'authentications#new'
|
29
|
+
post 'authentications/link', to: 'authentications#link'
|
30
|
+
end
|
31
|
+
|
32
|
+
resources :templates, only: [:index, :show]
|
33
|
+
|
34
|
+
root to: 'index#index'
|
35
|
+
|
36
|
+
begin
|
37
|
+
Page.for_routes.group_by(&:behavior).each do |behavior, pages|
|
38
|
+
pages.each do |page|
|
39
|
+
case behavior
|
40
|
+
when nil
|
41
|
+
else
|
42
|
+
resource( "#{page.class.name.underscore}_#{page.id}",
|
43
|
+
path: page.absolute_path,
|
44
|
+
controller: behavior,
|
45
|
+
only: :show,
|
46
|
+
page_id: page.id )
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
rescue
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateSettings < ActiveRecord::Migration<%= migration_version %>
|
2
|
+
def change
|
3
|
+
create_table :settings do |t|
|
4
|
+
t.string :copyright
|
5
|
+
t.string :email
|
6
|
+
t.string :company_name
|
7
|
+
t.string :contact_email
|
8
|
+
t.string :email_header_from
|
9
|
+
t.text :index_meta_description
|
10
|
+
t.string :index_meta_title
|
11
|
+
t.integer :per_page, default: 10
|
12
|
+
t.text :seo_google_analytics
|
13
|
+
t.text :seo_yandex_metrika
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|