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
data/mod/core/layout/modal.html
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,22 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
def toolbar_split_button name, button_link_opts
|
3
|
-
button_link = toolbar_split_button_link name, button_link_opts
|
4
|
-
split_button(button_link, active_toolbar_item) { yield }
|
5
|
-
end
|
6
|
-
|
7
|
-
def toolbar_split_button_link name, opts
|
8
|
-
link_text = toolbar_split_button_link_text name, opts
|
9
|
-
opts[:class] = "active" if active_toolbar_button == name
|
10
|
-
button_link link_text, opts
|
11
|
-
end
|
12
|
-
|
13
|
-
def toolbar_split_button_link_text name, opts
|
14
|
-
icon = icon_tag opts.delete(:icon)
|
15
|
-
icon + content_tag(:span, " #{name}".html_safe,
|
16
|
-
class: "d-none d-md-inline")
|
17
|
-
end
|
18
|
-
|
19
|
-
def subject
|
20
|
-
parent || self
|
21
|
-
end
|
22
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
# Classy home for classes and klasses
|
3
|
-
def class_up klass, classier, force=false
|
4
|
-
key = klass.to_s
|
5
|
-
return if !force && class_list[key]
|
6
|
-
class_list[key] = [class_list[key], classier.to_s].compact.join(" ")
|
7
|
-
end
|
8
|
-
|
9
|
-
def class_down klass, classier
|
10
|
-
class_list.delete klass if class_list[klass] == classier
|
11
|
-
end
|
12
|
-
|
13
|
-
def with_class_up klass, classier, force=false
|
14
|
-
class_up klass, classier, force
|
15
|
-
yield
|
16
|
-
ensure
|
17
|
-
class_down klass, classier
|
18
|
-
end
|
19
|
-
|
20
|
-
# don't use in the given block the additional class that
|
21
|
-
# was added to `klass`
|
22
|
-
def without_upped_class klass
|
23
|
-
tmp_class = class_list.delete klass
|
24
|
-
result = yield tmp_class
|
25
|
-
class_list[klass] = tmp_class
|
26
|
-
result
|
27
|
-
end
|
28
|
-
|
29
|
-
def class_list
|
30
|
-
@class_list ||= {}
|
31
|
-
end
|
32
|
-
|
33
|
-
def classy *classes
|
34
|
-
classes = Array.wrap(classes).flatten
|
35
|
-
[classes, class_list[classes.first]].flatten.compact.join " "
|
36
|
-
end
|
37
|
-
end
|
@@ -1,176 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
###---( TOP_LEVEL (used by menu) NEW / EDIT VIEWS )
|
3
|
-
view :edit, perms: :update, tags: :unknown_ok, cache: :never do
|
4
|
-
with_nest_mode :edit do
|
5
|
-
voo.show :toolbar, :help
|
6
|
-
frame_and_form :update, edit_form_opts do
|
7
|
-
[
|
8
|
-
edit_view_hidden,
|
9
|
-
_render_content_formgroup,
|
10
|
-
_render_edit_buttons
|
11
|
-
]
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def edit_form_opts
|
17
|
-
# for override
|
18
|
-
end
|
19
|
-
|
20
|
-
def edit_view_hidden
|
21
|
-
# for override
|
22
|
-
end
|
23
|
-
|
24
|
-
view :edit_buttons do
|
25
|
-
button_formgroup do
|
26
|
-
[standard_submit_button, standard_cancel_button]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def standard_submit_button
|
31
|
-
submit_button class: "submit-button"
|
32
|
-
end
|
33
|
-
|
34
|
-
def standard_cancel_button args={}
|
35
|
-
args.reverse_merge! class: "cancel-button", href: path
|
36
|
-
cancel_button args
|
37
|
-
end
|
38
|
-
|
39
|
-
view :edit_name, perms: :update do
|
40
|
-
voo.show :toolbar
|
41
|
-
frame_and_form({ action: :update, id: card.id },
|
42
|
-
"main-success" => "REDIRECT") do
|
43
|
-
[hidden_edit_name_fields,
|
44
|
-
_render_name_formgroup,
|
45
|
-
rename_confirmation_alert,
|
46
|
-
edit_name_buttons]
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
def hidden_edit_name_fields
|
51
|
-
hidden_tags success: "_self",
|
52
|
-
old_name: card.name,
|
53
|
-
card: { update_referers: false }
|
54
|
-
end
|
55
|
-
|
56
|
-
def edit_name_buttons
|
57
|
-
button_formgroup do
|
58
|
-
[rename_and_update_button, rename_button, standard_cancel_button]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def rename_and_update_button
|
63
|
-
submit_button text: "Rename and Update", disable_with: "Renaming",
|
64
|
-
class: "renamer-updater"
|
65
|
-
end
|
66
|
-
|
67
|
-
def rename_button
|
68
|
-
button_tag "Rename", data: { disable_with: "Renaming" }, class: "renamer"
|
69
|
-
end
|
70
|
-
|
71
|
-
def rename_confirmation_alert
|
72
|
-
msg = "<h5>Are you sure you want to rename <em>#{safe_name}</em>?</h5>"
|
73
|
-
msg << rename_effects_and_options
|
74
|
-
alert("warning") { msg }
|
75
|
-
end
|
76
|
-
|
77
|
-
def rename_effects_and_options
|
78
|
-
descendant_effect = rename_descendant_effect
|
79
|
-
referer_effect, referer_option = rename_referer_effect_and_option
|
80
|
-
effects = [descendant_effect, referer_effect].compact
|
81
|
-
return "" if effects.empty?
|
82
|
-
format_rename_effects_and_options effects, referer_option
|
83
|
-
end
|
84
|
-
|
85
|
-
def format_rename_effects_and_options effects, referer_option
|
86
|
-
effects = effects.map { |effect| "<li>#{effect}</li>" }.join
|
87
|
-
info = %(<h6>This change will...</h6>)
|
88
|
-
info += %(<ul>#{effects}</ul>)
|
89
|
-
info += %(<p>#{referer_option}</p>) if referer_option
|
90
|
-
info
|
91
|
-
end
|
92
|
-
|
93
|
-
def rename_descendant_effect
|
94
|
-
descendants = card.descendants
|
95
|
-
return unless descendants.any? # FIXME: count, don't instantiate
|
96
|
-
"automatically alter #{descendants.size} related name(s)."
|
97
|
-
end
|
98
|
-
|
99
|
-
def rename_referer_effect_and_option
|
100
|
-
referers = card.family_referers
|
101
|
-
return unless referers.any? # FIXME: count, don't instantiate
|
102
|
-
count = referers.size
|
103
|
-
refs = count == 1 ? "reference" : "references"
|
104
|
-
effect = "affect at least #{count} #{refs} to \"#{card.name}\""
|
105
|
-
effect += hidden_field_tag(:referers, count)
|
106
|
-
option = "You may choose to <em>update or ignore</em> the referers."
|
107
|
-
[effect, option]
|
108
|
-
end
|
109
|
-
|
110
|
-
view :edit_type, cache: :never, perms: :update do
|
111
|
-
voo.show :toolbar
|
112
|
-
frame_and_form :update do
|
113
|
-
[
|
114
|
-
hidden_edit_type_fields,
|
115
|
-
_render_type_formgroup,
|
116
|
-
edit_type_buttons
|
117
|
-
]
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
def hidden_edit_type_fields
|
122
|
-
hidden_field_tag "success[view]", "edit"
|
123
|
-
end
|
124
|
-
|
125
|
-
def edit_type_buttons
|
126
|
-
cancel_path = path view: :edit
|
127
|
-
button_formgroup do
|
128
|
-
[standard_submit_button, standard_cancel_button(href: cancel_path)]
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
view :edit_rules, cache: :never, tags: :unknown_ok do
|
133
|
-
voo.show :set_navbar, :toolbar
|
134
|
-
voo.hide :set_label, :rule_navbar
|
135
|
-
|
136
|
-
render_related items: { nest_name: current_set_card.name }
|
137
|
-
end
|
138
|
-
|
139
|
-
view :edit_structure, cache: :never do
|
140
|
-
return unless card.structure
|
141
|
-
voo.show :toolbar
|
142
|
-
render_related items: { view: :edit, nest_name: card.structure_rule_card.name }
|
143
|
-
# FIXME: this stuff:
|
144
|
-
# slot: {
|
145
|
-
# cancel_slot_selector: ".card-slot.related-view",
|
146
|
-
# cancel_path: card.format.path(view: :edit), hide: :edit_toolbar,
|
147
|
-
# hidden: { success: { view: :open, "slot[subframe]" => true } }
|
148
|
-
# }
|
149
|
-
# }
|
150
|
-
end
|
151
|
-
|
152
|
-
view :edit_nests, cache: :never do
|
153
|
-
voo.show :toolbar
|
154
|
-
frame do
|
155
|
-
with_nest_mode :edit do
|
156
|
-
multi_card_edit
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
|
161
|
-
# FIXME: - view can recurse. temporarily turned off
|
162
|
-
#
|
163
|
-
# view :edit_nest_rules, cache: :never do
|
164
|
-
# return ""#
|
165
|
-
# voo.show :toolbar
|
166
|
-
# view = args[:rule_view] || :field_related_rules
|
167
|
-
# frame do
|
168
|
-
# # with_nest_mode :edit do
|
169
|
-
# nested_fields.map do |name, _options|
|
170
|
-
# nest Card.fetch(name.to_name.trait(:self)),
|
171
|
-
# view: :titled, title: name, rule_view: view,
|
172
|
-
# hide: :set_label, show: :rule_navbar
|
173
|
-
# end
|
174
|
-
# end
|
175
|
-
# end
|
176
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
format :html do
|
2
|
-
# the related view nests a related card with a submenu
|
3
|
-
# the subcard is specified as an "item" card using the slot/voo api
|
4
|
-
view :related, cache: :never do
|
5
|
-
name, options = related_item
|
6
|
-
return unless related_card name
|
7
|
-
voo.show :toolbar, :menu, :help
|
8
|
-
frame do
|
9
|
-
voo.hide :header, :toggle
|
10
|
-
nest @related_card, related_options(options)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def related_item
|
15
|
-
options = voo.items
|
16
|
-
voo.items = {}
|
17
|
-
name = options.delete :nest_name
|
18
|
-
[name, options]
|
19
|
-
end
|
20
|
-
|
21
|
-
def related_card related_name
|
22
|
-
@related_card = Card.fetch related_name.to_name.absolute_name(card.name), new: {}
|
23
|
-
end
|
24
|
-
|
25
|
-
def related_options opts
|
26
|
-
opts[:view] ||= :open
|
27
|
-
opts.reverse_merge!(show: :comment_box) if @related_card.show_comment_box_in_related?
|
28
|
-
opts
|
29
|
-
end
|
30
|
-
end
|
@@ -1,264 +0,0 @@
|
|
1
|
-
include_set Abstract::ToolbarSplitButton
|
2
|
-
|
3
|
-
format :html do
|
4
|
-
TOOLBAR_TITLE = {
|
5
|
-
edit: "content", edit_name: "name", edit_type: "type",
|
6
|
-
edit_structure: "structure", edit_nests: "nests", history: "history",
|
7
|
-
common_rules: "common", recent_rules: "recent", grouped_rules: "all",
|
8
|
-
edit_nest_rules: "nests"
|
9
|
-
}.freeze
|
10
|
-
|
11
|
-
def toolbar_pinned?
|
12
|
-
(tp = Card[:toolbar_pinned]) && tp.content == "true"
|
13
|
-
end
|
14
|
-
|
15
|
-
view :toolbar, cache: :never do
|
16
|
-
tool_navbar do
|
17
|
-
[toolbar_split_buttons, toolbar_right_buttons]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
before :toolbar do
|
22
|
-
@rule_view = params[:rule_view]
|
23
|
-
end
|
24
|
-
|
25
|
-
# before :toolbar do
|
26
|
-
# args[:nested_fields] = nested_fields
|
27
|
-
# args[:active_toolbar_button] ||= active_toolbar_button @slot_view, args
|
28
|
-
# end
|
29
|
-
|
30
|
-
def expanded_close_link
|
31
|
-
opts = {}
|
32
|
-
opts[:no_nav] = true
|
33
|
-
close_link "navbar-text"
|
34
|
-
end
|
35
|
-
|
36
|
-
def collapsed_close_link
|
37
|
-
opts = {}
|
38
|
-
opts[:no_nav] = true
|
39
|
-
close_link "float-right d-sm-none navbar-text", opts
|
40
|
-
end
|
41
|
-
|
42
|
-
def tool_navbar
|
43
|
-
navbar "toolbar-#{card.name.safe_key}-#{voo.home_view}",
|
44
|
-
toggle_align: :left, class: "slotter toolbar",
|
45
|
-
navbar_type: "dark",
|
46
|
-
no_collapse: true do
|
47
|
-
yield
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
def toolbar_split_buttons
|
52
|
-
wrap_with :form do
|
53
|
-
[
|
54
|
-
account_split_button,
|
55
|
-
toolbar_button_card(:activity),
|
56
|
-
toolbar_button_card(:rules),
|
57
|
-
edit_split_button
|
58
|
-
]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def toolbar_simple_buttons
|
63
|
-
_render :toolbar_buttons
|
64
|
-
# end
|
65
|
-
end
|
66
|
-
|
67
|
-
def toolbar_right_buttons
|
68
|
-
wrap_with :div do
|
69
|
-
[
|
70
|
-
toolbar_simple_buttons,
|
71
|
-
expanded_close_link
|
72
|
-
]
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
# TODO: decentralize and let views choose which menu they are in.
|
77
|
-
# (Also, should only be represented once. Currently we must configure
|
78
|
-
# this relationship twice)
|
79
|
-
def active_toolbar_button
|
80
|
-
@active_toolbar_button ||=
|
81
|
-
case voo.root.ok_view
|
82
|
-
when :follow, :editors, :history then "activity"
|
83
|
-
when :edit_rules, :edit_nest_rules then "rules"
|
84
|
-
when :edit, :edit_name, :edit_type,
|
85
|
-
:edit_structure, :edit_nests then "edit"
|
86
|
-
when :related then active_related_toolbar_button
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def active_related_toolbar_button
|
91
|
-
return unless (codename = related_codename @related_card)
|
92
|
-
case codename
|
93
|
-
when :discussion, :editors then "activity"
|
94
|
-
when :account, :roles, :edited, :created, :follow then "account"
|
95
|
-
when :structure then "edit"
|
96
|
-
else "rules"
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def active_toolbar_item
|
101
|
-
@active_toolbar_item ||=
|
102
|
-
case
|
103
|
-
when @rule_view then @rule_view.to_sym
|
104
|
-
when voo.root.ok_view != :related then voo.root.ok_view
|
105
|
-
when @related_card then related_codename @related_card
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def toolbar_view_title view
|
110
|
-
if view == :edit_rules
|
111
|
-
current_set_card.name
|
112
|
-
else
|
113
|
-
TOOLBAR_TITLE[view]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def edit_split_button
|
118
|
-
toolbar_split_button "edit", view: :edit, icon: :edit do
|
119
|
-
{
|
120
|
-
edit: _render_edit_link,
|
121
|
-
edit_nests: (_render_edit_nests_link if nests_editable?),
|
122
|
-
structure: (_render_edit_structure_link if structure_editable?),
|
123
|
-
edit_name: _render_edit_name_link,
|
124
|
-
edit_type: _render_edit_type_link
|
125
|
-
}
|
126
|
-
end
|
127
|
-
end
|
128
|
-
|
129
|
-
def nests_editable?
|
130
|
-
!card.structure && nested_fields.present?
|
131
|
-
end
|
132
|
-
|
133
|
-
def account_split_button
|
134
|
-
return "" unless card.accountable?
|
135
|
-
toolbar_split_button "account", related: :account, icon: :account_box do
|
136
|
-
%i[account roles created edited follow].each_with_object({}) do |item, hash|
|
137
|
-
label = item == :account ? tr(:details) : tr(item)
|
138
|
-
args = { class: "dropdown-item" }
|
139
|
-
args[:path] = { slot: { items: { view: :edit } } } if item == :account
|
140
|
-
hash[item] = link_to_related item, label, args
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
def toolbar_button_card name
|
146
|
-
button_codename = "#{name}_toolbar_button".to_sym
|
147
|
-
return "" unless (button_card = Card[button_codename])
|
148
|
-
with_nest_mode :normal do
|
149
|
-
nest button_card, view: :core
|
150
|
-
end
|
151
|
-
end
|
152
|
-
|
153
|
-
def related_codename related_card
|
154
|
-
return nil unless related_card
|
155
|
-
Card.quick_fetch(related_card.name.right)&.codename
|
156
|
-
end
|
157
|
-
|
158
|
-
def close_link extra_class, opts={}
|
159
|
-
nav_css_classes = css_classes("nav navbar-nav", extra_class)
|
160
|
-
css_classes = opts[:no_nav] ? extra_class : nav_css_classes
|
161
|
-
wrap_with :div, class: css_classes do
|
162
|
-
[
|
163
|
-
# toolbar_pin_button,
|
164
|
-
link_to_view(voo.home_view || :open, icon_tag(:remove),
|
165
|
-
title: "cancel",
|
166
|
-
class: "btn-toolbar-control toolbar-close pl-1")
|
167
|
-
]
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
def toolbar_pin_button
|
172
|
-
button_tag icon_tag(:pushpin).html_safe,
|
173
|
-
situation: :primary, remote: true,
|
174
|
-
title: "#{'un' if toolbar_pinned?}pin",
|
175
|
-
class: "btn-toolbar-control toolbar-pin d-none d-sm-inline " \
|
176
|
-
"#{'in' unless toolbar_pinned?}active"
|
177
|
-
end
|
178
|
-
|
179
|
-
view :toolbar_buttons, cache: :never do
|
180
|
-
wrap_with(:div, class: "btn-group btn-group-sm") do
|
181
|
-
[
|
182
|
-
_render(:delete_button,
|
183
|
-
optional: (card.ok?(:delete) ? :show : :hide)),
|
184
|
-
_render(:refresh_button),
|
185
|
-
_render(:related_button)
|
186
|
-
]
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
view :related_button do
|
191
|
-
dropdown_button "", icon: :explore, class: "related dropdown-menu-right",
|
192
|
-
extra_css_class: "d-none d-md-inline" do
|
193
|
-
[
|
194
|
-
["children", :baby_formula, "*children"],
|
195
|
-
# ["mates", "bed", "*mates"],
|
196
|
-
# FIXME: optimize and restore
|
197
|
-
["references out", :log_out, "*refers_to"],
|
198
|
-
["references in", :log_in, "*referred_to_by"]
|
199
|
-
].map do |title, icon, tag|
|
200
|
-
menu_item " #{title}", icon, related: tag,
|
201
|
-
path: { slot: { show: :toolbar, hide: :menu } }
|
202
|
-
end
|
203
|
-
end
|
204
|
-
end
|
205
|
-
|
206
|
-
view :refresh_button do
|
207
|
-
icon = main? ? "refresh" : "open_in_new"
|
208
|
-
button_args = { card: card, path: { slot: { show: :toolbar } } }
|
209
|
-
button_args[:class] = "d-none d-sm-inline" if card.accountable?
|
210
|
-
toolbar_button "refresh", icon, button_args
|
211
|
-
end
|
212
|
-
|
213
|
-
view :delete_button do
|
214
|
-
confirm = "Are you sure you want to delete #{safe_name}?"
|
215
|
-
success = main? ? "REDIRECT: *previous" : { view: :just_deleted }
|
216
|
-
toolbar_button "delete", :trash,
|
217
|
-
path: { action: :delete, success: success },
|
218
|
-
class: "slotter", remote: true, 'data-confirm': confirm
|
219
|
-
end
|
220
|
-
|
221
|
-
# TODO: add undo functionality
|
222
|
-
view :just_deleted, tag: :unknown_ok do
|
223
|
-
wrap { "#{render_title} deleted" }
|
224
|
-
end
|
225
|
-
|
226
|
-
def toolbar_button text, symbol, opts={}
|
227
|
-
link_text = toolbar_button_text text, symbol, opts.delete(:hide)
|
228
|
-
opts[:class] = [opts[:class], "btn btn-primary"].compact * " "
|
229
|
-
opts[:title] ||= text
|
230
|
-
smart_link_to link_text, opts
|
231
|
-
end
|
232
|
-
|
233
|
-
def toolbar_button_text text, symbol, hide
|
234
|
-
hide ||= "d-none"
|
235
|
-
css_classes = "menu-item-label #{hide}"
|
236
|
-
rich_text = wrap_with :span, text.html_safe, class: css_classes
|
237
|
-
icon_tag(symbol) + rich_text
|
238
|
-
end
|
239
|
-
|
240
|
-
def autosaved_draft_link opts={}
|
241
|
-
text = opts.delete(:text) || "autosaved draft"
|
242
|
-
opts[:path] = { edit_draft: true, slot: { show: :toolbar } }
|
243
|
-
add_class opts, "navbar-link slotter"
|
244
|
-
link_to_view :edit, text, opts
|
245
|
-
end
|
246
|
-
|
247
|
-
{
|
248
|
-
edit: "content",
|
249
|
-
edit_name: "name",
|
250
|
-
edit_type: "type",
|
251
|
-
edit_nests: "nests",
|
252
|
-
edit_structure: "structure",
|
253
|
-
history: "history"
|
254
|
-
}.each do |viewname, viewtitle|
|
255
|
-
|
256
|
-
view "#{viewname}_link" do
|
257
|
-
link_to_view viewname, viewtitle, class: "dropdown-item"
|
258
|
-
end
|
259
|
-
end
|
260
|
-
|
261
|
-
def recently_edited_settings?
|
262
|
-
(rs = Card[:recent_settings]) && rs.item_names.present?
|
263
|
-
end
|
264
|
-
end
|