ui_bibz 2.5.6 → 3.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- 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 +90 -102
- 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 -2
- 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 +18 -0
- 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 +0 -4
- data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +6 -9
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_choice_field_input.rb +23 -0
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_slider_field_input.rb +11 -0
- data/lib/ui_bibz/rails/engine.rb +2 -13
- data/lib/ui_bibz/railtie.rb +6 -0
- data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +65 -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 +7 -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 +0 -3
- 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 +1 -1
- 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 +8 -7
- 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 +11 -6
- data/lib/ui_bibz/ui/core/forms/choices/switch_field.rb +1 -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 +8 -13
- data/lib/ui_bibz/ui/core/forms/dropdowns/split_dropdown.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/files/file_field.rb +20 -10
- data/lib/ui_bibz/ui/core/forms/numbers/formula_field.rb +16 -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 +33 -5
- data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +132 -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 +6 -9
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +0 -3
- data/lib/ui_bibz/ui/core/forms/selects/multi_select_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 +0 -3
- 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 +0 -3
- 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 +1 -4
- 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 +1 -4
- 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 +14 -5
- 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 +28 -7
- 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 +61 -14
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -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/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 +1 -4
- 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_search_field.rb +5 -5
- data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +69 -0
- data/lib/ui_bibz/utils/internationalization.rb +1 -1
- data/lib/ui_bibz/utils/screwdriver.rb +16 -10
- data/package.json +5 -0
- 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 -22
- 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 +45 -11
- 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_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 +1 -1
- 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/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 +23 -2
- data/test/ui/core/forms/numbers/slider_field_test.rb +26 -0
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +10 -10
- data/test/ui/core/forms/selects/multi_column_field_test.rb +1 -1
- data/test/ui/core/forms/selects/multi_select_field_test.rb +2 -2
- data/test/ui/core/forms/selects/select_field_test.rb +3 -3
- data/test/ui/core/forms/surrounds/surround_field_test.rb +15 -3
- 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 +11 -0
- data/test/ui/core/navigations/navbar_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 +60 -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 -105
- 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/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/icons/glyph_group_test.rb +0 -37
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Puma can serve each request in a thread from an internal thread pool.
|
4
|
+
# The `threads` method setting takes two numbers: a minimum and maximum.
|
5
|
+
# Any libraries that use thread pools should be configured to match
|
6
|
+
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
7
|
+
# and maximum; this matches the default thread size of Active Record.
|
8
|
+
#
|
9
|
+
max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
|
10
|
+
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
11
|
+
threads min_threads_count, max_threads_count
|
12
|
+
|
13
|
+
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
14
|
+
#
|
15
|
+
port ENV.fetch("PORT", 3000)
|
16
|
+
|
17
|
+
# Specifies the `environment` that Puma will run in.
|
18
|
+
#
|
19
|
+
environment ENV.fetch("RAILS_ENV", "development")
|
20
|
+
|
21
|
+
# Specifies the `pidfile` that Puma will use.
|
22
|
+
pidfile ENV.fetch("PIDFILE", "tmp/pids/server.pid")
|
23
|
+
|
24
|
+
# Specifies the number of `workers` to boot in clustered mode.
|
25
|
+
# Workers are forked web server processes. If using threads and workers together
|
26
|
+
# the concurrency of the application would be max `threads` * `workers`.
|
27
|
+
# Workers do not work on JRuby or Windows (both of which do not support
|
28
|
+
# processes).
|
29
|
+
#
|
30
|
+
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
31
|
+
|
32
|
+
# Use the `preload_app!` method when specifying a `workers` number.
|
33
|
+
# This directive tells Puma to first boot the application and load code
|
34
|
+
# before forking the application. This takes advantage of Copy On Write
|
35
|
+
# process behavior so workers use less memory.
|
36
|
+
#
|
37
|
+
# preload_app!
|
38
|
+
|
39
|
+
# Allow puma to be restarted by `rails restart` command.
|
40
|
+
plugin :tmp_restart
|
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,7 +37,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
37
37
|
f.input :created_at, as: :ui_date_picker_field
|
38
38
|
end
|
39
39
|
|
40
|
-
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input
|
40
|
+
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_date_picker_field optional user_created_at"><label class="control-label ui_date_picker_field optional" for="user_created_at">Created at</label><input type="text" name="user[created_at]" id="user_created_at" value="2017-04-26 14:48:43 UTC" class="ui_date_picker_field optional date_picker form-control" data-date-locale="en" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-today-btn="linked" data-date-toggle-active="true" /></div></form>'
|
41
41
|
|
42
42
|
assert_equal expected, actual
|
43
43
|
end
|
@@ -47,7 +47,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
47
47
|
f.input :name_fr, as: :ui_dropdown_select_field, collection: @users, label_method: :name_fr
|
48
48
|
end
|
49
49
|
|
50
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
50
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><option value=\"1\">test1</option>
|
51
51
|
<option value=\"2\">test2</option></select></div></form>"
|
52
52
|
|
53
53
|
assert_equal expected, actual
|
@@ -58,7 +58,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
58
58
|
f.input :name_fr, as: :ui_dropdown_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
|
59
59
|
end
|
60
60
|
|
61
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
61
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_dropdown_select_field optional user_name_fr\"><label class=\"control-label ui_dropdown_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"dropdown-select-field\" data-style=\"btn-secondary\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
|
62
62
|
<option value=\"2\">Deutchland</option></optgroup></select></div></form>"
|
63
63
|
|
64
64
|
assert_equal expected, actual
|
@@ -72,7 +72,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
72
72
|
f.input :price, as: :ui_formula_field
|
73
73
|
end
|
74
74
|
|
75
|
-
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input
|
75
|
+
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_formula_field optional user_price"><label class="control-label ui_formula_field optional" for="user_price">Price</label><div class="formula_field input-group ui_surround_field"><input type="text" name="user[price_formula]" id="user_price_formula" value="1+2" class="ui_formula_field optional formula-field form-control" formula_field_value="1+2" /><span class="formula-field-sign input-group-text">=</span><input type="text" name="user[price]" id="user_price" value="3.0" class="formula-field-result form-control" readonly="readonly" /><span data-toggle="tooltip" class="formula-field-alert input-group-text"><i class="glyph-danger glyph fas fa-exclamation-triangle"></i></span></div></div></form>'
|
76
76
|
|
77
77
|
assert_equal expected, actual
|
78
78
|
end
|
@@ -82,7 +82,7 @@ class SimpleFormTest < ActionView::TestCase
|
|
82
82
|
f.input :name_fr, as: :ui_markdown_editor_field
|
83
83
|
end
|
84
84
|
|
85
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
85
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_markdown_editor_field optional user_name_fr\"><label class=\"control-label ui_markdown_editor_field optional\" for=\"user_name_fr\">Name fr</label><textarea name=\"user[name_fr]\" id=\"user_name_fr\" class=\"ui_markdown_editor_field optional\" data-provide=\"markdown\" data-iconlibrary=\"fa\">
|
86
86
|
test1</textarea></div></form>"
|
87
87
|
|
88
88
|
assert_equal expected, actual
|
@@ -93,7 +93,7 @@ test1</textarea></div></form>"
|
|
93
93
|
f.input :name_fr, as: :ui_multi_column_field, collection: @users, label_method: :name_fr
|
94
94
|
end
|
95
95
|
|
96
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
96
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_column_field optional user_name_fr\"><label class=\"control-label ui_multi_column_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"name_fr[]\" id=\"name_fr\" class=\"multi-column-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
|
97
97
|
<option value=\"2\">test2</option></select></div></form>"
|
98
98
|
|
99
99
|
assert_equal expected, actual
|
@@ -104,7 +104,7 @@ test1</textarea></div></form>"
|
|
104
104
|
f.input :name_fr, as: :ui_multi_select_field, collection: @users, label_method: :name_fr
|
105
105
|
end
|
106
106
|
|
107
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
107
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><option value=\"1\">test1</option>
|
108
108
|
<option value=\"2\">test2</option></select></div></form>"
|
109
109
|
|
110
110
|
assert_equal expected, actual
|
@@ -115,7 +115,7 @@ test1</textarea></div></form>"
|
|
115
115
|
f.input :name_fr, as: :ui_multi_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
|
116
116
|
end
|
117
117
|
|
118
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
118
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_multi_select_field optional user_name_fr\"><label class=\"control-label ui_multi_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr][]\" id=\"user_name_fr\" class=\"btn-secondary multi-select-field\" multiple=\"multiple\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
|
119
119
|
<option value=\"2\">Deutchland</option></optgroup></select></div></form>"
|
120
120
|
|
121
121
|
assert_equal expected, actual
|
@@ -126,7 +126,7 @@ test1</textarea></div></form>"
|
|
126
126
|
f.input :name_fr, as: :ui_text_field
|
127
127
|
end
|
128
128
|
|
129
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
129
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_text_field optional user_name_fr\"><label class=\"control-label ui_text_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"ui_text_field\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"form-control string ui_text_field optional\" /></div></form>"
|
130
130
|
|
131
131
|
assert_equal expected, actual
|
132
132
|
end
|
@@ -137,7 +137,7 @@ test1</textarea></div></form>"
|
|
137
137
|
f.input :active, as: :ui_box_switch_field, collection: @users, label_method: :name_fr
|
138
138
|
end
|
139
139
|
|
140
|
-
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input
|
140
|
+
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_box_switch_field optional user_active"><label class="control-label ui_box_switch_field optional" for="user_active">Active</label><div class="switch-field-container"><input type="hidden" name="user[active]" id="user_active" value="0" /><input type="checkbox" name="user[active]" id="user_active" value="1" class="ui_box_switch_field optional switch-field" checked="checked" /></div></div></form>'
|
141
141
|
|
142
142
|
assert_equal expected, actual
|
143
143
|
end
|
@@ -147,7 +147,7 @@ test1</textarea></div></form>"
|
|
147
147
|
f.input :name_fr, as: :ui_radio_field, collection: @users, label_method: :name_fr
|
148
148
|
end
|
149
149
|
|
150
|
-
expected =
|
150
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_radio_field optional user_name_fr\"><label class=\"control-label ui_radio_field optional\">Name fr</label><input type=\"hidden\" name=\"user[name_fr]\" value=\"\" /><div class=\"radio ui_radio_field optional form-check\"><input class=\"ui_radio_field optional form-check\" type=\"radio\" value=\"1\" name=\"user[name_fr]\" id=\"user_name_fr_1\" /><label class=\"collection_radio_buttons\" for=\"user_name_fr_1\">test1</label></div><div class=\"radio ui_radio_field optional form-check\"><input class=\"ui_radio_field optional form-check\" type=\"radio\" value=\"2\" name=\"user[name_fr]\" id=\"user_name_fr_2\" /><label class=\"collection_radio_buttons\" for=\"user_name_fr_2\">test2</label></div></div></form>"
|
151
151
|
|
152
152
|
assert_equal expected, actual
|
153
153
|
end
|
@@ -157,7 +157,7 @@ test1</textarea></div></form>"
|
|
157
157
|
f.input :name_fr, as: :ui_select_field, collection: @users, label_method: :name_fr
|
158
158
|
end
|
159
159
|
|
160
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
160
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option value=\"1\">test1</option>
|
161
161
|
<option value=\"2\">test2</option></select></div></form>"
|
162
162
|
|
163
163
|
assert_equal expected, actual
|
@@ -168,8 +168,8 @@ test1</textarea></div></form>"
|
|
168
168
|
f.input :name_fr, as: :ui_select_field, refresh: { target: { data: [] } }, collection: @users, label_method: :name_fr
|
169
169
|
end
|
170
170
|
|
171
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
172
|
-
<option value=\"2\">test2</option></select><
|
171
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"field-refresh input-group ui_surround_field\"><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option value=\"1\">test1</option>
|
172
|
+
<option value=\"2\">test2</option></select><span data-connect=\"{"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
173
|
|
174
174
|
assert_equal expected, actual
|
175
175
|
end
|
@@ -179,7 +179,7 @@ test1</textarea></div></form>"
|
|
179
179
|
f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
|
180
180
|
end
|
181
181
|
|
182
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
182
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><optgroup label=\"Europe\"><option value=\"1\">France</option>
|
183
183
|
<option value=\"2\">Deutchland</option></optgroup></select></div></form>"
|
184
184
|
|
185
185
|
assert_equal expected, actual
|
@@ -191,7 +191,7 @@ test1</textarea></div></form>"
|
|
191
191
|
f.input :name_fr, as: :ui_select_field, collection: @countries
|
192
192
|
end
|
193
193
|
|
194
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
194
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><option selected=\"selected\" value=\"1\">France</option>
|
195
195
|
<option value=\"2\">Deutchland</option></select></div></form>"
|
196
196
|
|
197
197
|
assert_equal expected, actual
|
@@ -203,7 +203,7 @@ test1</textarea></div></form>"
|
|
203
203
|
f.input :name_fr, as: :ui_select_field, collection: @continents, toto: 'lala', grouped: true, group_method: :countries
|
204
204
|
end
|
205
205
|
|
206
|
-
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
206
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_select_field optional user_name_fr\"><label class=\"control-label ui_select_field optional\" for=\"user_name_fr\">Name fr</label><select name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-control select-field form-select\"><optgroup label=\"Europe\"><option selected=\"selected\" value=\"1\">France</option>
|
207
207
|
<option value=\"2\">Deutchland</option></optgroup></select></div></form>"
|
208
208
|
|
209
209
|
assert_equal expected, actual
|
@@ -214,7 +214,7 @@ test1</textarea></div></form>"
|
|
214
214
|
f.input :name_fr, as: :ui_number_field
|
215
215
|
end
|
216
216
|
|
217
|
-
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input
|
217
|
+
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_number_field optional user_name_fr"><label class="control-label ui_number_field optional" for="user_name_fr">Name fr</label><input type="number" name="user[name_fr]" id="user_name_fr" value="test1" class="form-control ui_number_field optional" /></div></form>'
|
218
218
|
|
219
219
|
assert_equal expected, actual
|
220
220
|
end
|
@@ -224,7 +224,7 @@ test1</textarea></div></form>"
|
|
224
224
|
f.input :name_fr, as: :ui_file_field
|
225
225
|
end
|
226
226
|
|
227
|
-
expected =
|
227
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_file_field optional user_name_fr\"><label class=\"control-label ui_file_field optional\" for=\"user_name_fr\">Name fr</label><div class=\"ui_file_field optional form-file\"><input type=\"file\" name=\"user[name_fr]\" id=\"user_name_fr\" class=\"form-file-input\" /><label class=\"form-file-label\" for=\"user_name_fr\"><span class=\"form-file-text\">test1</span><span class=\"form-file-button\">Browse</span></label></div></div></form>"
|
228
228
|
|
229
229
|
assert_equal expected, actual
|
230
230
|
end
|
@@ -234,11 +234,34 @@ test1</textarea></div></form>"
|
|
234
234
|
f.input :name_fr, as: :ui_range_field
|
235
235
|
end
|
236
236
|
|
237
|
-
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input
|
237
|
+
expected = '<form class="simple_form edit_user" id="edit_user_1" action="/users/1" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><div class="form-group ui_range_field optional user_name_fr"><label class="control-label ui_range_field optional" for="user_name_fr">Name fr</label><input type="range" name="user[name_fr]" id="user_name_fr" value="test1" class="ui_range_field optional form-range" /></div></form>'
|
238
238
|
|
239
239
|
assert_equal expected, actual
|
240
240
|
end
|
241
241
|
|
242
|
+
test 'slider field' do
|
243
|
+
actual = simple_form_for @user do |f|
|
244
|
+
f.input :name_en, as: :ui_slider_field
|
245
|
+
end
|
246
|
+
|
247
|
+
expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"form-group ui_slider_field optional user_name_en\"><label class=\"control-label ui_slider_field optional\" for=\"user_name_en\">Name en</label><div class=\"ui_slider_field optional slider\"><div><div class=\"slider-inverse-left\" style=\"width: 100%\"></div><div class=\"slider-inverse-right\" style=\"width: 100%\"></div><div class=\"slider-range\" style=\"left: 0%; right: 0%\"></div><div class=\"slider-thumb slider-thumb-left\" style=\"left: 0%\"></div><div class=\"slider-thumb slider-thumb-right\" style=\"left: 100%\"></div></div><input type=\"range\" name=\"user[name_en_min]\" id=\"user_name_en_min\" value=\"0\" max=\"100\" min=\"0\" step=\"1\" /><input type=\"range\" name=\"user[name_en_max]\" id=\"user_name_en_max\" value=\"100\" max=\"100\" min=\"0\" step=\"1\" /></div></div></form>"
|
248
|
+
|
249
|
+
assert_equal expected, actual
|
250
|
+
end
|
251
|
+
|
252
|
+
# test 'choice field' do
|
253
|
+
# actual = ui_form_for @user do |f|
|
254
|
+
# f.ui_choice_group do |cg|
|
255
|
+
# cg.input :name_fr, as: :ui_choice_field
|
256
|
+
# cg.input :name_fr, as: :ui_choice_field
|
257
|
+
# end
|
258
|
+
# end
|
259
|
+
#
|
260
|
+
# expected = "<form class=\"simple_form\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div class=\"button_group\"><div data-toggle=\"buttons\" class=\"btn-group button-choice btn-group-toggle\"><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"choice-21472\" /><label class=\"btn-secondary btn checkbox\" checked=\"checked\" for=\"choice-21472\">Name Fr</label><input type=\"checkbox\" autocomplete=\"off\" class=\"btn-check\" id=\"choice-13741\" /><label class=\"btn-secondary btn checkbox\" checked=\"checked\" for=\"choice-13741\">Name Fr</label></div></div></form>"
|
261
|
+
#
|
262
|
+
# assert_equal expected, actual
|
263
|
+
# end
|
264
|
+
|
242
265
|
# test 'test surround field into simple form' do
|
243
266
|
# actual = ui_form_for @user do |f|
|
244
267
|
# concat(f.ui_surround_field do |sf|
|
@@ -248,7 +271,7 @@ test1</textarea></div></form>"
|
|
248
271
|
# concat f.input(:name_fr, as: :ui_auto_complete_field, collection: @users, label_method: :name_fr)
|
249
272
|
# end
|
250
273
|
#
|
251
|
-
# expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input
|
274
|
+
# expected = "<form class=\"simple_form edit_user\" id=\"edit_user_1\" action=\"/users/1\" accept-charset=\"UTF-8\" method=\"post\"><input type=\"hidden\" name=\"_method\" value=\"patch\" /><div><div class=\"input-group\"><input type=\"text\" name=\"user[name_en]\" id=\"user_name_en\" value=\"test1 en\" class=\"text_field optional form-control\" /><span class=\"input-group-text\">€</span></div></div><div class=\"form-group ui_auto_complete_field optional user_name_fr\"><label class=\"control-label ui_auto_complete_field optional\" for=\"user_name_fr\">Name fr</label><input type=\"text\" name=\"user[name_fr]\" id=\"user_name_fr\" value=\"test1\" class=\"ui_auto_complete_field optional form-control auto-complete-field\" autocomplete=\"true\" list=\"user_name_fr-datalist\" /><datalist id=\"user_name_fr-datalist\"><option value=\"1\">test1</option>
|
252
275
|
# <option value=\"2\">test2</option></datalist></div></form>"
|
253
276
|
#
|
254
277
|
# assert_equal expected, actual
|