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
@@ -0,0 +1,17 @@
|
|
1
|
+
@@options = { junction_only: true }
|
2
|
+
|
3
|
+
def label _name
|
4
|
+
'All rule cards'
|
5
|
+
end
|
6
|
+
|
7
|
+
def short_label _name
|
8
|
+
'all rule cards'
|
9
|
+
end
|
10
|
+
|
11
|
+
def prototype_args _anchor
|
12
|
+
{ name: "*all+*create" }
|
13
|
+
end
|
14
|
+
|
15
|
+
def pattern_applies? card
|
16
|
+
card.is_rule?
|
17
|
+
end
|
File without changes
|
@@ -6,7 +6,7 @@ RSpec.describe Card::Format::HtmlFormat do
|
|
6
6
|
expect(view(:content, card: "A+B"))
|
7
7
|
.to have_tag(
|
8
8
|
'div[class="card-slot content-view ALL ALL_PLUS TYPE-basic '\
|
9
|
-
|
9
|
+
'RIGHT-b TYPE_PLUS_RIGHT-basic-b SELF-a-b d0-card-content"]'
|
10
10
|
)
|
11
11
|
end
|
12
12
|
|
@@ -27,105 +27,12 @@ RSpec.describe Card::Format::HtmlFormat do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
is_expected.to have_tag "header" do
|
35
|
-
with_tag 'a.nav-link.internal-link[href="/"]', text: "Home"
|
36
|
-
with_tag 'a.nav-link.internal-link[href="/:recent"]', text: "Recent"
|
37
|
-
with_tag 'form.navbox-form[action="/*search"]' do
|
38
|
-
with_tag 'select[name="query[keyword]"]'
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
it "renders card header" do
|
44
|
-
is_expected.to have_tag "div.d0-card-header.card-header" do
|
45
|
-
with_tag "div.d0-card-header-title" do
|
46
|
-
with_tag "span.card-title", text: "A+B"
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
it "renders card content" do
|
52
|
-
is_expected.to have_tag "div.d0-card-body.d0-card-content" \
|
53
|
-
".ALL.ALL_PLUS" \
|
54
|
-
".TYPE-basic.RIGHT-b.TYPE_PLUS_RIGHT-basic-b" \
|
55
|
-
".SELF-a-b.card-body.card-text",
|
56
|
-
text: /AlphaBeta/
|
57
|
-
end
|
58
|
-
|
59
|
-
it "renders card credit" do
|
60
|
-
is_expected.to have_tag 'div[class~="SELF-Xcredit"]' do
|
61
|
-
with_tag "img"
|
62
|
-
with_tag "a", text: "Decko v#{Card::Version.release}"
|
30
|
+
it "joins arrays" do
|
31
|
+
format =
|
32
|
+
Card["A"].format_with do
|
33
|
+
view(:array) { ["A", nil, %w[B C]] }
|
63
34
|
end
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
context "layout" do
|
68
|
-
before do
|
69
|
-
Card::Auth.as_bot do
|
70
|
-
@layout_card = Card.create name: "tmp layout", type: "Layout"
|
71
|
-
# warn "layout #{@layout_card.inspect}"
|
72
|
-
end
|
73
|
-
c = Card["*all+*layout"]
|
74
|
-
c.content = "[[tmp layout]]"
|
75
|
-
@main_card = Card.fetch("Joe User")
|
76
|
-
Card::Env[:main_name] = @main_card.name
|
77
|
-
|
78
|
-
# warn "lay #{@layout_card.inspect}, #{@main_card.inspect}"
|
79
|
-
end
|
80
|
-
|
81
|
-
# it "defaults to core view when in layout mode" do
|
82
|
-
# @layout_card.content = "Hi {{A}}"
|
83
|
-
# Card::Auth.as_bot { @layout_card.save }
|
84
|
-
#
|
85
|
-
# expect(@main_card.format.render!(:layout)).to match('Hi Alpha')
|
86
|
-
# end
|
87
|
-
|
88
|
-
# it "defaults to open view for main card" do
|
89
|
-
# @layout_card.content='Open up {{_main}}'
|
90
|
-
# Card::Auth.as_bot { @layout_card.save }
|
91
|
-
#
|
92
|
-
# result = @main_card.format.render_layout
|
93
|
-
# expect(result).to match(/Open up/)
|
94
|
-
# expect(result).to match(/card-header/)
|
95
|
-
# expect(result).to match(/Joe User/)
|
96
|
-
# end
|
97
|
-
|
98
|
-
it "renders custom view of main" do
|
99
|
-
@layout_card.content = "Hey {{_main|name}}"
|
100
|
-
Card::Auth.as_bot { @layout_card.save }
|
101
|
-
|
102
|
-
result = @main_card.format.render_layout
|
103
|
-
expect(result).to match(/Hey.*div.*Joe User/)
|
104
|
-
expect(result).not_to match(/d0-card-header/)
|
105
|
-
end
|
106
|
-
|
107
|
-
it "does not recurse" do
|
108
|
-
@layout_card.content = "Mainly {{_main|core}}"
|
109
|
-
Card::Auth.as_bot { @layout_card.save }
|
110
|
-
rendered = @layout_card.format.render! :layout
|
111
|
-
expect(rendered).to have_tag "div#main" do
|
112
|
-
have_tag "div.code" do
|
113
|
-
have_tag("pre") { with_text "Mainly {{_main|core}}" }
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
it "handles nested _main references" do
|
119
|
-
Card::Auth.as_bot do
|
120
|
-
@layout_card.content = "{{outer space|core}}"
|
121
|
-
@layout_card.save!
|
122
|
-
Card.create name: "outer space", content: "{{_main|name}}"
|
123
|
-
end
|
124
|
-
rendered = @main_card.format.render! :layout
|
125
|
-
expect(rendered).to have_tag "div#main" do
|
126
|
-
with_text "Joe User"
|
127
|
-
end
|
128
|
-
end
|
35
|
+
expect(format.render_array).to eq "A\nB\nC"
|
129
36
|
end
|
130
37
|
end
|
131
38
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
describe Card::Set::All::Collection do
|
3
|
+
RSpec.describe Card::Set::All::Collection do
|
4
4
|
describe "#item_names" do
|
5
5
|
subject do
|
6
6
|
item_names_args = @context ? { context: @context } : {}
|
@@ -86,10 +86,14 @@ describe Card::Set::All::Collection do
|
|
86
86
|
|
87
87
|
it "loads only the first tab pane" do
|
88
88
|
tabs = render_card :tabs, content: "[[A]]\n[[B]]\n[[C]]", type: "pointer"
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
89
|
+
expect(tabs).to have_tag :div, with: { role: "tabpanel" } do
|
90
|
+
with_tag "div.tab-pane#tempo_rary-a" do
|
91
|
+
with_tag "div.card-slot#a-content-view"
|
92
|
+
end
|
93
|
+
with_tag :li do
|
94
|
+
with_tag "a.load", with: { "data-toggle": "tab", href: "#tempo_rary-b" }
|
95
|
+
end
|
96
|
+
with_tag "div.tab-pane#tempo_rary-b"
|
93
97
|
end
|
94
98
|
end
|
95
99
|
|
@@ -51,6 +51,97 @@ RSpec.describe Card::Set::All::EventConditions do
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
context "when changing type" do
|
55
|
+
def update_type
|
56
|
+
Card::Auth.as_bot do
|
57
|
+
Card["Sample Pointer"].update! type: "Search"
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
it "does NOT run update events from sets that no longer apply after change" do
|
62
|
+
with_test_events do
|
63
|
+
test_event :validate, on: :update, set: Card::Set::Type::Pointer do
|
64
|
+
add_to_log "NO to run"
|
65
|
+
end
|
66
|
+
update_type
|
67
|
+
expect(@log).to be_empty
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
it "does run update events from old sets when `changing` value present" do
|
72
|
+
with_test_events do
|
73
|
+
test_event :validate,
|
74
|
+
on: :update, set: Card::Set::Type::Pointer, changing: :type do
|
75
|
+
add_to_log "YES to run"
|
76
|
+
end
|
77
|
+
update_type
|
78
|
+
expect(@log).to contain_exactly("YES to run")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
it "does run update events from sets that apply after change" do
|
83
|
+
with_test_events do
|
84
|
+
test_event :validate, on: :update, set: Card::Set::Type::SearchType do
|
85
|
+
add_to_log "YES to run"
|
86
|
+
end
|
87
|
+
update_type
|
88
|
+
expect(@log).to contain_exactly("YES to run")
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# following does not yet work, because old card has both old sets and new sets
|
93
|
+
# when conditions are tested.
|
94
|
+
xit "does NOT run update events from new sets when `changing` value present" do
|
95
|
+
with_test_events do
|
96
|
+
test_event :validate,
|
97
|
+
on: :update, set: Card::Set::Type::SearchType, changing: :type do
|
98
|
+
add_to_log "NO to run"
|
99
|
+
end
|
100
|
+
update_type
|
101
|
+
expect(@log).to be_empty
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
context "when changing name" do
|
107
|
+
def update_name
|
108
|
+
Card::Auth.as_bot do
|
109
|
+
Card["Cardtype B+*type+*create"].update! name: "B+*update"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
it "does NOT run update events from sets that no longer apply after change" do
|
114
|
+
with_test_events do
|
115
|
+
test_event :validate, on: :update, set: Card::Set::Right::Create do
|
116
|
+
add_to_log "NO to run"
|
117
|
+
end
|
118
|
+
update_name
|
119
|
+
expect(@log).to be_empty
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it "does run update events from old sets when `changing` value present" do
|
124
|
+
with_test_events do
|
125
|
+
test_event :validate,
|
126
|
+
on: :update, set: Card::Set::Right::Create, changing: :name do
|
127
|
+
add_to_log "YES to run"
|
128
|
+
end
|
129
|
+
update_name
|
130
|
+
expect(@log).to contain_exactly("YES to run")
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
it "does run update events from sets that apply after change" do
|
135
|
+
with_test_events do
|
136
|
+
test_event :validate, on: :update, set: Card::Set::Right::Update do
|
137
|
+
add_to_log "YES to run"
|
138
|
+
end
|
139
|
+
update_name
|
140
|
+
expect(@log).to contain_exactly("YES to run")
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
54
145
|
describe "trigger option" do
|
55
146
|
specify "trigger for whole act" do
|
56
147
|
with_test_events do
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
describe Card::Set::All::Pattern do
|
3
|
+
RSpec.describe Card::Set::All::Pattern do
|
4
4
|
describe :set_names do
|
5
5
|
it "returns self, type, all for simple cards" do
|
6
6
|
Card::Auth.as_bot do
|
@@ -33,15 +33,22 @@ describe Card::Set::All::Pattern do
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
it "returns set names for compound star cards" do
|
37
|
-
Card
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
it "returns set names for compound star cards", as_bot: true do
|
37
|
+
expect(Card.new(name: "Iliad+*to").set_names).to eq(
|
38
|
+
[
|
39
|
+
"Book+*to+*type plus right", "*to+*right", "*rstar",
|
40
|
+
"Pointer+*type", "*all plus", "*all"
|
41
|
+
]
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "returns set names for rule cards", as_bot: true do
|
46
|
+
expect(Card.new(name: "*all+*create").set_names).to eq(
|
47
|
+
[
|
48
|
+
"*rule", "Set+*create+*type plus right", "*create+*right", "*rstar",
|
49
|
+
"Pointer+*type", "*all plus", "*all"
|
50
|
+
]
|
51
|
+
)
|
45
52
|
end
|
46
53
|
|
47
54
|
# right place for this? really need more prototype tests...
|
@@ -0,0 +1,61 @@
|
|
1
|
+
format :html do
|
2
|
+
BRIDGE_TABS = { account_tab: "Account",
|
3
|
+
engage_tab: "Engage",
|
4
|
+
history_tab: "History",
|
5
|
+
related_tab: "Related",
|
6
|
+
rules_tab: "Rules" }.freeze
|
7
|
+
|
8
|
+
wrapper :bridge do
|
9
|
+
class_up "modal-dialog", "no-gaps"
|
10
|
+
voo.hide! :modal_footer
|
11
|
+
wrap_with_modal size: :full, title: bridge_breadcrumbs do
|
12
|
+
haml :bridge
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def bridge_tabs
|
17
|
+
lazy_loading_tabs visible_bridge_tabs, bridge_tab, _render(bridge_tab)
|
18
|
+
end
|
19
|
+
|
20
|
+
def bridge_tab
|
21
|
+
@bridge_tab ||= bridge_param :tab
|
22
|
+
end
|
23
|
+
|
24
|
+
def bridge_param key
|
25
|
+
params.dig(:bridge, key)&.to_sym || try("default_bridge_#{key}")
|
26
|
+
end
|
27
|
+
|
28
|
+
def bridge_breadcrumbs
|
29
|
+
<<-HTML.strip_heredoc
|
30
|
+
<nav aria-label="breadcrumb">
|
31
|
+
<ol class="breadcrumb _bridge-breadcrumb">
|
32
|
+
<li class="breadcrumb-item">#{card.name}</li>
|
33
|
+
<li class="breadcrumb-item active">Edit</li>
|
34
|
+
</ol>
|
35
|
+
</nav>
|
36
|
+
HTML
|
37
|
+
end
|
38
|
+
|
39
|
+
def bridge_link_opts opts={}
|
40
|
+
opts[:"data-slot-selector"] = bridge_slot_selector
|
41
|
+
opts[:remote] = true
|
42
|
+
add_class opts, "slotter"
|
43
|
+
opts.bury :path, :layout, :overlay
|
44
|
+
opts[:path][:view] ||= :content
|
45
|
+
opts
|
46
|
+
end
|
47
|
+
|
48
|
+
def bridge_slot_selector
|
49
|
+
".bridge-main > .card-slot, "\
|
50
|
+
".bridge-main > .overlay-container > .card-slot._bottomlay-slot"
|
51
|
+
end
|
52
|
+
|
53
|
+
def default_bridge_tab
|
54
|
+
show_account_tab? ? :account_tab : :engage_tab
|
55
|
+
end
|
56
|
+
|
57
|
+
def breadcrumb_data title, html_class=nil
|
58
|
+
html_class ||= title.underscore
|
59
|
+
{ "data-breadcrumb": title, "data-breadcrumb-class": html_class }
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
format :html do
|
2
|
+
def follow_section
|
3
|
+
return unless show_follow?
|
4
|
+
|
5
|
+
wrap_with :div, class: "mb-3" do
|
6
|
+
[follow_button_group, followers_bridge_link, follow_overview_button]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def follow_button_group
|
11
|
+
wrap_with :div, class: "btn-group btn-group-sm follow-btn-group" do
|
12
|
+
[follow_button, follow_advanced]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def follow_overview_button
|
17
|
+
link_to_card [Auth.current, :follow], "all followed cards",
|
18
|
+
bridge_link_opts(class: "btn btn-sm btn-secondary",
|
19
|
+
"data-cy": "follow-overview")
|
20
|
+
end
|
21
|
+
|
22
|
+
def follow_advanced
|
23
|
+
opts = bridge_link_opts(class: "btn btn-sm btn-primary",
|
24
|
+
path: { view: :overlay_rule },
|
25
|
+
"data-cy": "follow-advanced")
|
26
|
+
opts[:path].delete :layout
|
27
|
+
link_to_card card.follow_rule_card(Auth.current.name, new: {}),
|
28
|
+
icon_tag("more_horiz"), opts
|
29
|
+
end
|
30
|
+
|
31
|
+
def followers_bridge_link
|
32
|
+
cnt = card.followers_count
|
33
|
+
link_to_card card.name.field(:followers), "#{cnt} follower#{'s' unless cnt == 1}",
|
34
|
+
bridge_link_opts(class: "btn btn-sm ml-2 btn-secondary slotter",
|
35
|
+
remote: true, "data-cy": "followers")
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
format :html do
|
2
|
+
RELATED_ITEMS = [["children", :children],
|
3
|
+
# ["mates", "bed", "*mates"],
|
4
|
+
# FIXME: optimize and restore
|
5
|
+
["references out", :refers_to],
|
6
|
+
["references in", :referred_to_by]].freeze
|
7
|
+
|
8
|
+
view :engage_tab, wrap: { div: { class: "m-3 mt-4 _engage-tab" } } do
|
9
|
+
[render_follow_section, discussion_section].compact
|
10
|
+
end
|
11
|
+
|
12
|
+
view :history_tab do
|
13
|
+
class_up "d0-card-body", "history-slot"
|
14
|
+
voo.hide :act_legend
|
15
|
+
acts_bridge_layout card.history_acts
|
16
|
+
end
|
17
|
+
|
18
|
+
view :related_tab do
|
19
|
+
bridge_pills bridge_pill_items(RELATED_ITEMS, "Related")
|
20
|
+
end
|
21
|
+
|
22
|
+
view :rules_tab, tag: :unknown_ok do
|
23
|
+
class_up "card-slot", "flex-column"
|
24
|
+
wrap do
|
25
|
+
nest current_set_card, view: :bridge_rules_tab
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
view :account_tab do
|
30
|
+
bridge_pills bridge_pill_items(account_items, "Account")
|
31
|
+
end
|
32
|
+
|
33
|
+
view :follow_section, wrap: :slot do
|
34
|
+
follow_section
|
35
|
+
end
|
36
|
+
|
37
|
+
def discussion_section
|
38
|
+
return unless show_discussion?
|
39
|
+
|
40
|
+
field_nest(:discussion, view: :titled, title: "Discussion", show: :comment_box,
|
41
|
+
hide: [:menu])
|
42
|
+
end
|
43
|
+
|
44
|
+
def account_items
|
45
|
+
%i[account roles created edited follow].map do |item|
|
46
|
+
if item == :account
|
47
|
+
[tr(:details), item, { view: :edit, hide: %i[edit_name_row edit_type_row] }]
|
48
|
+
else
|
49
|
+
[tr(item), item]
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def bridge_pills items
|
55
|
+
list_tag class: "nav nav-pills _auto-single-select bridge-pills flex-column",
|
56
|
+
items: { class: "nav-item" } do
|
57
|
+
items
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def bridge_pill_items data, breadcrumb
|
62
|
+
data.map do |text, field, extra_opts|
|
63
|
+
opts = bridge_link_opts.merge("data-toggle": "pill")
|
64
|
+
opts.merge! breadcrumb_data(breadcrumb)
|
65
|
+
if extra_opts
|
66
|
+
classes = extra_opts.delete :class
|
67
|
+
add_class opts, classes if classes
|
68
|
+
opts.deep_merge! extra_opts
|
69
|
+
end
|
70
|
+
opts["data-cy"] = "#{text.to_name.key}-pill"
|
71
|
+
add_class opts, "nav-link"
|
72
|
+
link_to_card [card, field], text, opts
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|