ui_bibz 2.5.6 → 3.0.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -2
  3. data/.rubocop.yml +78 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +1 -0
  7. data/Gemfile.lock +90 -102
  8. data/README.md +9 -52
  9. data/Rakefile +3 -2
  10. data/bin/test +7 -0
  11. data/config/initializers/will_paginate.rb +2 -1
  12. data/lib/ui_bibz.rb +17 -2
  13. data/lib/ui_bibz/concerns/models/searchable.rb +3 -3
  14. data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +9 -1
  15. data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +18 -0
  16. data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +10 -2
  17. data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +1 -1
  18. data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +9 -5
  19. data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -6
  20. data/lib/ui_bibz/infos.rb +11 -5
  21. data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +15 -2
  22. data/lib/ui_bibz/inputs/ui_bibz_inputs/base_input.rb +0 -4
  23. data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +6 -9
  24. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_choice_field_input.rb +23 -0
  25. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_slider_field_input.rb +11 -0
  26. data/lib/ui_bibz/rails/engine.rb +2 -13
  27. data/lib/ui_bibz/railtie.rb +6 -0
  28. data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +65 -0
  29. data/lib/ui_bibz/ui/concerns/html_concern.rb +16 -0
  30. data/lib/ui_bibz/ui/core/boxes/card.rb +5 -50
  31. data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +2 -0
  32. data/lib/ui_bibz/ui/core/boxes/card_column.rb +3 -1
  33. data/lib/ui_bibz/ui/core/boxes/card_deck.rb +3 -1
  34. data/lib/ui_bibz/ui/core/boxes/card_grid.rb +60 -0
  35. data/lib/ui_bibz/ui/core/boxes/card_group.rb +3 -1
  36. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_link.rb +0 -3
  37. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_subtitle.rb +47 -0
  38. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_text.rb +0 -3
  39. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_title.rb +1 -4
  40. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +7 -0
  41. data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +65 -0
  42. data/lib/ui_bibz/ui/core/boxes/components/card_footer.rb +0 -3
  43. data/lib/ui_bibz/ui/core/boxes/components/card_header.rb +2 -4
  44. data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +0 -3
  45. data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +65 -0
  46. data/lib/ui_bibz/ui/core/boxes/components/card_tab_group.rb +0 -4
  47. data/lib/ui_bibz/ui/core/boxes/jumbotron.rb +1 -4
  48. data/lib/ui_bibz/ui/core/component.rb +16 -9
  49. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +1 -1
  50. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +9 -11
  51. data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -3
  52. data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_dropdown.rb +0 -3
  53. data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_split_dropdown.rb +0 -3
  54. data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -10
  55. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +8 -7
  56. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +22 -2
  57. data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +24 -12
  58. data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +11 -6
  59. data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +1 -5
  60. data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +12 -15
  61. data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_divider.rb +0 -1
  62. data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb +0 -3
  63. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +8 -13
  64. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +0 -3
  65. data/lib/ui_bibz/ui/core/forms/files/file_field.rb +20 -10
  66. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +16 -8
  67. data/lib/ui_bibz/ui/core/forms/numbers/number_field.rb +20 -3
  68. data/lib/ui_bibz/ui/core/forms/numbers/range_field.rb +33 -5
  69. data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +132 -0
  70. data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +71 -0
  71. data/lib/ui_bibz/ui/core/forms/selects/abstract_select.rb +0 -3
  72. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +6 -9
  73. data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +0 -3
  74. data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +0 -3
  75. data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +2 -5
  76. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb +1 -4
  77. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +0 -3
  78. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_group.rb +0 -3
  79. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +0 -3
  80. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_refresh.rb +1 -12
  81. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_checkbox_field.rb +9 -4
  82. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +0 -3
  83. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_radio_field.rb +9 -4
  84. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_switch_field.rb +0 -3
  85. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +1 -4
  86. data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +4 -7
  87. data/lib/ui_bibz/ui/core/forms/texts/auto_complete_field.rb +2 -5
  88. data/lib/ui_bibz/ui/core/forms/texts/text_field.rb +0 -3
  89. data/lib/ui_bibz/ui/core/icons/components/glyph_counter.rb +0 -3
  90. data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -4
  91. data/lib/ui_bibz/ui/core/icons/glyph.rb +1 -4
  92. data/lib/ui_bibz/ui/core/icons/star.rb +0 -3
  93. data/lib/ui_bibz/ui/core/layouts/col.rb +5 -42
  94. data/lib/ui_bibz/ui/core/layouts/container.rb +9 -6
  95. data/lib/ui_bibz/ui/core/layouts/row.rb +32 -2
  96. data/lib/ui_bibz/ui/core/lists/components/list.rb +6 -8
  97. data/lib/ui_bibz/ui/core/lists/components/list/list_body.rb +0 -3
  98. data/lib/ui_bibz/ui/core/lists/components/list/list_header.rb +0 -3
  99. data/lib/ui_bibz/ui/core/lists/list_group.rb +9 -6
  100. data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +3 -2
  101. data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +0 -3
  102. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +1 -4
  103. data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +3 -1
  104. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +14 -5
  105. data/lib/ui_bibz/ui/core/navigations/components/nav_link_list.rb +0 -4
  106. data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -4
  107. data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +0 -3
  108. data/lib/ui_bibz/ui/core/navigations/components/navbar_brand.rb +0 -3
  109. data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +4 -4
  110. data/lib/ui_bibz/ui/core/navigations/components/navbar_nav.rb +1 -4
  111. data/lib/ui_bibz/ui/core/navigations/components/navbar_text.rb +0 -3
  112. data/lib/ui_bibz/ui/core/navigations/components/pagination_link.rb +0 -3
  113. data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +3 -3
  114. data/lib/ui_bibz/ui/core/navigations/link.rb +0 -3
  115. data/lib/ui_bibz/ui/core/navigations/nav.rb +37 -10
  116. data/lib/ui_bibz/ui/core/navigations/navbar.rb +28 -7
  117. data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -1
  118. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +10 -5
  119. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +2 -0
  120. data/lib/ui_bibz/ui/core/notifications/alert.rb +2 -2
  121. data/lib/ui_bibz/ui/core/notifications/badge.rb +2 -5
  122. data/lib/ui_bibz/ui/core/notifications/components/alert_body.rb +0 -3
  123. data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +4 -10
  124. data/lib/ui_bibz/ui/core/notifications/components/bar.rb +0 -3
  125. data/lib/ui_bibz/ui/core/notifications/components/toast_body.rb +0 -3
  126. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -6
  127. data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +7 -5
  128. data/lib/ui_bibz/ui/core/notifications/spinner.rb +0 -3
  129. data/lib/ui_bibz/ui/core/notifications/toast.rb +14 -3
  130. data/lib/ui_bibz/ui/core/windows/components/modal_body.rb +0 -3
  131. data/lib/ui_bibz/ui/core/windows/components/modal_footer.rb +0 -3
  132. data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -7
  133. data/lib/ui_bibz/ui/core/windows/modal.rb +61 -14
  134. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -2
  135. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +9 -9
  136. data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +2 -2
  137. data/lib/ui_bibz/ui/ux/containers/components/panel_body.rb +0 -3
  138. data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +2 -0
  139. data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +2 -0
  140. data/lib/ui_bibz/ui/ux/containers/components/panel_footer.rb +0 -3
  141. data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +2 -0
  142. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +1 -4
  143. data/lib/ui_bibz/ui/ux/containers/components/panel_tab_group.rb +0 -4
  144. data/lib/ui_bibz/ui/ux/containers/components/panel_toolbar.rb +0 -3
  145. data/lib/ui_bibz/ui/ux/containers/panel.rb +4 -2
  146. data/lib/ui_bibz/ui/ux/tables/components/thead.rb +0 -3
  147. data/lib/ui_bibz/ui/ux/tables/table.rb +2 -4
  148. data/lib/ui_bibz/ui/ux/tables/table_card.rb +4 -3
  149. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +5 -5
  150. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +69 -0
  151. data/lib/ui_bibz/utils/internationalization.rb +1 -1
  152. data/lib/ui_bibz/utils/screwdriver.rb +16 -10
  153. data/package.json +5 -0
  154. data/test/dummy/Rakefile +1 -1
  155. data/test/dummy/app/javascripts/packs/index.js +3 -0
  156. data/test/dummy/app/views/layouts/application.html.erb +4 -1
  157. data/{app/ui/.keep → test/dummy/app/views/users/index.html.erb} +0 -0
  158. data/test/dummy/bin/setup +17 -13
  159. data/test/dummy/config.ru +2 -1
  160. data/test/dummy/config/application.rb +1 -0
  161. data/test/dummy/config/cable.yml +10 -0
  162. data/test/dummy/config/database.yml +1 -1
  163. data/test/dummy/config/environment.rb +1 -1
  164. data/test/dummy/config/environments/development.rb +33 -12
  165. data/test/dummy/config/environments/production.rb +52 -19
  166. data/test/dummy/config/environments/test.rb +18 -12
  167. data/test/dummy/config/initializers/application_controller_renderer.rb +9 -0
  168. data/test/dummy/config/initializers/assets.rb +4 -3
  169. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -1
  170. data/test/dummy/config/initializers/content_security_policy.rb +29 -0
  171. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  172. data/test/dummy/config/initializers/inflections.rb +0 -1
  173. data/test/dummy/config/initializers/mime_types.rb +0 -1
  174. data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
  175. data/test/dummy/config/puma.rb +40 -0
  176. data/test/dummy/config/routes.rb +3 -0
  177. data/test/dummy/config/spring.rb +8 -0
  178. data/test/dummy/config/storage.yml +34 -0
  179. data/test/dummy/db/migrate/20150123191805_create_users.rb +1 -1
  180. data/test/dummy/db/schema.rb +24 -24
  181. data/test/dummy/public/404.html +6 -6
  182. data/test/dummy/public/422.html +6 -6
  183. data/test/dummy/public/500.html +6 -6
  184. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  185. data/test/dummy/public/apple-touch-icon.png +0 -0
  186. data/test/dummy/storage/.keep +0 -0
  187. data/test/simple_form_test.rb +45 -22
  188. data/test/store_test.rb +5 -5
  189. data/test/test_helper.rb +18 -9
  190. data/test/ui/core/boxes/card_grid_test.rb +17 -0
  191. data/test/ui/core/boxes/card_test.rb +45 -11
  192. data/test/ui/core/boxes/jumbotron_test.rb +2 -2
  193. data/test/ui/core/component_test.rb +1 -1
  194. data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
  195. data/test/ui/core/forms/buttons/button_test.rb +2 -2
  196. data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
  197. data/test/ui/core/forms/choices/choice_group_test.rb +11 -9
  198. data/test/ui/core/forms/choices/radio_field_test.rb +1 -1
  199. data/test/ui/core/forms/dates/date_picker_field_test.rb +1 -1
  200. data/test/ui/core/forms/files/file_field_test.rb +12 -0
  201. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
  202. data/test/ui/core/forms/numbers/range_field_test.rb +23 -2
  203. data/test/ui/core/forms/numbers/slider_field_test.rb +26 -0
  204. data/test/ui/core/forms/selects/dropdown_select_field_test.rb +10 -10
  205. data/test/ui/core/forms/selects/multi_column_field_test.rb +1 -1
  206. data/test/ui/core/forms/selects/multi_select_field_test.rb +2 -2
  207. data/test/ui/core/forms/selects/select_field_test.rb +3 -3
  208. data/test/ui/core/forms/surrounds/surround_field_test.rb +15 -3
  209. data/test/ui/core/forms/textareas/markdown_editor_field_test.rb +1 -1
  210. data/test/ui/core/forms/texts/auto_complete_field_test.rb +8 -8
  211. data/test/ui/core/forms/texts/text_field_test.rb +2 -2
  212. data/test/ui/core/layouts/col_test.rb +11 -2
  213. data/test/ui/core/layouts/container_test.rb +15 -1
  214. data/test/ui/core/layouts/row_test.rb +68 -3
  215. data/test/ui/core/lists/list_group_test.rb +1 -1
  216. data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
  217. data/test/ui/core/navigations/link_test.rb +1 -1
  218. data/test/ui/core/navigations/nav_test.rb +11 -0
  219. data/test/ui/core/navigations/navbar_test.rb +4 -4
  220. data/test/ui/core/notifications/alert_test.rb +2 -2
  221. data/test/ui/core/notifications/badge_test.rb +3 -3
  222. data/test/ui/core/notifications/progress_bar_test.rb +1 -1
  223. data/test/ui/core/notifications/toast_test.rb +10 -1
  224. data/test/ui/core/windows/modal_test.rb +15 -1
  225. data/test/ui/utils/breakdown_class_name_generator_test.rb +60 -0
  226. data/test/ui/ux/containers/panel_test.rb +5 -5
  227. data/test/ui/ux/tables/table_test.rb +6 -6
  228. data/test/ui_bibz_test.rb +1 -1
  229. data/ui_bibz.gemspec +16 -16
  230. metadata +100 -105
  231. data/app/assets/javascripts/fix_bootstrap.coffee +0 -7
  232. data/app/assets/javascripts/form.coffee +0 -83
  233. data/app/assets/javascripts/formula.coffee +0 -69
  234. data/app/assets/javascripts/input-connected.coffee +0 -101
  235. data/app/assets/javascripts/interface.coffee +0 -55
  236. data/app/assets/javascripts/jquery.multi-select-extend.coffee +0 -38
  237. data/app/assets/javascripts/table.coffee +0 -36
  238. data/app/assets/javascripts/ui_bibz.coffee.erb +0 -75
  239. data/app/assets/stylesheets/_custom_variables.sass +0 -20
  240. data/app/assets/stylesheets/_panel.scss +0 -315
  241. data/app/assets/stylesheets/bootstrap-switch.sass +0 -159
  242. data/app/assets/stylesheets/boxes.sass +0 -5
  243. data/app/assets/stylesheets/containers.sass +0 -2
  244. data/app/assets/stylesheets/fix-bootstrap-4.sass +0 -19
  245. data/app/assets/stylesheets/fix_addon.sass +0 -216
  246. data/app/assets/stylesheets/forms.sass +0 -91
  247. data/app/assets/stylesheets/navigations.sass +0 -17
  248. data/app/assets/stylesheets/notifications.sass +0 -42
  249. data/app/assets/stylesheets/tables.sass +0 -66
  250. data/app/assets/stylesheets/ui_bibz.sass.erb +0 -55
  251. data/lib/generators/ui_bibz/install_generator.rb +0 -17
  252. data/lib/generators/ui_bibz/templates/ui_bibz_initializer.rb +0 -5
  253. data/lib/ui_bibz/ui/core/icons/glyph_group.rb +0 -101
  254. data/test/dummy/bin/bundle +0 -5
  255. data/test/ui/core/forms/files/text_field_test.rb +0 -12
  256. data/test/ui/core/icons/glyph_group_test.rb +0 -37
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Puma can serve each request in a thread from an internal thread pool.
4
+ # The `threads` method setting takes two numbers: a minimum and maximum.
5
+ # Any libraries that use thread pools should be configured to match
6
+ # the maximum value specified for Puma. Default is set to 5 threads for minimum
7
+ # and maximum; this matches the default thread size of Active Record.
8
+ #
9
+ max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
10
+ min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
11
+ threads min_threads_count, max_threads_count
12
+
13
+ # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
14
+ #
15
+ port ENV.fetch("PORT", 3000)
16
+
17
+ # Specifies the `environment` that Puma will run in.
18
+ #
19
+ environment ENV.fetch("RAILS_ENV", "development")
20
+
21
+ # Specifies the `pidfile` that Puma will use.
22
+ pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid")
23
+
24
+ # Specifies the number of `workers` to boot in clustered mode.
25
+ # Workers are forked web server processes. If using threads and workers together
26
+ # the concurrency of the application would be max `threads` * `workers`.
27
+ # Workers do not work on JRuby or Windows (both of which do not support
28
+ # processes).
29
+ #
30
+ # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
31
+
32
+ # Use the `preload_app!` method when specifying a `workers` number.
33
+ # This directive tells Puma to first boot the application and load code
34
+ # before forking the application. This takes advantage of Copy On Write
35
+ # process behavior so workers use less memory.
36
+ #
37
+ # preload_app!
38
+
39
+ # Allow puma to be restarted by `rails restart` command.
40
+ plugin :tmp_restart
@@ -2,6 +2,9 @@
2
2
 
3
3
  Rails.application.routes.draw do
4
4
  resources :users
5
+
6
+ root to: "users#index"
7
+
5
8
  # The priority is based upon order of creation: first created -> highest priority.
6
9
  # See how all your routes lay out with "rake routes".
7
10
 
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ Spring.watch(
4
+ ".ruby-version",
5
+ ".rbenv-vars",
6
+ "tmp/restart.txt",
7
+ "tmp/caching-dev.txt"
8
+ )
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class CreateUsers < ActiveRecord::Migration
3
+ class CreateUsers < ActiveRecord::Migration[4.2]
4
4
  def change
5
5
  create_table :users do |t|
6
6
  t.string :name_fr
@@ -4,37 +4,37 @@
4
4
  # of editing this file, please use the migrations feature of Active Record to
5
5
  # incrementally modify your database, and then regenerate this schema definition.
6
6
  #
7
- # Note that this schema.rb definition is the authoritative source for your
8
- # database schema. If you need to create the application database on another
9
- # system, you should be using db:schema:load, not running all the migrations
10
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
11
- # you'll amass, the slower it'll run and the greater likelihood for issues).
7
+ # This file is the source Rails uses to define your schema when running `rails
8
+ # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
9
+ # be faster and is potentially less error prone than running all of your
10
+ # migrations from scratch. Old migrations may fail to apply correctly if those
11
+ # migrations use external dependencies or application code.
12
12
  #
13
13
  # It's strongly recommended that you check this file into your version control system.
14
14
 
15
15
  ActiveRecord::Schema.define(version: 20_170_309_084_453) do
16
- create_table 'continents', force: :cascade do |t|
17
- t.string 'name'
18
- t.datetime 'created_at', null: false
19
- t.datetime 'updated_at', null: false
16
+ create_table "continents", force: :cascade do |t|
17
+ t.string "name"
18
+ t.datetime "created_at", null: false
19
+ t.datetime "updated_at", null: false
20
20
  end
21
21
 
22
- create_table 'countries', force: :cascade do |t|
23
- t.string 'name'
24
- t.integer 'continent_id'
25
- t.datetime 'created_at', null: false
26
- t.datetime 'updated_at', null: false
22
+ create_table "countries", force: :cascade do |t|
23
+ t.string "name"
24
+ t.integer "continent_id"
25
+ t.datetime "created_at", null: false
26
+ t.datetime "updated_at", null: false
27
27
  end
28
28
 
29
- create_table 'users', force: :cascade do |t|
30
- t.string 'name_fr'
31
- t.string 'name_en'
32
- t.string 'body_fr'
33
- t.string 'body_en'
34
- t.boolean 'active'
35
- t.float 'price'
36
- t.string 'price_formula'
37
- t.datetime 'created_at', null: false
38
- t.datetime 'updated_at', null: false
29
+ create_table "users", force: :cascade do |t|
30
+ t.string "name_fr"
31
+ t.string "name_en"
32
+ t.string "body_fr"
33
+ t.string "body_en"
34
+ t.boolean "active"
35
+ t.float "price"
36
+ t.string "price_formula"
37
+ t.datetime "created_at", null: false
38
+ t.datetime "updated_at", null: false
39
39
  end
40
40
  end
@@ -4,7 +4,7 @@
4
4
  <title>The page you were looking for doesn't exist (404)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/404.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -4,7 +4,7 @@
4
4
  <title>The change you wanted was rejected (422)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/422.html -->
59
59
  <div class="dialog">
60
60
  <div>
@@ -4,7 +4,7 @@
4
4
  <title>We're sorry, but something went wrong (500)</title>
5
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
6
  <style>
7
- body {
7
+ .rails-default-error-page {
8
8
  background-color: #EFEFEF;
9
9
  color: #2E2F30;
10
10
  text-align: center;
@@ -12,13 +12,13 @@
12
12
  margin: 0;
13
13
  }
14
14
 
15
- div.dialog {
15
+ .rails-default-error-page div.dialog {
16
16
  width: 95%;
17
17
  max-width: 33em;
18
18
  margin: 4em auto 0;
19
19
  }
20
20
 
21
- div.dialog > div {
21
+ .rails-default-error-page div.dialog > div {
22
22
  border: 1px solid #CCC;
23
23
  border-right-color: #999;
24
24
  border-left-color: #999;
@@ -31,13 +31,13 @@
31
31
  box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
32
  }
33
33
 
34
- h1 {
34
+ .rails-default-error-page h1 {
35
35
  font-size: 100%;
36
36
  color: #730E15;
37
37
  line-height: 1.5em;
38
38
  }
39
39
 
40
- div.dialog > p {
40
+ .rails-default-error-page div.dialog > p {
41
41
  margin: 0 0 1em;
42
42
  padding: 1em;
43
43
  background-color: #F7F7F7;
@@ -54,7 +54,7 @@
54
54
  </style>
55
55
  </head>
56
56
 
57
- <body>
57
+ <body class="rails-default-error-page">
58
58
  <!-- This file lives in public/500.html -->
59
59
  <div class="dialog">
60
60
  <div>
File without changes
File without changes
@@ -26,7 +26,7 @@ class SimpleFormTest < ActionView::TestCase
26
26
  f.input :name_fr, as: :ui_auto_complete_field, collection: @users, label_method: :name_fr
27
27
  end
28
28
 
29
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_auto_complete_field optional user_name_fr\"><label class=\"control-label ui_auto_complete_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"user_name_fr-datalist\" /><datalist id=\"user_name_fr-datalist\"><option value=\"1\">test1</option>
29
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_auto_complete_field optional user_name_fr\"><label class=\"control-label ui_auto_complete_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control auto-complete-field\" autocomplete=\"true\" list=\"user_name_fr-datalist\" /><datalist id=\"user_name_fr-datalist\"><option value=\"1\">test1</option>
30
30
  <option value=\"2\">test2</option></datalist></div></form>"
31
31
 
32
32
  assert_equal expected, actual
@@ -37,7 +37,7 @@ class SimpleFormTest < ActionView::TestCase
37
37
  f.input :created_at, as: :ui_date_picker_field
38
38
  end
39
39
 
40
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_date_picker_field optional user_created_at"><label class="control-label ui_date_picker_field optional" for="user_created_at">Created at</label><input type="text" name="user[created_at]" id="user_created_at" value="2017-04-26 14:48:43 UTC" class="ui_date_picker_field optional date_picker form-control" data-date-locale="en" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-btn="linked" data-date-toggle-active="true" /></div></form>'
40
+ expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_date_picker_field optional user_created_at"><label class="control-label ui_date_picker_field optional" for="user_created_at">Created at</label><input type="text" name="user[created_at]" id="user_created_at" value="2017-04-26 14:48:43 UTC" class="ui_date_picker_field optional date_picker form-control" data-date-locale="en" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-btn="linked" data-date-toggle-active="true" /></div></form>'
41
41
 
42
42
  assert_equal expected, actual
43
43
  end
@@ -47,7 +47,7 @@ class SimpleFormTest < ActionView::TestCase
47
47
  f.input :name_fr, as: :ui_dropdown_select_field, collection: @users, label_method: :name_fr
48
48
  end
49
49
 
50
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><option value=\"1\">test1</option>
50
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><option value=\"1\">test1</option>
51
51
  <option value=\"2\">test2</option></select></div></form>"
52
52
 
53
53
  assert_equal expected, actual
@@ -58,7 +58,7 @@ class SimpleFormTest < ActionView::TestCase
58
58
  f.input :name_fr, as: :ui_dropdown_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
59
59
  end
60
60
 
61
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
61
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
62
62
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
63
63
 
64
64
  assert_equal expected, actual
@@ -72,7 +72,7 @@ class SimpleFormTest < ActionView::TestCase
72
72
  f.input :price, as: :ui_formula_field
73
73
  end
74
74
 
75
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_formula_field optional user_price"><label class="control-label ui_formula_field optional" for="user_price">Price</label><div class="formula_field input-group ui_surround_field"><input type="text" name="user[price_formula]" id="user_price_formula" value="1+2" class="ui_formula_field optional formula-field form-control" formula_field_value="1+2" /><span class="formula-field-sign input-group-addon">=</span><input type="text" name="user[price]" id="user_price" value="3.0" class="formula-field-result form-control" readonly="readonly" /><span data-toggle="tooltip" class="formula-field-alert input-group-addon"><i class="glyph-danger glyph fas fa-exclamation-triangle"></i></span></div></div></form>'
75
+ expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_formula_field optional user_price"><label class="control-label ui_formula_field optional" for="user_price">Price</label><div class="formula_field input-group ui_surround_field"><input type="text" name="user[price_formula]" id="user_price_formula" value="1+2" class="ui_formula_field optional formula-field form-control" formula_field_value="1+2" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="user[price]" id="user_price" value="3.0" class="formula-field-result form-control" readonly="readonly" /><span data-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph fas fa-exclamation-triangle"></i></span></div></div></form>'
76
76
 
77
77
  assert_equal expected, actual
78
78
  end
@@ -82,7 +82,7 @@ class SimpleFormTest < ActionView::TestCase
82
82
  f.input :name_fr, as: :ui_markdown_editor_field
83
83
  end
84
84
 
85
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_markdown_editor_field optional user_name_fr\"><label class=\"control-label ui_markdown_editor_field optional\" for=\"user_name_fr\">Name fr</label><textarea name=\"user[name_fr]\" id=\"user_name_fr\" class=\"ui_markdown_editor_field optional\" data-provide=\"markdown\" data-iconlibrary=\"fa-5\">
85
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_markdown_editor_field optional user_name_fr\"><label class=\"control-label ui_markdown_editor_field optional\" for=\"user_name_fr\">Name fr</label><textarea name=\"user[name_fr]\" id=\"user_name_fr\" class=\"ui_markdown_editor_field optional\" data-provide=\"markdown\" data-iconlibrary=\"fa\">
86
86
  test1</textarea></div></form>"
87
87
 
88
88
  assert_equal expected, actual
@@ -93,7 +93,7 @@ test1</textarea></div></form>"
93
93
  f.input :name_fr, as: :ui_multi_column_field, collection: @users, label_method: :name_fr
94
94
  end
95
95
 
96
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_column_field optional user_name_fr\"><label class=\"control-label ui_multi_column_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"name_fr[]\" id=\"name_fr\" class=\"multi-column-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
96
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_column_field optional user_name_fr\"><label class=\"control-label ui_multi_column_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"name_fr[]\" id=\"name_fr\" class=\"multi-column-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
97
97
  <option value=\"2\">test2</option></select></div></form>"
98
98
 
99
99
  assert_equal expected, actual
@@ -104,7 +104,7 @@ test1</textarea></div></form>"
104
104
  f.input :name_fr, as: :ui_multi_select_field, collection: @users, label_method: :name_fr
105
105
  end
106
106
 
107
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
107
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
108
108
  <option value=\"2\">test2</option></select></div></form>"
109
109
 
110
110
  assert_equal expected, actual
@@ -115,7 +115,7 @@ test1</textarea></div></form>"
115
115
  f.input :name_fr, as: :ui_multi_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
116
116
  end
117
117
 
118
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
118
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
119
119
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
120
120
 
121
121
  assert_equal expected, actual
@@ -126,7 +126,7 @@ test1</textarea></div></form>"
126
126
  f.input :name_fr, as: :ui_text_field
127
127
  end
128
128
 
129
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_text_field optional user_name_fr\"><label class=\"control-label ui_text_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"ui_text_field\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control string ui_text_field optional\" /></div></form>"
129
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_text_field optional user_name_fr\"><label class=\"control-label ui_text_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"ui_text_field\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control string ui_text_field optional\" /></div></form>"
130
130
 
131
131
  assert_equal expected, actual
132
132
  end
@@ -137,7 +137,7 @@ test1</textarea></div></form>"
137
137
  f.input :active, as: :ui_box_switch_field, collection: @users, label_method: :name_fr
138
138
  end
139
139
 
140
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_box_switch_field optional user_active"><label class="control-label ui_box_switch_field optional" for="user_active">Active</label><div class="switch-field-container"><input type="hidden" name="user[active]" id="user_active" value="0" /><input type="checkbox" name="user[active]" id="user_active" value="1" class="ui_box_switch_field optional switch-field" checked="checked" /></div></div></form>'
140
+ expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_box_switch_field optional user_active"><label class="control-label ui_box_switch_field optional" for="user_active">Active</label><div class="switch-field-container"><input type="hidden" name="user[active]" id="user_active" value="0" /><input type="checkbox" name="user[active]" id="user_active" value="1" class="ui_box_switch_field optional switch-field" checked="checked" /></div></div></form>'
141
141
 
142
142
  assert_equal expected, actual
143
143
  end
@@ -147,7 +147,7 @@ test1</textarea></div></form>"
147
147
  f.input :name_fr, as: :ui_radio_field, collection: @users, label_method: :name_fr
148
148
  end
149
149
 
150
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_radio_field optional user_name_fr"><label class="control-label ui_radio_field optional">Name fr</label><input type="hidden" name="user[name_fr]" value="" /><div class="radio ui_radio_field optional custom-control custom-radio"><input class="ui_radio_field optional custom-control custom-radio" type="radio" value="1" name="user[name_fr]" id="user_name_fr_1" /><label class="collection_radio_buttons" for="user_name_fr_1">test1</label></div><div class="radio ui_radio_field optional custom-control custom-radio"><input class="ui_radio_field optional custom-control custom-radio" type="radio" value="2" name="user[name_fr]" id="user_name_fr_2" /><label class="collection_radio_buttons" for="user_name_fr_2">test2</label></div></div></form>'
150
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_radio_field optional user_name_fr\"><label class=\"control-label ui_radio_field optional\">Name fr</label><input type=\"hidden\" name=\"user[name_fr]\" value=\"\" /><div class=\"radio ui_radio_field optional form-check\"><input class=\"ui_radio_field optional form-check\" type=\"radio\" value=\"1\" name=\"user[name_fr]\" id=\"user_name_fr_1\" /><label class=\"collection_radio_buttons\" for=\"user_name_fr_1\">test1</label></div><div class=\"radio ui_radio_field optional form-check\"><input class=\"ui_radio_field optional form-check\" type=\"radio\" value=\"2\" name=\"user[name_fr]\" id=\"user_name_fr_2\" /><label class=\"collection_radio_buttons\" for=\"user_name_fr_2\">test2</label></div></div></form>"
151
151
 
152
152
  assert_equal expected, actual
153
153
  end
@@ -157,7 +157,7 @@ test1</textarea></div></form>"
157
157
  f.input :name_fr, as: :ui_select_field, collection: @users, label_method: :name_fr
158
158
  end
159
159
 
160
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field custom-select\"><option value=\"1\">test1</option>
160
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option value=\"1\">test1</option>
161
161
  <option value=\"2\">test2</option></select></div></form>"
162
162
 
163
163
  assert_equal expected, actual
@@ -168,8 +168,8 @@ test1</textarea></div></form>"
168
168
  f.input :name_fr, as: :ui_select_field, refresh: { target: { data: [] } }, collection: @users, label_method: :name_fr
169
169
  end
170
170
 
171
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"field-refresh input-group ui_surround_field\"><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field custom-select\"><option value=\"1\">test1</option>
172
- <option value=\"2\">test2</option></select><div class=\"input-group-btn\"><span data-connect=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;#user_name_fr&quot;,&quot;url&quot;:&quot;&quot;,&quot;data&quot;:[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i> </span></div></div></div></form>"
171
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"field-refresh input-group ui_surround_field\"><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option value=\"1\">test1</option>
172
+ <option value=\"2\">test2</option></select><span data-connect=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;#user_name_fr&quot;,&quot;url&quot;:&quot;&quot;,&quot;data&quot;:[]}}\" class=\"btn-secondary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fas fa-sync-alt\"></i> </span></div></div></form>"
173
173
 
174
174
  assert_equal expected, actual
175
175
  end
@@ -179,7 +179,7 @@ test1</textarea></div></form>"
179
179
  f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
180
180
  end
181
181
 
182
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field custom-select\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
182
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
183
183
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
184
184
 
185
185
  assert_equal expected, actual
@@ -191,7 +191,7 @@ test1</textarea></div></form>"
191
191
  f.input :name_fr, as: :ui_select_field, collection: @countries
192
192
  end
193
193
 
194
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field custom-select\"><option selected=\"selected\" value=\"1\">France</option>
194
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option selected=\"selected\" value=\"1\">France</option>
195
195
  <option value=\"2\">Deutchland</option></select></div></form>"
196
196
 
197
197
  assert_equal expected, actual
@@ -203,7 +203,7 @@ test1</textarea></div></form>"
203
203
  f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
204
204
  end
205
205
 
206
- expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field custom-select\"><optgroup label=\"Europe\"><option selected=\"selected\" value=\"1\">France</option>
206
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><optgroup label=\"Europe\"><option selected=\"selected\" value=\"1\">France</option>
207
207
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
208
208
 
209
209
  assert_equal expected, actual
@@ -214,7 +214,7 @@ test1</textarea></div></form>"
214
214
  f.input :name_fr, as: :ui_number_field
215
215
  end
216
216
 
217
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_number_field optional user_name_fr"><label class="control-label ui_number_field optional" for="user_name_fr">Name fr</label><input type="number" name="user[name_fr]" id="user_name_fr" value="test1" class="form-control ui_number_field optional" /></div></form>'
217
+ expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_number_field optional user_name_fr"><label class="control-label ui_number_field optional" for="user_name_fr">Name fr</label><input type="number" name="user[name_fr]" id="user_name_fr" value="test1" class="form-control ui_number_field optional" /></div></form>'
218
218
 
219
219
  assert_equal expected, actual
220
220
  end
@@ -224,7 +224,7 @@ test1</textarea></div></form>"
224
224
  f.input :name_fr, as: :ui_file_field
225
225
  end
226
226
 
227
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_file_field optional user_name_fr"><label class="control-label ui_file_field optional" for="user_name_fr">Name fr</label><div class="ui_file_field optional custom-file"><input type="file" name="user[name_fr]" id="user_name_fr" class="custom-file-input" /><label class="custom-file-label" for="user_name_fr">test1</label></div></div></form>'
227
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"ui_file_field optional form-file\"><input type=\"file\" name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-file-input\" /><label class=\"form-file-label\" for=\"user_name_fr\"><span class=\"form-file-text\">test1</span><span class=\"form-file-button\">Browse</span></label></div></div></form>"
228
228
 
229
229
  assert_equal expected, actual
230
230
  end
@@ -234,11 +234,34 @@ test1</textarea></div></form>"
234
234
  f.input :name_fr, as: :ui_range_field
235
235
  end
236
236
 
237
- expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="&#x2713;" /><input type="hidden" name="_method" value="patch" /><div class="form-group ui_range_field optional user_name_fr"><label class="control-label ui_range_field optional" for="user_name_fr">Name fr</label><input type="range" name="user[name_fr]" id="user_name_fr" value="test1" class="ui_range_field optional custom-range" /></div></form>'
237
+ expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_range_field optional user_name_fr"><label class="control-label ui_range_field optional" for="user_name_fr">Name fr</label><input type="range" name="user[name_fr]" id="user_name_fr" value="test1" class="ui_range_field optional form-range" /></div></form>'
238
238
 
239
239
  assert_equal expected, actual
240
240
  end
241
241
 
242
+ test 'slider field' do
243
+ actual = simple_form_for @user do |f|
244
+ f.input :name_en, as: :ui_slider_field
245
+ end
246
+
247
+ expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_slider_field optional user_name_en\"><label class=\"control-label ui_slider_field optional\" for=\"user_name_en\">Name en</label><div class=\"ui_slider_field optional slider\"><div><div class=\"slider-inverse-left\" style=\"width: 100%\"></div><div class=\"slider-inverse-right\" style=\"width: 100%\"></div><div class=\"slider-range\" style=\"left: 0%; right: 0%\"></div><div class=\"slider-thumb slider-thumb-left\" style=\"left: 0%\"></div><div class=\"slider-thumb slider-thumb-right\" style=\"left: 100%\"></div></div><input type=\"range\" name=\"user[name_en_min]\" id=\"user_name_en_min\" value=\"0\" max=\"100\" min=\"0\" step=\"1\" /><input type=\"range\" name=\"user[name_en_max]\" id=\"user_name_en_max\" value=\"100\" max=\"100\" min=\"0\" step=\"1\" /></div></div></form>"
248
+
249
+ assert_equal expected, actual
250
+ end
251
+
252
+ # test 'choice field' do
253
+ # actual = ui_form_for @user do |f|
254
+ # f.ui_choice_group do |cg|
255
+ # cg.input :name_fr, as: :ui_choice_field
256
+ # cg.input :name_fr, as: :ui_choice_field
257
+ # end
258
+ # end
259
+ #
260
+ # expected = "<form class=\"simple_form\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"button_group\"><div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"choice-21472\" /><label class=\"btn-secondary btn checkbox\" checked=\"checked\" for=\"choice-21472\">Name Fr</label><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"choice-13741\" /><label class=\"btn-secondary btn checkbox\" checked=\"checked\" for=\"choice-13741\">Name Fr</label></div></div></form>"
261
+ #
262
+ # assert_equal expected, actual
263
+ # end
264
+
242
265
  # test 'test surround field into simple form' do
243
266
  # actual = ui_form_for @user do |f|
244
267
  # concat(f.ui_surround_field do |sf|
@@ -248,7 +271,7 @@ test1</textarea></div></form>"
248
271
  # concat f.input(:name_fr, as: :ui_auto_complete_field, collection: @users, label_method: :name_fr)
249
272
  # end
250
273
  #
251
- # expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div><div class=\"input-group\"><input type=\"text\" name=\"user[name_en]\" id=\"user_name_en\" value=\"test1 en\" class=\"text_field optional form-control\" /><span class=\"input-group-addon\">€</span></div></div><div class=\"form-group ui_auto_complete_field optional user_name_fr\"><label class=\"control-label ui_auto_complete_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_auto_complete_field optional form-control auto-complete-field\" autocomplete=\"true\" list=\"user_name_fr-datalist\" /><datalist id=\"user_name_fr-datalist\"><option value=\"1\">test1</option>
274
+ # expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div><div class=\"input-group\"><input type=\"text\" name=\"user[name_en]\" id=\"user_name_en\" value=\"test1 en\" class=\"text_field optional form-control\" /><span class=\"input-group-text\">€</span></div></div><div class=\"form-group ui_auto_complete_field optional user_name_fr\"><label class=\"control-label ui_auto_complete_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_auto_complete_field optional form-control auto-complete-field\" autocomplete=\"true\" list=\"user_name_fr-datalist\" /><datalist id=\"user_name_fr-datalist\"><option value=\"1\">test1</option>
252
275
  # <option value=\"2\">test2</option></datalist></div></form>"
253
276
  #
254
277
  # assert_equal expected, actual