inline_forms 8.1.21 → 8.1.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.forgejo/workflows/ci.yml +63 -0
- data/.forgejo/workflows/full-gate.yml +75 -0
- data/.gitignore +4 -3
- data/.rubocop.yml +30 -0
- data/.rubocop_todo.yml +151 -0
- data/CHANGELOG.md +261 -0
- data/Gemfile +14 -2
- data/README.rdoc +23 -6
- data/Rakefile +2 -2
- data/app/assets/fonts/opensans-v44-latin-italic.woff2 +0 -0
- data/app/assets/fonts/opensans-v44-latin-regular.woff2 +0 -0
- data/app/assets/javascripts/inline_forms/inline_forms.js +30 -43
- data/app/assets/stylesheets/inline_forms/_foundation_icons.scss +6 -12
- data/app/assets/stylesheets/inline_forms/_theme.scss +134 -0
- data/app/assets/stylesheets/inline_forms/devise.scss +14 -13
- data/app/assets/stylesheets/inline_forms/foundation_and_overrides.scss +4 -0
- data/app/assets/stylesheets/inline_forms/inline_forms.scss +59 -68
- data/app/assets/stylesheets/inline_forms_fonts.css.erb +39 -0
- data/app/controllers/inline_forms_application_controller.rb +8 -4
- data/app/controllers/inline_forms_controller.rb +73 -14
- data/app/helpers/inline_forms_helper.rb +58 -15
- data/app/models/concerns/inline_forms/soft_deletable.rb +11 -12
- data/app/validators/curacao_id_number_validator.rb +5 -6
- data/app/validators/is_curacao_phone_validator.rb +2 -3
- data/app/validators/is_email_address_validator.rb +3 -3
- data/app/validators/must_be_a_value_validator.rb +6 -6
- data/app/views/inline_forms/_show.html.erb +1 -1
- data/app/views/layouts/application.html.erb +6 -3
- data/app/views/layouts/devise.html.erb +1 -0
- data/app/views/layouts/inline_forms.html.erb +7 -4
- data/archived/README.md +2 -0
- data/archived/form_elements/dns_records/README.md +25 -0
- data/archived/form_elements/question_list/README.md +25 -0
- data/inline_forms.gemspec +8 -7
- data/lib/generators/inline_forms_attribute_overrides.rb +3 -2
- data/lib/generators/templates/application_record.rb +1 -1
- data/lib/inline_forms/archived_form_elements.rb +23 -10
- data/lib/inline_forms/form_element_from_callee.rb +1 -0
- data/lib/inline_forms/form_element_registry.rb +32 -32
- data/lib/inline_forms/form_elements/color_field_helper.rb +44 -0
- data/lib/inline_forms/form_elements/date_helper.rb +4 -1
- data/lib/inline_forms/form_elements/dropdown_with_other_helper.rb +25 -113
- data/lib/inline_forms/form_elements/month_year_picker_helper.rb +13 -2
- data/lib/inline_forms/form_elements/multi_image_field_helper.rb +18 -6
- data/lib/inline_forms/form_elements/slider_with_values_helper.rb +31 -64
- data/lib/inline_forms/form_elements/time_helper.rb +3 -1
- data/lib/inline_forms/gem_files.rb +1 -0
- data/lib/inline_forms/tabs.rb +175 -0
- data/lib/inline_forms/turbo_tabs_builder.rb +20 -13
- data/lib/inline_forms/version.rb +2 -1
- data/lib/inline_forms.rb +59 -45
- data/test/archived_form_elements_test.rb +34 -4
- data/test/dummy/app/controllers/application_controller.rb +24 -0
- data/test/dummy/app/controllers/machines_controller.rb +4 -0
- data/test/dummy/app/controllers/parts_controller.rb +4 -0
- data/test/dummy/app/controllers/widgets_controller.rb +4 -0
- data/test/dummy/app/helpers/application_helper.rb +13 -0
- data/test/dummy/app/models/application_record.rb +26 -0
- data/test/dummy/app/models/kind.rb +8 -0
- data/test/dummy/app/models/machine.rb +23 -0
- data/test/dummy/app/models/part.rb +16 -0
- data/test/dummy/app/models/widget.rb +39 -0
- data/test/dummy/app/views/_inline_forms_tabs.html.erb +40 -0
- data/test/dummy/config/application.rb +34 -0
- data/test/dummy/config/database.yml +3 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/initializers/inline_forms.rb +6 -0
- data/test/dummy/config/initializers/paper_trail_yaml_safe_load.rb +28 -0
- data/test/dummy/config/routes.rb +22 -0
- data/test/integration/inline_forms_crud_test.rb +141 -0
- data/test/integration/legacy_elements_test.rb +42 -0
- data/test/integration/native_inputs_test.rb +138 -0
- data/test/integration/open_after_create_test.rb +85 -0
- data/test/integration_test_helper.rb +80 -0
- data/test/plain_text_configuration_test.rb +3 -3
- data/test/tabs_test.rb +98 -0
- data/test/user_model_config_test.rb +1 -0
- data/vendor/assets/javascripts/trix.min.js +7 -0
- data/vendor/assets/stylesheets/trix.css +470 -0
- metadata +63 -320
- data/app/assets/images/jquery-ui/animated-overlay.gif +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonal-maze_20_6e4f1c_10x10.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonal-maze_40_000000_10x10.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-medium_20_d34d17_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_25_c5ddfc_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_40_db4865_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_50_262626_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_50_93c3cd_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_50_ff3853_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-small_75_ccd232_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_15_0b3e6f_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_20_e69700_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_22_1484e6_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_26_2293f7_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_75_f3d8d8_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_8_333333_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_90_eeeeee_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diagonals-thick_95_ffdc2e_40x40.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_10_4f4221_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_20_372806_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_25_675423_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_25_d5ac5d_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_8_261803_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_diamond_8_443113_10x8.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-medium_30_0b58a2_4x4.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-medium_80_ffff38_4x4.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-small_20_333333_2x2.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-small_30_a32d00_2x2.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-small_35_35414f_2x2.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-small_40_00498f_2x2.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_dots-small_65_a6a6a6_2x2.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_10_eceadf_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_10_f8f7f6_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_15_eceadf_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_15_f7f3de_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_15_ffffff_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_65_654b24_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_fine-grain_68_b83400_60x60.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_303030_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_333333_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_4c4c4c_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_e69700_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_e6b900_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_10_000000_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_15_cd0a0a_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_30_cccccc_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_40_292929_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_50_5c5c5c_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_994d53_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_999999_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_c0402a_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_eeeeee_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_fafafa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_65_ffffff_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_75_aaaaaa_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_75_ba9217_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_75_ddd4b0_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_100_f5f0e5_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_100_f8f8f8_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_15_5f391b_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_20_555555_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_25_cb842e_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_35_dddddd_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_40_0078a3_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_40_0a0a0a_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_40_111111_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_40_ffc73d_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_45_0078ae_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_50_3baae3_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_1c1c1c_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_f1fbe5_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_f8da4e_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf8ee_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_55_fcf0ba_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_60_000000_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_60_eeeeee_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_70_ede4d4_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_79c9ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_100_ece8da_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_16_121212_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_20_111111_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_20_1c160d_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_25_333333_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_25_453326_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_30_3d3644_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_30_44372c_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_45_817865_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_45_e14f1c_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_50_6eac2c_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_55_000000_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_60_fece2f_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_70_ffdd57_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_75_2191c0_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_85_9fda58_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_90_fff9e5_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_gloss-wave_95_f6ecd5_500x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_f2f5f7_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_f4f0ec_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_f5f3e5_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_f6f6f6_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_100_fafaf4_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_15_459e00_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_15_888888_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_20_0972a5_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_30_285c00_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_40_aaaaaa_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_55_555555_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_65_fee4bd_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_70_000000_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_75_f5f5b5_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-hard_95_cccccc_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_dcd9de_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_deedf7_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_eae6ea_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_f9f9f9_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_100_feeebd_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_15_cc0000_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_20_201913_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_20_619226_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_25_30273a_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_25_67b021_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_25_ffef8f_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_33_003147_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_33_3a8104_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_35_222222_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_35_adadad_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_44_444444_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_45_5f5964_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_50_4eb305_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_50_aaaaaa_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_60_4ca20b_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_60_dddddd_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_80_eeeeee_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_highlight-soft_95_ffedad_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_eeeeee_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_45_cd0a0a_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_55_ffeb80_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-hard_75_999999_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_100_f4f0ec_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_10_201913_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_10_285c00_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_15_121212_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_15_2b2922_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_25_000000_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_30_f58400_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_30_ffffff_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_inset-soft_50_c9c9c9_1x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_loop_25_000000_21x21.png +0 -0
- data/app/assets/images/jquery-ui/ui-bg_white-lines_85_f7f7ba_40x100.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_000000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_004276_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_00498f_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_0078ae_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_056b93_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_070603_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_0a82eb_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_0b54d5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_1f1f1f_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_228ef1_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2694e8_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_3383bb_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_3572ac_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_3d3d3d_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_3d80b3_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_4b8e0b_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_4ca300_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_4eb305_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_5fa5e3_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_70b2e1_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_72a7cf_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_72b42d_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_734d99_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_808080_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_847e71_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_88a206_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_8DC262_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_8c291d_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_8d78a5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_98d2fb_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_999999_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_9bcc60_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_9ccdfc_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_9fda58_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_a83300_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_a8a3ae_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_aaaaaa_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_add978_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_b83400_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_b8ec79_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_bbbbbb_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_bd7b00_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_c02669_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_c47a23_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_c98000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cb672b_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cc0000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cccccc_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_d19405_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_e0fdff_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_e1e463_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_e3ddc9_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_e8e2b5_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_e9cd86_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_eb990f_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ebccce_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ed9f26_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ededed_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_eeeeee_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ef8c08_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_efec9f_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f08000_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f1fd86_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f29a00_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f2ec64_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f35f07_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f5e175_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f7a50d_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_f9f2bd_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_fadc7a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_fbc856_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_fbdb93_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_fcd113_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_fcdd4a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ff7519_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffcf29_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffd27a_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffe180_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffeb33_256x240.png +0 -0
- data/app/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/app/assets/stylesheets/jquery_ui/jquery.ui.accordion.css.scss +0 -39
- data/app/assets/stylesheets/jquery_ui/jquery.ui.all.css.scss +0 -14
- data/app/assets/stylesheets/jquery_ui/jquery.ui.autocomplete.css.scss +0 -17
- data/app/assets/stylesheets/jquery_ui/jquery.ui.base.css.scss +0 -27
- data/app/assets/stylesheets/jquery_ui/jquery.ui.button.css.scss +0 -115
- data/app/assets/stylesheets/jquery_ui/jquery.ui.core.css.scss +0 -92
- data/app/assets/stylesheets/jquery_ui/jquery.ui.datepicker.css.scss +0 -179
- data/app/assets/stylesheets/jquery_ui/jquery.ui.dialog.css.scss +0 -70
- data/app/assets/stylesheets/jquery_ui/jquery.ui.menu.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/jquery.ui.progressbar.css.scss +0 -29
- data/app/assets/stylesheets/jquery_ui/jquery.ui.resizable.css.scss +0 -79
- data/app/assets/stylesheets/jquery_ui/jquery.ui.selectable.css.scss +0 -16
- data/app/assets/stylesheets/jquery_ui/jquery.ui.slider.css.scss +0 -74
- data/app/assets/stylesheets/jquery_ui/jquery.ui.spinner.css.scss +0 -66
- data/app/assets/stylesheets/jquery_ui/jquery.ui.tabs.css.scss +0 -53
- data/app/assets/stylesheets/jquery_ui/jquery.ui.theme.css.scss +0 -408
- data/app/assets/stylesheets/jquery_ui/jquery.ui.tooltip.css.scss +0 -20
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.base.css.scss +0 -78
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.black-tie.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.blitzer.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.cupertino.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.dark-hive.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.dot-luv.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.eggplant.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.excite-bike.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.flick.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.hot-sneaks.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.humanity.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.le-frog.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.mint-choc.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.overcast.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.pepper-grinder.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.redmond.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.smoothness.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.south-street.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.start.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.sunny.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.swanky-purse.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.trontastic.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.ui-darkness.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.ui-lightness.css.scss +0 -80
- data/app/assets/stylesheets/jquery_ui/themes/_jquery.ui.vader.css.scss +0 -80
- /data/{lib → archived/form_elements/dns_records/lib}/inline_forms/form_elements/dns_records_helper.rb +0 -0
- /data/{lib → archived/form_elements/question_list/lib}/inline_forms/form_elements/question_list_helper.rb +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
|
|
3
|
+
module InlineForms
|
|
4
|
+
# Vendored replacement for the tabs_on_rails gem (8.1.23).
|
|
5
|
+
#
|
|
6
|
+
# inline_forms used tabs_on_rails 3.0.0 (MIT, Copyright (c) 2009-2017
|
|
7
|
+
# Simone Carletti <weppos@weppos.net>; last released 2017) for exactly four
|
|
8
|
+
# things: the controller `set_tab` DSL, the `current_tab`/`current_tab?`
|
|
9
|
+
# helpers, the `tabs_tag` view helper, and the `TabsBuilder` base class that
|
|
10
|
+
# InlineForms::TurboTabsBuilder subclasses. This file ports that surface —
|
|
11
|
+
# API-compatible with the gem — so generated apps no longer need an
|
|
12
|
+
# unmaintained dependency (which was also an *undeclared* one: the engine
|
|
13
|
+
# required "tabs_on_rails" but the gemspec never listed it; only the
|
|
14
|
+
# installer-written Gemfile made it load).
|
|
15
|
+
#
|
|
16
|
+
# The port keeps upstream semantics:
|
|
17
|
+
#
|
|
18
|
+
# class OwnersController < ApplicationController
|
|
19
|
+
# set_tab :owner # class-level, uses before_action
|
|
20
|
+
# set_tab :naw, :subtabs, only: :show
|
|
21
|
+
# end
|
|
22
|
+
#
|
|
23
|
+
# <%= tabs_tag builder: InlineForms::TurboTabsBuilder do |tab| %>
|
|
24
|
+
# <%= tab.naw "NAW", owner_path(@object, tab: :naw) %>
|
|
25
|
+
# <% end %>
|
|
26
|
+
#
|
|
27
|
+
# If the host app still bundles the tabs_on_rails gem (apps generated before
|
|
28
|
+
# 8.1.23), the engine skips its own controller include and leaves the gem's
|
|
29
|
+
# identical implementation in charge — see the engine initializer in
|
|
30
|
+
# lib/inline_forms.rb.
|
|
31
|
+
module Tabs
|
|
32
|
+
# Controller mixin: tab state lives in @tab_stack per namespace.
|
|
33
|
+
module Controller
|
|
34
|
+
extend ActiveSupport::Concern
|
|
35
|
+
|
|
36
|
+
included do
|
|
37
|
+
extend ClassMethods
|
|
38
|
+
helper HelperMethods
|
|
39
|
+
helper_method :current_tab, :current_tab?
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
protected
|
|
43
|
+
|
|
44
|
+
def set_tab(name, namespace = nil)
|
|
45
|
+
tab_stack[namespace || :default] = name
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def current_tab(namespace = nil)
|
|
49
|
+
tab_stack[namespace || :default]
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def current_tab?(name, namespace = nil)
|
|
53
|
+
current_tab(namespace).to_s == name.to_s
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def tab_stack
|
|
57
|
+
@tab_stack ||= {}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
module ClassMethods
|
|
61
|
+
# set_tab :foo
|
|
62
|
+
# set_tab :foo, only: [:index, :show]
|
|
63
|
+
# set_tab :foo, :namespace, except: :new
|
|
64
|
+
def set_tab(*args)
|
|
65
|
+
options = args.extract_options!
|
|
66
|
+
name, namespace = args
|
|
67
|
+
|
|
68
|
+
before_action(options) do |controller|
|
|
69
|
+
controller.send(:set_tab, name, namespace)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
module HelperMethods
|
|
75
|
+
def tabs_tag(options = {}, &block)
|
|
76
|
+
Renderer.new(self, { namespace: :default }.merge(options)).render(&block)
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Renders a tab group: open tag, one tab_for per named tab, close tag.
|
|
82
|
+
# `tab.anything(...)` is dispatched to the builder's tab_for via
|
|
83
|
+
# method_missing, exactly like upstream.
|
|
84
|
+
class Renderer
|
|
85
|
+
def initialize(context, options = {})
|
|
86
|
+
@context = context
|
|
87
|
+
@builder = (options.delete(:builder) || TabsBuilder).new(@context, options)
|
|
88
|
+
@options = options
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
def open_tabs(*args)
|
|
92
|
+
call_builder(:open_tabs, *args)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def close_tabs(*args)
|
|
96
|
+
call_builder(:close_tabs, *args)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def method_missing(*args, &block)
|
|
100
|
+
@builder.tab_for(*args, &block)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def respond_to_missing?(_name, _include_private = false)
|
|
104
|
+
true
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def render(&block)
|
|
108
|
+
raise LocalJumpError, "no block given" unless block_given?
|
|
109
|
+
|
|
110
|
+
options = @options.dup
|
|
111
|
+
open_tabs_options = options.delete(:open_tabs) || {}
|
|
112
|
+
close_tabs_options = options.delete(:close_tabs) || {}
|
|
113
|
+
|
|
114
|
+
"".dup.tap do |html|
|
|
115
|
+
html << open_tabs(open_tabs_options).to_s
|
|
116
|
+
html << @context.capture(self, &block)
|
|
117
|
+
html << close_tabs(close_tabs_options).to_s
|
|
118
|
+
end.html_safe
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
private
|
|
122
|
+
|
|
123
|
+
def call_builder(name, *args)
|
|
124
|
+
method = @builder.method(name)
|
|
125
|
+
method.arity.zero? ? method.call : method.call(*args)
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Abstract builder API (initialize signature is part of the contract:
|
|
130
|
+
# custom builders from either this module or the old gem are duck-typed
|
|
131
|
+
# against it).
|
|
132
|
+
class Builder
|
|
133
|
+
def initialize(context, options = {})
|
|
134
|
+
@context = context
|
|
135
|
+
@namespace = options.delete(:namespace) || :default
|
|
136
|
+
@options = options
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def current_tab?(tab)
|
|
140
|
+
tab.to_s == @context.current_tab(@namespace).to_s
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def tab_for(*args)
|
|
144
|
+
raise NotImplementedError
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def open_tabs(*args); end
|
|
148
|
+
|
|
149
|
+
def close_tabs(*args); end
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Default builder: <ul> of <li><a>, active tab as <li class="current"><span>.
|
|
153
|
+
class TabsBuilder < Builder
|
|
154
|
+
def tab_for(tab, name, url_options, item_options = {})
|
|
155
|
+
if current_tab?(tab)
|
|
156
|
+
item_options[:class] = item_options[:class].to_s.split(" ")
|
|
157
|
+
.push(@options[:active_class] || "current")
|
|
158
|
+
.join(" ")
|
|
159
|
+
end
|
|
160
|
+
content = @context.link_to_unless(current_tab?(tab), name, url_options) do
|
|
161
|
+
@context.content_tag(:span, name)
|
|
162
|
+
end
|
|
163
|
+
@context.content_tag(:li, content, item_options)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def open_tabs(options = {})
|
|
167
|
+
@context.tag("ul", options, true)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
def close_tabs(_options = {})
|
|
171
|
+
"</ul>".html_safe
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
require "inline_forms/tabs"
|
|
3
4
|
|
|
4
5
|
module InlineForms
|
|
5
6
|
# Tabs_on_rails 3.0 (weppos, RubyGems) only threads the 4th argument of
|
|
@@ -29,9 +30,14 @@ module InlineForms
|
|
|
29
30
|
#
|
|
30
31
|
# `link_options:` is consumed by the builder and forwarded to `link_to`;
|
|
31
32
|
# everything else still applies to the `<li>` exactly like the upstream
|
|
32
|
-
# `TabsBuilder`. Active-tab highlighting still uses
|
|
33
|
-
#
|
|
34
|
-
|
|
33
|
+
# `TabsBuilder`. Active-tab highlighting still uses `current_tab?` (driven
|
|
34
|
+
# by controller `set_tab :foo`).
|
|
35
|
+
#
|
|
36
|
+
# Since 8.1.23 this subclasses the vendored InlineForms::Tabs::TabsBuilder
|
|
37
|
+
# (tabs_on_rails itself is no longer a dependency). The builder contract is
|
|
38
|
+
# duck-typed, so this class also still works if a pre-8.1.23 app renders it
|
|
39
|
+
# through the tabs_on_rails gem's `tabs_tag`.
|
|
40
|
+
class TurboTabsBuilder < InlineForms::Tabs::TabsBuilder
|
|
35
41
|
def tab_for(tab, name, url_options, item_options = {})
|
|
36
42
|
link_options = item_options.delete(:link_options) || {}
|
|
37
43
|
active = current_tab?(tab)
|
|
@@ -39,7 +45,7 @@ module InlineForms
|
|
|
39
45
|
if active
|
|
40
46
|
active_class = @options[:active_class] || "current"
|
|
41
47
|
existing = item_options[:class].to_s.split(/\s+/).reject(&:empty?)
|
|
42
|
-
item_options[:class] = (existing + [active_class]).uniq.join(" ")
|
|
48
|
+
item_options[:class] = (existing + [ active_class ]).uniq.join(" ")
|
|
43
49
|
end
|
|
44
50
|
|
|
45
51
|
# The active label is rendered as an `<a>` *without* an href so that
|
|
@@ -48,14 +54,15 @@ module InlineForms
|
|
|
48
54
|
# it up just like the inactive tabs. Skipping the href keeps the
|
|
49
55
|
# active tab non-clickable, and `aria-current="page"` advertises
|
|
50
56
|
# the selection state to assistive tech / Foundation's CSS.
|
|
51
|
-
content =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
content =
|
|
58
|
+
if active
|
|
59
|
+
@context.content_tag(:a, name,
|
|
60
|
+
link_options.merge("aria-current" => "page",
|
|
61
|
+
"aria-selected" => "true"))
|
|
62
|
+
else
|
|
63
|
+
@context.link_to(name, url_options,
|
|
64
|
+
link_options.merge("aria-selected" => "false"))
|
|
65
|
+
end
|
|
59
66
|
|
|
60
67
|
@context.content_tag(:li, content, item_options)
|
|
61
68
|
end
|
data/lib/inline_forms/version.rb
CHANGED
data/lib/inline_forms.rb
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
|
+
|
|
2
3
|
require "inline_forms/version"
|
|
3
4
|
require "inline_forms/form_element_from_callee"
|
|
4
5
|
require "inline_forms/archived_form_elements"
|
|
5
6
|
require "inline_forms/form_element_registry"
|
|
6
7
|
require "inline_forms/form_elements"
|
|
8
|
+
require "inline_forms/tabs"
|
|
7
9
|
require "inline_forms/turbo_tabs_builder"
|
|
8
10
|
# InlineForms is a Rails Engine that let you setup an admin interface quick and
|
|
9
11
|
# easy. Please install it as a gem or include it in your Gemfile.
|
|
@@ -33,17 +35,17 @@ module InlineForms
|
|
|
33
35
|
# end
|
|
34
36
|
#
|
|
35
37
|
DEFAULT_COLUMN_TYPES = {
|
|
36
|
-
:
|
|
37
|
-
:
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:
|
|
41
|
-
:
|
|
42
|
-
:
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
:
|
|
46
|
-
:
|
|
38
|
+
string: :string,
|
|
39
|
+
text: :text,
|
|
40
|
+
integer: :integer,
|
|
41
|
+
float: :float,
|
|
42
|
+
decimal: :decimal,
|
|
43
|
+
datetime: :datetime,
|
|
44
|
+
timestamp: :timestamp,
|
|
45
|
+
time: :time,
|
|
46
|
+
date: :date,
|
|
47
|
+
binary: :binary,
|
|
48
|
+
boolean: :boolean
|
|
47
49
|
# :references => :belongs_to,
|
|
48
50
|
# :belongs_to => :belongs_to,
|
|
49
51
|
}
|
|
@@ -67,17 +69,17 @@ module InlineForms
|
|
|
67
69
|
# as you see, both :string and :integer are mapped to a :text_field
|
|
68
70
|
#
|
|
69
71
|
DEFAULT_FORM_ELEMENTS = {
|
|
70
|
-
:
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
:
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
:
|
|
77
|
-
:
|
|
78
|
-
:
|
|
79
|
-
:
|
|
80
|
-
:
|
|
72
|
+
string: :text_field,
|
|
73
|
+
text: :plain_text,
|
|
74
|
+
integer: :text_field,
|
|
75
|
+
float: :text_field,
|
|
76
|
+
decimal: :text_field,
|
|
77
|
+
datetime: :datetime_select,
|
|
78
|
+
timestamp: :datetime_select,
|
|
79
|
+
time: :time_select,
|
|
80
|
+
date: :date_select,
|
|
81
|
+
binary: :text_field,
|
|
82
|
+
boolean: :check_box
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
# SPECIAL_COLUMN_TYPES maps the column types that we define here and in
|
|
@@ -96,7 +98,7 @@ module InlineForms
|
|
|
96
98
|
# to the inline_forms_attribute_list in the model.
|
|
97
99
|
#
|
|
98
100
|
SPECIAL_COLUMN_TYPES = {
|
|
99
|
-
:
|
|
101
|
+
associated: :no_migration
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
PLAIN_TEXT_FORM_ELEMENTS = %i[
|
|
@@ -161,19 +163,19 @@ module InlineForms
|
|
|
161
163
|
# rails g inline_forms Example phone_number:string type_of_number:dropdown client:belongs_to
|
|
162
164
|
#
|
|
163
165
|
RELATIONS = {
|
|
164
|
-
:
|
|
165
|
-
:
|
|
166
|
+
belongs_to: :belongs_to,
|
|
167
|
+
references: :belongs_to
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
# SPECIAL_RELATIONS maps AR relations to migrations.
|
|
169
171
|
# In most cases, these relations have no migration at all, but they do need
|
|
170
172
|
# a line in the model.
|
|
171
173
|
SPECIAL_RELATIONS = {
|
|
172
|
-
:
|
|
173
|
-
:
|
|
174
|
-
:
|
|
175
|
-
:
|
|
176
|
-
:
|
|
174
|
+
has_many: :no_migration,
|
|
175
|
+
has_many_destroy: :no_migration,
|
|
176
|
+
has_one: :no_migration,
|
|
177
|
+
has_and_belongs_to_many: :no_migration,
|
|
178
|
+
habtm: :no_migration
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
# load form elements. Each element goes into a separate file
|
|
@@ -182,7 +184,6 @@ module InlineForms
|
|
|
182
184
|
|
|
183
185
|
# Declare as a Rails::Engine, see http://www.ruby-forum.com/topic/211017#927932
|
|
184
186
|
class Engine < Rails::Engine
|
|
185
|
-
|
|
186
187
|
initializer "inline_forms.form_element_registry" do
|
|
187
188
|
InlineForms::FormElementRegistry.apply!
|
|
188
189
|
end
|
|
@@ -204,25 +205,39 @@ module InlineForms
|
|
|
204
205
|
ValidationHints::ValidationsPatch.apply!
|
|
205
206
|
end
|
|
206
207
|
|
|
208
|
+
# Tabs support (set_tab / current_tab? / tabs_tag) is vendored in
|
|
209
|
+
# InlineForms::Tabs since 8.1.23. Apps generated before 8.1.23 still bundle
|
|
210
|
+
# the tabs_on_rails gem, whose Railtie includes the identical API into
|
|
211
|
+
# ActionController::Base — skip ours then so the two don't stack.
|
|
212
|
+
initializer "inline_forms.tabs" do
|
|
213
|
+
ActiveSupport.on_load(:action_controller) do
|
|
214
|
+
unless defined?(TabsOnRails::ActionController)
|
|
215
|
+
::ActionController::Base.include(InlineForms::Tabs::Controller)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
207
220
|
initializer "inline_forms.assets.precompile" do |app|
|
|
208
|
-
|
|
221
|
+
# Skip when the host has no Sprockets-style pipeline (e.g. the test/dummy
|
|
222
|
+
# harness); generated apps always bundle sprockets-rails.
|
|
223
|
+
next unless app.config.respond_to?(:assets)
|
|
224
|
+
|
|
225
|
+
app.config.assets.precompile += %w[
|
|
209
226
|
inline_forms/inline_forms.css
|
|
210
227
|
inline_forms/devise.css
|
|
211
228
|
inline_forms/inline_forms.js
|
|
229
|
+
inline_forms_fonts.css
|
|
212
230
|
popper.min.js
|
|
213
231
|
tippy-bundle.umd.min.js
|
|
232
|
+
trix.min.js
|
|
233
|
+
trix.css
|
|
214
234
|
inline_forms/glass_plate.gif
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
initializer "inline_forms.jquery_ui_stylesheet_path" do |app|
|
|
222
|
-
path = root.join("app", "assets", "stylesheets", "jquery_ui")
|
|
223
|
-
next unless path.directory?
|
|
224
|
-
|
|
225
|
-
app.config.assets.paths << path unless app.config.assets.paths.include?(path)
|
|
235
|
+
foundation-icons.woff
|
|
236
|
+
foundation-icons.ttf
|
|
237
|
+
foundation-icons.svg
|
|
238
|
+
opensans-v44-latin-regular.woff2
|
|
239
|
+
opensans-v44-latin-italic.woff2
|
|
240
|
+
]
|
|
226
241
|
end
|
|
227
242
|
|
|
228
243
|
config.to_prepare do
|
|
@@ -242,8 +257,7 @@ module InlineForms
|
|
|
242
257
|
end
|
|
243
258
|
end
|
|
244
259
|
|
|
245
|
-
I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__) +
|
|
260
|
+
I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__) + "/locales"), "*.yml")]
|
|
246
261
|
I18n.load_path.flatten!
|
|
247
262
|
end
|
|
248
|
-
|
|
249
263
|
end
|
|
@@ -6,25 +6,25 @@ require "inline_forms/archived_form_elements"
|
|
|
6
6
|
class ArchivedFormElementsTest < Minitest::Test
|
|
7
7
|
class ModelWithArchivedElement
|
|
8
8
|
def inline_forms_attribute_list
|
|
9
|
-
[[:address, :geo_code_curacao]]
|
|
9
|
+
[ [ :address, :geo_code_curacao ] ]
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
class ModelWithArchivedTree
|
|
14
14
|
def inline_forms_attribute_list
|
|
15
|
-
[[:children, :tree]]
|
|
15
|
+
[ [ :children, :tree ] ]
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
class ModelWithArchivedCkeditor
|
|
20
20
|
def inline_forms_attribute_list
|
|
21
|
-
[[:body, :ckeditor]]
|
|
21
|
+
[ [ :body, :ckeditor ] ]
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
class ModelWithArchivedTextAreaWithoutCkeditor
|
|
26
26
|
def inline_forms_attribute_list
|
|
27
|
-
[[:notes, :text_area_without_ckeditor]]
|
|
27
|
+
[ [ :notes, :text_area_without_ckeditor ] ]
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -68,4 +68,34 @@ class ArchivedFormElementsTest < Minitest::Test
|
|
|
68
68
|
assert_equal "6.3.0", meta[:removed_in_version]
|
|
69
69
|
assert_nil meta[:archive_path]
|
|
70
70
|
end
|
|
71
|
+
|
|
72
|
+
class ModelWithArchivedQuestionList
|
|
73
|
+
def inline_forms_attribute_list
|
|
74
|
+
[ [ :questions, :question_list ] ]
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
class ModelWithArchivedDnsrecords
|
|
79
|
+
def inline_forms_attribute_list
|
|
80
|
+
[ [ :records, :dnsrecords ] ]
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def test_raises_when_model_declares_archived_question_list
|
|
85
|
+
err = assert_raises(InlineForms::ArchivedFormElementError) do
|
|
86
|
+
InlineForms.validate_no_archived_form_elements_for!(ModelWithArchivedQuestionList)
|
|
87
|
+
end
|
|
88
|
+
assert_includes err.message, "question_list"
|
|
89
|
+
assert_includes err.message, "8.1.30"
|
|
90
|
+
assert_includes err.message, "archived/form_elements/question_list"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def test_raises_when_model_declares_archived_dnsrecords
|
|
94
|
+
err = assert_raises(InlineForms::ArchivedFormElementError) do
|
|
95
|
+
InlineForms.validate_no_archived_form_elements_for!(ModelWithArchivedDnsrecords)
|
|
96
|
+
end
|
|
97
|
+
assert_includes err.message, "dnsrecords"
|
|
98
|
+
assert_includes err.message, "8.1.30"
|
|
99
|
+
assert_includes err.message, "archived/form_elements/dns_records"
|
|
100
|
+
end
|
|
71
101
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class ApplicationController < ActionController::Base
|
|
4
|
+
# Devise/role stand-in. The full `layouts/inline_forms` chrome (rendered by
|
|
5
|
+
# create/new HTML responses) calls `current_user.name` and
|
|
6
|
+
# `current_user.role?`, so a nil current_user cannot render it. The stub is
|
|
7
|
+
# superadmin so `destroy_permitted?` allows hard destroy, matching the
|
|
8
|
+
# generated apps' test user.
|
|
9
|
+
DummyUser = Struct.new(:id, :name) do
|
|
10
|
+
def role?(role)
|
|
11
|
+
role.to_sym == :superadmin
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
helper_method :current_user
|
|
16
|
+
|
|
17
|
+
def current_user
|
|
18
|
+
@current_user ||= DummyUser.new(1, "Dummy User")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def devise_controller?
|
|
22
|
+
false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Mirrors the helper the installer writes into host apps (installer_core.rb);
|
|
4
|
+
# the full `layouts/inline_forms` chrome needs it.
|
|
5
|
+
module ApplicationHelper
|
|
6
|
+
def application_name
|
|
7
|
+
"Dummy"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def application_title
|
|
11
|
+
"Dummy"
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Mirrors the host-app contract the installer's application_record.rb template
|
|
4
|
+
# establishes (lib/generators/templates/application_record.rb): paper_trail on
|
|
5
|
+
# every model, will_paginate per_page, inline_forms list/search scopes, and
|
|
6
|
+
# the not_accessible_through_html? default the engine controller consults.
|
|
7
|
+
class ApplicationRecord < ActiveRecord::Base
|
|
8
|
+
self.abstract_class = true
|
|
9
|
+
|
|
10
|
+
has_paper_trail on: [ :create, :update, :destroy ]
|
|
11
|
+
|
|
12
|
+
attr_writer :inline_forms_attribute_list
|
|
13
|
+
|
|
14
|
+
self.per_page = 7
|
|
15
|
+
|
|
16
|
+
scope :inline_forms_list, -> { all }
|
|
17
|
+
scope :inline_forms_search, ->(_q) { all }
|
|
18
|
+
|
|
19
|
+
def human_attribute_name(*args)
|
|
20
|
+
self.class.human_attribute_name(*args)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.not_accessible_through_html?
|
|
24
|
+
false
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Parent with an :associated (has_many) panel, shaped like the example app's
|
|
4
|
+
# Apartment (photos:has_many photos:associated). Exercises the
|
|
5
|
+
# open-after-create flow (InlineFormsController#render_created_row_open_streams).
|
|
6
|
+
class Machine < ApplicationRecord
|
|
7
|
+
has_many :parts
|
|
8
|
+
|
|
9
|
+
validates :name, presence: true
|
|
10
|
+
|
|
11
|
+
scope :inline_forms_list, -> { order(:name, :id) }
|
|
12
|
+
|
|
13
|
+
def _presentation
|
|
14
|
+
"#{name}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def inline_forms_attribute_list
|
|
18
|
+
@inline_forms_attribute_list ||= [
|
|
19
|
+
[ :name, :text_field ],
|
|
20
|
+
[ :parts, :associated ]
|
|
21
|
+
]
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Child of Machine (see machine.rb); shaped like the example app's Photo.
|
|
4
|
+
class Part < ApplicationRecord
|
|
5
|
+
belongs_to :machine, optional: true
|
|
6
|
+
|
|
7
|
+
def _presentation
|
|
8
|
+
"#{name}"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def inline_forms_attribute_list
|
|
12
|
+
@inline_forms_attribute_list ||= [
|
|
13
|
+
[ :name, :text_field ]
|
|
14
|
+
]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Exercises one representative of each form-element family the integration
|
|
4
|
+
# tests cover; shaped exactly like a `rails g inline_forms` model.
|
|
5
|
+
class Widget < ApplicationRecord
|
|
6
|
+
belongs_to :kind, optional: true
|
|
7
|
+
|
|
8
|
+
validates :name, presence: true
|
|
9
|
+
|
|
10
|
+
scope :inline_forms_list, -> { order(:name, :id) }
|
|
11
|
+
scope :inline_forms_search, ->(q) { where("name LIKE ?", "%#{q}%") }
|
|
12
|
+
|
|
13
|
+
def _presentation
|
|
14
|
+
"#{name}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def inline_forms_attribute_list
|
|
18
|
+
@inline_forms_attribute_list ||= [
|
|
19
|
+
[ :name, :text_field ],
|
|
20
|
+
[ :notes, :plain_text_area ],
|
|
21
|
+
[ :released_on, :date_select ],
|
|
22
|
+
[ :meeting_at, :time_select ],
|
|
23
|
+
[ :start_month, :month_year_picker ],
|
|
24
|
+
[ :priority, :dropdown_with_values, { 1 => "low", 2 => "mid", 3 => "high" } ],
|
|
25
|
+
[ :active, :check_box, { 0 => "no", 1 => "yes" } ],
|
|
26
|
+
[ :kind, :dropdown_with_other ],
|
|
27
|
+
[ :rating, :slider_with_values, { 1 => "one", 2 => "two", 3 => "three", 4 => "four", 5 => "five" } ],
|
|
28
|
+
# simple_file_field's values entry names the host download route method
|
|
29
|
+
# (attribute_values(...)[0][1]); only used when a file is present.
|
|
30
|
+
[ :manual, :simple_file_field, { 0 => "download" } ],
|
|
31
|
+
[ :accent, :color_field ],
|
|
32
|
+
[ :report, :pdf_link ]
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def <=>(other)
|
|
37
|
+
name <=> other.name
|
|
38
|
+
end
|
|
39
|
+
end
|