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.
Files changed (288) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +14 -0
  3. data/.gitignore +25 -0
  4. data/.gitlab-ci.yml +18 -0
  5. data/.rspec +2 -0
  6. data/.rubocop.yml +120 -0
  7. data/.rubocop_todo.yml +58 -0
  8. data/Gemfile +25 -0
  9. data/Guardfile +70 -0
  10. data/LICENSE.txt +22 -0
  11. data/README.md +88 -0
  12. data/Rakefile +20 -0
  13. data/adminos.gemspec +37 -0
  14. data/adminos.png +0 -0
  15. data/app/assets/images/.keep +0 -0
  16. data/app/assets/images/apple-touch-icon.png +0 -0
  17. data/app/assets/images/favicon-16x16.png +0 -0
  18. data/app/assets/images/favicon-32x32.png +0 -0
  19. data/app/assets/images/favicon.ico +0 -0
  20. data/app/assets/images/safari-pinned-tab.svg +23 -0
  21. data/app/inputs/cropp_input.rb +45 -0
  22. data/bin/bundle +105 -0
  23. data/bin/gem +39 -0
  24. data/bin/rspec +29 -0
  25. data/exe/adminos +5 -0
  26. data/lib/adminos/cli.rb +71 -0
  27. data/lib/adminos/controllers/admin_extension.rb +34 -0
  28. data/lib/adminos/controllers/helpers.rb +24 -0
  29. data/lib/adminos/controllers/resource.rb +169 -0
  30. data/lib/adminos/extensions/globalize_actiontext.rb +28 -0
  31. data/lib/adminos/extensions/globalize_fields.rb +19 -0
  32. data/lib/adminos/extensions/nested_set.rb +27 -0
  33. data/lib/adminos/extensions/string.rb +5 -0
  34. data/lib/adminos/generators/gemfile_merge.rb +85 -0
  35. data/lib/adminos/generators/utilities.rb +87 -0
  36. data/lib/adminos/helpers/admin.rb +190 -0
  37. data/lib/adminos/helpers/bootstrap.rb +64 -0
  38. data/lib/adminos/helpers/models/apply_sortable_order.rb +10 -0
  39. data/lib/adminos/helpers/models/array_attrs.rb +17 -0
  40. data/lib/adminos/helpers/models/cropped.rb +20 -0
  41. data/lib/adminos/helpers/models/dom_id.rb +16 -0
  42. data/lib/adminos/helpers/models/flag_attrs.rb +43 -0
  43. data/lib/adminos/helpers/models/if_blank_set_to_nil_params.rb +19 -0
  44. data/lib/adminos/helpers/models/move_to.rb +17 -0
  45. data/lib/adminos/helpers/models/nested_set/duplication.rb +31 -0
  46. data/lib/adminos/helpers/models/nested_set/materialize_path.rb +50 -0
  47. data/lib/adminos/helpers/models/nested_set/place_to.rb +35 -0
  48. data/lib/adminos/helpers/models/nested_set/safe_destroy.rb +34 -0
  49. data/lib/adminos/helpers/models/recognizable.rb +28 -0
  50. data/lib/adminos/helpers/models/slugged.rb +20 -0
  51. data/lib/adminos/helpers/models/soft_destroy.rb +61 -0
  52. data/lib/adminos/helpers/models/wysiwyg.rb +105 -0
  53. data/lib/adminos/helpers/view.rb +137 -0
  54. data/lib/adminos/operations/check_environment.rb +18 -0
  55. data/lib/adminos/operations/extract_environment.rb +42 -0
  56. data/lib/adminos/operations/load_environment.rb +30 -0
  57. data/lib/adminos/stateful_link/action_any_of.rb +76 -0
  58. data/lib/adminos/stateful_link/helper.rb +31 -0
  59. data/lib/adminos.rb +42 -0
  60. data/lib/adminos_template.rb +15 -0
  61. data/lib/generators/adminos/adminos_generator.rb +164 -0
  62. data/lib/generators/adminos/ci_generator.rb +124 -0
  63. data/lib/generators/adminos/field_generator.rb +105 -0
  64. data/lib/generators/adminos/i18n_generator.rb +76 -0
  65. data/lib/generators/adminos/install_generator.rb +238 -0
  66. data/lib/generators/templates/adminos/adminos.ru.yml +15 -0
  67. data/lib/generators/templates/adminos/fields.slim +21 -0
  68. data/lib/generators/templates/adminos/locales/general_fields.slim +7 -0
  69. data/lib/generators/templates/adminos/locales/locale_fields.slim +10 -0
  70. data/lib/generators/templates/adminos/locales/migration.rb.erb +18 -0
  71. data/lib/generators/templates/adminos/locales/model.rb.erb +6 -0
  72. data/lib/generators/templates/adminos/sidebar.slim +2 -0
  73. data/lib/generators/templates/adminos/sorts/body.slim +3 -0
  74. data/lib/generators/templates/adminos/sorts/headers.slim +3 -0
  75. data/lib/generators/templates/adminos/types/default/controller.rb.erb +18 -0
  76. data/lib/generators/templates/adminos/types/default/migration.rb +5 -0
  77. data/lib/generators/templates/adminos/types/default/model.rb +20 -0
  78. data/lib/generators/templates/adminos/types/default/model_includes.rb +4 -0
  79. data/lib/generators/templates/adminos/types/default/views/index.slim +14 -0
  80. data/lib/generators/templates/adminos/types/section/controller.rb.erb +10 -0
  81. data/lib/generators/templates/adminos/types/section/migration.rb +12 -0
  82. data/lib/generators/templates/adminos/types/section/model.rb +62 -0
  83. data/lib/generators/templates/adminos/types/section/model_includes.rb +7 -0
  84. data/lib/generators/templates/adminos/types/section/views/_object.slim +24 -0
  85. data/lib/generators/templates/adminos/types/section/views/_objects.slim +6 -0
  86. data/lib/generators/templates/adminos/types/section/views/index.slim +7 -0
  87. data/lib/generators/templates/adminos/types/sortable/controller.rb.erb +10 -0
  88. data/lib/generators/templates/adminos/types/sortable/migration.rb +9 -0
  89. data/lib/generators/templates/adminos/types/sortable/model.rb +35 -0
  90. data/lib/generators/templates/adminos/types/sortable/model_includes.rb +6 -0
  91. data/lib/generators/templates/adminos/types/sortable/views/_object.slim +17 -0
  92. data/lib/generators/templates/adminos/types/sortable/views/_objects.slim +6 -0
  93. data/lib/generators/templates/adminos/types/sortable/views/index.slim +7 -0
  94. data/lib/generators/templates/adminos/types/table/controller.rb.erb +19 -0
  95. data/lib/generators/templates/adminos/types/table/views/index.slim +31 -0
  96. data/lib/generators/templates/ci/.gitlab-ci.yml +40 -0
  97. data/lib/generators/templates/ci/audit/Gemfile +3 -0
  98. data/lib/generators/templates/ci/lint/Gemfile +3 -0
  99. data/lib/generators/templates/ci/lint/rubocop.yml +116 -0
  100. data/lib/generators/templates/ci/rakelib/audit.rake +13 -0
  101. data/lib/generators/templates/ci/rakelib/lint.rake +13 -0
  102. data/lib/generators/templates/ci/spec/Gemfile +9 -0
  103. data/lib/generators/templates/field/locales/locale_fields.slim +4 -0
  104. data/lib/generators/templates/field/locales/migration.rb.erb +13 -0
  105. data/lib/generators/templates/field/locales/model.rb.erb +6 -0
  106. data/lib/generators/templates/i18n/Gemfile +1 -0
  107. data/lib/generators/templates/i18n/add_translation_table_to_page.rb +15 -0
  108. data/lib/generators/templates/i18n/auto/app/validators/locale_validator.rb +23 -0
  109. data/lib/generators/templates/i18n/auto/app/views/admin/base/_fields.slim +1 -0
  110. data/lib/generators/templates/i18n/auto/app/views/admin/base/_pills.slim +19 -0
  111. data/lib/generators/templates/i18n/auto/app/views/admin/pages/_general_fields.slim +8 -0
  112. data/lib/generators/templates/i18n/auto/app/views/admin/pages/_locale_fields.slim +13 -0
  113. data/lib/generators/templates/i18n/auto/config/initializers/globalize_fields.rb +1 -0
  114. data/lib/generators/templates/i18n/controller.rb +12 -0
  115. data/lib/generators/templates/i18n/devise/devise.ru.yml +60 -0
  116. data/lib/generators/templates/i18n/devise/views/_links.erb +25 -0
  117. data/lib/generators/templates/i18n/devise/views/confirmations/new.slim +8 -0
  118. data/lib/generators/templates/i18n/devise/views/mailer/confirmation_instructions.slim +4 -0
  119. data/lib/generators/templates/i18n/devise/views/mailer/reset_password_instructions.slim +5 -0
  120. data/lib/generators/templates/i18n/devise/views/mailer/unlock_instructions.slim +4 -0
  121. data/lib/generators/templates/i18n/devise/views/passwords/edit.slim +7 -0
  122. data/lib/generators/templates/i18n/devise/views/passwords/new.slim +5 -0
  123. data/lib/generators/templates/i18n/devise/views/registrations/edit.slim +25 -0
  124. data/lib/generators/templates/i18n/devise/views/registrations/new.slim +7 -0
  125. data/lib/generators/templates/i18n/devise/views/sessions/new.slim +22 -0
  126. data/lib/generators/templates/i18n/devise/views/unlocks/new.slim +11 -0
  127. data/lib/generators/templates/i18n/locales.slim +3 -0
  128. data/lib/generators/templates/i18n/page.rb +5 -0
  129. data/lib/generators/templates/install/.gitignore +11 -0
  130. data/lib/generators/templates/install/Gemfile +57 -0
  131. data/lib/generators/templates/install/Procfile +1 -0
  132. data/lib/generators/templates/install/_sidebar.slim.erb +44 -0
  133. data/lib/generators/templates/install/add_authentications/authentication.rb +7 -0
  134. data/lib/generators/templates/install/add_authentications/authentications_controller.rb +95 -0
  135. data/lib/generators/templates/install/add_authentications/authentications_migration.rb +12 -0
  136. data/lib/generators/templates/install/add_authentications/views/authentications/_form.slim +5 -0
  137. data/lib/generators/templates/install/add_authentications/views/authentications/_modal.slim +7 -0
  138. data/lib/generators/templates/install/add_pages/page.rb +116 -0
  139. data/lib/generators/templates/install/add_pages/pages_controller.rb +6 -0
  140. data/lib/generators/templates/install/add_pages/pages_migration.rb +25 -0
  141. data/lib/generators/templates/install/add_pages/views/pages/show.slim +4 -0
  142. data/lib/generators/templates/install/admin.slim +36 -0
  143. data/lib/generators/templates/install/admin_panel/pages/admin_pages_controller.rb +9 -0
  144. data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_fields.slim +26 -0
  145. data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_object.slim +25 -0
  146. data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/_objects.slim +6 -0
  147. data/lib/generators/templates/install/admin_panel/pages/views/admin_pages/index.slim +7 -0
  148. data/lib/generators/templates/install/admin_panel/users/admin_users_controller.rb +29 -0
  149. data/lib/generators/templates/install/admin_panel/users/views/admin_users/_fields.slim +4 -0
  150. data/lib/generators/templates/install/admin_panel/users/views/admin_users/index.slim +33 -0
  151. data/lib/generators/templates/install/admin_panel/versions/admin_versions_controller.rb +29 -0
  152. data/lib/generators/templates/install/admin_panel/versions/views/admin_versions/index.slim +47 -0
  153. data/lib/generators/templates/install/admin_panel/versions/views/admin_versions/show.slim +18 -0
  154. data/lib/generators/templates/install/application.slim.erb +31 -0
  155. data/lib/generators/templates/install/auto/.editorconfig +14 -0
  156. data/lib/generators/templates/install/auto/.env.staging +2 -0
  157. data/lib/generators/templates/install/auto/Capfile +14 -0
  158. data/lib/generators/templates/install/auto/Guardfile +18 -0
  159. data/lib/generators/templates/install/auto/Procfile +1 -0
  160. data/lib/generators/templates/install/auto/Procfile.local +2 -0
  161. data/lib/generators/templates/install/auto/app/assets/javascripts/admin/application.js +3 -0
  162. data/lib/generators/templates/install/auto/app/assets/javascripts/admin/cocoon_fields.js +43 -0
  163. data/lib/generators/templates/install/auto/app/assets/javascripts/application.js +1 -0
  164. data/lib/generators/templates/install/auto/app/assets/stylesheets/admin/application.scss +1 -0
  165. data/lib/generators/templates/install/auto/app/controllers/admin/base_controller.rb +16 -0
  166. data/lib/generators/templates/install/auto/app/controllers/admin/helps_controller.rb +4 -0
  167. data/lib/generators/templates/install/auto/app/controllers/admin/settings_controller.rb +26 -0
  168. data/lib/generators/templates/install/auto/app/controllers/application_controller.rb +50 -0
  169. data/lib/generators/templates/install/auto/app/controllers/index_controller.rb +2 -0
  170. data/lib/generators/templates/install/auto/app/helpers/nested_helper.rb +75 -0
  171. data/lib/generators/templates/install/auto/app/helpers/versions_helper.rb +33 -0
  172. data/lib/generators/templates/install/auto/app/inputs/carrierwave_input.rb +52 -0
  173. data/lib/generators/templates/install/auto/app/inputs/checkbox_input.rb +13 -0
  174. data/lib/generators/templates/install/auto/app/inputs/rich_text_input.rb +9 -0
  175. data/lib/generators/templates/install/auto/app/mailers/notifier.rb +9 -0
  176. data/lib/generators/templates/install/auto/app/models/settings.rb +27 -0
  177. data/lib/generators/templates/install/auto/app/services/export_xlsx.rb +76 -0
  178. data/lib/generators/templates/install/auto/app/views/active_storage/blobs/_blob.html.erb +17 -0
  179. data/lib/generators/templates/install/auto/app/views/admin/base/_form.slim +33 -0
  180. data/lib/generators/templates/install/auto/app/views/admin/base/_object.slim +27 -0
  181. data/lib/generators/templates/install/auto/app/views/admin/base/_objects.slim +19 -0
  182. data/lib/generators/templates/install/auto/app/views/admin/base/drop.js.erb +1 -0
  183. data/lib/generators/templates/install/auto/app/views/admin/base/edit.slim +1 -0
  184. data/lib/generators/templates/install/auto/app/views/admin/base/index.slim +14 -0
  185. data/lib/generators/templates/install/auto/app/views/admin/base/new.slim +1 -0
  186. data/lib/generators/templates/install/auto/app/views/admin/helps/index.slim +29 -0
  187. data/lib/generators/templates/install/auto/app/views/admin/settings/edit.slim +27 -0
  188. data/lib/generators/templates/install/auto/app/views/kaminari/_first_page.slim +10 -0
  189. data/lib/generators/templates/install/auto/app/views/kaminari/_gap.slim +7 -0
  190. data/lib/generators/templates/install/auto/app/views/kaminari/_last_page.slim +10 -0
  191. data/lib/generators/templates/install/auto/app/views/kaminari/_next_page.slim +9 -0
  192. data/lib/generators/templates/install/auto/app/views/kaminari/_page.slim +10 -0
  193. data/lib/generators/templates/install/auto/app/views/kaminari/_paginator.slim +16 -0
  194. data/lib/generators/templates/install/auto/app/views/kaminari/_prev_page.slim +9 -0
  195. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_first_page.slim +10 -0
  196. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_gap.slim +8 -0
  197. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_last_page.slim +10 -0
  198. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_next_page.slim +10 -0
  199. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_page.slim +10 -0
  200. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_paginator.slim +16 -0
  201. data/lib/generators/templates/install/auto/app/views/kaminari/admin/_prev_page.slim +10 -0
  202. data/lib/generators/templates/install/auto/app/views/layouts/admin/base.slim +17 -0
  203. data/lib/generators/templates/install/auto/app/views/shared/admin/_back_button.slim +3 -0
  204. data/lib/generators/templates/install/auto/app/views/shared/admin/_footer.slim +3 -0
  205. data/lib/generators/templates/install/auto/app/views/shared/admin/_search_form.slim +6 -0
  206. data/lib/generators/templates/install/auto/app/views/shared/admin/_topbar.slim +11 -0
  207. data/lib/generators/templates/install/auto/app/views/shared/helpers/_alert_close.slim +1 -0
  208. data/lib/generators/templates/install/auto/app/views/shared/helpers/_contacts_page_link_tag.slim +1 -0
  209. data/lib/generators/templates/install/auto/app/views/shared/helpers/_link_button_to.slim +2 -0
  210. data/lib/generators/templates/install/auto/app/views/shared/helpers/_method_ajax_request_link_to.slim +2 -0
  211. data/lib/generators/templates/install/auto/app/views/shared/helpers/_method_link_to.slim +12 -0
  212. data/lib/generators/templates/install/auto/app/views/shared/helpers/_navigation_menu.html.slim +3 -0
  213. data/lib/generators/templates/install/auto/app/views/shared/helpers/_print_tag.slim +2 -0
  214. data/lib/generators/templates/install/auto/app/views/shared/helpers/_search_tag_for.slim +16 -0
  215. data/lib/generators/templates/install/auto/app/views/shared/helpers/_show_breadcrumbs.slim +7 -0
  216. data/lib/generators/templates/install/auto/app/views/shared/helpers/_show_flash_alert.slim +9 -0
  217. data/lib/generators/templates/install/auto/app/views/shared/helpers/_sortable_column.slim +3 -0
  218. data/lib/generators/templates/install/auto/app/views/shared/helpers/_span_link_to.slim +3 -0
  219. data/lib/generators/templates/install/auto/app/views/shared/helpers/_sub_navigation.slim +14 -0
  220. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_batch_actions_tag.slim +16 -0
  221. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_collection_button_new.slim +5 -0
  222. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_collection_header.slim +4 -0
  223. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_locked_sign.slim +3 -0
  224. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_nav_published_sign.slim +1 -0
  225. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_children.slim +2 -0
  226. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_duplication.slim +1 -0
  227. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_edit.slim +1 -0
  228. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_object_link_new.slim +1 -0
  229. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_page_header.slim +5 -0
  230. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_published_sign.slim +1 -0
  231. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_show_breadcrumbs.slim +6 -0
  232. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_top_menu_item.slim +5 -0
  233. data/lib/generators/templates/install/auto/app/views/shared/helpers/admin/_unpublished_sign.slim +1 -0
  234. data/lib/generators/templates/install/auto/browserslist +3 -0
  235. data/lib/generators/templates/install/auto/config/deploy/shared/database.yml.erb +10 -0
  236. data/lib/generators/templates/install/auto/config/deploy/shared/nginx.conf.erb +28 -0
  237. data/lib/generators/templates/install/auto/config/deploy/shared/unicorn.rb.erb +35 -0
  238. data/lib/generators/templates/install/auto/config/deploy/staging.rb +12 -0
  239. data/lib/generators/templates/install/auto/config/environments/staging.rb +84 -0
  240. data/lib/generators/templates/install/auto/config/initializers/awesome_nested_set.rb +1 -0
  241. data/lib/generators/templates/install/auto/config/initializers/content_security_policy.rb +26 -0
  242. data/lib/generators/templates/install/auto/config/initializers/friendly_id.rb +1 -0
  243. data/lib/generators/templates/install/auto/config/initializers/kaminari_config.rb +15 -0
  244. data/lib/generators/templates/install/auto/config/initializers/simple_form.rb +238 -0
  245. data/lib/generators/templates/install/auto/config/initializers/slim.rb +2 -0
  246. data/lib/generators/templates/install/auto/config/locales/adminos.en.yml +164 -0
  247. data/lib/generators/templates/install/auto/config/locales/adminos.ru.yml +292 -0
  248. data/lib/generators/templates/install/auto/lib/capistrano/substitute_strings.rb +12 -0
  249. data/lib/generators/templates/install/auto/lib/capistrano/tasks/setup_config.cap +39 -0
  250. data/lib/generators/templates/install/auto/lib/capistrano/template.rb +33 -0
  251. data/lib/generators/templates/install/auto/public/404.html +26 -0
  252. data/lib/generators/templates/install/auto/public/500.html +25 -0
  253. data/lib/generators/templates/install/database.yml +19 -0
  254. data/lib/generators/templates/install/deploy.rb.erb +21 -0
  255. data/lib/generators/templates/install/install_devise/ability.rb +49 -0
  256. data/lib/generators/templates/install/install_devise/application.rb +7 -0
  257. data/lib/generators/templates/install/install_devise/prepare_users.rb +1 -0
  258. data/lib/generators/templates/install/install_devise/user.rb +21 -0
  259. data/lib/generators/templates/install/prepare_settings.rb +4 -0
  260. data/lib/generators/templates/install/routes/pages.rb +18 -0
  261. data/lib/generators/templates/install/routes.rb.erb +53 -0
  262. data/lib/generators/templates/install/settings_migration.rb +16 -0
  263. data/lib/generators/templates/install/webpack/custom.js +36 -0
  264. data/lib/generators/templates/install/webpack/environment.js +4 -0
  265. data/lib/generators/templates/install/webpack/javascript/admin/js/index.js +2 -0
  266. data/lib/generators/templates/install/webpack/javascript/admin/styles/admin.scss +2 -0
  267. data/lib/generators/templates/install/webpack/javascript/packs/admin.js +2 -0
  268. data/package-lock.json +3 -0
  269. data/spec/config/database.yml +2 -0
  270. data/spec/db/schema.rb +0 -0
  271. data/spec/lib/adminos/helpers/models/apply_sortable_order.rb +26 -0
  272. data/spec/lib/adminos/helpers/models/array_attrs_spec.rb +38 -0
  273. data/spec/lib/adminos/helpers/models/dom_id_spec.rb +41 -0
  274. data/spec/lib/adminos/helpers/models/flag_attrs_spec.rb +115 -0
  275. data/spec/lib/adminos/helpers/models/if_blank_set_to_nil_params_spec.rb +36 -0
  276. data/spec/lib/adminos/helpers/models/recognizable_spec.rb +40 -0
  277. data/spec/lib/adminos/helpers/models/slugged.rb +40 -0
  278. data/spec/lib/generators/adminos/adminos_generator_spec.rb +106 -0
  279. data/spec/lib/generators/adminos/ci_generator_spec.rb +88 -0
  280. data/spec/lib/generators/adminos/i18n_generator_spec.rb +31 -0
  281. data/spec/lib/generators/adminos/install_generator_rspec.rb +322 -0
  282. data/spec/spec_helper.rb +122 -0
  283. data/spec/support/ammeter.rb +14 -0
  284. data/spec/support/database.rb +29 -0
  285. data/spec/support/generators.rb +99 -0
  286. data/spec/support/post.rb +8 -0
  287. data/spec/support/shared/generator.rb +35 -0
  288. metadata +632 -0
@@ -0,0 +1,84 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # config.action_mailer.delivery_method = :postal
64
+ # config.action_mailer.postal_settings = { host: ENV['POSTAL_HOST'], server_key: ENV['POSTAL_KEY'] }
65
+
66
+ # config.action_mailer.default_url_options = { host: 'http://example.com/' }
67
+
68
+ # Ignore bad email addresses and do not raise email delivery errors.
69
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
70
+ # config.action_mailer.raise_delivery_errors = false
71
+
72
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
73
+ # the I18n.default_locale when a translation cannot be found).
74
+ # config.i18n.fallbacks = true
75
+
76
+ # Send deprecation notices to registered listeners.
77
+ config.active_support.deprecation = :notify
78
+
79
+ # Use default logging formatter so that PID and timestamp are not suppressed.
80
+ config.log_formatter = ::Logger::Formatter.new
81
+
82
+ # Do not dump schema after migrations.
83
+ config.active_record.dump_schema_after_migration = false
84
+ end
@@ -0,0 +1 @@
1
+ require 'awesome_nested_set'
@@ -0,0 +1,26 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
18
+ end
19
+
20
+ # If you are using UJS then enable automatic nonce generation
21
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
22
+
23
+ # Report CSP violations to a specified URI
24
+ # For further information see the following documentation:
25
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
26
+ # Rails.application.config.content_security_policy_report_only = true
@@ -0,0 +1,15 @@
1
+ require 'kaminari'
2
+
3
+ Kaminari.configure do |config|
4
+ # config.default_per_page = 25
5
+ # config.left = 0
6
+ # config.max_per_page = nil
7
+ # config.outer_window = 0
8
+ # config.page_method_name = :page
9
+ # config.param_name = :page
10
+ # config.right = 0
11
+ # config.window = 4
12
+ config.left = 1
13
+ config.right = 1
14
+ config.window = 6
15
+ end
@@ -0,0 +1,238 @@
1
+ require 'simple_form'
2
+
3
+ SimpleForm.setup do |config|
4
+ # Wrappers are used by the form builder to generate a
5
+ # complete input. You can remove any component from the
6
+ # wrapper, change the order or even add your own to the
7
+ # stack. The options given below are used to wrap the
8
+ # whole input.
9
+ config.wrappers :default, class: :input,
10
+ hint_class: :field_with_hint, error_class: :field_with_errors do |b|
11
+ ## Extensions enabled by default
12
+ # Any of these extensions can be disabled for a
13
+ # given input by passing: `f.input EXTENSION_NAME => false`.
14
+ # You can make any of these extensions optional by
15
+ # renaming `b.use` to `b.optional`.
16
+
17
+ # Determines whether to use HTML5 (:email, :url, ...)
18
+ # and required attributes
19
+ b.use :html5
20
+
21
+ # Calculates placeholders automatically from I18n
22
+ # You can also pass a string as f.input :placeholder => "Placeholder"
23
+ b.use :placeholder
24
+
25
+ ## Optional extensions
26
+ # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
27
+ # to the input. If so, they will retrieve the values from the model
28
+ # if any exists. If you want to enable the lookup for any of those
29
+ # extensions by default, you can change `b.optional` to `b.use`.
30
+
31
+ # Calculates maxlength from length validations for string inputs
32
+ b.optional :maxlength
33
+
34
+ # Calculates pattern from format validations for string inputs
35
+ b.optional :pattern
36
+
37
+ # Calculates min and max from length validations for numeric inputs
38
+ b.optional :min_max
39
+
40
+ # Calculates readonly automatically from readonly attributes
41
+ b.optional :readonly
42
+
43
+ ## Inputs
44
+ b.use :label_input
45
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
46
+ b.use :error, wrap_with: { tag: :span, class: :error }
47
+ end
48
+
49
+ config.wrappers :bootstrap, tag: 'div', class: 'control-group', error_class: 'error' do |b|
50
+ b.use :html5
51
+ b.use :placeholder
52
+ b.use :label
53
+ b.wrapper tag: 'div', class: 'controls' do |ba|
54
+ ba.use :input
55
+ ba.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
56
+ ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' }
57
+ end
58
+ end
59
+
60
+ config.wrappers :prepend, tag: 'div', class: "control-group", error_class: 'error' do |b|
61
+ b.use :html5
62
+ b.use :placeholder
63
+ b.use :label
64
+ b.wrapper tag: 'div', class: 'controls' do |input|
65
+ input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
66
+ prepend.use :input
67
+ end
68
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
69
+ input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
70
+ end
71
+ end
72
+
73
+ config.wrappers :append, tag: 'div', class: "control-group", error_class: 'error' do |b|
74
+ b.use :html5
75
+ b.use :placeholder
76
+ b.use :label
77
+ b.wrapper tag: 'div', class: 'controls' do |input|
78
+ input.wrapper tag: 'div', class: 'input-append' do |append|
79
+ append.use :input
80
+ end
81
+ input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
82
+ input.use :error, wrap_with: { tag: 'span', class: 'help-inline' }
83
+ end
84
+ end
85
+
86
+ config.wrappers :auth, tag: 'div', class: 'form__field', error_class: 'form__field--error' do |b|
87
+ b.use :html5
88
+
89
+ b.use :placeholder
90
+
91
+ b.use :input, class: 'form-control'
92
+
93
+ b.use :error, wrap_with: { tag: 'span', class: 'form__comment' }
94
+ b.use :hint, wrap_with: { tag: 'span', class: 'form__comment' }
95
+ end
96
+
97
+ config.wrappers :admin, tag: 'div', class: 'f-field', error_class: 'f-field--error' do |b|
98
+ b.use :html5
99
+
100
+ b.wrapper tag: 'div', class: 'f-field__label' do |b1|
101
+ b1.use :label, class: 'f-label'
102
+ end
103
+
104
+ b.wrapper tag: 'div', class: 'f-field__container' do |b2|
105
+ b2.use :input, class: 'form-control'
106
+
107
+ b2.use :error, wrap_with: { tag: 'span', class: 'f-comment' }
108
+ b2.use :hint, wrap_with: { tag: 'span', class: 'f-comment' }
109
+ end
110
+ end
111
+
112
+ config.wrappers :select, tag: 'div', class: 'f-field', error_class: 'f-field--error' do |b|
113
+ b.use :html5
114
+
115
+ b.wrapper tag: 'div', class: 'f-field__label' do |b1|
116
+ b1.use :label, class: 'f-label'
117
+ end
118
+
119
+ b.wrapper tag: 'div', class: 'f-field__container' do |b2|
120
+ b2.use :input, class: 'custom-select'
121
+
122
+ b2.use :error, wrap_with: { tag: 'span', class: 'f-comment' }
123
+ b2.use :hint, wrap_with: { tag: 'span', class: 'f-comment' }
124
+ end
125
+ end
126
+
127
+ config.wrappers :check, tag: 'div', class: 'f-field f-field--checks', error_class: 'f-field--error' do |b|
128
+ b.use :html5
129
+
130
+ b.wrapper tag: 'div', class: 'f-field__container' do |b1|
131
+ b1.wrapper tag: 'label', class: 'f-check' do |b2|
132
+ b2.use :input
133
+
134
+ b2.wrapper tag: 'span', class: 'f-check__box' do
135
+ end
136
+
137
+ b2.wrapper tag: 'span', class: 'f-check__label' do |b3|
138
+ b3.use :label_text
139
+ end
140
+ end
141
+
142
+ b1.use :error, wrap_with: { tag: 'span', class: 'f-comment' }
143
+ b1.use :hint, wrap_with: { tag: 'span', class: 'f-comment' }
144
+ end
145
+ end
146
+
147
+ # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
148
+ # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
149
+ # to learn about the different styles for forms and inputs,
150
+ # buttons and other elements.
151
+ config.default_wrapper = :bootstrap
152
+
153
+ # Define the way to render check boxes / radio buttons with labels.
154
+ # Defaults to :nested for bootstrap config.
155
+ # :inline => input + label
156
+ # :nested => label > input
157
+ config.boolean_style = :inline
158
+
159
+ # Default class for buttons
160
+ config.button_class = 'btn'
161
+
162
+ # Method used to tidy up errors.
163
+ # config.error_method = :first
164
+
165
+ # Default tag used for error notification helper.
166
+ config.error_notification_tag = :div
167
+
168
+ # CSS class to add for error notification helper.
169
+ config.error_notification_class = 'alert alert-error'
170
+
171
+ # ID to add for error notification helper.
172
+ # config.error_notification_id = nil
173
+
174
+ # Series of attempts to detect a default label method for collection.
175
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
176
+
177
+ # Series of attempts to detect a default value method for collection.
178
+ # config.collection_value_methods = [ :id, :to_s ]
179
+
180
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
181
+ # config.collection_wrapper_tag = nil
182
+
183
+ # You can define the class to use on all collection wrappers. Defaulting to none.
184
+ # config.collection_wrapper_class = nil
185
+
186
+ # You can wrap each item in a collection of radio/check boxes with a tag,
187
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
188
+ # SimpleForm will force this option to be a label.
189
+ # config.item_wrapper_tag = :span
190
+
191
+ # You can define a class to use in all item wrappers. Defaulting to none.
192
+ # config.item_wrapper_class = nil
193
+
194
+ # How the label text should be generated altogether with the required text.
195
+ config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
196
+
197
+ # You can define the class to use on all labels. Default is nil.
198
+ config.label_class = 'control-label'
199
+
200
+ # You can define the class to use on all forms. Default is simple_form.
201
+ # config.form_class = :simple_form
202
+
203
+ # You can define which elements should obtain additional classes
204
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
205
+
206
+ # Whether attributes are required by default (or not). Default is true.
207
+ # config.required_by_default = true
208
+
209
+ # Tell browsers whether to use default HTML5 validations (novalidate option).
210
+ # Default is enabled.
211
+ config.browser_validations = false
212
+
213
+ # Collection of methods to detect if a file type was given.
214
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
215
+
216
+ # Custom mappings for input types. This should be a hash containing a regexp
217
+ # to match as key, and the input type that will be used when the field name
218
+ # matches the regexp as value.
219
+ # config.input_mappings = { /count/ => :integer }
220
+
221
+ # Default priority for time_zone inputs.
222
+ # config.time_zone_priority = nil
223
+
224
+ # Default priority for country inputs.
225
+ # config.country_priority = nil
226
+
227
+ # Default size for text inputs.
228
+ # config.default_input_size = 50
229
+
230
+ # When false, do not use translations for labels.
231
+ # config.translate_labels = true
232
+
233
+ # Automatically discover new inputs in Rails' autoload path.
234
+ # config.inputs_discovery = true
235
+
236
+ # Cache SimpleForm inputs discovery
237
+ # config.cache_discovery = !Rails.env.development?
238
+ end
@@ -0,0 +1,2 @@
1
+ require 'slim-rails'
2
+ Slim::Engine.set_options(pretty: false)
@@ -0,0 +1,164 @@
1
+ en:
2
+ attributes:
3
+ name: Name
4
+ published: Published
5
+ nav_name: Navigation name
6
+ nav_published: Show in naviation
7
+ slug: URL
8
+ body: Body
9
+ lead: Short description
10
+ published_at: Publication date
11
+ created_at: Date
12
+ meta_title: Title
13
+ meta_description: Description
14
+ height: Height
15
+ area: Area
16
+ start: Contract starts
17
+ end: Contract ends
18
+ image: Main image
19
+ summary: Short description
20
+ description: Description
21
+ type: Type
22
+ city: City
23
+ country: Country
24
+ coordinates: Coordinates
25
+
26
+ activerecord:
27
+ attributes:
28
+ settings:
29
+ company_name: Company name
30
+ contact_email: Contact email
31
+ email: Email for notifications
32
+ email_header_from: FROM email
33
+ index_meta_description: Description
34
+ index_meta_title: Title
35
+ per_page: Per page
36
+ seo_google_analytics: Google Analytics code
37
+ seo_yandex_metrika: Яндекс.Метрики code
38
+ pr_email: Email PR
39
+ test_emails: Email for test mail
40
+ user:
41
+ email: E-mail
42
+ password: Password
43
+ roles: Roles
44
+ admin: Admin
45
+ paper_trail/version:
46
+ item: Object
47
+ item_type: Type
48
+ event: Event
49
+ whodunnit: User
50
+ project_image:
51
+ file: Photo
52
+
53
+ admin:
54
+ actions:
55
+ create: Create
56
+ update: Update
57
+ destroy: Destroy
58
+ projects:
59
+ actions:
60
+ index:
61
+ header: Projects
62
+ title: Projects
63
+ labels:
64
+ actions:
65
+ create: Add project
66
+ edit: Save project
67
+ new: Add project
68
+ update: Save project
69
+ users:
70
+ actions:
71
+ index:
72
+ header: Users
73
+ title: Users
74
+ labels:
75
+ actions:
76
+ create: Add user
77
+ edit: Save user
78
+ new: Add user
79
+ update: Save user
80
+ form:
81
+ login: Sign in
82
+ registration: Sign up
83
+ forgot_password: Forgot your password?
84
+ confirm: Didn't receive confirmation instructions?
85
+ oauth: Sign in with
86
+ remember_me: Remember me
87
+ password: Password
88
+ password_confirmation: Password confirmation
89
+ new_password: New password
90
+ new_password_confirmation: New password confirmation
91
+ buttons:
92
+ password_reset: Send me reset password instructions
93
+ password_edit: Change my password
94
+ register: Sign up
95
+ paper_trail/versions:
96
+ actions:
97
+ index:
98
+ header: Actions
99
+ title: Actions
100
+ labels:
101
+ actions:
102
+ show: Show modifications
103
+ settings:
104
+ actions:
105
+ index:
106
+ header: Settings
107
+ sets:
108
+ counters: Counters
109
+ index: Main page
110
+ contact_information: Contacts
111
+ labels:
112
+ actions:
113
+ create: Settings
114
+ edit: Save settings
115
+ update: Save settings
116
+ contact_email: E-mail
117
+ pages:
118
+ actions:
119
+ index:
120
+ header: Pages
121
+ title: Pages
122
+ labels:
123
+ actions:
124
+ create: Add page
125
+ edit: Save page
126
+ new: Add page
127
+ update: Save page
128
+
129
+ labels:
130
+ application:
131
+ admin: Dashboard
132
+ admin:
133
+ add: Add
134
+ add_child: Add child
135
+ back: Back
136
+ cancel: Cancel
137
+ destroy: Delete
138
+ edit: Edit
139
+ show: Show modifications
140
+ go_to_root: Home
141
+ info: Information
142
+ other: Other
143
+ legend:
144
+ common: Main
145
+ seo: SEO
146
+ logout: Logout
147
+ nav_published: Navigation
148
+ published: Published
149
+ locked: Locked
150
+ server_restart: Restart server
151
+ unpublished: Unpublished
152
+ batch_actions:
153
+ destroy: Delete
154
+ set_nav_published_off: Remove from navigation
155
+ set_nav_published_on: Add to navigation
156
+ set_published_off: Remove from publication
157
+ set_published_on: Publish
158
+
159
+ sites:
160
+ holding: Holding
161
+ construction: Construction
162
+
163
+ unauthorized:
164
+ default: You must login or register.