ui_bibz 2.5.6 → 3.0.0.alpha8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -2
- data/.rubocop.yml +78 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +92 -104
- data/README.md +9 -52
- data/Rakefile +3 -2
- data/bin/test +7 -0
- data/config/initializers/will_paginate.rb +2 -1
- data/lib/ui_bibz.rb +17 -3
- data/lib/ui_bibz/concerns/models/searchable.rb +3 -3
- data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +9 -1
- data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +20 -1
- data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +10 -2
- data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +1 -1
- data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +9 -5
- data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -6
- data/lib/ui_bibz/infos.rb +11 -5
- data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +15 -2
- data/lib/ui_bibz/inputs/ui_bibz_inputs/base_input.rb +4 -7
- data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +6 -9
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_checkbox_field_input.rb +5 -1
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_choice_field_input.rb +23 -0
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_multi_select_field_input.rb +3 -3
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_slider_field_input.rb +12 -0
- data/lib/ui_bibz/rails/engine.rb +1 -16
- data/lib/ui_bibz/railtie.rb +6 -0
- data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +67 -0
- data/lib/ui_bibz/ui/concerns/html_concern.rb +16 -0
- data/lib/ui_bibz/ui/core/boxes/card.rb +5 -50
- data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +2 -0
- data/lib/ui_bibz/ui/core/boxes/card_column.rb +3 -1
- data/lib/ui_bibz/ui/core/boxes/card_deck.rb +3 -1
- data/lib/ui_bibz/ui/core/boxes/card_grid.rb +60 -0
- data/lib/ui_bibz/ui/core/boxes/card_group.rb +3 -1
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_link.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_subtitle.rb +47 -0
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_text.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/components/body/card_body_title.rb +1 -4
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +15 -0
- data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +65 -0
- data/lib/ui_bibz/ui/core/boxes/components/card_footer.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/components/card_header.rb +2 -4
- data/lib/ui_bibz/ui/core/boxes/components/card_image.rb +1 -4
- data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +65 -0
- data/lib/ui_bibz/ui/core/boxes/components/card_tab_group.rb +0 -4
- data/lib/ui_bibz/ui/core/boxes/jumbotron.rb +1 -4
- data/lib/ui_bibz/ui/core/component.rb +16 -9
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +9 -11
- data/lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_dropdown.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/buttons/components/button_group_split_dropdown.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -10
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +20 -10
- data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +22 -2
- data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +24 -12
- data/lib/ui_bibz/ui/core/forms/choices/radio_field.rb +17 -6
- data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +5 -5
- data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +12 -15
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_divider.rb +0 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_header.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +19 -20
- data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +7 -5
- data/lib/ui_bibz/ui/core/forms/files/file_field.rb +20 -10
- data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +18 -8
- data/lib/ui_bibz/ui/core/forms/numbers/number_field.rb +20 -3
- data/lib/ui_bibz/ui/core/forms/numbers/range_field.rb +51 -5
- data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +144 -0
- data/lib/ui_bibz/ui/core/forms/numbers/slider_header.rb +71 -0
- data/lib/ui_bibz/ui/core/forms/selects/abstract_select.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +41 -62
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/selects/select_field.rb +2 -5
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_addon.rb +1 -4
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button.rb +1 -6
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_group.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_link.rb +1 -6
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_button_refresh.rb +1 -12
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_checkbox_field.rb +9 -4
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_dropdown.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_radio_field.rb +9 -4
- data/lib/ui_bibz/ui/core/forms/surrounds/components/surround_switch_field.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +4 -12
- data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +4 -7
- data/lib/ui_bibz/ui/core/forms/texts/auto_complete_field.rb +2 -5
- data/lib/ui_bibz/ui/core/forms/texts/text_field.rb +0 -3
- data/lib/ui_bibz/ui/core/icons/components/glyph_counter.rb +0 -3
- data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -4
- data/lib/ui_bibz/ui/core/icons/glyph.rb +1 -4
- data/lib/ui_bibz/ui/core/icons/star.rb +0 -3
- data/lib/ui_bibz/ui/core/layouts/col.rb +5 -42
- data/lib/ui_bibz/ui/core/layouts/container.rb +9 -6
- data/lib/ui_bibz/ui/core/layouts/row.rb +32 -2
- data/lib/ui_bibz/ui/core/lists/components/list.rb +6 -8
- data/lib/ui_bibz/ui/core/lists/components/list/list_body.rb +0 -3
- data/lib/ui_bibz/ui/core/lists/components/list/list_header.rb +0 -3
- data/lib/ui_bibz/ui/core/lists/list_group.rb +9 -6
- data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +3 -2
- data/lib/ui_bibz/ui/core/navigations/components/breadcrumb_link.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/components/nav_dropdown.rb +2 -5
- data/lib/ui_bibz/ui/core/navigations/components/nav_link.rb +3 -1
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_link.rb +15 -6
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_list.rb +0 -4
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -4
- data/lib/ui_bibz/ui/core/navigations/components/nav_text.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/components/navbar_brand.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +4 -4
- data/lib/ui_bibz/ui/core/navigations/components/navbar_nav.rb +1 -4
- data/lib/ui_bibz/ui/core/navigations/components/navbar_text.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/components/pagination_link.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/link.rb +0 -3
- data/lib/ui_bibz/ui/core/navigations/nav.rb +37 -10
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +31 -8
- data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -1
- data/lib/ui_bibz/ui/core/navigations/tab_group.rb +10 -5
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +2 -0
- data/lib/ui_bibz/ui/core/notifications/alert.rb +2 -2
- data/lib/ui_bibz/ui/core/notifications/badge.rb +2 -5
- data/lib/ui_bibz/ui/core/notifications/components/alert_body.rb +0 -3
- data/lib/ui_bibz/ui/core/notifications/components/alert_header.rb +4 -10
- data/lib/ui_bibz/ui/core/notifications/components/bar.rb +0 -3
- data/lib/ui_bibz/ui/core/notifications/components/toast_body.rb +0 -3
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -6
- data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +7 -5
- data/lib/ui_bibz/ui/core/notifications/spinner.rb +0 -3
- data/lib/ui_bibz/ui/core/notifications/toast.rb +14 -3
- data/lib/ui_bibz/ui/core/windows/components/modal_body.rb +0 -3
- data/lib/ui_bibz/ui/core/windows/components/modal_footer.rb +0 -3
- data/lib/ui_bibz/ui/core/windows/components/modal_header.rb +1 -7
- data/lib/ui_bibz/ui/core/windows/modal.rb +65 -14
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +6 -2
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +9 -9
- data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +2 -2
- data/lib/ui_bibz/ui/extensions/core/forms/surround_extension.rb +1 -1
- data/lib/ui_bibz/ui/ux/containers/components/panel_body.rb +0 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +2 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +2 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_footer.rb +0 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +2 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -6
- data/lib/ui_bibz/ui/ux/containers/components/panel_header_title.rb +47 -0
- data/lib/ui_bibz/ui/ux/containers/components/panel_tab_group.rb +0 -4
- data/lib/ui_bibz/ui/ux/containers/components/panel_toolbar.rb +0 -3
- data/lib/ui_bibz/ui/ux/containers/panel.rb +4 -2
- data/lib/ui_bibz/ui/ux/tables/components/thead.rb +0 -3
- data/lib/ui_bibz/ui/ux/tables/table.rb +2 -4
- data/lib/ui_bibz/ui/ux/tables/table_card.rb +4 -3
- data/lib/ui_bibz/ui/ux/tables/table_pagination_per_page.rb +3 -3
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +8 -8
- data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +82 -0
- data/lib/ui_bibz/utils/internationalization.rb +2 -2
- data/lib/ui_bibz/utils/screwdriver.rb +16 -10
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/javascripts/packs/index.js +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +4 -1
- data/{app/ui/.keep → test/dummy/app/views/users/index.html.erb} +0 -0
- data/test/dummy/bin/setup +17 -13
- data/test/dummy/config.ru +2 -1
- data/test/dummy/config/application.rb +1 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +1 -1
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +33 -12
- data/test/dummy/config/environments/production.rb +52 -19
- data/test/dummy/config/environments/test.rb +18 -12
- data/test/dummy/config/initializers/application_controller_renderer.rb +9 -0
- data/test/dummy/config/initializers/assets.rb +4 -3
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -1
- data/test/dummy/config/initializers/content_security_policy.rb +29 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +2 -0
- data/test/dummy/config/initializers/inflections.rb +0 -1
- data/test/dummy/config/initializers/mime_types.rb +0 -1
- data/test/dummy/config/initializers/wrap_parameters.rb +2 -2
- data/test/dummy/config/puma.rb +40 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/config/spring.rb +8 -0
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/db/migrate/20150123191805_create_users.rb +1 -1
- data/test/dummy/db/schema.rb +24 -24
- data/test/dummy/public/404.html +6 -6
- data/test/dummy/public/422.html +6 -6
- data/test/dummy/public/500.html +6 -6
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/storage/.keep +0 -0
- data/test/simple_form_test.rb +45 -44
- data/test/store_test.rb +5 -5
- data/test/test_helper.rb +18 -9
- data/test/ui/core/boxes/card_grid_test.rb +17 -0
- data/test/ui/core/boxes/card_test.rb +46 -12
- data/test/ui/core/boxes/jumbotron_test.rb +2 -2
- data/test/ui/core/component_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -2
- data/test/ui/core/forms/choices/checkbox_field_test.rb +9 -2
- data/test/ui/core/forms/choices/choice_group_test.rb +11 -9
- data/test/ui/core/forms/choices/radio_field_test.rb +1 -1
- data/test/ui/core/forms/dates/date_picker_field_test.rb +1 -1
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +2 -2
- data/test/ui/core/forms/files/file_field_test.rb +12 -0
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- data/test/ui/core/forms/numbers/range_field_test.rb +37 -2
- data/test/ui/core/forms/numbers/slider_field_test.rb +26 -0
- data/test/ui/core/forms/selects/multi_column_field_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +7 -7
- data/test/ui/core/forms/selects/select_field_test.rb +3 -3
- data/test/ui/core/forms/surrounds/surround_field_test.rb +40 -4
- data/test/ui/core/forms/textareas/markdown_editor_field_test.rb +1 -1
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +8 -8
- data/test/ui/core/forms/texts/text_field_test.rb +2 -2
- data/test/ui/core/layouts/col_test.rb +11 -2
- data/test/ui/core/layouts/container_test.rb +15 -1
- data/test/ui/core/layouts/row_test.rb +68 -3
- data/test/ui/core/lists/list_group_test.rb +1 -1
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +17 -5
- data/test/ui/core/navigations/navbar_test.rb +7 -8
- data/test/ui/core/navigations/tab_group_test.rb +4 -4
- data/test/ui/core/notifications/alert_test.rb +2 -2
- data/test/ui/core/notifications/badge_test.rb +3 -3
- data/test/ui/core/notifications/progress_bar_test.rb +1 -1
- data/test/ui/core/notifications/toast_test.rb +10 -1
- data/test/ui/core/windows/modal_test.rb +15 -1
- data/test/ui/utils/breakdown_class_name_generator_test.rb +74 -0
- data/test/ui/ux/containers/panel_test.rb +5 -5
- data/test/ui/ux/tables/table_test.rb +6 -6
- data/test/ui_bibz_test.rb +1 -1
- data/ui_bibz.gemspec +16 -16
- metadata +100 -108
- data/app/assets/javascripts/fix_bootstrap.coffee +0 -7
- data/app/assets/javascripts/form.coffee +0 -83
- data/app/assets/javascripts/formula.coffee +0 -69
- data/app/assets/javascripts/input-connected.coffee +0 -101
- data/app/assets/javascripts/interface.coffee +0 -55
- data/app/assets/javascripts/jquery.multi-select-extend.coffee +0 -38
- data/app/assets/javascripts/table.coffee +0 -36
- data/app/assets/javascripts/ui_bibz.coffee.erb +0 -75
- data/app/assets/stylesheets/_custom_variables.sass +0 -20
- data/app/assets/stylesheets/_panel.scss +0 -315
- data/app/assets/stylesheets/bootstrap-switch.sass +0 -159
- data/app/assets/stylesheets/boxes.sass +0 -5
- data/app/assets/stylesheets/containers.sass +0 -2
- data/app/assets/stylesheets/fix-bootstrap-4.sass +0 -19
- data/app/assets/stylesheets/fix_addon.sass +0 -216
- data/app/assets/stylesheets/forms.sass +0 -91
- data/app/assets/stylesheets/navigations.sass +0 -17
- data/app/assets/stylesheets/notifications.sass +0 -42
- data/app/assets/stylesheets/tables.sass +0 -66
- data/app/assets/stylesheets/ui_bibz.sass.erb +0 -55
- data/lib/generators/ui_bibz/install_generator.rb +0 -17
- data/lib/generators/ui_bibz/templates/ui_bibz_initializer.rb +0 -5
- data/lib/ui_bibz/ui/core/forms/selects/multi_select_field.rb +0 -125
- data/lib/ui_bibz/ui/core/icons/glyph_group.rb +0 -101
- data/test/dummy/bin/bundle +0 -5
- data/test/ui/core/forms/files/text_field_test.rb +0 -12
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +0 -84
- data/test/ui/core/icons/glyph_group_test.rb +0 -37
@@ -7,10 +7,10 @@
|
|
7
7
|
|
8
8
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
9
9
|
ActiveSupport.on_load(:action_controller) do
|
10
|
-
wrap_parameters format: [:json]
|
10
|
+
wrap_parameters format: [:json]
|
11
11
|
end
|
12
12
|
|
13
13
|
# To enable root element in JSON for ActiveRecord objects.
|
14
14
|
# ActiveSupport.on_load(:active_record) do
|
15
|
-
#
|
15
|
+
# self.include_root_in_json = true
|
16
16
|
# end
|
@@ -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
|
data/test/dummy/config/routes.rb
CHANGED
@@ -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 ]
|
data/test/dummy/db/schema.rb
CHANGED
@@ -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
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# from scratch.
|
11
|
-
#
|
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
|
17
|
-
t.string
|
18
|
-
t.datetime
|
19
|
-
t.datetime
|
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
|
23
|
-
t.string
|
24
|
-
t.integer
|
25
|
-
t.datetime
|
26
|
-
t.datetime
|
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
|
30
|
-
t.string
|
31
|
-
t.string
|
32
|
-
t.string
|
33
|
-
t.string
|
34
|
-
t.boolean
|
35
|
-
t.float
|
36
|
-
t.string
|
37
|
-
t.datetime
|
38
|
-
t.datetime
|
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
|
data/test/dummy/public/404.html
CHANGED
@@ -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
|
-
|
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>
|
data/test/dummy/public/422.html
CHANGED
@@ -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
|
-
|
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>
|
data/test/dummy/public/500.html
CHANGED
@@ -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
|
-
|
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
|
File without changes
|
data/test/simple_form_test.rb
CHANGED
@@ -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
|
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
|
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=\"✓\" /><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=\"✓\" /><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
|
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
|
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
|
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: :
|
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
|
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: :
|
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
|
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
|
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
|
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 =
|
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
|
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
|
172
|
-
<option value=\"2\">test2</option></select><
|
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=\"{"events":"click","mode":"remote","target":{"selector":"#user_name_fr","url":"","data":[]}}\" 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
|
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
|
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
|
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
|
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 =
|
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
|
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
|
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
|