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
@@ -182,8 +182,34 @@ schema_migrations_core_cards_090:
|
|
182
182
|
schema_migrations_core_cards_091:
|
183
183
|
version: '20180601133753'
|
184
184
|
schema_migrations_core_cards_092:
|
185
|
-
version: '
|
185
|
+
version: '20180712042655'
|
186
186
|
schema_migrations_core_cards_093:
|
187
|
-
version: '
|
187
|
+
version: '20180905061534'
|
188
188
|
schema_migrations_core_cards_094:
|
189
|
+
version: '20180905061536'
|
190
|
+
schema_migrations_core_cards_095:
|
191
|
+
version: '20181108181219'
|
192
|
+
schema_migrations_core_cards_096:
|
193
|
+
version: '20181120200937'
|
194
|
+
schema_migrations_core_cards_097:
|
189
195
|
version: '20181129140917'
|
196
|
+
schema_migrations_core_cards_098:
|
197
|
+
version: '20190125125150'
|
198
|
+
schema_migrations_core_cards_099:
|
199
|
+
version: '20190204195038'
|
200
|
+
schema_migrations_core_cards_100:
|
201
|
+
version: '20190204195039'
|
202
|
+
schema_migrations_core_cards_101:
|
203
|
+
version: '20190228122633'
|
204
|
+
schema_migrations_core_cards_102:
|
205
|
+
version: '20190228122634'
|
206
|
+
schema_migrations_core_cards_103:
|
207
|
+
version: '20190228122635'
|
208
|
+
schema_migrations_core_cards_104:
|
209
|
+
version: '20190228122636'
|
210
|
+
schema_migrations_core_cards_105:
|
211
|
+
version: '20190228122638'
|
212
|
+
schema_migrations_core_cards_106:
|
213
|
+
version: '20190306172622'
|
214
|
+
schema_migrations_core_cards_107:
|
215
|
+
version: '20190306172623'
|
data/db/seed/test/seed.rb
CHANGED
@@ -15,7 +15,6 @@ class SharedData
|
|
15
15
|
|
16
16
|
CARDTYPE_COUNT = 35
|
17
17
|
|
18
|
-
|
19
18
|
class << self
|
20
19
|
|
21
20
|
def create_user name, args
|
@@ -56,6 +55,17 @@ class SharedData
|
|
56
55
|
create name
|
57
56
|
end
|
58
57
|
|
58
|
+
create_layout "lay out", "Greatest {{_main|title: Callahan!; view: labeled}}"
|
59
|
+
create_pointer "stacks", ["horizontal", "vertical"]
|
60
|
+
create_pointer "stacks+*self+*layout", "lay out"
|
61
|
+
|
62
|
+
create_pointer "friends+*right+*default"
|
63
|
+
create_search_type "friends+*right+*options", '{"type":"User"}'
|
64
|
+
|
65
|
+
create_pointer "joes"
|
66
|
+
create "joes+*self+*input", "filtered list"
|
67
|
+
create "joes+*self+*options", ["Joe Admin", "Joe User", "Joe Camel"]
|
68
|
+
|
59
69
|
# cards for rename_test
|
60
70
|
# FIXME: could probably refactor these..
|
61
71
|
[
|
@@ -134,6 +144,10 @@ class SharedData
|
|
134
144
|
|
135
145
|
notification_cards
|
136
146
|
|
147
|
+
create "42", TEXT
|
148
|
+
create_pointer "items",
|
149
|
+
content: ["Parry Hotter", "42", "Stam Broker", "First",
|
150
|
+
"yeti skin+image", "*all+*script+*machine output"]
|
137
151
|
# Card['*all+*style' ].ensure_machine_output
|
138
152
|
# Card['*all+*script'].ensure_machine_output
|
139
153
|
# (ie9 = Card[:script_html5shiv_printshiv]) && ie9.ensure_machine_output
|
@@ -280,4 +294,22 @@ class SharedData
|
|
280
294
|
|
281
295
|
end
|
282
296
|
end
|
297
|
+
|
298
|
+
TEXT = <<-TXT.strip_heredoc.freeze
|
299
|
+
Far out in the uncharted backwaters of the unfashionable end of
|
300
|
+
the western spiral arm of the Galaxy lies a small unregarded
|
301
|
+
yellow sun.
|
302
|
+
|
303
|
+
Orbiting this at a distance of roughly ninety-two million miles
|
304
|
+
is an utterly insignificant little blue green planet whose ape-
|
305
|
+
descended life forms are so amazingly primitive that they still
|
306
|
+
think digital watches are a pretty neat idea.
|
307
|
+
|
308
|
+
This planet has - or rather had - a problem, which was this: most
|
309
|
+
of the people living on it were unhappy for pretty much of the time.
|
310
|
+
Many solutions were suggested for this problem, but most of these
|
311
|
+
were largely concerned with the movements of small green pieces
|
312
|
+
of paper, which is odd because on the whole it wasn't the small
|
313
|
+
green pieces of paper that were unhappy.
|
314
|
+
TXT
|
283
315
|
end
|
data/db/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
20190131223248
|
data/db/version_core_cards.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
20190306172623
|
data/lib/card.rb
CHANGED
@@ -114,6 +114,7 @@ class Card < ApplicationRecord
|
|
114
114
|
require_dependency "card/view"
|
115
115
|
require_dependency "card/act_manager"
|
116
116
|
require_dependency "card/dirty"
|
117
|
+
require_dependency "card/layout"
|
117
118
|
|
118
119
|
has_many :references_in, class_name: :Reference, foreign_key: :referee_id
|
119
120
|
has_many :references_out, class_name: :Reference, foreign_key: :referer_id
|
data/lib/card/act_manager.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require_dependency "card/act_manager/stage_director"
|
2
2
|
|
3
|
-
|
4
3
|
class Card
|
5
4
|
# Manages the whole process of creating an {act Card::Act} ie. changing
|
6
5
|
# a card and attached subcards.
|
@@ -82,6 +81,7 @@ class Card
|
|
82
81
|
class << self
|
83
82
|
def act_director
|
84
83
|
return unless act_card
|
84
|
+
|
85
85
|
act_card.director
|
86
86
|
end
|
87
87
|
|
@@ -113,6 +113,7 @@ class Card
|
|
113
113
|
# FIXME: use "parent" instead of opts (it's the only option)
|
114
114
|
def fetch card, opts={}
|
115
115
|
return directors[card] if directors[card]
|
116
|
+
|
116
117
|
directors.each_key do |dir_card|
|
117
118
|
return dir_card.director if dir_card.name == card.name && dir_card.director
|
118
119
|
end
|
@@ -146,11 +147,13 @@ class Card
|
|
146
147
|
|
147
148
|
def card_changed old_card
|
148
149
|
return unless (director = @directors.delete old_card)
|
150
|
+
|
149
151
|
add director
|
150
152
|
end
|
151
153
|
|
152
154
|
def delete director
|
153
155
|
return unless @directors
|
156
|
+
|
154
157
|
@directors.delete director.card
|
155
158
|
director.delete
|
156
159
|
end
|
@@ -193,6 +196,7 @@ class Card
|
|
193
196
|
self.act = Act.find act_id if act_id
|
194
197
|
with_env_and_auth env, auth do
|
195
198
|
return yield unless act
|
199
|
+
|
196
200
|
run_act(act.card || card) do
|
197
201
|
act_card.director.run_delayed_event act, &block
|
198
202
|
end
|
@@ -209,7 +213,7 @@ class Card
|
|
209
213
|
|
210
214
|
def to_s
|
211
215
|
act_director.to_s
|
212
|
-
#directors.values.map(&:to_s).join "\n"
|
216
|
+
# directors.values.map(&:to_s).join "\n"
|
213
217
|
end
|
214
218
|
end
|
215
219
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class Card
|
2
2
|
class ActManager
|
3
3
|
module Stage
|
4
|
-
STAGES = [
|
5
|
-
|
4
|
+
STAGES = %i[initialize prepare_to_validate validate prepare_to_store
|
5
|
+
store finalize integrate after_integrate integrate_with_delay].freeze
|
6
6
|
stage_index = {}
|
7
7
|
STAGES.each_with_index do |stage, i|
|
8
8
|
stage_index[stage] = i
|
@@ -22,9 +22,9 @@ class Card
|
|
22
22
|
def stage_index stage
|
23
23
|
case stage
|
24
24
|
when Symbol then
|
25
|
-
|
25
|
+
STAGE_INDEX[stage]
|
26
26
|
when Integer then
|
27
|
-
|
27
|
+
stage
|
28
28
|
else
|
29
29
|
raise Card::Error, "not a valid stage: #{stage}"
|
30
30
|
end
|
@@ -36,7 +36,7 @@ class Card
|
|
36
36
|
(opts[:before] && before?(opts[:before])) ||
|
37
37
|
(opts[:after] && after?(opts[:after])) ||
|
38
38
|
true # no phase restriction in opts
|
39
|
-
|
39
|
+
)
|
40
40
|
end
|
41
41
|
|
42
42
|
def before? allowed_phase
|
@@ -1,10 +1,10 @@
|
|
1
|
-
|
2
1
|
class Card
|
3
2
|
def restore_changes_information
|
4
3
|
# restores changes for integration phase
|
5
4
|
# (rails cleared them in an after_create/after_update hook which is
|
6
5
|
# executed before the integration phase)
|
7
6
|
return unless saved_changes.present?
|
7
|
+
|
8
8
|
@mutations_from_database = mutations_before_last_save
|
9
9
|
end
|
10
10
|
|
@@ -98,6 +98,7 @@ class Card
|
|
98
98
|
def catch_up_to_stage next_stage
|
99
99
|
if @transact_in_stage
|
100
100
|
return if @transact_in_stage != next_stage
|
101
|
+
|
101
102
|
next_stage = :integrate_with_delay
|
102
103
|
end
|
103
104
|
upto_stage(next_stage) do |stage|
|
@@ -143,6 +144,7 @@ class Card
|
|
143
144
|
unless act_director
|
144
145
|
raise Card::Error, "act requested without a main stage director"
|
145
146
|
end
|
147
|
+
|
146
148
|
@act = act_director.act ||= ActManager.need_act
|
147
149
|
end
|
148
150
|
|
@@ -150,7 +152,7 @@ class Card
|
|
150
152
|
if main?
|
151
153
|
self
|
152
154
|
else
|
153
|
-
ActManager.act_director || (@parent
|
155
|
+
ActManager.act_director || (@parent&.main_director)
|
154
156
|
end
|
155
157
|
end
|
156
158
|
|
@@ -186,6 +188,7 @@ class Card
|
|
186
188
|
new_stage = stage_index(stage)
|
187
189
|
@stage ||= -1
|
188
190
|
return if @stage >= new_stage
|
191
|
+
|
189
192
|
if @stage < new_stage - 1
|
190
193
|
raise Card::Error, "stage #{stage_symbol(new_stage - 1)} was " \
|
191
194
|
"skipped for card #{@card}"
|
@@ -195,10 +198,11 @@ class Card
|
|
195
198
|
|
196
199
|
def run_single_stage stage, &block
|
197
200
|
return true unless valid_next_stage? stage
|
201
|
+
|
198
202
|
# puts "#{@card.name}: #{stage} stage".red
|
199
203
|
prepare_stage_run stage
|
200
204
|
execute_stage_run stage, &block
|
201
|
-
rescue => e
|
205
|
+
rescue StandardError => e
|
202
206
|
@card.clean_after_stage_fail
|
203
207
|
raise e
|
204
208
|
end
|
@@ -256,9 +260,7 @@ class Card
|
|
256
260
|
# and use the ActiveRecord :around_save callback to run the :store and
|
257
261
|
# :finalize stages
|
258
262
|
def store &save_block
|
259
|
-
if main? && !block_given?
|
260
|
-
raise Card::Error, "need block to store main card"
|
261
|
-
end
|
263
|
+
raise Card::Error, "need block to store main card" if main? && !block_given?
|
262
264
|
|
263
265
|
# the block is the ActiveRecord block from the around save callback that
|
264
266
|
# saves the card
|
@@ -284,6 +286,7 @@ class Card
|
|
284
286
|
def store_pre_subcards
|
285
287
|
@subdirectors.each do |subdir|
|
286
288
|
next unless subdir.prior_store
|
289
|
+
|
287
290
|
subdir.catch_up_to_stage :store
|
288
291
|
end
|
289
292
|
end
|
@@ -291,6 +294,7 @@ class Card
|
|
291
294
|
def store_post_subcards
|
292
295
|
@subdirectors.each do |subdir|
|
293
296
|
next if subdir.prior_store
|
297
|
+
|
294
298
|
subdir.catch_up_to_stage :store
|
295
299
|
end
|
296
300
|
end
|
@@ -311,7 +315,7 @@ class Card
|
|
311
315
|
end
|
312
316
|
|
313
317
|
def delete
|
314
|
-
@parent
|
318
|
+
@parent&.subdirectors&.delete self
|
315
319
|
super
|
316
320
|
end
|
317
321
|
end
|
@@ -25,18 +25,14 @@ class Card
|
|
25
25
|
|
26
26
|
def integration_phase
|
27
27
|
return if @abort
|
28
|
+
|
28
29
|
@card.restore_changes_information
|
29
30
|
run_single_stage :integrate
|
30
31
|
run_single_stage :after_integrate
|
31
32
|
run_single_stage :integrate_with_delay
|
32
|
-
rescue => e # don't rollback
|
33
|
-
Card::Error.
|
34
|
-
|
35
|
-
warn "exception in integrate phase: #{e.message}"
|
36
|
-
warn e.backtrace.join "\n"
|
37
|
-
@card.notable_exception_raised
|
38
|
-
end
|
39
|
-
return false
|
33
|
+
rescue StandardError => e # don't rollback
|
34
|
+
Card::Error.report e, @card
|
35
|
+
false
|
40
36
|
ensure
|
41
37
|
@card.clear_changes_information unless @abort
|
42
38
|
# ActManager.clear if main? && !@card.only_storage_phase
|
data/lib/card/auth.rb
CHANGED
data/lib/card/auth/current.rb
CHANGED
@@ -113,7 +113,7 @@ class Card
|
|
113
113
|
# set the current user based on token
|
114
114
|
def set_current_from_token token, current=nil
|
115
115
|
account = find_account_by_token token
|
116
|
-
if account
|
116
|
+
if account&.validate_token!(token)
|
117
117
|
unless current && always_ok_usr_id?(account.left_id)
|
118
118
|
# can override current only if admin
|
119
119
|
current = account.left_id
|
data/lib/card/auth/proxy.rb
CHANGED
data/lib/card/cache.rb
CHANGED
@@ -31,12 +31,14 @@ class Card
|
|
31
31
|
# @return [{Card::Cache}]
|
32
32
|
def [] klass
|
33
33
|
raise "nil klass" if klass.nil?
|
34
|
+
|
34
35
|
cache_type = persistent_cache || nil
|
35
36
|
cache_by_class[klass] ||= new class: klass, store: cache_type
|
36
37
|
end
|
37
38
|
|
38
39
|
def persistent_cache
|
39
|
-
return @persistent_cache
|
40
|
+
return @persistent_cache unless @persistent_cache.nil?
|
41
|
+
|
40
42
|
@persistent_cache =
|
41
43
|
case
|
42
44
|
when ENV["NO_RAILS_CACHE"] then false
|
@@ -51,7 +53,7 @@ class Card
|
|
51
53
|
renew_persistent
|
52
54
|
cache_by_class.each_value do |cache|
|
53
55
|
cache.soft.reset
|
54
|
-
cache.hard
|
56
|
+
cache.hard&.renew
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
@@ -79,7 +81,7 @@ class Card
|
|
79
81
|
def reset_global
|
80
82
|
cache_by_class.each_value do |cache|
|
81
83
|
cache.soft.reset
|
82
|
-
cache.hard
|
84
|
+
cache.hard&.annihilate
|
83
85
|
end
|
84
86
|
reset_other
|
85
87
|
end
|
@@ -88,7 +90,7 @@ class Card
|
|
88
90
|
def reset_hard
|
89
91
|
Card::Cache::Persistent.reset if persistent_cache
|
90
92
|
cache_by_class.each_value do |cache|
|
91
|
-
cache.hard
|
93
|
+
cache.hard&.reset
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -144,7 +146,7 @@ class Card
|
|
144
146
|
# @param key [String]
|
145
147
|
# @param value
|
146
148
|
def write key, value
|
147
|
-
@hard
|
149
|
+
@hard&.write key, value
|
148
150
|
@soft.write key, value
|
149
151
|
end
|
150
152
|
|
@@ -159,21 +161,20 @@ class Card
|
|
159
161
|
# delete specific cache entries by key
|
160
162
|
# @param key [String]
|
161
163
|
def delete key
|
162
|
-
@hard
|
164
|
+
@hard&.delete key
|
163
165
|
@soft.delete key
|
164
166
|
end
|
165
167
|
|
166
168
|
# reset both caches (for a given Card::Cache instance)
|
167
169
|
def reset
|
168
|
-
@hard
|
170
|
+
@hard&.reset
|
169
171
|
@soft.reset
|
170
172
|
end
|
171
173
|
|
172
174
|
# test for the existence of the key in either cache
|
173
175
|
# @return [true/false]
|
174
176
|
def exist? key
|
175
|
-
@soft.exist?(key) || (@hard
|
177
|
+
@soft.exist?(key) || (@hard&.exist?(key))
|
176
178
|
end
|
177
179
|
end
|
178
180
|
end
|
179
|
-
|
@@ -115,6 +115,7 @@ class Card
|
|
115
115
|
# @param attribute [String, Symbol]
|
116
116
|
def write_attribute key, attribute, value
|
117
117
|
return value unless @store
|
118
|
+
|
118
119
|
if (object = deep_read key)
|
119
120
|
object.instance_variable_set "@#{attribute}", value
|
120
121
|
write key, object
|
@@ -124,7 +125,7 @@ class Card
|
|
124
125
|
|
125
126
|
def deep_read key
|
126
127
|
local_cache = @store.send :local_cache
|
127
|
-
local_cache
|
128
|
+
local_cache&.clear
|
128
129
|
read key
|
129
130
|
end
|
130
131
|
|