ui_bibz 2.5.5 → 3.0.0.alpha6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -2
  3. data/.rubocop.yml +89 -1
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +1 -0
  7. data/Gemfile.lock +96 -108
  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 -3
  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 +20 -1
  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 +4 -7
  23. data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +6 -9
  24. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb +5 -1
  25. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_choice_field_input.rb +23 -0
  26. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_multi_select_field_input.rb +3 -3
  27. data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_slider_field_input.rb +12 -0
  28. data/lib/ui_bibz/rails/engine.rb +1 -16
  29. data/lib/ui_bibz/railtie.rb +6 -0
  30. data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +67 -0
  31. data/lib/ui_bibz/ui/concerns/html_concern.rb +16 -0
  32. data/lib/ui_bibz/ui/core/boxes/card.rb +5 -50
  33. data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +2 -0
  34. data/lib/ui_bibz/ui/core/boxes/card_column.rb +3 -1
  35. data/lib/ui_bibz/ui/core/boxes/card_deck.rb +3 -1
  36. data/lib/ui_bibz/ui/core/boxes/card_grid.rb +60 -0
  37. data/lib/ui_bibz/ui/core/boxes/card_group.rb +3 -1
  38. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_link.rb +0 -3
  39. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_subtitle.rb +47 -0
  40. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_text.rb +0 -3
  41. data/lib/ui_bibz/ui/core/boxes/components/body/card_body_title.rb +1 -4
  42. data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +15 -0
  43. data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +65 -0
  44. data/lib/ui_bibz/ui/core/boxes/components/card_footer.rb +0 -3
  45. data/lib/ui_bibz/ui/core/boxes/components/card_header.rb +2 -4
  46. data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +1 -4
  47. data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +65 -0
  48. data/lib/ui_bibz/ui/core/boxes/components/card_tab_group.rb +0 -4
  49. data/lib/ui_bibz/ui/core/boxes/jumbotron.rb +1 -4
  50. data/lib/ui_bibz/ui/core/component.rb +16 -9
  51. data/lib/ui_bibz/ui/core/forms/buttons/button.rb +2 -2
  52. data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +9 -11
  53. data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -3
  54. data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_dropdown.rb +0 -3
  55. data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_split_dropdown.rb +0 -3
  56. data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -10
  57. data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +20 -10
  58. data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +22 -2
  59. data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +24 -12
  60. data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +17 -6
  61. data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +5 -5
  62. data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +12 -15
  63. data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_divider.rb +0 -1
  64. data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb +0 -3
  65. data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +19 -20
  66. data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +7 -5
  67. data/lib/ui_bibz/ui/core/forms/files/file_field.rb +20 -10
  68. data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +16 -8
  69. data/lib/ui_bibz/ui/core/forms/numbers/number_field.rb +20 -3
  70. data/lib/ui_bibz/ui/core/forms/numbers/range_field.rb +51 -5
  71. data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +144 -0
  72. data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +71 -0
  73. data/lib/ui_bibz/ui/core/forms/selects/abstract_select.rb +0 -3
  74. data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +41 -62
  75. data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +0 -3
  76. data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +2 -5
  77. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb +1 -4
  78. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +0 -3
  79. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_group.rb +0 -3
  80. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +0 -3
  81. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_refresh.rb +1 -12
  82. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_checkbox_field.rb +9 -4
  83. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +0 -3
  84. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_radio_field.rb +9 -4
  85. data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_switch_field.rb +0 -3
  86. data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +4 -12
  87. data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +4 -7
  88. data/lib/ui_bibz/ui/core/forms/texts/auto_complete_field.rb +2 -5
  89. data/lib/ui_bibz/ui/core/forms/texts/text_field.rb +0 -3
  90. data/lib/ui_bibz/ui/core/icons/components/glyph_counter.rb +0 -3
  91. data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -4
  92. data/lib/ui_bibz/ui/core/icons/glyph.rb +1 -4
  93. data/lib/ui_bibz/ui/core/icons/star.rb +0 -3
  94. data/lib/ui_bibz/ui/core/layouts/col.rb +5 -42
  95. data/lib/ui_bibz/ui/core/layouts/container.rb +9 -6
  96. data/lib/ui_bibz/ui/core/layouts/row.rb +32 -2
  97. data/lib/ui_bibz/ui/core/lists/components/list.rb +6 -8
  98. data/lib/ui_bibz/ui/core/lists/components/list/list_body.rb +0 -3
  99. data/lib/ui_bibz/ui/core/lists/components/list/list_header.rb +0 -3
  100. data/lib/ui_bibz/ui/core/lists/list_group.rb +9 -6
  101. data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +3 -2
  102. data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +0 -3
  103. data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +2 -5
  104. data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +3 -1
  105. data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +15 -6
  106. data/lib/ui_bibz/ui/core/navigations/components/nav_link_list.rb +0 -4
  107. data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -4
  108. data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +0 -3
  109. data/lib/ui_bibz/ui/core/navigations/components/navbar_brand.rb +0 -3
  110. data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +4 -4
  111. data/lib/ui_bibz/ui/core/navigations/components/navbar_nav.rb +1 -4
  112. data/lib/ui_bibz/ui/core/navigations/components/navbar_text.rb +0 -3
  113. data/lib/ui_bibz/ui/core/navigations/components/pagination_link.rb +0 -3
  114. data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +3 -3
  115. data/lib/ui_bibz/ui/core/navigations/link.rb +0 -3
  116. data/lib/ui_bibz/ui/core/navigations/nav.rb +37 -10
  117. data/lib/ui_bibz/ui/core/navigations/navbar.rb +28 -7
  118. data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -1
  119. data/lib/ui_bibz/ui/core/navigations/tab_group.rb +10 -5
  120. data/lib/ui_bibz/ui/core/navigations/toolbar.rb +2 -0
  121. data/lib/ui_bibz/ui/core/notifications/alert.rb +2 -2
  122. data/lib/ui_bibz/ui/core/notifications/badge.rb +2 -5
  123. data/lib/ui_bibz/ui/core/notifications/components/alert_body.rb +0 -3
  124. data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +4 -10
  125. data/lib/ui_bibz/ui/core/notifications/components/bar.rb +0 -3
  126. data/lib/ui_bibz/ui/core/notifications/components/toast_body.rb +0 -3
  127. data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -6
  128. data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +7 -5
  129. data/lib/ui_bibz/ui/core/notifications/spinner.rb +0 -3
  130. data/lib/ui_bibz/ui/core/notifications/toast.rb +14 -3
  131. data/lib/ui_bibz/ui/core/windows/components/modal_body.rb +0 -3
  132. data/lib/ui_bibz/ui/core/windows/components/modal_footer.rb +0 -3
  133. data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -7
  134. data/lib/ui_bibz/ui/core/windows/modal.rb +65 -14
  135. data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +6 -2
  136. data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +9 -9
  137. data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +2 -2
  138. data/lib/ui_bibz/ui/ux/containers/components/panel_body.rb +0 -3
  139. data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +2 -0
  140. data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +2 -0
  141. data/lib/ui_bibz/ui/ux/containers/components/panel_footer.rb +0 -3
  142. data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +2 -0
  143. data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -6
  144. data/lib/ui_bibz/ui/ux/containers/components/panel_header_title.rb +47 -0
  145. data/lib/ui_bibz/ui/ux/containers/components/panel_tab_group.rb +0 -4
  146. data/lib/ui_bibz/ui/ux/containers/components/panel_toolbar.rb +0 -3
  147. data/lib/ui_bibz/ui/ux/containers/panel.rb +4 -2
  148. data/lib/ui_bibz/ui/ux/tables/components/thead.rb +0 -3
  149. data/lib/ui_bibz/ui/ux/tables/table.rb +2 -4
  150. data/lib/ui_bibz/ui/ux/tables/table_card.rb +4 -3
  151. data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +5 -5
  152. data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +82 -0
  153. data/lib/ui_bibz/utils/internationalization.rb +2 -2
  154. data/lib/ui_bibz/utils/screwdriver.rb +16 -10
  155. data/test/dummy/Rakefile +1 -1
  156. data/test/dummy/app/javascripts/packs/index.js +3 -0
  157. data/test/dummy/app/views/layouts/application.html.erb +4 -1
  158. data/{app/ui/.keep → test/dummy/app/views/users/index.html.erb} +0 -0
  159. data/test/dummy/bin/setup +17 -13
  160. data/test/dummy/config.ru +2 -1
  161. data/test/dummy/config/application.rb +1 -0
  162. data/test/dummy/config/cable.yml +10 -0
  163. data/test/dummy/config/database.yml +1 -1
  164. data/test/dummy/config/environment.rb +1 -1
  165. data/test/dummy/config/environments/development.rb +33 -12
  166. data/test/dummy/config/environments/production.rb +52 -19
  167. data/test/dummy/config/environments/test.rb +18 -12
  168. data/test/dummy/config/initializers/application_controller_renderer.rb +9 -0
  169. data/test/dummy/config/initializers/assets.rb +4 -3
  170. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -1
  171. data/test/dummy/config/initializers/content_security_policy.rb +29 -0
  172. data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
  173. data/test/dummy/config/initializers/inflections.rb +0 -1
  174. data/test/dummy/config/initializers/mime_types.rb +0 -1
  175. data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
  176. data/test/dummy/config/puma.rb +40 -0
  177. data/test/dummy/config/routes.rb +3 -0
  178. data/test/dummy/config/spring.rb +8 -0
  179. data/test/dummy/config/storage.yml +34 -0
  180. data/test/dummy/db/migrate/20150123191805_create_users.rb +1 -1
  181. data/test/dummy/db/schema.rb +24 -24
  182. data/test/dummy/public/404.html +6 -6
  183. data/test/dummy/public/422.html +6 -6
  184. data/test/dummy/public/500.html +6 -6
  185. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  186. data/test/dummy/public/apple-touch-icon.png +0 -0
  187. data/test/dummy/storage/.keep +0 -0
  188. data/test/simple_form_test.rb +45 -44
  189. data/test/store_test.rb +5 -5
  190. data/test/test_helper.rb +18 -9
  191. data/test/ui/core/boxes/card_grid_test.rb +17 -0
  192. data/test/ui/core/boxes/card_test.rb +46 -12
  193. data/test/ui/core/boxes/jumbotron_test.rb +2 -2
  194. data/test/ui/core/component_test.rb +1 -1
  195. data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
  196. data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
  197. data/test/ui/core/forms/buttons/button_test.rb +2 -2
  198. data/test/ui/core/forms/choices/checkbox_field_test.rb +9 -2
  199. data/test/ui/core/forms/choices/choice_group_test.rb +11 -9
  200. data/test/ui/core/forms/choices/radio_field_test.rb +1 -1
  201. data/test/ui/core/forms/dates/date_picker_field_test.rb +1 -1
  202. data/test/ui/core/forms/dropdowns/dropdown_test.rb +2 -2
  203. data/test/ui/core/forms/files/file_field_test.rb +12 -0
  204. data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
  205. data/test/ui/core/forms/numbers/range_field_test.rb +37 -2
  206. data/test/ui/core/forms/numbers/slider_field_test.rb +26 -0
  207. data/test/ui/core/forms/selects/multi_column_field_test.rb +1 -1
  208. data/test/ui/core/forms/selects/multi_select_field_test.rb +7 -7
  209. data/test/ui/core/forms/selects/select_field_test.rb +3 -3
  210. data/test/ui/core/forms/surrounds/surround_field_test.rb +39 -3
  211. data/test/ui/core/forms/textareas/markdown_editor_field_test.rb +1 -1
  212. data/test/ui/core/forms/texts/auto_complete_field_test.rb +8 -8
  213. data/test/ui/core/forms/texts/text_field_test.rb +2 -2
  214. data/test/ui/core/layouts/col_test.rb +11 -2
  215. data/test/ui/core/layouts/container_test.rb +15 -1
  216. data/test/ui/core/layouts/row_test.rb +68 -3
  217. data/test/ui/core/lists/list_group_test.rb +1 -1
  218. data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
  219. data/test/ui/core/navigations/link_test.rb +1 -1
  220. data/test/ui/core/navigations/nav_test.rb +17 -5
  221. data/test/ui/core/navigations/navbar_test.rb +7 -8
  222. data/test/ui/core/navigations/tab_group_test.rb +4 -4
  223. data/test/ui/core/notifications/alert_test.rb +2 -2
  224. data/test/ui/core/notifications/badge_test.rb +3 -3
  225. data/test/ui/core/notifications/progress_bar_test.rb +1 -1
  226. data/test/ui/core/notifications/toast_test.rb +10 -1
  227. data/test/ui/core/windows/modal_test.rb +15 -1
  228. data/test/ui/utils/breakdown_class_name_generator_test.rb +74 -0
  229. data/test/ui/ux/containers/panel_test.rb +5 -5
  230. data/test/ui/ux/tables/table_test.rb +6 -6
  231. data/test/ui_bibz_test.rb +1 -1
  232. data/ui_bibz.gemspec +16 -16
  233. metadata +100 -109
  234. data/.rubocop_todo.yml +0 -25
  235. data/app/assets/javascripts/fix_bootstrap.coffee +0 -7
  236. data/app/assets/javascripts/form.coffee +0 -83
  237. data/app/assets/javascripts/formula.coffee +0 -69
  238. data/app/assets/javascripts/input-connected.coffee +0 -101
  239. data/app/assets/javascripts/interface.coffee +0 -55
  240. data/app/assets/javascripts/jquery.multi-select-extend.coffee +0 -38
  241. data/app/assets/javascripts/table.coffee +0 -36
  242. data/app/assets/javascripts/ui_bibz.coffee.erb +0 -75
  243. data/app/assets/stylesheets/_custom_variables.sass +0 -20
  244. data/app/assets/stylesheets/_panel.scss +0 -315
  245. data/app/assets/stylesheets/bootstrap-switch.sass +0 -159
  246. data/app/assets/stylesheets/boxes.sass +0 -5
  247. data/app/assets/stylesheets/containers.sass +0 -2
  248. data/app/assets/stylesheets/fix-bootstrap-4.sass +0 -19
  249. data/app/assets/stylesheets/fix_addon.sass +0 -216
  250. data/app/assets/stylesheets/forms.sass +0 -91
  251. data/app/assets/stylesheets/navigations.sass +0 -17
  252. data/app/assets/stylesheets/notifications.sass +0 -42
  253. data/app/assets/stylesheets/tables.sass +0 -66
  254. data/app/assets/stylesheets/ui_bibz.sass.erb +0 -55
  255. data/lib/generators/ui_bibz/install_generator.rb +0 -17
  256. data/lib/generators/ui_bibz/templates/ui_bibz_initializer.rb +0 -5
  257. data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +0 -125
  258. data/lib/ui_bibz/ui/core/icons/glyph_group.rb +0 -101
  259. data/test/dummy/bin/bundle +0 -5
  260. data/test/ui/core/forms/files/text_field_test.rb +0 -12
  261. data/test/ui/core/forms/selects/dropdown_select_field_test.rb +0 -84
  262. data/test/ui/core/icons/glyph_group_test.rb +0 -37
@@ -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,29 +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>'
41
-
42
- assert_equal expected, actual
43
- end
44
-
45
- test 'dropdown field select input in simple form' do
46
- actual = simple_form_for @user do |f|
47
- f.input :name_fr, as: :ui_dropdown_select_field, collection: @users, label_method: :name_fr
48
- end
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>
51
- <option value=\"2\">test2</option></select></div></form>"
52
-
53
- assert_equal expected, actual
54
- end
55
-
56
- test 'dropdown field select input with grouped option in simple form' do
57
- actual = simple_form_for @user do |f|
58
- f.input :name_fr, as: :ui_dropdown_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
59
- end
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>
62
- <option value=\"2\">Deutchland</option></optgroup></select></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>'
63
41
 
64
42
  assert_equal expected, actual
65
43
  end
@@ -72,7 +50,7 @@ class SimpleFormTest < ActionView::TestCase
72
50
  f.input :price, as: :ui_formula_field
73
51
  end
74
52
 
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>'
53
+ 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
54
 
77
55
  assert_equal expected, actual
78
56
  end
@@ -82,7 +60,7 @@ class SimpleFormTest < ActionView::TestCase
82
60
  f.input :name_fr, as: :ui_markdown_editor_field
83
61
  end
84
62
 
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\">
63
+ 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
64
  test1</textarea></div></form>"
87
65
 
88
66
  assert_equal expected, actual
@@ -93,7 +71,7 @@ test1</textarea></div></form>"
93
71
  f.input :name_fr, as: :ui_multi_column_field, collection: @users, label_method: :name_fr
94
72
  end
95
73
 
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>
74
+ 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
75
  <option value=\"2\">test2</option></select></div></form>"
98
76
 
99
77
  assert_equal expected, actual
@@ -101,10 +79,10 @@ test1</textarea></div></form>"
101
79
 
102
80
  test 'multi select field input in simple form' do
103
81
  actual = simple_form_for @user do |f|
104
- f.input :name_fr, as: :ui_multi_select_field, collection: @users, label_method: :name_fr
82
+ f.input :name_fr, as: :ui_dropdown_select_field, multiple: true, collection: @users, label_method: :name_fr
105
83
  end
106
84
 
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>
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_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=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
108
86
  <option value=\"2\">test2</option></select></div></form>"
109
87
 
110
88
  assert_equal expected, actual
@@ -112,10 +90,10 @@ test1</textarea></div></form>"
112
90
 
113
91
  test 'multi select input with grouped option in simple form' do
114
92
  actual = simple_form_for @user do |f|
115
- f.input :name_fr, as: :ui_multi_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
93
+ f.input :name_fr, as: :ui_dropdown_select_field, multiple: true, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
116
94
  end
117
95
 
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>
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_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=\"btn-secondary multi-select-field\" multiple=\"multiple\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
119
97
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
120
98
 
121
99
  assert_equal expected, actual
@@ -126,7 +104,7 @@ test1</textarea></div></form>"
126
104
  f.input :name_fr, as: :ui_text_field
127
105
  end
128
106
 
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>"
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_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
108
 
131
109
  assert_equal expected, actual
132
110
  end
@@ -137,7 +115,7 @@ test1</textarea></div></form>"
137
115
  f.input :active, as: :ui_box_switch_field, collection: @users, label_method: :name_fr
138
116
  end
139
117
 
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>'
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_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
119
 
142
120
  assert_equal expected, actual
143
121
  end
@@ -147,7 +125,7 @@ test1</textarea></div></form>"
147
125
  f.input :name_fr, as: :ui_radio_field, collection: @users, label_method: :name_fr
148
126
  end
149
127
 
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>'
128
+ 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
129
 
152
130
  assert_equal expected, actual
153
131
  end
@@ -157,7 +135,7 @@ test1</textarea></div></form>"
157
135
  f.input :name_fr, as: :ui_select_field, collection: @users, label_method: :name_fr
158
136
  end
159
137
 
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>
138
+ 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
139
  <option value=\"2\">test2</option></select></div></form>"
162
140
 
163
141
  assert_equal expected, actual
@@ -168,8 +146,8 @@ test1</textarea></div></form>"
168
146
  f.input :name_fr, as: :ui_select_field, refresh: { target: { data: [] } }, collection: @users, label_method: :name_fr
169
147
  end
170
148
 
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>"
149
+ 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>
150
+ <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
151
 
174
152
  assert_equal expected, actual
175
153
  end
@@ -179,7 +157,7 @@ test1</textarea></div></form>"
179
157
  f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
180
158
  end
181
159
 
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>
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\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
183
161
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
184
162
 
185
163
  assert_equal expected, actual
@@ -191,7 +169,7 @@ test1</textarea></div></form>"
191
169
  f.input :name_fr, as: :ui_select_field, collection: @countries
192
170
  end
193
171
 
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>
172
+ 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
173
  <option value=\"2\">Deutchland</option></select></div></form>"
196
174
 
197
175
  assert_equal expected, actual
@@ -203,7 +181,7 @@ test1</textarea></div></form>"
203
181
  f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
204
182
  end
205
183
 
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>
184
+ 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
185
  <option value=\"2\">Deutchland</option></optgroup></select></div></form>"
208
186
 
209
187
  assert_equal expected, actual
@@ -214,7 +192,7 @@ test1</textarea></div></form>"
214
192
  f.input :name_fr, as: :ui_number_field
215
193
  end
216
194
 
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>'
195
+ 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
196
 
219
197
  assert_equal expected, actual
220
198
  end
@@ -224,7 +202,7 @@ test1</textarea></div></form>"
224
202
  f.input :name_fr, as: :ui_file_field
225
203
  end
226
204
 
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>'
205
+ 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
206
 
229
207
  assert_equal expected, actual
230
208
  end
@@ -234,11 +212,34 @@ test1</textarea></div></form>"
234
212
  f.input :name_fr, as: :ui_range_field
235
213
  end
236
214
 
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>'
215
+ 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>'
216
+
217
+ assert_equal expected, actual
218
+ end
219
+
220
+ test 'slider field' do
221
+ actual = simple_form_for @user do |f|
222
+ f.input :name_en, as: :ui_slider_field
223
+ end
224
+
225
+ 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\" id=\"user_name_en_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>"
238
226
 
239
227
  assert_equal expected, actual
240
228
  end
241
229
 
230
+ # test 'choice field' do
231
+ # actual = ui_form_for @user do |f|
232
+ # f.ui_choice_group do |cg|
233
+ # cg.input :name_fr, as: :ui_choice_field
234
+ # cg.input :name_fr, as: :ui_choice_field
235
+ # end
236
+ # end
237
+ #
238
+ # 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>"
239
+ #
240
+ # assert_equal expected, actual
241
+ # end
242
+
242
243
  # test 'test surround field into simple form' do
243
244
  # actual = ui_form_for @user do |f|
244
245
  # concat(f.ui_surround_field do |sf|
@@ -248,7 +249,7 @@ test1</textarea></div></form>"
248
249
  # concat f.input(:name_fr, as: :ui_auto_complete_field, collection: @users, label_method: :name_fr)
249
250
  # end
250
251
  #
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>
252
+ # 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
253
  # <option value=\"2\">test2</option></datalist></div></form>"
253
254
  #
254
255
  # assert_equal expected, actual
@@ -22,15 +22,15 @@ class StoreTest < ActionView::TestCase
22
22
  end
23
23
 
24
24
  test 'total pages' do
25
- assert_equal @store.total_pages, 3
25
+ assert_equal(3, @store.total_pages)
26
26
  end
27
27
 
28
28
  test 'current page' do
29
- assert_equal @store.current_page, 1
29
+ assert_equal(1, @store.current_page)
30
30
  end
31
31
 
32
32
  test 'limit value' do
33
- assert_equal @store.limit_value, 10
33
+ assert_equal(10, @store.limit_value)
34
34
  end
35
35
 
36
36
  test 'model' do
@@ -38,10 +38,10 @@ class StoreTest < ActionView::TestCase
38
38
  end
39
39
 
40
40
  test 'records' do
41
- assert_equal @store.records.count, 25
41
+ assert_equal(25, @store.records.count)
42
42
  end
43
43
 
44
44
  test 'controller' do
45
- assert_equal @store.controller, 'users'
45
+ assert_equal('users', @store.controller)
46
46
  end
47
47
  end