inline_forms 8.1.21 → 8.1.42
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 +77 -0
- data/.gitignore +10 -5
- data/.rubocop.yml +31 -0
- data/.rubocop_todo.yml +151 -0
- data/CHANGELOG.md +305 -0
- data/CLAUDE.md +68 -0
- data/Gemfile +18 -2
- data/README.rdoc +23 -6
- data/Rakefile +53 -12
- 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 +88 -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/_new.html.erb +4 -1
- data/app/views/inline_forms/_pending_migration_row.html.erb +15 -0
- data/app/views/inline_forms/_show.html.erb +5 -2
- data/app/views/inline_forms/field_pending.html.erb +10 -0
- 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_addto/USAGE +31 -0
- data/lib/generators/inline_forms_addto_generator.rb +198 -26
- 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/attribute_list.rb +191 -0
- 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 +27 -0
- data/lib/inline_forms/schema_apply.rb +85 -0
- data/lib/inline_forms/schema_intent.rb +76 -0
- data/lib/inline_forms/schema_label.rb +65 -0
- data/lib/inline_forms/schema_preview.rb +135 -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 +145 -45
- data/lib/locales/inline_forms.en.yml +2 -0
- data/lib/locales/inline_forms.nl.yml +2 -0
- data/test/archived_form_elements_test.rb +34 -4
- data/test/attribute_list_test.rb +165 -0
- data/test/dummy/app/controllers/application_controller.rb +24 -0
- data/test/dummy/app/controllers/gizmos_controller.rb +4 -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/gizmo.rb +25 -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 +37 -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 +31 -0
- data/test/inline_forms_addto_generator_test.rb +220 -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/pending_migration_gate_test.rb +75 -0
- data/test/integration/schema_batch_pipeline_test.rb +189 -0
- data/test/integration/schema_edit_test.rb +141 -0
- data/test/integration/schema_preview_test.rb +65 -0
- data/test/integration_test_helper.rb +121 -0
- data/test/plain_text_configuration_test.rb +3 -3
- data/test/schema_apply_test.rb +73 -0
- data/test/schema_intent_test.rb +53 -0
- data/test/schema_label_test.rb +61 -0
- 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 +91 -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,16 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
|
+
|
|
2
3
|
require "inline_forms/version"
|
|
4
|
+
require "inline_forms/attribute_list"
|
|
5
|
+
require "inline_forms/schema_intent"
|
|
6
|
+
require "inline_forms/schema_preview"
|
|
7
|
+
require "inline_forms/schema_apply"
|
|
8
|
+
require "inline_forms/schema_label"
|
|
3
9
|
require "inline_forms/form_element_from_callee"
|
|
4
10
|
require "inline_forms/archived_form_elements"
|
|
5
11
|
require "inline_forms/form_element_registry"
|
|
6
12
|
require "inline_forms/form_elements"
|
|
13
|
+
require "inline_forms/tabs"
|
|
7
14
|
require "inline_forms/turbo_tabs_builder"
|
|
8
15
|
# InlineForms is a Rails Engine that let you setup an admin interface quick and
|
|
9
16
|
# easy. Please install it as a gem or include it in your Gemfile.
|
|
@@ -33,17 +40,17 @@ module InlineForms
|
|
|
33
40
|
# end
|
|
34
41
|
#
|
|
35
42
|
DEFAULT_COLUMN_TYPES = {
|
|
36
|
-
:
|
|
37
|
-
:
|
|
38
|
-
:
|
|
39
|
-
:
|
|
40
|
-
:
|
|
41
|
-
:
|
|
42
|
-
:
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
:
|
|
46
|
-
:
|
|
43
|
+
string: :string,
|
|
44
|
+
text: :text,
|
|
45
|
+
integer: :integer,
|
|
46
|
+
float: :float,
|
|
47
|
+
decimal: :decimal,
|
|
48
|
+
datetime: :datetime,
|
|
49
|
+
timestamp: :timestamp,
|
|
50
|
+
time: :time,
|
|
51
|
+
date: :date,
|
|
52
|
+
binary: :binary,
|
|
53
|
+
boolean: :boolean
|
|
47
54
|
# :references => :belongs_to,
|
|
48
55
|
# :belongs_to => :belongs_to,
|
|
49
56
|
}
|
|
@@ -67,17 +74,17 @@ module InlineForms
|
|
|
67
74
|
# as you see, both :string and :integer are mapped to a :text_field
|
|
68
75
|
#
|
|
69
76
|
DEFAULT_FORM_ELEMENTS = {
|
|
70
|
-
:
|
|
71
|
-
:
|
|
72
|
-
:
|
|
73
|
-
:
|
|
74
|
-
:
|
|
75
|
-
:
|
|
76
|
-
:
|
|
77
|
-
:
|
|
78
|
-
:
|
|
79
|
-
:
|
|
80
|
-
:
|
|
77
|
+
string: :text_field,
|
|
78
|
+
text: :plain_text,
|
|
79
|
+
integer: :text_field,
|
|
80
|
+
float: :text_field,
|
|
81
|
+
decimal: :text_field,
|
|
82
|
+
datetime: :datetime_select,
|
|
83
|
+
timestamp: :datetime_select,
|
|
84
|
+
time: :time_select,
|
|
85
|
+
date: :date_select,
|
|
86
|
+
binary: :text_field,
|
|
87
|
+
boolean: :check_box
|
|
81
88
|
}
|
|
82
89
|
|
|
83
90
|
# SPECIAL_COLUMN_TYPES maps the column types that we define here and in
|
|
@@ -96,7 +103,7 @@ module InlineForms
|
|
|
96
103
|
# to the inline_forms_attribute_list in the model.
|
|
97
104
|
#
|
|
98
105
|
SPECIAL_COLUMN_TYPES = {
|
|
99
|
-
:
|
|
106
|
+
associated: :no_migration
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
PLAIN_TEXT_FORM_ELEMENTS = %i[
|
|
@@ -104,6 +111,25 @@ module InlineForms
|
|
|
104
111
|
plain_text_area
|
|
105
112
|
].freeze
|
|
106
113
|
|
|
114
|
+
# Form elements that render a set of choices and therefore REQUIRE a values
|
|
115
|
+
# hash as the 3rd element of their attribute_list row (their _show/_edit
|
|
116
|
+
# helpers call `attribute_values`, which raises when it is missing). Shared by
|
|
117
|
+
# the addto generator and the schema GUI/preview so both insert a placeholder.
|
|
118
|
+
VALUE_BEARING_FORM_ELEMENTS = %i[
|
|
119
|
+
dropdown_with_values
|
|
120
|
+
dropdown_with_integers
|
|
121
|
+
dropdown_with_values_with_stars
|
|
122
|
+
radio_button
|
|
123
|
+
check_box
|
|
124
|
+
scale_with_integers
|
|
125
|
+
scale_with_values
|
|
126
|
+
slider_with_values
|
|
127
|
+
].freeze
|
|
128
|
+
|
|
129
|
+
# Placeholder values hash inserted when a value-bearing element is added
|
|
130
|
+
# programmatically (generator / GUI); the user edits it to real values after.
|
|
131
|
+
PLACEHOLDER_VALUES = { 1 => "one", 2 => "two" }.freeze
|
|
132
|
+
|
|
107
133
|
def self.plain_text_form_element?(form_element)
|
|
108
134
|
PLAIN_TEXT_FORM_ELEMENTS.include?(form_element.to_sym)
|
|
109
135
|
rescue NoMethodError
|
|
@@ -119,6 +145,68 @@ module InlineForms
|
|
|
119
145
|
"Use :rich_text for ActionText-backed attributes, or add a text column for :plain_text."
|
|
120
146
|
end
|
|
121
147
|
|
|
148
|
+
# Form elements exempt from the pending-migration gate. They either render a
|
|
149
|
+
# label only (:header), or read a *virtual* attribute whose name is not its
|
|
150
|
+
# backing column — :devise_password_field (backed by encrypted_password),
|
|
151
|
+
# :money_field (backed by a *_cents column via money-rails), :info
|
|
152
|
+
# (conventionally bound to pre-existing columns like created_at). None of
|
|
153
|
+
# these are produced by `inline_forms_addto` in the transient pre-migrate
|
|
154
|
+
# window, so gating them would only ever mis-fire.
|
|
155
|
+
PENDING_GATE_EXEMPT_FORM_ELEMENTS = %i[
|
|
156
|
+
header
|
|
157
|
+
info
|
|
158
|
+
devise_password_field
|
|
159
|
+
money_field
|
|
160
|
+
].freeze
|
|
161
|
+
|
|
162
|
+
# True when an attribute_list row references a column that its model's table
|
|
163
|
+
# does not have yet — i.e. the model file was edited (row added) but the
|
|
164
|
+
# migration adding the column has not run. Rendering or writing such a row
|
|
165
|
+
# raises (e.g. `object[:foo]` / `foo_show` on a missing column), so callers
|
|
166
|
+
# gate on this to show a "pending migration" placeholder and skip writes
|
|
167
|
+
# instead of 500ing during the window between `rails g inline_forms_addto`
|
|
168
|
+
# and `rails db:migrate`.
|
|
169
|
+
#
|
|
170
|
+
# Detection is column-presence based (robust): the expected column is derived
|
|
171
|
+
# from the form element via the same type maps the generator uses. `nil`
|
|
172
|
+
# (associations, rich_text, pdf_link, unknown elements) and virtual-backed
|
|
173
|
+
# elements (see PENDING_GATE_EXEMPT_FORM_ELEMENTS) are never gated. The gate
|
|
174
|
+
# self-heals: once the migration runs and the schema cache reflects the new
|
|
175
|
+
# column, the column is present and the row renders normally — no flag to
|
|
176
|
+
# clear, nothing to maintain.
|
|
177
|
+
def self.attribute_pending_migration?(object, attribute, form_element)
|
|
178
|
+
fe = form_element.to_sym
|
|
179
|
+
return false if PENDING_GATE_EXEMPT_FORM_ELEMENTS.include?(fe)
|
|
180
|
+
|
|
181
|
+
klass = object.class
|
|
182
|
+
return false unless klass.respond_to?(:table_exists?) && klass.respond_to?(:column_names)
|
|
183
|
+
return false unless klass.table_exists?
|
|
184
|
+
|
|
185
|
+
column = pending_gate_expected_column(attribute, fe)
|
|
186
|
+
return false if column.nil?
|
|
187
|
+
|
|
188
|
+
!klass.column_names.include?(column)
|
|
189
|
+
rescue StandardError
|
|
190
|
+
# The gate must never itself break rendering; fail open (render as before).
|
|
191
|
+
false
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# The column an attribute_list row expects on the model's own table, or nil
|
|
195
|
+
# when the form element needs no such column (has_many/habtm/has_one/
|
|
196
|
+
# rich_text -> :no_migration; pdf_link/info_list/unknown -> nil). Relation
|
|
197
|
+
# dropdowns are backed by a foreign key (`<attribute>_id`); every other
|
|
198
|
+
# column-backed element uses a column named after the attribute.
|
|
199
|
+
def self.pending_gate_expected_column(attribute, form_element)
|
|
200
|
+
column_type =
|
|
201
|
+
SPECIAL_COLUMN_TYPES[form_element] ||
|
|
202
|
+
(DEFAULT_FORM_ELEMENTS.value?(form_element) ? :__scalar__ : nil)
|
|
203
|
+
|
|
204
|
+
return nil if column_type.nil? || column_type == :no_migration
|
|
205
|
+
return "#{attribute}_id" if column_type == :belongs_to
|
|
206
|
+
|
|
207
|
+
attribute.to_s
|
|
208
|
+
end
|
|
209
|
+
|
|
122
210
|
def self.validate_plain_text_configuration_for!(klass)
|
|
123
211
|
return unless klass.respond_to?(:table_exists?) &&
|
|
124
212
|
klass.respond_to?(:column_names) &&
|
|
@@ -161,19 +249,19 @@ module InlineForms
|
|
|
161
249
|
# rails g inline_forms Example phone_number:string type_of_number:dropdown client:belongs_to
|
|
162
250
|
#
|
|
163
251
|
RELATIONS = {
|
|
164
|
-
:
|
|
165
|
-
:
|
|
252
|
+
belongs_to: :belongs_to,
|
|
253
|
+
references: :belongs_to
|
|
166
254
|
}
|
|
167
255
|
|
|
168
256
|
# SPECIAL_RELATIONS maps AR relations to migrations.
|
|
169
257
|
# In most cases, these relations have no migration at all, but they do need
|
|
170
258
|
# a line in the model.
|
|
171
259
|
SPECIAL_RELATIONS = {
|
|
172
|
-
:
|
|
173
|
-
:
|
|
174
|
-
:
|
|
175
|
-
:
|
|
176
|
-
:
|
|
260
|
+
has_many: :no_migration,
|
|
261
|
+
has_many_destroy: :no_migration,
|
|
262
|
+
has_one: :no_migration,
|
|
263
|
+
has_and_belongs_to_many: :no_migration,
|
|
264
|
+
habtm: :no_migration
|
|
177
265
|
}
|
|
178
266
|
|
|
179
267
|
# load form elements. Each element goes into a separate file
|
|
@@ -182,7 +270,6 @@ module InlineForms
|
|
|
182
270
|
|
|
183
271
|
# Declare as a Rails::Engine, see http://www.ruby-forum.com/topic/211017#927932
|
|
184
272
|
class Engine < Rails::Engine
|
|
185
|
-
|
|
186
273
|
initializer "inline_forms.form_element_registry" do
|
|
187
274
|
InlineForms::FormElementRegistry.apply!
|
|
188
275
|
end
|
|
@@ -204,25 +291,39 @@ module InlineForms
|
|
|
204
291
|
ValidationHints::ValidationsPatch.apply!
|
|
205
292
|
end
|
|
206
293
|
|
|
294
|
+
# Tabs support (set_tab / current_tab? / tabs_tag) is vendored in
|
|
295
|
+
# InlineForms::Tabs since 8.1.23. Apps generated before 8.1.23 still bundle
|
|
296
|
+
# the tabs_on_rails gem, whose Railtie includes the identical API into
|
|
297
|
+
# ActionController::Base — skip ours then so the two don't stack.
|
|
298
|
+
initializer "inline_forms.tabs" do
|
|
299
|
+
ActiveSupport.on_load(:action_controller) do
|
|
300
|
+
unless defined?(TabsOnRails::ActionController)
|
|
301
|
+
::ActionController::Base.include(InlineForms::Tabs::Controller)
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
207
306
|
initializer "inline_forms.assets.precompile" do |app|
|
|
208
|
-
|
|
307
|
+
# Skip when the host has no Sprockets-style pipeline (e.g. the test/dummy
|
|
308
|
+
# harness); generated apps always bundle sprockets-rails.
|
|
309
|
+
next unless app.config.respond_to?(:assets)
|
|
310
|
+
|
|
311
|
+
app.config.assets.precompile += %w[
|
|
209
312
|
inline_forms/inline_forms.css
|
|
210
313
|
inline_forms/devise.css
|
|
211
314
|
inline_forms/inline_forms.js
|
|
315
|
+
inline_forms_fonts.css
|
|
212
316
|
popper.min.js
|
|
213
317
|
tippy-bundle.umd.min.js
|
|
318
|
+
trix.min.js
|
|
319
|
+
trix.css
|
|
214
320
|
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)
|
|
321
|
+
foundation-icons.woff
|
|
322
|
+
foundation-icons.ttf
|
|
323
|
+
foundation-icons.svg
|
|
324
|
+
opensans-v44-latin-regular.woff2
|
|
325
|
+
opensans-v44-latin-italic.woff2
|
|
326
|
+
]
|
|
226
327
|
end
|
|
227
328
|
|
|
228
329
|
config.to_prepare do
|
|
@@ -242,8 +343,7 @@ module InlineForms
|
|
|
242
343
|
end
|
|
243
344
|
end
|
|
244
345
|
|
|
245
|
-
I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__) +
|
|
346
|
+
I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__) + "/locales"), "*.yml")]
|
|
246
347
|
I18n.load_path.flatten!
|
|
247
348
|
end
|
|
248
|
-
|
|
249
349
|
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
|