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,19 @@
|
|
|
1
|
+
class Admin::<%= table_name.camelize %>Controller < Admin::BaseController
|
|
2
|
+
authorize_resource param_method: :strong_params
|
|
3
|
+
|
|
4
|
+
resource(<%= file_name.camelize %>,
|
|
5
|
+
collection_scope: [:sorted],
|
|
6
|
+
location: proc { params[:stay_in_place] ?
|
|
7
|
+
edit_polymorphic_path([:admin, resource]) :
|
|
8
|
+
polymorphic_path([:admin, resource.class]) },
|
|
9
|
+
finder: :find_by_slug!)
|
|
10
|
+
|
|
11
|
+
private
|
|
12
|
+
|
|
13
|
+
alias_method :collection_orig, :collection
|
|
14
|
+
def collection
|
|
15
|
+
@collection ||= collection_orig
|
|
16
|
+
.page(params[:page]).per(settings.per_page)
|
|
17
|
+
.order("#{params[:order_by]} #{params[:direction]}")
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
- collection_title
|
|
2
|
+
= collection_header
|
|
3
|
+
|
|
4
|
+
- if collection.present?
|
|
5
|
+
- pagination = capture do
|
|
6
|
+
- if collection.respond_to?(:current_page)
|
|
7
|
+
= paginate collection, theme: :admin
|
|
8
|
+
|
|
9
|
+
- list = capture do
|
|
10
|
+
= pagination
|
|
11
|
+
.table-list
|
|
12
|
+
table.table.table-hover.table-sm
|
|
13
|
+
thead
|
|
14
|
+
tr
|
|
15
|
+
th= admin_sortable_column :name, resource_class.human_attribute_name(:name)
|
|
16
|
+
th
|
|
17
|
+
th
|
|
18
|
+
tbody
|
|
19
|
+
- collection.each do |object|
|
|
20
|
+
tr
|
|
21
|
+
td= link_to object.name, polymorphic_path([:admin, object], action: :edit)
|
|
22
|
+
td.table-list__controls= object_link_edit(object)
|
|
23
|
+
td.table-list__check= admin_cb(object)
|
|
24
|
+
= pagination
|
|
25
|
+
|
|
26
|
+
- if controller.respond_to?(:batch_action)
|
|
27
|
+
= batch_actions_tag publication: (collection.respond_to?(:set_each_published_on)),
|
|
28
|
+
nav_publication: (collection.respond_to?(:set_nav_published_on)) do
|
|
29
|
+
= list
|
|
30
|
+
- else
|
|
31
|
+
= list
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
variables:
|
|
2
|
+
RAILS_ENV: test
|
|
3
|
+
|
|
4
|
+
before_script:
|
|
5
|
+
- rvm install $(cat .ruby-version)
|
|
6
|
+
- rvm use $(cat .ruby-version)
|
|
7
|
+
- gem install bundler --no-ri --no-rdoc
|
|
8
|
+
- bundle config build.pg --with-pg-config=/usr/pgsql-9.4/bin/pg_config
|
|
9
|
+
- bin/setup
|
|
10
|
+
|
|
11
|
+
cache:
|
|
12
|
+
untracked: true
|
|
13
|
+
paths:
|
|
14
|
+
- node_modules
|
|
15
|
+
|
|
16
|
+
deploy to staging:
|
|
17
|
+
stage: deploy
|
|
18
|
+
script:
|
|
19
|
+
- eval $(ssh-agent -s)
|
|
20
|
+
- ssh-add <(echo -e "$SSH_STAGING_KEY")
|
|
21
|
+
- bin/cap staging deploy
|
|
22
|
+
only:
|
|
23
|
+
refs: [develop]
|
|
24
|
+
when: manual
|
|
25
|
+
environment:
|
|
26
|
+
name: staging
|
|
27
|
+
url: http://staging.example.test
|
|
28
|
+
|
|
29
|
+
deploy to production:
|
|
30
|
+
stage: deploy
|
|
31
|
+
script:
|
|
32
|
+
- eval $(ssh-agent -s)
|
|
33
|
+
- ssh-add <(echo -e "$SSH_PRODUCTION_KEY")
|
|
34
|
+
- bin/cap production deploy
|
|
35
|
+
only:
|
|
36
|
+
refs: [master]
|
|
37
|
+
when: manual
|
|
38
|
+
environment:
|
|
39
|
+
name: production
|
|
40
|
+
url: http://example.test
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
TargetRubyVersion: <%= rubocop_target_ruby_version %>
|
|
3
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
|
4
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
|
5
|
+
DisabledByDefault: true
|
|
6
|
+
Exclude:
|
|
7
|
+
- vendor
|
|
8
|
+
|
|
9
|
+
# Prefer &&/|| over and/or.
|
|
10
|
+
Style/AndOr:
|
|
11
|
+
Enabled: true
|
|
12
|
+
|
|
13
|
+
# Do not use braces for hash literals when they are the last argument of a
|
|
14
|
+
# method call.
|
|
15
|
+
Style/BracesAroundHashParameters:
|
|
16
|
+
Enabled: true
|
|
17
|
+
|
|
18
|
+
# Align `when` with `case`.
|
|
19
|
+
Layout/CaseIndentation:
|
|
20
|
+
Enabled: true
|
|
21
|
+
|
|
22
|
+
# Align comments with method definitions.
|
|
23
|
+
Layout/CommentIndentation:
|
|
24
|
+
Enabled: true
|
|
25
|
+
|
|
26
|
+
# No extra empty lines.
|
|
27
|
+
Layout/EmptyLines:
|
|
28
|
+
Enabled: true
|
|
29
|
+
|
|
30
|
+
# In a regular class definition, no empty lines around the body.
|
|
31
|
+
Layout/EmptyLinesAroundClassBody:
|
|
32
|
+
Enabled: true
|
|
33
|
+
|
|
34
|
+
# In a regular method definition, no empty lines around the body.
|
|
35
|
+
Layout/EmptyLinesAroundMethodBody:
|
|
36
|
+
Enabled: true
|
|
37
|
+
|
|
38
|
+
# In a regular module definition, no empty lines around the body.
|
|
39
|
+
Layout/EmptyLinesAroundModuleBody:
|
|
40
|
+
Enabled: true
|
|
41
|
+
|
|
42
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
43
|
+
Style/HashSyntax:
|
|
44
|
+
Enabled: true
|
|
45
|
+
|
|
46
|
+
# Method definitions after `private` or `protected` isolated calls need one
|
|
47
|
+
# extra level of indentation.
|
|
48
|
+
Layout/IndentationConsistency:
|
|
49
|
+
Enabled: true
|
|
50
|
+
|
|
51
|
+
# Two spaces, no tabs (for indentation).
|
|
52
|
+
Layout/IndentationWidth:
|
|
53
|
+
Enabled: true
|
|
54
|
+
|
|
55
|
+
Layout/SpaceAfterColon:
|
|
56
|
+
Enabled: true
|
|
57
|
+
|
|
58
|
+
Layout/SpaceAfterComma:
|
|
59
|
+
Enabled: true
|
|
60
|
+
|
|
61
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
|
62
|
+
Enabled: true
|
|
63
|
+
|
|
64
|
+
Layout/SpaceAroundKeyword:
|
|
65
|
+
Enabled: true
|
|
66
|
+
|
|
67
|
+
Layout/SpaceAroundOperators:
|
|
68
|
+
Enabled: true
|
|
69
|
+
|
|
70
|
+
Layout/SpaceBeforeFirstArg:
|
|
71
|
+
Enabled: true
|
|
72
|
+
|
|
73
|
+
# Defining a method with parameters needs parentheses.
|
|
74
|
+
Style/MethodDefParentheses:
|
|
75
|
+
Enabled: true
|
|
76
|
+
|
|
77
|
+
# Use `foo {}` not `foo{}`.
|
|
78
|
+
Layout/SpaceBeforeBlockBraces:
|
|
79
|
+
Enabled: true
|
|
80
|
+
|
|
81
|
+
# Use `foo { bar }` not `foo {bar}`.
|
|
82
|
+
Layout/SpaceInsideBlockBraces:
|
|
83
|
+
Enabled: true
|
|
84
|
+
|
|
85
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
|
86
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
87
|
+
Enabled: true
|
|
88
|
+
|
|
89
|
+
Layout/SpaceInsideParens:
|
|
90
|
+
Enabled: true
|
|
91
|
+
|
|
92
|
+
# Detect hard tabs, no hard tabs.
|
|
93
|
+
Layout/Tab:
|
|
94
|
+
Enabled: true
|
|
95
|
+
|
|
96
|
+
# Blank lines should not have any spaces.
|
|
97
|
+
Layout/TrailingBlankLines:
|
|
98
|
+
Enabled: true
|
|
99
|
+
|
|
100
|
+
# No trailing whitespace.
|
|
101
|
+
Layout/TrailingWhitespace:
|
|
102
|
+
Enabled: true
|
|
103
|
+
|
|
104
|
+
# Use quotes for string literals when they are enough.
|
|
105
|
+
Style/UnneededPercentQ:
|
|
106
|
+
Enabled: true
|
|
107
|
+
|
|
108
|
+
# Align `end` with the matching keyword or starting expression except for
|
|
109
|
+
# assignments, where it should be aligned with the LHS.
|
|
110
|
+
Layout/EndAlignment:
|
|
111
|
+
Enabled: true
|
|
112
|
+
EnforcedStyleAlignWith: variable
|
|
113
|
+
|
|
114
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
115
|
+
Lint/RequireParentheses:
|
|
116
|
+
Enabled: true
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class AddTranslationFields<%= attributes.select(&:locale).map(&:name).join('_').camelize %>To<%= file_name.camelize %> < ActiveRecord::Migration[5.1]
|
|
2
|
+
def up
|
|
3
|
+
<% attributes.select(&:locale).each do |attribute| -%>
|
|
4
|
+
<%= file_name.camelize %>.add_translation_fields! <%= attribute.name %>: :<%= attribute.type %>
|
|
5
|
+
<% end -%>
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def down
|
|
9
|
+
<% attributes.select(&:locale).each do |attribute| -%>
|
|
10
|
+
remove_column :<%= file_name %>_translations, :<%= attribute.name %>
|
|
11
|
+
<% end -%>
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem 'globalize'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class AddTranslationTableToPage < ActiveRecord::Migration[5.1]
|
|
2
|
+
def up
|
|
3
|
+
Page.create_translation_table!({
|
|
4
|
+
name: :string,
|
|
5
|
+
nav_name: :string,
|
|
6
|
+
body: :text,
|
|
7
|
+
meta_description: :text,
|
|
8
|
+
meta_title: :string
|
|
9
|
+
}, migrate_data: true)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def down
|
|
13
|
+
Page.drop_translation_table! migrate_data: true
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Checking on fill at least one field
|
|
2
|
+
|
|
3
|
+
class LocaleValidator < ActiveModel::Validator
|
|
4
|
+
def validate(record)
|
|
5
|
+
fields = options[:fields] || [:name]
|
|
6
|
+
|
|
7
|
+
fields.each do |field|
|
|
8
|
+
validations(field, record)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
def validations(field, record)
|
|
15
|
+
validate_name = false
|
|
16
|
+
I18n.available_locales.each do |locale|
|
|
17
|
+
validate_name = true unless record.translation_for(locale).send(field).blank?
|
|
18
|
+
end
|
|
19
|
+
validate_name = true if record.send(field).presence
|
|
20
|
+
|
|
21
|
+
record.errors.add(field, 'Укажите Название хотя бы в одной локали') unless validate_name
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
= render 'pills', f: f
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
- general = lookup_context.template_exists?('general_fields', lookup_context.prefixes, true)
|
|
2
|
+
|
|
3
|
+
- if general
|
|
4
|
+
= render 'general_fields', f: f
|
|
5
|
+
|
|
6
|
+
ul.nav.nav-tabs.with-togglable-navigation
|
|
7
|
+
- I18n.available_locales.each_with_index do |locale, i|
|
|
8
|
+
li.nav-item
|
|
9
|
+
a.nav-link href="#pill_#{locale}" class=('active' if locale == :ru) data-toggle="pill"
|
|
10
|
+
= locale
|
|
11
|
+
|
|
12
|
+
.tab-content
|
|
13
|
+
- I18n.available_locales.each_with_index do |locale, i|
|
|
14
|
+
.tab-pane id="pill_#{locale}" class=('active' if locale == :ru)
|
|
15
|
+
- if locale == I18n.default_locale
|
|
16
|
+
= render 'locale_fields', locale: locale, f: f
|
|
17
|
+
- else
|
|
18
|
+
= f.globalize_fields_for locale, wrapper: :admin do |g|
|
|
19
|
+
= render 'locale_fields', locale: locale, f: g
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
.f__fieldset
|
|
2
|
+
.hidden
|
|
3
|
+
= f.input :behavior, as: :select, wrapper: :select,
|
|
4
|
+
collection: resource.class::BEHAVIORS.map { |b| [resource.class.human_behavior_name(b), b]},
|
|
5
|
+
include_blank: false
|
|
6
|
+
= f.input :slug
|
|
7
|
+
= f.input :published, wrapper: :check
|
|
8
|
+
= f.input :nav_published, wrapper: :check
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.f__fieldset
|
|
2
|
+
= f.input :name
|
|
3
|
+
= f.input :nav_name
|
|
4
|
+
|
|
5
|
+
= f.rich_text_area :content
|
|
6
|
+
/ = f.input :body
|
|
7
|
+
/.kaya-please
|
|
8
|
+
= f.input_field :body, as: :text, id: 'kaya-editor', value: f.object.read_attribute(:body)
|
|
9
|
+
|
|
10
|
+
.f__fieldset
|
|
11
|
+
.f__legend= t 'labels.admin.legend.seo'
|
|
12
|
+
= f.input :meta_title
|
|
13
|
+
= f.input :meta_description, as: :string
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'adminos/extensions/globalize_fields'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
def set_locale
|
|
3
|
+
I18n.locale = params[:locale] || I18n.default_locale
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
def default_url_options
|
|
7
|
+
I18n.locale == I18n.default_locale ? { locale: nil } : { locale: I18n.locale }
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def check_page_name_locale
|
|
11
|
+
redirect_to root_path if current_page.try { name.blank? }
|
|
12
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
ru:
|
|
2
|
+
errors:
|
|
3
|
+
messages:
|
|
4
|
+
expired: "устарела. Пожалуйста, запросите новую"
|
|
5
|
+
not_found: "не найдена"
|
|
6
|
+
already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему"
|
|
7
|
+
not_locked: "не заблокирована"
|
|
8
|
+
not_saved:
|
|
9
|
+
one: "%{resource}: сохранение не удалось из-за %{count} ошибки"
|
|
10
|
+
few: "%{resource}: сохранение не удалось из-за %{count} ошибок"
|
|
11
|
+
many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
|
|
12
|
+
other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
|
|
13
|
+
|
|
14
|
+
devise:
|
|
15
|
+
failure:
|
|
16
|
+
already_authenticated: "Вы уже вошли в систему."
|
|
17
|
+
unauthenticated: "Вам необходимо войти в систему или зарегистрироваться."
|
|
18
|
+
unconfirmed: "Вы должны подтвердить вашу учётную запись."
|
|
19
|
+
locked: "Ваша учётная запись заблокирована."
|
|
20
|
+
invalid: "Неверный адрес e-mail или пароль."
|
|
21
|
+
invalid_token: "Неверный ключ аутентификации."
|
|
22
|
+
timeout: "Ваш сеанс закончился. Пожалуйста, войдите в систему снова."
|
|
23
|
+
inactive: "Ваша учётная запись ещё не активирована."
|
|
24
|
+
user:
|
|
25
|
+
not_found_in_database: "Неверный адрес e-mail или пароль."
|
|
26
|
+
sessions:
|
|
27
|
+
signed_in: "Вход в систему выполнен."
|
|
28
|
+
signed_out: "Выход из системы выполнен."
|
|
29
|
+
passwords:
|
|
30
|
+
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля."
|
|
31
|
+
updated: "Ваш пароль изменён. Теперь вы вошли в систему."
|
|
32
|
+
updated_not_active: 'Ваш пароль изменен.'
|
|
33
|
+
send_paranoid_instructions: "Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля."
|
|
34
|
+
confirmations:
|
|
35
|
+
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
|
|
36
|
+
send_paranoid_instructions: "Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
|
|
37
|
+
confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему."
|
|
38
|
+
registrations:
|
|
39
|
+
signed_up: "Добро пожаловать! Вы успешно зарегистрировались."
|
|
40
|
+
inactive_signed_up: "Добро пожаловать! Вы успешно зарегистрировались. Но пока вы не можете войти в систему, т.к. ваша учётная запись %{reason}."
|
|
41
|
+
updated: "Ваша учётная запись изменена."
|
|
42
|
+
destroyed: "До свидания! Ваша учётная запись удалена. Надеемся снова увидеть вас."
|
|
43
|
+
reasons:
|
|
44
|
+
inactive: 'неактивна'
|
|
45
|
+
unconfirmed: 'не подтверждена'
|
|
46
|
+
locked: 'заблокирована'
|
|
47
|
+
unlocks:
|
|
48
|
+
send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по разблокировке вашей учётной записи."
|
|
49
|
+
unlocked: "Ваша учётная запись разблокирована. Теперь вы вошли в систему."
|
|
50
|
+
send_paranoid_instructions: "Если ваша учётная запись существует, то в течение нескольких минут вы получите письмо с инструкциями по её разблокировке."
|
|
51
|
+
omniauth_callbacks:
|
|
52
|
+
success: "Вход в систему выполнен с учётной записью из %{kind}."
|
|
53
|
+
failure: "Вы не можете войти в систему с учётной записью из %{kind}, т.к. \"%{reason}\"."
|
|
54
|
+
mailer:
|
|
55
|
+
confirmation_instructions:
|
|
56
|
+
subject: "Инструкции по подтверждению учётной записи"
|
|
57
|
+
reset_password_instructions:
|
|
58
|
+
subject: "Инструкции по восстановлению пароля"
|
|
59
|
+
unlock_instructions:
|
|
60
|
+
subject: "Инструкции по разблокировке учётной записи"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
|
2
|
+
<%= link_to t('admin.users.labels.form.login'), new_session_path(resource_name) %><br />
|
|
3
|
+
<% end -%>
|
|
4
|
+
|
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
|
6
|
+
<%= link_to t('admin.users.labels.form.registration'), new_registration_path(resource_name) %><br />
|
|
7
|
+
<% end -%>
|
|
8
|
+
|
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
|
10
|
+
<%= link_to t('admin.users.labels.form.forgot_password'), new_password_path(resource_name) %><br />
|
|
11
|
+
<% end -%>
|
|
12
|
+
|
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
14
|
+
<%= link_to t('admin.users.labels.form.confirm'), new_confirmation_path(resource_name) %><br />
|
|
15
|
+
<% end -%>
|
|
16
|
+
|
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
|
19
|
+
<% end -%>
|
|
20
|
+
|
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
|
23
|
+
<%= link_to t('admin.users.labels.form.oauth') + ' ' + provider.to_s.titleize, omniauth_authorize_path(resource_name, provider) %><br />
|
|
24
|
+
<% end -%>
|
|
25
|
+
<% end -%>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#devise_page
|
|
2
|
+
h2 Отправить инструкции по подтверждению аккаунта
|
|
3
|
+
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
|
|
4
|
+
div
|
|
5
|
+
= f.label :email
|
|
6
|
+
= f.email_field :email
|
|
7
|
+
div= f.submit "Отправить"
|
|
8
|
+
= render "links"
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
p Здравствуйте!
|
|
2
|
+
p Вы можете подтвердить данный почтовый ящик своего аккаунта по следующей ссылке:
|
|
3
|
+
p= link_to 'Активировать мой аккаунт', confirmation_url(@resource, confirmation_token: @resource.confirmation_token)
|
|
4
|
+
p Если вы не регистрировались на сайте или не запрашивали повторных инструкций по активации, просто проигнорируйте это сообщение.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
p Здравствуйте!
|
|
2
|
+
p Мы получили запрос по смене пароля вашего аккаунта, вы можете сделать это по следующей ссылке:
|
|
3
|
+
p= link_to 'Изменить пароль', edit_password_url(@resource, reset_password_token: @resource.reset_password_token)
|
|
4
|
+
p Если вы не запрашивали данной операции, пожалуйста, проигнорируйте это письмо.
|
|
5
|
+
p Ваш пароль не изменится до перехода по полученной ссылке выше.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#devise_page.users_form
|
|
2
|
+
= simple_form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :put }, validate: false do |f|
|
|
3
|
+
= f.input :reset_password_token, as: :hidden
|
|
4
|
+
= f.input :password, placeholder: t('admin.users.labels.form.new_password'), label: false
|
|
5
|
+
= f.input :password_confirmation, placeholder: t('admin.users.labels.form.new_password_confirmation'), label: false
|
|
6
|
+
.submit= f.submit t('admin.users.labels.buttons.password_edit'), tabindex: 3, class: bs_btn
|
|
7
|
+
= render "links"
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#devise_page.users_form
|
|
2
|
+
= simple_form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :post } do |f|
|
|
3
|
+
= f.input :email, placeholder: 'E-mail', label: false
|
|
4
|
+
.submit= f.submit t('admin.users.labels.buttons.password_reset'), tabindex: 3, class: bs_btn
|
|
5
|
+
= render "links"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/
|
|
2
|
+
<h2>Edit <haml:loud> resource_name.to_s.humanize </haml:loud></h2>
|
|
3
|
+
|
|
4
|
+
<haml:loud> form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; { :method =&gt; :put }) do |f| </haml:loud><haml:block>
|
|
5
|
+
<haml:loud> devise_error_messages! </haml:loud>
|
|
6
|
+
|
|
7
|
+
<div><haml:loud> f.label :email </haml:loud><br />
|
|
8
|
+
<haml:loud> f.email_field :email, :autofocus =&gt; true </haml:loud></div>
|
|
9
|
+
|
|
10
|
+
<div><haml:loud> f.label :password </haml:loud> <i>(leave blank if you don't want to change it)</i><br />
|
|
11
|
+
<haml:loud> f.password_field :password, :autocomplete =&gt; &quot;off&quot; </haml:loud></div>
|
|
12
|
+
|
|
13
|
+
<div><haml:loud> f.label :password_confirmation </haml:loud><br />
|
|
14
|
+
<haml:loud> f.password_field :password_confirmation </haml:loud></div>
|
|
15
|
+
|
|
16
|
+
<div><haml:loud> f.label :current_password </haml:loud> <i>(we need your current password to confirm your changes)</i><br />
|
|
17
|
+
<haml:loud> f.password_field :current_password </haml:loud></div>
|
|
18
|
+
|
|
19
|
+
<div><haml:loud> f.submit &quot;Update&quot; </haml:loud></div>
|
|
20
|
+
</haml:block>
|
|
21
|
+
<h3>Cancel my account</h3>
|
|
22
|
+
|
|
23
|
+
<p>Unhappy? <haml:loud> link_to &quot;Cancel my account&quot;, registration_path(resource_name), :data =&gt; { :confirm =&gt; &quot;Are you sure?&quot; }, :method =&gt; :delete </haml:loud>.</p>
|
|
24
|
+
|
|
25
|
+
<haml:loud> link_to &quot;Back&quot;, :back </haml:loud>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#devise_page.users_form
|
|
2
|
+
= simple_form_for resource, as: resource_name, url: registration_path(resource_name) do |f|
|
|
3
|
+
= f.input :email, placeholder: 'E-mail', label: false
|
|
4
|
+
= f.input :password, placeholder: t('admin.users.labels.form.password'), label: false
|
|
5
|
+
= f.input :password_confirmation, placeholder: t('admin.users.labels.form.password_confirmation'), label: false
|
|
6
|
+
.submit= f.submit t('admin.users.labels.buttons.register'), tabindex: 3, class: bs_btn
|
|
7
|
+
= render "links"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
- @body_class = "page--auth ready"
|
|
2
|
+
|
|
3
|
+
.auth
|
|
4
|
+
.auth__title Adminos
|
|
5
|
+
.auth__welcome Вход в систему администрирования
|
|
6
|
+
|
|
7
|
+
= simple_form_for resource, as: resource_name, url: session_path(resource_name), wrapper: :auth, html: { class: 'form auth__form' } do |f|
|
|
8
|
+
= f.input :email, placeholder: 'Электронная почта'
|
|
9
|
+
= f.input :password, placeholder: 'Пароль'
|
|
10
|
+
|
|
11
|
+
/- if devise_mapping.rememberable?
|
|
12
|
+
= f.input :remember_me, as: :boolean, inline_label: t('admin.users.labels.form.remember_me'), label: false
|
|
13
|
+
|
|
14
|
+
.form__submit.centered
|
|
15
|
+
= f.submit 'Войти', class: 'button button--rounded'
|
|
16
|
+
|
|
17
|
+
/.auth__help
|
|
18
|
+
a href="#" Напомнить пароль
|
|
19
|
+
|
|
20
|
+
- if flash.present?
|
|
21
|
+
.auth__message
|
|
22
|
+
= show_flash_alert
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/
|
|
2
|
+
<h2>Resend unlock instructions</h2>
|
|
3
|
+
|
|
4
|
+
<haml:loud> form_for(resource, :as =&gt; resource_name, :url =&gt; unlock_path(resource_name), :html =&gt; { :method =&gt; :post }) do |f| </haml:loud><haml:block>
|
|
5
|
+
|
|
6
|
+
<div><haml:loud> f.label :email </haml:loud><br />
|
|
7
|
+
<haml:loud> f.email_field :email </haml:loud></div>
|
|
8
|
+
|
|
9
|
+
<div><haml:loud> f.submit &quot;Resend unlock instructions&quot; </haml:loud></div>
|
|
10
|
+
</haml:block>
|
|
11
|
+
<haml:loud> render &quot;links&quot; </haml:loud>
|