card 1.96.8 → 1.97.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/config/initializers/01_core_extensions/hash.rb +7 -7
- data/config/initializers/01_core_extensions/object.rb +8 -4
- data/config/initializers/02_patches/kaminari.rb +0 -6
- data/config/locales/de.yml +7 -4
- data/config/locales/en.yml +46 -39
- data/db/migrate/20110511221913_require_earlier_migrations.rb +1 -0
- data/db/migrate/20120105203350_require_1_8_migrations.rb +1 -0
- data/db/migrate/20190116170824_add_left_key_to_card_virtuals.rb +11 -0
- data/db/migrate/20190131223248_add_codename_index.rb +9 -0
- data/db/migrate_core_cards/20120611203506_rails_inflection_updates.rb +8 -2
- data/db/migrate_core_cards/20180712042655_head_rule.rb +14 -0
- data/db/migrate_core_cards/20180905061536_migrate_layouts.rb +64 -0
- data/db/migrate_core_cards/20190125125150_add_script_rules_card.rb +9 -0
- data/db/migrate_core_cards/20190204195039_add_rule_card.rb +7 -0
- data/db/migrate_core_cards/data/decko_logo.svg +59 -0
- data/db/schema.rb +3 -2
- data/db/seed/new/card_actions.yml +1506 -1458
- data/db/seed/new/card_acts.yml +2 -2
- data/db/seed/new/card_references.yml +633 -633
- data/db/seed/new/cards.yml +1802 -1634
- data/db/seed/new/schema_migrations.yml +4 -0
- data/db/seed/new/schema_migrations_core_cards.yml +28 -2
- data/db/seed/test/fixtures/card_actions.yml +2485 -2533
- data/db/seed/test/fixtures/card_acts.yml +520 -460
- data/db/seed/test/fixtures/card_changes.yml +66 -66
- data/db/seed/test/fixtures/card_references.yml +1533 -1407
- data/db/seed/test/fixtures/cards.yml +3392 -2945
- data/db/seed/test/fixtures/schema_migrations.yml +4 -0
- data/db/seed/test/fixtures/schema_migrations_core_cards.yml +28 -2
- data/db/seed/test/seed.rb +33 -1
- data/db/version.txt +1 -1
- data/db/version_core_cards.txt +1 -1
- data/lib/card.rb +1 -0
- data/lib/card/act_manager.rb +6 -2
- data/lib/card/act_manager/stage.rb +5 -5
- data/lib/card/act_manager/stage_director.rb +11 -7
- data/lib/card/act_manager/stage_director/phases.rb +4 -8
- data/lib/card/auth.rb +1 -0
- data/lib/card/auth/current.rb +1 -1
- data/lib/card/auth/permissions.rb +1 -0
- data/lib/card/auth/proxy.rb +1 -0
- data/lib/card/cache.rb +10 -9
- data/lib/card/cache/persistent.rb +2 -1
- data/lib/card/cache/prepopulate.rb +1 -0
- data/lib/card/cache/temporary.rb +1 -0
- data/lib/card/codename.rb +11 -6
- data/lib/card/content/chunk.rb +24 -9
- data/lib/card/content/clean.rb +4 -2
- data/lib/card/content/diff.rb +4 -4
- data/lib/card/content/diff/lcs.rb +1 -3
- data/lib/card/content/diff/processor.rb +2 -0
- data/lib/card/content/diff/result.rb +3 -0
- data/lib/card/content/parser.rb +2 -1
- data/lib/card/content/truncate.rb +4 -1
- data/lib/card/dirty.rb +3 -2
- data/lib/card/env.rb +11 -2
- data/lib/card/env/location_history.rb +3 -1
- data/lib/card/env/success.rb +3 -1
- data/lib/card/error.rb +42 -8
- data/lib/card/format.rb +22 -9
- data/lib/card/format/content.rb +10 -2
- data/lib/card/format/context_names.rb +4 -2
- data/lib/card/format/error.rb +1 -1
- data/lib/card/format/nest.rb +4 -3
- data/lib/card/format/nesting.rb +2 -0
- data/lib/card/format/nesting/main.rb +11 -5
- data/lib/card/format/nesting/mode.rb +1 -0
- data/lib/card/format/nesting/subformat.rb +12 -0
- data/lib/card/format/permission.rb +3 -0
- data/lib/card/format/registration.rb +7 -3
- data/lib/card/format/render.rb +73 -17
- data/lib/card/mailer.rb +2 -1
- data/lib/card/mark.rb +2 -2
- data/lib/card/migration.rb +115 -113
- data/lib/card/migration/core.rb +1 -0
- data/lib/card/migration/deck_structure.rb +1 -0
- data/lib/card/migration/import.rb +1 -1
- data/lib/card/migration/import/import_data.rb +6 -3
- data/lib/card/migration/import/import_data/card_attributes.rb +56 -54
- data/lib/card/migration/import/import_data/card_content.rb +0 -1
- data/lib/card/mod.rb +4 -1
- data/lib/card/mod/dirs.rb +11 -2
- data/lib/card/mod/load_strategy.rb +4 -4
- data/lib/card/mod/load_strategy/set_binding_magic.rb +9 -5
- data/lib/card/mod/load_strategy/set_tmp_files.rb +1 -1
- data/lib/card/mod/load_strategy/tmp_files.rb +1 -0
- data/lib/card/mod/loader.rb +8 -9
- data/lib/card/mod/loader/set_loader.rb +4 -4
- data/lib/card/mod/loader/set_pattern_loader.rb +2 -2
- data/lib/card/mod/module_template.rb +12 -12
- data/lib/card/model/save_helper.rb +13 -4
- data/lib/card/name.rb +3 -2
- data/lib/card/name/name_variants.rb +3 -3
- data/lib/card/query.rb +19 -12
- data/lib/card/query/abstract_query/query_helper.rb +2 -0
- data/lib/card/query/card_query.rb +1 -0
- data/lib/card/query/card_query/conjunctions.rb +2 -0
- data/lib/card/query/card_query/interpretation.rb +2 -7
- data/lib/card/query/card_query/match_attributes.rb +1 -0
- data/lib/card/query/card_query/reference_attributes.rb +4 -4
- data/lib/card/query/card_query/run.rb +1 -0
- data/lib/card/query/card_query/sorting.rb +1 -0
- data/lib/card/query/clause.rb +14 -12
- data/lib/card/query/join.rb +4 -2
- data/lib/card/query/reference_query.rb +1 -0
- data/lib/card/query/sql_statement.rb +4 -8
- data/lib/card/query/sql_statement/joins.rb +1 -0
- data/lib/card/query/sql_statement/order.rb +7 -6
- data/lib/card/query/sql_statement/where.rb +3 -1
- data/lib/card/query/value.rb +1 -0
- data/lib/card/reference.rb +1 -0
- data/lib/card/set/advanced_api.rb +2 -2
- data/lib/card/set/code_nest.rb +15 -0
- data/lib/card/set/event.rb +4 -3
- data/lib/card/set/event/callbacks.rb +1 -0
- data/lib/card/set/event/delayed_event.rb +7 -6
- data/lib/card/set/event/options.rb +5 -1
- data/lib/card/set/format.rb +21 -0
- data/lib/card/set/format/abstract_format.rb +15 -6
- data/lib/card/set/format/haml_views.rb +1 -1
- data/lib/card/set/format/wrapper.rb +89 -0
- data/lib/card/set/helpers.rb +5 -0
- data/lib/card/set/i18n_scanner.rb +5 -4
- data/lib/card/set/i18n_scope.rb +10 -10
- data/lib/card/set/inheritance.rb +3 -0
- data/lib/card/set/loader.rb +1 -0
- data/lib/card/set/required_field.rb +74 -0
- data/lib/card/set/trait.rb +6 -0
- data/lib/card/set_pattern.rb +8 -4
- data/lib/card/subcards.rb +9 -1
- data/lib/card/subcards/add.rb +1 -3
- data/lib/card/subcards/remove.rb +2 -0
- data/lib/card/tasks/card.rake +2 -0
- data/lib/card/tasks/card/create.rake +2 -1
- data/lib/card/tasks/card/file_card_creator.rb +1 -1
- data/lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb +1 -0
- data/lib/card/tasks/card/migrate.rake +3 -3
- data/lib/card/version.rb +6 -4
- data/lib/card/view.rb +15 -2
- data/lib/card/view/cache.rb +12 -12
- data/lib/card/view/cache_action.rb +11 -14
- data/lib/card/view/classy.rb +168 -0
- data/lib/card/view/layout.rb +14 -0
- data/lib/card/view/options.rb +12 -8
- data/lib/card/view/options/key_lists.rb +4 -4
- data/lib/card/view/options/voo_api.rb +46 -9
- data/lib/card/view/stub.rb +2 -2
- data/lib/card/view/visibility.rb +4 -5
- data/lib/card/view/wrapper.rb +28 -0
- data/lib/cardio.rb +2 -1
- data/mod/Modfile +2 -0
- data/mod/account/set/right/account.rb +4 -6
- data/mod/account/set/right/password.rb +2 -2
- data/mod/account/set/self/signin.rb +16 -9
- data/mod/account/set/type/signup.rb +1 -1
- data/mod/account/spec/set/right/password_spec.rb +26 -19
- data/mod/account/spec/set/type/signup_spec.rb +1 -1
- data/mod/basic_formats/set/self/head.rb +4 -0
- data/mod/bootstrap/lib/javascript/script_load_select2.js.coffee +2 -0
- data/mod/bootstrap/lib/stylesheets/style_bootstrap_cards.scss +76 -21
- data/mod/bootstrap/lib/stylesheets/style_select2_bootstrap.scss +24 -6
- data/mod/bootstrap/set/abstract/bootswatch_theme/html_views.rb +2 -1
- data/mod/bootstrap/set/type/customized_bootswatch_skin/core.haml +2 -2
- data/mod/bootstrap/set/type/customized_bootswatch_skin/html_views.rb +14 -14
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors.rb +4 -0
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/core.haml +10 -0
- data/mod/carrierwave/lib/carrier_wave/file_card_uploader.rb +2 -2
- data/mod/carrierwave/set/abstract/attachment.rb +1 -1
- data/mod/carrierwave/set/type/file.rb +4 -0
- data/mod/carrierwave/set/type/image.rb +13 -0
- data/mod/carrierwave/spec/lib/carrier_wave/file_card_uploader_spec.rb +2 -2
- data/mod/carrierwave/spec/set/type/file_spec.rb +4 -4
- data/mod/carrierwave/spec/set/type/image_spec.rb +6 -6
- data/mod/core/chunk/nest.rb +9 -1
- data/mod/core/format/html_format.rb +9 -45
- data/mod/core/layout/blank.html +5 -5
- data/mod/core/layout/default.html +10 -8
- data/mod/core/layout/noside.html +6 -9
- data/mod/core/layout/pre.html +1 -2
- data/mod/core/layout/simple.html +1 -5
- data/mod/core/set/abstract/code_file.rb +1 -1
- data/mod/core/set/all/cache.rb +0 -2
- data/mod/core/set/all/codename.rb +2 -0
- data/mod/core/set/all/collection.rb +3 -1
- data/mod/core/set/all/event_conditions.rb +36 -4
- data/mod/core/set/all/export.rb +1 -10
- data/mod/core/set/all/haml.rb +3 -2
- data/mod/core/set/all/layouts.rb +34 -0
- data/mod/core/set/all/name_events.rb +1 -1
- data/mod/core/set/all/pattern.rb +6 -11
- data/mod/core/set/all/subcards.rb +4 -0
- data/mod/core/set/all/utils.rb +21 -1
- data/mod/core/set_pattern/07_type_plus_right.rb +1 -1
- data/mod/core/set_pattern/08_rule.rb +17 -0
- data/mod/core/set_pattern/{08_self.rb → 09_self.rb} +0 -0
- data/mod/core/spec/format/html_format_spec.rb +6 -99
- data/mod/core/spec/set/all/codename_spec.rb +1 -1
- data/mod/core/spec/set/all/collection_spec.rb +9 -5
- data/mod/core/spec/set/all/event_conditions_spec.rb +91 -0
- data/mod/core/spec/set/all/pattern_spec.rb +17 -10
- data/mod/developer/spec/set/right/debug_spec.rb +1 -1
- data/mod/edit/set/all/bridge.rb +61 -0
- data/mod/edit/set/all/bridge/bridge.haml +6 -0
- data/mod/edit/set/all/bridge/follow_section.rb +37 -0
- data/mod/edit/set/all/bridge/tab_views.rb +75 -0
- data/mod/edit/set/all/bridge/tab_visibility.rb +51 -0
- data/mod/edit/set/all/edit_content.rb +58 -0
- data/mod/edit/set/all/edit_in_place.rb +58 -0
- data/mod/edit/set/all/edit_name.rb +87 -0
- data/mod/edit/set/all/edit_type.rb +28 -0
- data/mod/edit/set/all/editing.rb +79 -0
- data/mod/{standard/set/all/rich_html → edit/set/all}/editor.rb +1 -0
- data/mod/{standard/set/all/rich_html → edit/set/all}/form.rb +17 -10
- data/mod/edit/set/all/form_buttons.rb +52 -0
- data/mod/{standard/set/all/rich_html → edit/set/all}/form_elements.rb +2 -1
- data/mod/{standard/set/all/rich_html → edit/set/all}/formgroup.rb +3 -1
- data/mod/{standard/set/all/rich_html → edit/set/all}/new.rb +0 -2
- data/mod/edit/set/all/toolbar.rb +8 -0
- data/mod/edit/spec/set/all/bridge/tab_views_spec.rb +14 -0
- data/mod/{standard/spec/set/all/rich_html/editing_spec.rb → edit/spec/set/all/bridge_spec.rb} +1 -1
- data/mod/edit/spec/set/all/editing_spec.rb +15 -0
- data/mod/{standard/spec/set/all/rich_html → edit/spec/set/all}/form_elements_spec.rb +10 -8
- data/mod/edit/spec/set/all/form_spec.rb +50 -0
- data/mod/follow/lib/card/follower_stash.rb +5 -0
- data/mod/follow/set/abstract/follow_option.rb +0 -1
- data/mod/follow/set/all/follow/follow_link.rb +42 -54
- data/mod/follow/set/all/follow/follow_link_views.rb +29 -0
- data/mod/follow/set/all/follow/followed_by.rb +3 -0
- data/mod/follow/set/all/follow/follower_ids.rb +5 -0
- data/mod/follow/set/all/follow/start_follow_link.rb +11 -0
- data/mod/follow/set/all/follow/stop_follow_link.rb +12 -0
- data/mod/follow/set/all/notify.rb +4 -0
- data/mod/follow/set/all/notify/base_views.rb +11 -0
- data/mod/follow/set/right/account.rb +2 -1
- data/mod/follow/set/right/follow.rb +4 -0
- data/mod/follow/set/right/follow/follow_status.haml +2 -2
- data/mod/follow/set/right/followers.rb +1 -0
- data/mod/follow/set/right/following.rb +2 -3
- data/mod/follow/set/self/follow_defaults.rb +17 -16
- data/mod/follow/set/type/set.rb +2 -0
- data/mod/follow/set/type/user.rb +1 -0
- data/mod/follow/set/type_plus_right/user/follow.rb +1 -0
- data/mod/follow/set/type_plus_right/user/follow/follow_editor.haml +4 -1
- data/mod/follow/set/type_plus_right/user/follow/follow_editor_helper.rb +6 -0
- data/mod/follow/spec/set/all/follow/follow_link_views_spec.rb +27 -0
- data/mod/follow/spec/set/all/follow/start_follow_link_spec.rb +11 -0
- data/mod/follow/spec/set/all/follow/stop_follow_link_spec.rb +13 -0
- data/mod/follow/spec/set/all/follow_spec.rb +13 -9
- data/mod/follow/spec/set/all/notify_spec.rb +4 -3
- data/mod/follow/spec/set/right/account_spec.rb +29 -31
- data/mod/follow/spec/set/right/following_spec.rb +2 -8
- data/mod/history/lib/card/act.rb +9 -7
- data/mod/history/lib/card/act/act_renderer.rb +12 -9
- data/mod/history/lib/card/act/act_renderer/absolute_act_renderer.rb +2 -2
- data/mod/history/lib/card/act/act_renderer/bridge_act_renderer.rb +53 -0
- data/mod/history/lib/card/act/act_renderer/relative_act_renderer.rb +3 -0
- data/mod/history/lib/card/action.rb +9 -4
- data/mod/history/lib/card/action/action_renderer.rb +5 -3
- data/mod/history/lib/card/action/differ.rb +3 -0
- data/mod/history/set/all/history.rb +2 -1
- data/mod/history/set/all/history/act_listing.rb +11 -8
- data/mod/history/set/all/history/actions.rb +11 -2
- data/mod/history/set/all/history/events.rb +0 -1
- data/mod/history/set/all/history/last.rb +2 -1
- data/mod/history/set/all/history/revision.rb +1 -0
- data/mod/history/set/all/history/selected.rb +1 -1
- data/mod/history/set/all/history/views.rb +0 -1
- data/mod/history/set/all/history_bridge.rb +66 -0
- data/mod/item/set/all/bar.haml +1 -3
- data/mod/item/set/all/bar.rb +39 -21
- data/mod/item/set/all/box.haml +1 -0
- data/mod/item/set/all/box.rb +13 -3
- data/mod/item/set/all/expanded_bar.haml +4 -6
- data/mod/machines/file/all_script_machine_output/file.js +37380 -65
- data/mod/machines/file/all_style_machine_output/file.css +2 -2
- data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +1 -1
- data/mod/machines/lib/javascript/decko.js.coffee +2 -17
- data/mod/machines/lib/javascript/decko_bridge.js.coffee +28 -0
- data/mod/machines/lib/javascript/decko_components.js.coffee +21 -0
- data/mod/machines/lib/javascript/decko_filter.js.coffee +3 -1
- data/mod/machines/lib/javascript/decko_mod.js.coffee +7 -64
- data/mod/machines/lib/javascript/decko_modal.js.coffee +108 -0
- data/mod/machines/lib/javascript/decko_navbox.js.coffee +2 -0
- data/mod/machines/lib/javascript/decko_overlay.js.coffee +42 -0
- data/mod/machines/lib/javascript/decko_recaptcha.js.coffee +9 -1
- data/mod/machines/lib/javascript/decko_slot.js.coffee +46 -50
- data/mod/machines/lib/javascript/decko_slotter.js.coffee +204 -63
- data/mod/machines/lib/javascript/script_card_menu.js.coffee +3 -3
- data/mod/machines/lib/stylesheets/style_cards.scss +234 -107
- data/mod/machines/set/abstract/machine.rb +4 -3
- data/mod/machines/set/self/script_slot.rb +2 -2
- data/mod/machines/set/type/css.rb +8 -1
- data/mod/machines/set/type/skin.rb +1 -1
- data/mod/machines/spec/set/type/coffeescript_spec.rb +3 -3
- data/mod/pointer/set/abstract/00_paging_params.rb +2 -0
- data/mod/pointer/set/abstract/01_paging.rb +12 -6
- data/mod/pointer/set/abstract/02_pointer/html_views.rb +25 -0
- data/mod/pointer/set/abstract/02_pointer/html_views/filter.rb +20 -4
- data/mod/pointer/set/abstract/02_pointer/html_views/filter/filter_items.haml +1 -6
- data/mod/pointer/set/abstract/02_pointer/html_views/filter/filtered_list_input.haml +4 -13
- data/mod/pointer/set/type/pointer.rb +9 -0
- data/mod/pointer/spec/set/abstract/pointer/events_spec.rb +6 -0
- data/mod/rules/lib/javascript/script_rules.js.coffee +23 -0
- data/mod/rules/set/rstar/rule_user.rb +8 -0
- data/mod/rules/set/rule/bridge_rules_editor.rb +32 -0
- data/mod/rules/set/rule/editor.rb +144 -0
- data/mod/rules/set/rule/rule_form.rb +57 -0
- data/mod/rules/set/rule/rule_form/buttons.rb +44 -0
- data/mod/rules/set/rule/rule_form/form_elements.rb +52 -0
- data/mod/rules/set/rule/rule_form/rule_form.haml +20 -0
- data/mod/rules/set/rule/rule_form/rule_set_radio.rb +86 -0
- data/mod/rules/set/rule/rule_form/set_selection.rb +46 -0
- data/mod/{standard/set/rstar → rules/set/rule}/rules.rb +5 -9
- data/mod/rules/set/rule/table.rb +27 -0
- data/mod/rules/set/rule/table_row.rb +62 -0
- data/mod/rules/set/self/script_rules.rb +3 -0
- data/mod/{standard → rules}/set/type/set.rb +8 -10
- data/mod/rules/set/type/set/html_views.rb +72 -0
- data/mod/{standard → rules}/set/type/set/html_views/group_panel.haml +0 -0
- data/mod/rules/set/type/set/html_views/rules_bridge.rb +129 -0
- data/mod/rules/set/type/set/html_views/rules_table.haml +11 -0
- data/mod/{standard → rules}/set/type/set/html_views/template.rb +3 -7
- data/mod/{standard → rules}/set/type/set/html_views/template/template_editor.haml +0 -0
- data/mod/rules/spec/set/rule/editor_spec.rb +9 -0
- data/mod/rules/spec/set/rule/table_row_spec.rb +9 -0
- data/mod/rules/spec/set/rule/table_spec.rb +15 -0
- data/mod/rules/spec/set/type/set/html_views_spec.rb +22 -0
- data/mod/{standard → rules}/spec/set/type/set_spec.rb +18 -18
- data/mod/search/set/abstract/00_filter_helper.rb +15 -7
- data/mod/search/set/abstract/01_filter_form_helper.rb +1 -0
- data/mod/search/set/abstract/02_search_params.rb +7 -5
- data/mod/search/set/abstract/03_filter.rb +3 -2
- data/mod/search/set/abstract/04_right_filter_form.rb +1 -2
- data/mod/search/set/abstract/search.rb +1 -1
- data/mod/search/set/abstract/search/views.rb +2 -0
- data/mod/search/set/abstract/wql_search.rb +6 -0
- data/mod/search/set/self/navbox.rb +1 -1
- data/mod/search/set/self/search.rb +2 -2
- data/mod/settings/lib/card/setting.rb +6 -1
- data/mod/settings/set/right/help.rb +4 -0
- data/mod/settings/set/right/read.rb +14 -4
- data/mod/settings/set/right/structure.rb +3 -0
- data/mod/settings/set/right/style.rb +2 -1
- data/mod/settings/set/self/create.rb +2 -1
- data/mod/settings/set/self/default.rb +2 -1
- data/mod/settings/set/self/delete.rb +2 -1
- data/mod/settings/set/self/head.rb +2 -0
- data/mod/settings/set/self/help.rb +2 -1
- data/mod/settings/set/self/input.rb +1 -1
- data/mod/settings/set/self/read.rb +2 -1
- data/mod/settings/set/self/structure.rb +2 -1
- data/mod/settings/set/self/thanks.rb +2 -1
- data/mod/settings/set/self/update.rb +2 -1
- data/mod/settings/set/type/setting.rb +1 -1
- data/mod/solid_cache/set/abstract/solid_cache.rb +2 -2
- data/mod/standard/file/logo/image-original.svg +59 -0
- data/mod/standard/lib/card/layout.rb +79 -0
- data/mod/standard/lib/card/layout/card_layout.rb +44 -0
- data/mod/standard/lib/card/layout/code_layout.rb +9 -0
- data/mod/standard/lib/card/layout/proc_layout.rb +9 -0
- data/mod/standard/lib/card/layout/unknown_layout.rb +20 -0
- data/mod/standard/set/all/links.rb +5 -20
- data/mod/standard/set/all/rich_html.rb +4 -0
- data/mod/standard/set/all/rich_html/alert.rb +23 -0
- data/mod/standard/set/all/rich_html/content.rb +26 -100
- data/mod/standard/set/all/rich_html/error.rb +27 -3
- data/mod/standard/set/all/rich_html/error/debug_server_error.haml +1015 -0
- data/mod/standard/set/all/rich_html/frame.rb +10 -54
- data/mod/standard/set/all/rich_html/header.rb +25 -15
- data/mod/standard/set/all/rich_html/header/header_wrap.haml +2 -1
- data/mod/standard/set/all/rich_html/html_views/help.rb +18 -0
- data/mod/standard/set/all/rich_html/html_views/info.rb +59 -0
- data/mod/standard/set/all/rich_html/html_views/size.rb +17 -0
- data/mod/standard/set/all/rich_html/menu.rb +44 -146
- data/mod/standard/set/all/rich_html/modal.rb +99 -24
- data/mod/standard/set/all/rich_html/modal/modal_dialog.haml +12 -0
- data/mod/standard/set/all/rich_html/overlay.rb +57 -13
- data/mod/standard/set/all/rich_html/process_layout.rb +91 -0
- data/mod/standard/set/all/rich_html/show.rb +37 -0
- data/mod/standard/set/all/rich_html/wrapper.rb +47 -10
- data/mod/standard/set/right/head.rb +11 -0
- data/mod/standard/set/type/cardtype.rb +1 -1
- data/mod/standard/set/type/listed_by.rb +3 -3
- data/mod/standard/spec/set/all/email_html_format_spec.rb +17 -0
- data/mod/standard/spec/set/all/links_spec.rb +1 -22
- data/mod/standard/spec/set/all/rich_html/overlay_spec.rb +18 -0
- data/mod/standard/spec/set/all/rich_html/process_layout/explicit_modal_wrapper_spec.rb +29 -0
- data/mod/standard/spec/set/all/rich_html/process_layout_spec.rb +110 -0
- data/mod/standard/spec/set/all/rich_html/show_spec.rb +9 -0
- data/mod/standard/spec/set/all/rich_html/wrapper_spec.rb +17 -24
- data/mod/standard/spec/set/type/email_template/email_config_spec.rb +9 -5
- data/mod/standard/spec/set/type/layout_type_spec.rb +6 -0
- data/mod/standard/spec/set/type/search_type_spec.rb +1 -1
- data/mod/tinymce_editor/db/migrate_core_cards/20190306172623_update_tinymce_config_to_v5.rb +23 -0
- data/mod/tinymce_editor/lib/javascript/script_tinymce.js +9 -2
- data/mod/tinymce_editor/lib/javascript/script_tinymce_config.js.coffee +3 -2
- data/mod/tinymce_editor/public/assets/tinymce/jquery.tinymce.min.js +92 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/advlist/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/anchor/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/autolink/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/autoresize/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/autosave/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/bbcode/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/charmap/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/code/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/codesample/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/colorpicker/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/contextmenu/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/directionality/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.js +9015 -0
- data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/js/emojis.min.js +2 -0
- data/mod/tinymce_editor/public/assets/tinymce/plugins/emoticons/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/fullpage/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/fullscreen/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/help/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/hr/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/image/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/imagetools/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/importcss/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/insertdatetime/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/legacyoutput/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/link/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/lists/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/media/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/nonbreaking/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/noneditable/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/pagebreak/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/paste/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/preview/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/print/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/quickbars/plugin.min.js +9 -0
- data/mod/tinymce_editor/public/assets/tinymce/plugins/save/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/searchreplace/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/spellchecker/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/tabfocus/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/table/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/template/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/textcolor/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/textpattern/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/toc/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/visualblocks/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/visualchars/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/plugins/wordcount/plugin.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/skins/content/default/content.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/content/document/content.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/content/writer/content.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/content.mobile.min.css +1 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.min.css +7 -0
- data/mod/tinymce_editor/public/assets/tinymce/skins/ui/oxide/skin.mobile.min.css +1 -0
- data/mod/tinymce_editor/public/assets/tinymce/themes/mobile/theme.min.js +9 -1
- data/mod/tinymce_editor/public/assets/tinymce/themes/silver/theme.min.js +9 -0
- data/mod/tinymce_editor/public/assets/tinymce/tinymce.min.js +9 -2
- data/mod/utility/spec/set/abstract/media_spec.rb +6 -6
- data/mod/virtual/lib/card/virtual.rb +17 -2
- data/mod/virtual/set/abstract/virtual_cache.rb +1 -1
- data/mod/virtual/spec/set/lib/card/virtual_spec.rb +1 -1
- metadata +121 -42
- data/mod/core/layout/modal.html +0 -9
- data/mod/core/layout/simple_modal.html +0 -3
- data/mod/follow/spec/set/all/follow/follow_link_spec.rb +0 -7
- data/mod/standard/file/logo/image-icon.png +0 -0
- data/mod/standard/file/logo/image-large.png +0 -0
- data/mod/standard/file/logo/image-medium.png +0 -0
- data/mod/standard/file/logo/image-original.png +0 -0
- data/mod/standard/file/logo/image-small.png +0 -0
- data/mod/standard/set/abstract/toolbar_split_button.rb +0 -22
- data/mod/standard/set/all/rich_html/classy.rb +0 -37
- data/mod/standard/set/all/rich_html/editing.rb +0 -176
- data/mod/standard/set/all/rich_html/related.rb +0 -30
- data/mod/standard/set/all/rich_html/toolbar.rb +0 -264
- data/mod/standard/set/rstar/rules_editor.rb +0 -371
- data/mod/standard/set/self/activity_toolbar_button.rb +0 -14
- data/mod/standard/set/self/rules_toolbar_button.rb +0 -44
- data/mod/standard/set/type/set/html_views.rb +0 -155
- data/mod/standard/set/type/set/html_views/rules_table.haml +0 -9
- data/mod/standard/spec/set/all/rich_html/form_spec.rb +0 -47
- data/mod/standard/spec/set/all/rich_html/toolbar_spec.rb +0 -25
- data/mod/standard/spec/set/rstar/rules_spec.rb +0 -26
- data/mod/standard/spec/set/self/activity_toolbar_button_spec.rb +0 -22
- data/mod/standard/spec/set/type/set/html_views_spec.rb +0 -10
@@ -164,9 +164,10 @@ end
|
|
164
164
|
def make_machine_output_coded mod=:machines
|
165
165
|
update_machine_output
|
166
166
|
Card::Auth.as_bot do
|
167
|
-
|
168
|
-
|
169
|
-
|
167
|
+
ENV["STORE_CODED_FILES"] = "true"
|
168
|
+
machine_output_card.update! storage_type: :coded, mod: mod,
|
169
|
+
codename: machine_output_codename
|
170
|
+
ENV["STORE_CODED_FILES"] = nil
|
170
171
|
end
|
171
172
|
end
|
172
173
|
|
@@ -2,8 +2,8 @@ include_set Abstract::CodeFile
|
|
2
2
|
|
3
3
|
def source_files
|
4
4
|
%w[decko_mod decko_editor decko_layout decko_navbox decko_upload
|
5
|
-
decko_filter decko_slot decko_recaptcha
|
6
|
-
decko_slotter decko].map do |n|
|
5
|
+
decko_filter decko_slot decko_modal decko_overlay decko_recaptcha
|
6
|
+
decko_slotter decko_bridge decko_components decko].map do |n|
|
7
7
|
"#{n}.js.coffee"
|
8
8
|
end
|
9
9
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
3
|
require "sass"
|
4
|
+
require "benchmark"
|
5
|
+
|
4
6
|
include_set Abstract::Machine
|
5
7
|
include_set Abstract::MachineInput
|
6
8
|
|
@@ -11,7 +13,7 @@ machine_input do
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def compress_css input
|
14
|
-
Sass.compile
|
16
|
+
compress_css? ? Sass.compile(input, style: :compressed) : input
|
15
17
|
rescue => e
|
16
18
|
raise Card::Error, css_compression_error(e)
|
17
19
|
end
|
@@ -32,6 +34,11 @@ def clean_html?
|
|
32
34
|
false
|
33
35
|
end
|
34
36
|
|
37
|
+
def compress_css?
|
38
|
+
return true
|
39
|
+
!Rails.env.development?
|
40
|
+
end
|
41
|
+
|
35
42
|
format do
|
36
43
|
# def default_nest_view
|
37
44
|
# :raw
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
describe Card::Set::Type::CoffeeScript do
|
3
|
+
RSpec.describe Card::Set::Type::CoffeeScript do
|
4
4
|
let(:coffee) { 'alert "Hi" ' }
|
5
5
|
let(:compressed_coffee) { '(function(){alert("Hi")}).call(this);' }
|
6
6
|
let(:changed_coffee) { 'alert "Hello" ' }
|
@@ -24,7 +24,7 @@ describe Card::Set::Type::CoffeeScript do
|
|
24
24
|
Card.gimme! "coffee input", type: :coffee_script, content: coffee
|
25
25
|
end
|
26
26
|
let(:create_another_machine_input_card) do
|
27
|
-
Card.gimme! "more coffee input", type: :coffee_script, content:
|
27
|
+
Card.gimme! "more coffee input", type: :coffee_script, content: changed_coffee
|
28
28
|
end
|
29
29
|
let(:create_machine_card) do
|
30
30
|
Card.gimme! "coffee machine+*script", type: :pointer
|
@@ -35,7 +35,7 @@ describe Card::Set::Type::CoffeeScript do
|
|
35
35
|
changed_in: changed_coffee,
|
36
36
|
changed_out: "//coffee input\n#{compressed_changed_coffee}",
|
37
37
|
added_out: "//coffee input\n#{compressed_coffee}\n"\
|
38
|
-
"//more coffee input\n#{
|
38
|
+
"//more coffee input\n#{compressed_changed_coffee}" }
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -24,6 +24,10 @@ format do
|
|
24
24
|
def current_page
|
25
25
|
(offset / limit).to_i
|
26
26
|
end
|
27
|
+
|
28
|
+
def extra_paging_path_args
|
29
|
+
{}
|
30
|
+
end
|
27
31
|
end
|
28
32
|
|
29
33
|
format :html do
|
@@ -37,6 +41,7 @@ format :html do
|
|
37
41
|
|
38
42
|
view :paging, cache: :never do
|
39
43
|
return "" unless paging_needed?
|
44
|
+
|
40
45
|
<<-HTML
|
41
46
|
<nav>
|
42
47
|
<ul class="pagination paging">
|
@@ -66,6 +71,7 @@ format :html do
|
|
66
71
|
|
67
72
|
def page_link text, page, options
|
68
73
|
return content_tag(:div, text.html_safe, class: "page-link") unless page
|
74
|
+
|
69
75
|
options.merge! class: "card-paging-link slotter page-link",
|
70
76
|
remote: true,
|
71
77
|
path: page_link_path_args(page)
|
@@ -97,16 +103,13 @@ format :html do
|
|
97
103
|
end
|
98
104
|
|
99
105
|
def paging_view
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
def extra_paging_path_args
|
104
|
-
{}
|
106
|
+
voo&.home_view || voo.slot_options[:view] || :content
|
105
107
|
end
|
106
108
|
|
107
109
|
def paging_needed?
|
108
110
|
return false if limit < 1
|
109
111
|
return false if fewer_results_than_limit? # avoid extra count search
|
112
|
+
|
110
113
|
# count search result instead
|
111
114
|
limit < count_with_params
|
112
115
|
end
|
@@ -114,6 +117,7 @@ format :html do
|
|
114
117
|
# clear we don't need paging even before running count query
|
115
118
|
def fewer_results_than_limit?
|
116
119
|
return false unless offset.zero?
|
120
|
+
|
117
121
|
limit > offset + search_with_params.length
|
118
122
|
end
|
119
123
|
end
|
@@ -125,11 +129,12 @@ format :json do
|
|
125
129
|
offset: page * limit,
|
126
130
|
item: default_item_view, # hack. need standard voo handling
|
127
131
|
format: :json
|
128
|
-
}
|
132
|
+
}.merge extra_paging_path_args
|
129
133
|
end
|
130
134
|
|
131
135
|
def paging_urls
|
132
136
|
return {} unless total_pages > 1
|
137
|
+
|
133
138
|
{ paging: paging_urls_hash }
|
134
139
|
end
|
135
140
|
|
@@ -144,6 +149,7 @@ format :json do
|
|
144
149
|
|
145
150
|
def add_paging_url hash, page, status
|
146
151
|
return unless page && status.in?(%i[next previous])
|
152
|
+
|
147
153
|
hash[status] = path page_link_path_args(page)
|
148
154
|
end
|
149
155
|
end
|
@@ -5,6 +5,12 @@ format :html do
|
|
5
5
|
standard_pointer_core
|
6
6
|
end
|
7
7
|
|
8
|
+
view :item_cores, cache: :never do
|
9
|
+
card.known_item_cards.map do |item|
|
10
|
+
nest item, view: :core
|
11
|
+
end.join "\n"
|
12
|
+
end
|
13
|
+
|
8
14
|
def stat_number
|
9
15
|
card.item_count
|
10
16
|
end
|
@@ -13,6 +19,10 @@ format :html do
|
|
13
19
|
stat_number == 1 ? "item" : "items"
|
14
20
|
end
|
15
21
|
|
22
|
+
def short_content
|
23
|
+
"#{stat_number} #{stat_label}"
|
24
|
+
end
|
25
|
+
|
16
26
|
def standard_pointer_core
|
17
27
|
with_paging do |paging_args|
|
18
28
|
wrap_with :div, standard_pointer_items(paging_args), class: "pointer-list"
|
@@ -85,6 +95,21 @@ format :html do
|
|
85
95
|
multiple: true, class: "pointer-multiselect form-control"
|
86
96
|
end
|
87
97
|
|
98
|
+
def add_item_modal_link
|
99
|
+
modal_link "Add Item",
|
100
|
+
size: :large,
|
101
|
+
class: "btn btn-sm btn-primary _add-item-link",
|
102
|
+
path: { view: :filter_items_modal,
|
103
|
+
item: implicit_item_view,
|
104
|
+
filter_card: filter_card.name,
|
105
|
+
slot_selector: filtered_list_slot_class,
|
106
|
+
item_selector: "_filtered-list-item",
|
107
|
+
slot: { hide: :modal_footer },
|
108
|
+
filter: { not_ids: card.item_ids.map(&:to_s).join(",") } }
|
109
|
+
end
|
110
|
+
|
111
|
+
def add_item_overlay_link; end
|
112
|
+
|
88
113
|
private
|
89
114
|
|
90
115
|
# currently only used by :list and :autocomplete. could be generalized?
|
@@ -3,19 +3,34 @@ format :html do
|
|
3
3
|
filtered_list_input
|
4
4
|
end
|
5
5
|
|
6
|
-
view :
|
7
|
-
|
6
|
+
view :filter_items_modal, tags: :unknown_ok, cache: :never, wrap: :modal do
|
7
|
+
render_filter_items
|
8
|
+
end
|
9
|
+
|
10
|
+
view :filter_items, tags: :unknown_ok, cache: :never, wrap: :slot do
|
11
|
+
haml :filter_items
|
8
12
|
end
|
9
13
|
|
10
14
|
def filtered_list_input
|
11
15
|
with_nest_mode :normal do
|
12
16
|
class_up "card-slot", filtered_list_slot_class
|
13
|
-
|
14
|
-
|
17
|
+
with_class_up "card-slot", filtered_list_slot_class do
|
18
|
+
wrap do
|
19
|
+
haml :filtered_list_input
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
|
25
|
+
def add_selected_link
|
26
|
+
link_to "Add Selected",
|
27
|
+
path: { item: params[:item], filter_card: params[:filter_card] },
|
28
|
+
class: "_add-selected slotter _close-modal btn btn-primary disabled",
|
29
|
+
data: { "slot-selector": ".#{params[:slot_selector]}",
|
30
|
+
"item-selector": ".#{params[:item_selector]}",
|
31
|
+
remote: true }
|
32
|
+
end
|
33
|
+
|
19
34
|
def filtered_list_item item_card
|
20
35
|
nest_item item_card do |rendered, item_view|
|
21
36
|
wrap_item rendered, item_view
|
@@ -31,6 +46,7 @@ format :html do
|
|
31
46
|
def default_filter_card
|
32
47
|
fcard = card.options_rule_card || Card[:all]
|
33
48
|
return fcard if fcard.respond_to? :wql_hash
|
49
|
+
|
34
50
|
fcard.fetch trait: :referred_to_by, new: {}
|
35
51
|
end
|
36
52
|
|
@@ -27,9 +27,4 @@
|
|
27
27
|
.form-group
|
28
28
|
.selected-item-buttons.pl-3
|
29
29
|
= button_tag "Cancel", class: "cancel-modal", data: { dismiss: :modal }
|
30
|
-
=
|
31
|
-
filter_card: params[:filter_card] },
|
32
|
-
class: "_add-selected slotter close-modal btn btn-primary disabled",
|
33
|
-
data: { "slot-selector": ".#{params[:slot_selector]}",
|
34
|
-
"item-selector": ".#{params[:item_selector]}",
|
35
|
-
remote: true }
|
30
|
+
= add_selected_link
|
@@ -1,5 +1,5 @@
|
|
1
1
|
%div.filtered-list-editor
|
2
|
-
%ul.filtered-list-review._pointer-filtered-list.list-group.vertical.nopadding
|
2
|
+
%ul.pointer-list.filtered-list-review._pointer-filtered-list.list-group.vertical.nopadding
|
3
3
|
- card.item_cards(context: :raw).each do |item_card|
|
4
4
|
%li._filtered-list-item.clearfix{ data: item_card.format.wrap_data(false) }
|
5
5
|
%span._handle.float-left.m-2
|
@@ -12,18 +12,9 @@
|
|
12
12
|
= icon_tag :remove
|
13
13
|
%br
|
14
14
|
.clearfix
|
15
|
-
=
|
16
|
-
|
17
|
-
|
18
|
-
filter_card: filter_card.name,
|
19
|
-
layout: :simple_modal,
|
20
|
-
slot_selector: filtered_list_slot_class,
|
21
|
-
item_selector: "_filtered-list-item",
|
22
|
-
slot: { hide: :modal_footer },
|
23
|
-
filter: { not_ids: card.item_ids.map(&:to_s).join(",") } },
|
24
|
-
class: "btn btn-sm btn-primary _add-item-link",
|
25
|
-
"data-target": "#modal-filtered-list"
|
26
|
-
= modal_slot "filtered-list", "modal-lg"
|
15
|
+
= add_item_modal_link
|
16
|
+
-# "data-target": "#modal-filtered-list"
|
17
|
+
-# = modal_slot "filtered-list", "modal-lg"
|
27
18
|
|
28
19
|
// note: passing item and filter card because in some cases (eg Project+Metric on wikirate)
|
29
20
|
// the link was losing set-identifying information (type of left)
|
@@ -82,5 +82,11 @@ describe Card::Set::Abstract::Pointer do
|
|
82
82
|
content: ["b1", "[[b2]]"]
|
83
83
|
expect(pointer1.content).to eq("[[b1]]\n[[b2]]")
|
84
84
|
end
|
85
|
+
|
86
|
+
it "handles arrays for subfields" do
|
87
|
+
create "super card", subfields: { "a pointer" => { content: ["b1", "[[b2]]"],
|
88
|
+
type_id: Card::PointerID } }
|
89
|
+
expect_card("super card+a pointer").to have_db_content "[[b1]]\n[[b2]]"
|
90
|
+
end
|
85
91
|
end
|
86
92
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$(window).ready ->
|
2
|
+
# permissions mod
|
3
|
+
$('body').on 'click', '.perm-vals input', ->
|
4
|
+
$(this).slot().find('#inherit').attr('checked',false)
|
5
|
+
|
6
|
+
$('body').on 'click', '.perm-editor #inherit', ->
|
7
|
+
slot = $(this).slot()
|
8
|
+
slot.find('.perm-group input:checked').attr('checked', false)
|
9
|
+
slot.find('.perm-indiv input').val('')
|
10
|
+
|
11
|
+
# rstar mod
|
12
|
+
$('body').on 'click', '._rule-submit-button', ->
|
13
|
+
f = $(this).closest('form')
|
14
|
+
checked = f.find('.set-editor input:checked')
|
15
|
+
if checked.val()
|
16
|
+
if checked.attr('warning')
|
17
|
+
confirm checked.attr('warning')
|
18
|
+
else
|
19
|
+
true
|
20
|
+
else
|
21
|
+
f.find('.set-editor').addClass('attention')
|
22
|
+
$(this).notify 'To what Set does this Rule apply?'
|
23
|
+
false
|
@@ -0,0 +1,32 @@
|
|
1
|
+
format :html do
|
2
|
+
view :overlay_rule, cache: :never, tags: :unknown_ok do
|
3
|
+
wrap_with_overlay slot: breadcrumb_data("Rule editing", "rules") do
|
4
|
+
current_rule_form
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
view :modal_rule, cache: :never, tags: :unknown_ok, wrap: :modal do
|
9
|
+
current_rule_form
|
10
|
+
end
|
11
|
+
|
12
|
+
view :overlay_title do
|
13
|
+
edit_rule_title
|
14
|
+
end
|
15
|
+
|
16
|
+
view :overlay_rule_help, tags: :unknown_ok, perms: :none, cache: :never do
|
17
|
+
# wrap_with :div, class: "help-text rule-instruction d-flex justify-content-between"
|
18
|
+
# do
|
19
|
+
|
20
|
+
# output [wrap_with(:div, rule_based_help), setting_link]
|
21
|
+
# end
|
22
|
+
popover_link([rule_based_help, setting_link].join(" "))
|
23
|
+
end
|
24
|
+
|
25
|
+
def setting_link
|
26
|
+
wrap_with :div, class: "ml-auto" do
|
27
|
+
# FIXME: hardcoded count
|
28
|
+
link_to_card card.rule_setting_name, " (37 #{card.rule_setting_title} rules)",
|
29
|
+
class: "text-muted", target: "wagn_setting"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,144 @@
|
|
1
|
+
format :html do
|
2
|
+
attr_accessor :rule_context
|
3
|
+
|
4
|
+
def current_rule force_reload=true
|
5
|
+
@current_rule = nil if force_reload
|
6
|
+
@current_rule ||= begin
|
7
|
+
rule = determine_current_rule
|
8
|
+
reload_rule rule
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def determine_current_rule
|
13
|
+
existing = find_existing_rule_card
|
14
|
+
return existing if existing
|
15
|
+
|
16
|
+
Card.new name: "#{Card[:all].name}+#{card.rule_user_setting_name}"
|
17
|
+
end
|
18
|
+
|
19
|
+
view :rule_help, tags: :unknown_ok, perms: :none, cache: :never do
|
20
|
+
wrap_with :div, class: "alert alert-info rule-instruction" do
|
21
|
+
rule_based_help
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
view :show_rule, cache: :never, tags: :unknown_ok do
|
26
|
+
return "No Current Rule" if card.new_card?
|
27
|
+
|
28
|
+
voo.items[:view] ||= :link
|
29
|
+
output [
|
30
|
+
show_rule_set(card.rule_set),
|
31
|
+
_render_core
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
def show_rule_set set
|
36
|
+
wrap_with :div, class: "rule-set" do
|
37
|
+
%(<label>Applies to</label> #{link_to_card set.name, set.label}:)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
view :rule_bridge_link, tags: :unknown_ok do
|
42
|
+
opts = bridge_link_opts(class: "edit-rule-link nav-link",
|
43
|
+
"data-toggle": "pill",
|
44
|
+
"data-cy": "#{setting_title.to_name.key}-pill")
|
45
|
+
opts[:path].delete(:layout)
|
46
|
+
link_to_view(:overlay_rule, (setting_title + short_help_text), opts)
|
47
|
+
end
|
48
|
+
|
49
|
+
def setting_title
|
50
|
+
card.name.tag.tr "*", ""
|
51
|
+
end
|
52
|
+
|
53
|
+
def short_help_text
|
54
|
+
"<div class=\"help-text\">#{card.short_help_text}</div>"
|
55
|
+
end
|
56
|
+
|
57
|
+
def rule_content_container
|
58
|
+
wrap_with :div, class: "rule-content-container" do
|
59
|
+
wrap_with(:span, class: "closed-content content") { yield }
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def link_to_open_rule
|
64
|
+
setting_title = card.name.tag.tr "*", ""
|
65
|
+
link_to_view :open_rule, setting_title, class: "edit-rule-link"
|
66
|
+
end
|
67
|
+
|
68
|
+
def closed_rule_content rule_card
|
69
|
+
return "" unless rule_card
|
70
|
+
|
71
|
+
nest rule_card, { view: :closed_content }, set_context: card.name.trunk_name
|
72
|
+
end
|
73
|
+
|
74
|
+
def open_rule_setting_links
|
75
|
+
wrap_with :div, class: "rule-setting" do
|
76
|
+
[link_to_closed_rule, link_to_all_rules]
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def link_to_all_rules
|
81
|
+
link_to_card card.rule_setting_name, "all #{card.rule_setting_title} rules",
|
82
|
+
class: "setting-link", target: "wagn_setting"
|
83
|
+
end
|
84
|
+
|
85
|
+
def link_to_closed_rule
|
86
|
+
link_to_view :closed_rule, card.rule_setting_title,
|
87
|
+
class: "close-rule-link"
|
88
|
+
end
|
89
|
+
|
90
|
+
def reload_rule rule
|
91
|
+
return rule unless (card_args = params[:card])
|
92
|
+
|
93
|
+
if card_args[:name] && card_args[:name].to_name.key != rule.key
|
94
|
+
Card.new card_args
|
95
|
+
else
|
96
|
+
rule = rule.refresh
|
97
|
+
rule.assign_attributes card_args
|
98
|
+
rule.include_set_modules
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def rule_set_description
|
103
|
+
card.rule_set.follow_label
|
104
|
+
end
|
105
|
+
|
106
|
+
def rules_type_formgroup
|
107
|
+
return unless card.right.rule_type_editable
|
108
|
+
|
109
|
+
success = @edit_rule_success
|
110
|
+
wrap_type_formgroup do
|
111
|
+
type_field(
|
112
|
+
href: path(mark: success[:id], view: success[:view], type_reload: true),
|
113
|
+
class: "type-field rule-type-field live-type-field",
|
114
|
+
"data-remote" => true
|
115
|
+
)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def rule_content_formgroup
|
120
|
+
formgroup "content", editor: "content", help: false do
|
121
|
+
content_field true
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def current_set_key
|
126
|
+
card.new_card? ? Card.quick_fetch(:all).name.key : card.rule_set_key
|
127
|
+
end
|
128
|
+
|
129
|
+
private
|
130
|
+
|
131
|
+
def find_existing_rule_card
|
132
|
+
# self.card is a POTENTIAL rule; it quacks like a rule but may or may not
|
133
|
+
# exist.
|
134
|
+
# This generates a prototypical member of the POTENTIAL rule's set
|
135
|
+
# and returns that member's ACTUAL rule for the POTENTIAL rule's setting
|
136
|
+
if card.new_card?
|
137
|
+
if (setting = card.right)
|
138
|
+
card.set_prototype.rule_card setting.codename, user: card.rule_user
|
139
|
+
end
|
140
|
+
else
|
141
|
+
card
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|