adminos 1.0.0.pre.rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,14 @@
|
|
|
1
|
+
- collection_title
|
|
2
|
+
= collection_header
|
|
3
|
+
|
|
4
|
+
- if collection.present?
|
|
5
|
+
|
|
6
|
+
- list = capture do
|
|
7
|
+
= render partial: 'objects', object: collection
|
|
8
|
+
|
|
9
|
+
- if controller.respond_to?(:batch_action)
|
|
10
|
+
= batch_actions_tag publication: (collection.respond_to?(:set_each_published_on)),
|
|
11
|
+
nav_publication: (collection.respond_to?(:set_nav_published_on)) do
|
|
12
|
+
= list
|
|
13
|
+
- else
|
|
14
|
+
= list
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= render 'form'
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
- title I18n.t('admin.helps.actions.index.title')
|
|
2
|
+
|
|
3
|
+
= admin_page_header I18n.t('admin.helps.actions.index.header')
|
|
4
|
+
h4 Общие замечания по добавлению и редактированию информации:
|
|
5
|
+
ul
|
|
6
|
+
li Везде, где можно добавить ту или иную сущность (например, страницу), <b>в правой верхней части страницы есть кнопка «добавить»</b>.
|
|
7
|
+
li Некоторые типы записей могут быть <b>опубликованы</b> (и будут отображаться на сайте) и <b>заархивированы</b> (сохранятся в базе, их можно редактировать, но они не будут опубликованы на сайте). <b>Состояние опубликованной записи обозначается пиктограммой <i class="icon-eye-open"></i> в правой части списка</b> (отсутствие пиктограммы обозначает то, что запись заархивирована).
|
|
8
|
+
li В некоторых списках есть возможность <b>ручной сортировки записей</b> (порядок отображения на сайте и в списках). Иногда требуется вывести какую-то запись раньше предыдущей. Это справедливо, например, для списка страниц. <b>Чтобы переместить запись выше или ниже, достаточно просто перетащить её в нужное место указателем мыши</b> (предварительно нажав левую кнопку мыши, когда указатель находится над пиктограммой <i class="icon-move"></i>).
|
|
9
|
+
li В некоторых списках предусмотрены <b>групповые операции</b> — публикация, архивирование и удаление. Чтобы выполнить групповую операцию, необходимо выбрать записи, с которыми будет осуществляться операция — это можно сделать, отметив эти записи галочками в чекбоксах, — а затем выбрать операцию из списка внизу страницы (нажать на соответствующую кнопку). Эти операции можно выполнять также и с отдельными объектами (то есть по одному), чтобы не заходить на страницу редактирования записи.
|
|
10
|
+
li Если <b>редактирование записей</b> доступно, то в списке присутствует пиктограмма <i class="icon-edit"></i>. Щелчок по этой пиктограмме открывает страницу редактирования соответствующей записи.
|
|
11
|
+
li Все <b>специфичные настройки страниц</b> вынесены в раздел «#{link_to I18n.t('admin.settings.actions.index.header'), edit_admin_settings_path}».
|
|
12
|
+
li В случаях, где это предусмотрено оформлением страниц, текстовые поля оснащены <b>WYSIWYG-редактором</b>. Редактор имеет возможность размещения изображений и вставки кода для видео (embedded video) с сервиса YouTube.
|
|
13
|
+
h4 Значение пиктограмм:
|
|
14
|
+
ul.legend
|
|
15
|
+
li
|
|
16
|
+
<i class="icon-edit"></i>
|
|
17
|
+
= I18n.t('admin.helps.actions.index.legend.edit')
|
|
18
|
+
li
|
|
19
|
+
<i class="icon-remove"></i>
|
|
20
|
+
= I18n.t('admin.helps.actions.index.legend.delete')
|
|
21
|
+
li
|
|
22
|
+
<i class="icon-move"></i>
|
|
23
|
+
= I18n.t('admin.helps.actions.index.legend.move')
|
|
24
|
+
li
|
|
25
|
+
<i class="icon-eye-open"></i>
|
|
26
|
+
= I18n.t('admin.helps.actions.index.legend.published')
|
|
27
|
+
li
|
|
28
|
+
<i class="icon-list"></i>
|
|
29
|
+
= I18n.t('admin.helps.actions.index.legend.nav_published')
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
- title 'Настройки'
|
|
2
|
+
= resource_header 'Настройки'
|
|
3
|
+
|
|
4
|
+
= simple_form_for [:admin, resource], url: admin_settings_path, wrapper: :admin, html: { method: :put } do |f|
|
|
5
|
+
/.pill-content
|
|
6
|
+
.f
|
|
7
|
+
.f__wrapper
|
|
8
|
+
.f__fieldset
|
|
9
|
+
= f.input :email
|
|
10
|
+
= f.input :email_header_from
|
|
11
|
+
= f.input :per_page, input_html: {class: 'input-mini'}
|
|
12
|
+
= f.input :copyright
|
|
13
|
+
.f__fieldset
|
|
14
|
+
.f__legend= I18n.t 'admin.settings.sets.index'
|
|
15
|
+
= f.input :index_meta_title
|
|
16
|
+
= f.input :index_meta_description, as: :string
|
|
17
|
+
.f__fieldset
|
|
18
|
+
.f__legend= I18n.t 'admin.settings.sets.contact_information'
|
|
19
|
+
= f.input :company_name
|
|
20
|
+
= f.input :contact_email
|
|
21
|
+
.f__fieldset
|
|
22
|
+
.f__legend= I18n.t 'admin.settings.sets.counters'
|
|
23
|
+
= f.input :seo_google_analytics
|
|
24
|
+
= f.input :seo_yandex_metrika
|
|
25
|
+
.f-submit.f-submit--fixed
|
|
26
|
+
.wrapper
|
|
27
|
+
= f.button :submit, resource_button_value_main, class: 'btn btn-primary btn--done'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "First" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the first page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.first')
|
|
9
|
+
span.first
|
|
10
|
+
= link_to_unless current_page.first?, label, url, remote: remote
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/ Non-link tag that stands for skipped pages...
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ current_page: a page object for the currently displayed page
|
|
4
|
+
/ num_pages: total number of pages
|
|
5
|
+
/ per_page: number of items to fetch per page
|
|
6
|
+
/ remote: data-remote
|
|
7
|
+
b= raw(t 'views.pagination.truncate')
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "Last" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the last page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.last')
|
|
9
|
+
span.last
|
|
10
|
+
= link_to_unless current_page.last?, label, url, {remote: remote}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/ Link to the "Next" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the next page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.next')
|
|
9
|
+
= link_to label, url, class: :next
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link showing page number
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ page: a page object for "this" page
|
|
4
|
+
/ url: url to this page
|
|
5
|
+
/ current_page: a page object for the currently displayed page
|
|
6
|
+
/ num_pages: total number of pages
|
|
7
|
+
/ per_page: number of items to fetch per page
|
|
8
|
+
/ remote: data-remote
|
|
9
|
+
= link_to_unless page.current?, page, url, remote: remote do
|
|
10
|
+
em.current= page
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/ The container tag
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ current_page: a page object for the currently displayed page
|
|
4
|
+
/ num_pages: total number of pages
|
|
5
|
+
/ per_page: number of items to fetch per page
|
|
6
|
+
/ remote: data-remote
|
|
7
|
+
/ paginator: the paginator that renders the pagination tags inside
|
|
8
|
+
= paginator.render do
|
|
9
|
+
.pagination
|
|
10
|
+
= prev_page_tag unless current_page.first?
|
|
11
|
+
- each_page do |page|
|
|
12
|
+
- if page.left_outer? || page.right_outer? || page.inside_window?
|
|
13
|
+
= page_tag page
|
|
14
|
+
- elsif !page.was_truncated?
|
|
15
|
+
= gap_tag
|
|
16
|
+
= next_page_tag unless current_page.last?
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/ Link to the "Previous" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the previous page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.previous')
|
|
9
|
+
= link_to '', url, class: :prev
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "First" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the first page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.admin.first')
|
|
9
|
+
span.first
|
|
10
|
+
= link_to_unless current_page.first?, label, url, remote: remote
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/ Non-link tag that stands for skipped pages...
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ current_page: a page object for the currently displayed page
|
|
4
|
+
/ num_pages: total number of pages
|
|
5
|
+
/ per_page: number of items to fetch per page
|
|
6
|
+
/ remote: data-remote
|
|
7
|
+
.page-item.disabled
|
|
8
|
+
span.page-link= t('views.pagination.admin.truncate')
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "Last" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the last page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.admin.last')
|
|
9
|
+
span.last
|
|
10
|
+
= link_to_unless current_page.last?, label, url, {remote: remote}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "Next" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the next page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.admin.next')
|
|
9
|
+
.page-item class=(:disabled if current_page.last?)
|
|
10
|
+
= link_to label, url, rel: :next, remote: remote, class: 'page-link page-link--next', title: label
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link showing page number
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ page: a page object for "this" page
|
|
4
|
+
/ url: url to this page
|
|
5
|
+
/ current_page: a page object for the currently displayed page
|
|
6
|
+
/ num_pages: total number of pages
|
|
7
|
+
/ per_page: number of items to fetch per page
|
|
8
|
+
/ remote: data-remote
|
|
9
|
+
.page-item class=(:active if page.current?)
|
|
10
|
+
= link_to page, url, remote: remote, rel: (page.next? ? :next : (page.prev? ? :prev : nil)), class: 'page-link'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/ The container tag
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ current_page: a page object for the currently displayed page
|
|
4
|
+
/ num_pages: total number of pages
|
|
5
|
+
/ per_page: number of items to fetch per page
|
|
6
|
+
/ remote: data-remote
|
|
7
|
+
/ paginator: the paginator that renders the pagination tags inside
|
|
8
|
+
= paginator.render do
|
|
9
|
+
.pagination
|
|
10
|
+
= raw prev_page_tag
|
|
11
|
+
- each_page do |page|
|
|
12
|
+
- if page.left_outer? || page.right_outer? || page.inside_window?
|
|
13
|
+
= raw page_tag page
|
|
14
|
+
- elsif !page.was_truncated?
|
|
15
|
+
= raw gap_tag
|
|
16
|
+
= raw next_page_tag
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/ Link to the "Previous" page
|
|
2
|
+
/ available local variables
|
|
3
|
+
/ url: url to the previous page
|
|
4
|
+
/ current_page: a page object for the currently displayed page
|
|
5
|
+
/ num_pages: total number of pages
|
|
6
|
+
/ per_page: number of items to fetch per page
|
|
7
|
+
/ remote: data-remote
|
|
8
|
+
- label = raw(t 'views.pagination.admin.previous')
|
|
9
|
+
.page-item class=(:disabled if current_page.first?)
|
|
10
|
+
= link_to label, url, rel: :prev, remote: remote, class: 'page-link page-link--prev', title: label
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
= inside_layout :admin do
|
|
2
|
+
|
|
3
|
+
.page-container#container
|
|
4
|
+
|
|
5
|
+
= render 'shared/admin/sidebar'
|
|
6
|
+
= render 'shared/admin/topbar'
|
|
7
|
+
|
|
8
|
+
.content
|
|
9
|
+
.wrapper
|
|
10
|
+
|
|
11
|
+
= show_flash_alert with_close_bullet: true
|
|
12
|
+
|
|
13
|
+
= show_breadcrumbs admin: true
|
|
14
|
+
|
|
15
|
+
= content_for?(:'admin/base_layout') ? yield(:'admin/base_layout') : yield
|
|
16
|
+
|
|
17
|
+
= render 'shared/admin/footer'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/- if content_for?(:topbar_button)
|
|
2
|
+
.topbar
|
|
3
|
+
.wrapper
|
|
4
|
+
.topbar__actions
|
|
5
|
+
.actions
|
|
6
|
+
= yield :topbar_button
|
|
7
|
+
/.actions__item
|
|
8
|
+
a.actions__link.actions__link--import href="#" Импорт
|
|
9
|
+
/.actions__item
|
|
10
|
+
a.actions__link.actions__link--export href="#" Экспорт
|
|
11
|
+
= yield :search
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
button.close data-dismiss="alert" ×
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/_contacts_page_link_tag.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= navigation_link contacts_page
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
= form_tag form_url, method: method,
|
|
2
|
+
class: "method-link-to inline #{css_class} #{'remote' if form_remote}",
|
|
3
|
+
title: (label unless with_link_get_method) do
|
|
4
|
+
- if confirmation.present?
|
|
5
|
+
input type="hidden" class="confirm-message" value="#{h(confirmation)}"
|
|
6
|
+
- if data.present?
|
|
7
|
+
- data.each do |name, value|
|
|
8
|
+
= hidden_field_tag name, value
|
|
9
|
+
- if with_link_get_method
|
|
10
|
+
= link_to label, form_url, options.reverse_merge(class: 'submit-form')
|
|
11
|
+
noscript
|
|
12
|
+
= submit_tag(strip_tags(label).strip)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
- css_class = []
|
|
2
|
+
- css_class << (is_light_search ? 'light-search' : 'common-search')
|
|
3
|
+
.search-footer class=css_class
|
|
4
|
+
= form_tag redirect_to_kind_search_path, method: :post do
|
|
5
|
+
= hidden_field_tag :direction, sorting[:direction]
|
|
6
|
+
.form
|
|
7
|
+
.input-search
|
|
8
|
+
- css_class = ['search_all_input']
|
|
9
|
+
- css_class << (is_light_search ? 'with-light-autocomplete' : 'with-autocomplete')
|
|
10
|
+
= text_field_tag :q, query, placeholder: placeholder,
|
|
11
|
+
class: css_class, id: nil, tabindex: tabindex[:text]
|
|
12
|
+
= submit_tag t('labels.application.form.search.submit'),
|
|
13
|
+
tabindex: tabindex[:submit], name: nil
|
|
14
|
+
|
|
15
|
+
- if block.present?
|
|
16
|
+
= block
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
.bread-crumbs
|
|
2
|
+
= link_to_unless_current '', root_path, class: :home
|
|
3
|
+
- breadcrumbs.each_with_index do |breadcrumb, index|
|
|
4
|
+
- css_class = []
|
|
5
|
+
- css_class << :down if index == breadcrumbs.length - 1
|
|
6
|
+
= link_to_unless_current h(breadcrumb.label), breadcrumb.url,
|
|
7
|
+
class: (css_class if css_class.present?)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-# - message = 'debugging info'
|
|
2
|
+
-# - kind = :notice
|
|
3
|
+
-# - kind = :error
|
|
4
|
+
- css_class = css_class << {error: 'alert-error', notice: 'alert-success'}[kind]
|
|
5
|
+
.message
|
|
6
|
+
.alert.alert-info.alert-dismissible.fade.in(class=css_class.uniq.compact style=style)
|
|
7
|
+
- if options[:with_close_bullet]
|
|
8
|
+
= alert_close
|
|
9
|
+
span(style=style)= message
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
- if first_level.present?
|
|
2
|
+
nav
|
|
3
|
+
ul
|
|
4
|
+
- first_level.each do |object|
|
|
5
|
+
= sub_navigation_first_level_link object,
|
|
6
|
+
second_level: second_level.present?
|
|
7
|
+
-#
|
|
8
|
+
- if second_level.present?
|
|
9
|
+
.second-level
|
|
10
|
+
.list
|
|
11
|
+
- if second_level_label.present?
|
|
12
|
+
.item.year-text= second_level_label
|
|
13
|
+
- second_level.each do |object|
|
|
14
|
+
= sub_navigation_second_level_link object
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_batch_actions_tag.slim
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
= form_tag url_for(action: :batch_action), method: :post do
|
|
2
|
+
= block
|
|
3
|
+
.list-actions
|
|
4
|
+
- if with_publication
|
|
5
|
+
button.btn.btn-secondary.btn-sm type="submit" name="set_published_on"
|
|
6
|
+
= I18n.t('labels.admin.batch_actions.set_published_on')
|
|
7
|
+
button.btn.btn-secondary.btn-sm type="submit" name="set_published_off"
|
|
8
|
+
= I18n.t('labels.admin.batch_actions.set_published_off')
|
|
9
|
+
- if with_nav_publication
|
|
10
|
+
button.btn.btn-secondary.btn-sm type="submit" name="set_nav_published_on"
|
|
11
|
+
= I18n.t('labels.admin.batch_actions.set_nav_published_on')
|
|
12
|
+
button.btn.btn-secondary.btn-sm type="submit" name="set_nav_published_off"
|
|
13
|
+
= I18n.t('labels.admin.batch_actions.set_nav_published_off')
|
|
14
|
+
- if with_destroy
|
|
15
|
+
button.btn.btn-secondary.btn-sm type="submit" name="destroy" data-confirm="#{t('confirmations.destroy.many')}"
|
|
16
|
+
= I18n.t('labels.admin.batch_actions.destroy')
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_nav_published_sign.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.icon.icon--nav title=t('labels.admin.nav_published')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= link_to t('labels.admin.duplication'), polymorphic_path(object, action: :duplication), method: :post, class: 'icon icon--copy', title: t('labels.admin.duplication')
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_edit.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= link_to t('labels.admin.edit'), polymorphic_path(object, action: :edit), class: 'icon icon--edit -edit', title: t('labels.admin.edit')
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_new.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= link_to :new, polymorphic_path( [:admin, object.class], action: :new, parent_id: object.id )
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_published_sign.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.icon.icon--published title=t('labels.admin.published')
|
data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_unpublished_sign.slim
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.icon.icon--published.icon--inactive title=t('labels.admin.unpublished')
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
upstream unicorn {
|
|
2
|
+
server unix:<%= shared_path %>/tmp/sockets/unicorn.sock fail_timeout=0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
server {
|
|
6
|
+
server_name <%= fetch(:server_name) %>;
|
|
7
|
+
listen 80;
|
|
8
|
+
root <%= fetch(:deploy_to) %>/current/public;
|
|
9
|
+
|
|
10
|
+
location ^~ /assets/ {
|
|
11
|
+
gzip_static on;
|
|
12
|
+
expires max;
|
|
13
|
+
add_header Cache-Control public;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
try_files $uri/index.html $uri @unicorn;
|
|
17
|
+
location @unicorn {
|
|
18
|
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
19
|
+
proxy_set_header Host $http_host;
|
|
20
|
+
proxy_redirect off;
|
|
21
|
+
proxy_pass http://unicorn;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
error_page 500 502 503 504 /500.html;
|
|
25
|
+
client_max_body_size 4G;
|
|
26
|
+
keepalive_timeout 10;
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
worker_processes <%= fetch(:unicorn_worker_processes) %>
|
|
2
|
+
user "<%= fetch(:deploy_user) %>", "<%= fetch(:deploy_user) %>"
|
|
3
|
+
working_directory "<%= current_path %>"
|
|
4
|
+
listen "<%= shared_path %>/tmp/sockets/unicorn.sock"
|
|
5
|
+
|
|
6
|
+
timeout 80
|
|
7
|
+
|
|
8
|
+
preload_app true
|
|
9
|
+
|
|
10
|
+
pid "<%= shared_path %>/tmp/pids/unicorn.pid"
|
|
11
|
+
|
|
12
|
+
stderr_path "<%= shared_path %>/log/unicorn.stderr.log"
|
|
13
|
+
stdout_path "<%= shared_path %>/log/unicorn.stdout.log"
|
|
14
|
+
|
|
15
|
+
GC.respond_to?(:copy_on_write_friendly=) and
|
|
16
|
+
GC.copy_on_write_friendly = true
|
|
17
|
+
|
|
18
|
+
before_fork do |server, worker|
|
|
19
|
+
old_pid = "#{server.config[:pid]}.oldbin"
|
|
20
|
+
if File.exists?(old_pid) && server.pid != old_pid
|
|
21
|
+
begin
|
|
22
|
+
Process.kill("QUIT", File.read(old_pid).to_i)
|
|
23
|
+
rescue Errno::ENOENT, Errno::ESRCH
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
after_fork do |server, worker|
|
|
29
|
+
defined?(ActiveRecord::Base) and
|
|
30
|
+
ActiveRecord::Base.establish_connection
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
before_exec do |server|
|
|
34
|
+
ENV['BUNDLE_GEMFILE'] = "<%= current_path %>/Gemfile"
|
|
35
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
server "#{fetch(:application)}.staging.molinos.ru", user: 'deployer', roles: %w(web app db), primary: true
|
|
2
|
+
set :deploy_user, :deployer
|
|
3
|
+
set :server_name, "#{fetch(:application)}.staging.molinos.ru"
|
|
4
|
+
set :app_name, fetch(:application)
|
|
5
|
+
set :user_home_dir, "/home/#{fetch(:deploy_user)}"
|
|
6
|
+
# set :god_port, PLACEHOLDER
|
|
7
|
+
set :keep_releases, 5
|
|
8
|
+
set :rails_env, 'staging'
|
|
9
|
+
set :unicorn_env, 'staging'
|
|
10
|
+
set :branch, :staging
|
|
11
|
+
set :unicorn_worker_processes, 1
|
|
12
|
+
set :deploy_to, "#{fetch(:user_home_dir)}/#{fetch(:application)}"
|