card 1.98.3 → 1.99.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/locales/de.yml +7 -7
- data/config/locales/en.yml +7 -7
- data/config/locales/es.yml +7 -7
- data/db/migrate_core_cards/20150610180019_add_recaptcha_key_and_admin_info_cards.rb +3 -3
- data/db/migrate_core_cards/20160801143221_change_bootstrap_card_type_to_scss.rb +1 -1
- data/db/migrate_core_cards/20160804112510_reorganize_scripts.rb +1 -1
- data/db/migrate_core_cards/20160908154210_add_trash_card.rb +1 -1
- data/db/migrate_core_cards/20180508210903_add_json_type.rb +3 -3
- data/db/migrate_core_cards/20180712042655_head_rule.rb +1 -1
- data/db/migrate_core_cards/{20180905061536_migrate_layouts.rb → 20180905061537_migrate_layouts.rb} +12 -1
- data/db/migrate_core_cards/20190204195039_add_rule_card.rb +3 -0
- data/db/migrate_core_cards/20190320091257_upgrade_recaptcha_to_v3.rb +5 -6
- data/db/migrate_core_cards/20190417142612_reorganize_scripts_2.rb +3 -3
- data/db/migrate_core_cards/20190502130029_add_shark_and_help_desk_role.rb +4 -5
- data/db/migrate_core_cards/20190618110446_add_dropdown_divider.rb +1 -1
- data/db/migrate_core_cards/20190710090209_homepage_tweaks.rb +17 -0
- data/db/migrate_core_cards/20190820155833_update_cardtype_type_structure.rb +7 -0
- data/db/migrate_core_cards/20190822093633_move_help_text_to_code.rb +38 -0
- data/db/migrate_core_cards/20190823220018_cleanup_for_decko_1_0.rb +21 -0
- data/db/migrate_core_cards/20190826132738_add_more_guides.rb +7 -0
- data/db/migrate_core_cards/20190829093961_cardtype_grouping.rb +16 -0
- data/db/migrate_core_cards/20190829205148_remove_add_help.rb +14 -0
- data/db/migrate_core_cards/20190830131820_setting_settings_aside.rb +17 -0
- data/db/migrate_core_cards/20190902161223_add_style_media.rb +7 -0
- data/db/migrate_core_cards/20190902193208_input_type.rb +22 -0
- data/db/migrate_core_cards/20190904174403_token_upgrade.rb +14 -0
- data/db/migrate_core_cards/20190909104250_add_cardtype_input_types.rb +10 -0
- data/db/migrate_core_cards/20190918200115_ensure_description_card.rb +13 -0
- data/db/migrate_core_cards/data/cards.yml +12 -8
- data/db/migrate_core_cards/data/cards/Xaccount +22 -0
- data/db/migrate_core_cards/data/cards/Xgetting_started +5 -5
- data/db/migrate_core_cards/data/cards/{Xgetting_started-link → Xgetting_started_link} +0 -0
- data/db/migrate_core_cards/data/cards/Xmain_menu +1 -1
- data/db/migrate_core_cards/data/cards/Xstructure-Xright-Xguide +12 -0
- data/db/migrate_core_cards/data/cards/administrator-dashboard +5 -0
- data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xguide +24 -0
- data/db/migrate_core_cards/data/cards/cardtype-Xtype-Xstructure +3 -3
- data/db/migrate_core_cards/data/cards/shark-dashboard +2 -2
- data/db/migrate_core_cards/data/mailer/password_reset_email.html +6 -3
- data/db/migrate_core_cards/data/mailer/password_reset_email.txt +1 -1
- data/db/migrate_core_cards/data/mailer/verification_email.html +5 -2
- data/db/migrate_core_cards/data/mailer/verification_email.txt +2 -1
- data/db/seed/README.md +1 -1
- data/db/seed/new/card_actions.yml +2118 -2534
- data/db/seed/new/card_acts.yml +2 -2
- data/db/seed/new/card_references.yml +2326 -2466
- data/db/seed/new/cards.yml +2654 -3713
- data/db/seed/new/schema_migrations_core_cards.yml +77 -39
- data/db/seed/test/fixtures/card_actions.yml +3225 -3681
- data/db/seed/test/fixtures/card_acts.yml +503 -509
- data/db/seed/test/fixtures/card_changes.yml +66 -66
- data/db/seed/test/fixtures/card_references.yml +3135 -3275
- data/db/seed/test/fixtures/cards.yml +4187 -5516
- data/db/seed/test/fixtures/schema_migrations_core_cards.yml +77 -39
- data/db/{seed/test/seed.rb → test_seed.rb} +13 -11
- data/lib/card/auth.rb +1 -0
- data/lib/card/auth/current.rb +25 -27
- data/lib/card/auth/setup.rb +13 -12
- data/lib/card/auth/token.rb +38 -0
- data/lib/card/content.rb +34 -7
- data/lib/card/content/clean.rb +2 -1
- data/lib/card/content/truncate.rb +2 -0
- data/lib/card/env/success.rb +1 -14
- data/lib/card/error.rb +1 -0
- data/lib/card/format/content.rb +2 -2
- data/lib/card/format/error.rb +1 -1
- data/lib/card/format/nest.rb +1 -1
- data/lib/card/format/nesting.rb +2 -2
- data/lib/card/format/nesting/mode.rb +15 -15
- data/lib/card/mod/loader.rb +5 -0
- data/lib/card/model/save_helper.rb +2 -0
- data/lib/card/query.rb +1 -0
- data/lib/card/query/card_query/reference_attributes.rb +4 -2
- data/lib/card/seed_consts.rb +1 -1
- data/lib/card/set/format/abstract_format.rb +3 -5
- data/lib/card/set/format/abstract_format/view_opts.rb +1 -1
- data/lib/card/set/required_field.rb +8 -3
- data/lib/card/set_pattern.rb +10 -0
- data/lib/card/view/cache/stub.rb +3 -20
- data/lib/card/view/options.rb +4 -3
- data/lib/card/view/options/voo_api.rb +1 -1
- data/lib/cardio.rb +7 -1
- data/mod/Modfile +1 -0
- data/mod/account/set/abstract/account_field.rb +15 -0
- data/mod/account/set/abstract/accounted.rb +15 -0
- data/mod/account/set/all/account.rb +0 -4
- data/mod/account/set/right/account.rb +23 -151
- data/mod/account/set/right/account/events.rb +98 -0
- data/mod/account/set/right/account/views.rb +65 -0
- data/mod/account/set/right/api_key.rb +48 -0
- data/mod/account/set/right/email.rb +2 -2
- data/mod/account/set/right/password.rb +6 -9
- data/mod/account/set/right/salt.rb +5 -1
- data/mod/account/set/right/status.rb +10 -1
- data/mod/account/set/self/signin.rb +3 -3
- data/mod/account/set/type/role.rb +4 -0
- data/mod/account/set/type/signup.rb +31 -158
- data/mod/account/{template → set}/type/signup/core.haml +0 -0
- data/mod/account/set/type/signup/views.rb +93 -0
- data/mod/account/set/type/user.rb +16 -27
- data/mod/account/set/type/user/setup_help.haml +10 -0
- data/mod/account/spec/set/all/account_spec.rb +84 -98
- data/mod/account/spec/set/right/account_spec.rb +40 -33
- data/mod/account/spec/set/self/signin_spec.rb +2 -2
- data/mod/account/spec/set/type/signup_spec.rb +40 -78
- data/mod/ace_editor/db/migrate_core_cards/{20160805112548_delete_ace_help_card.rb → 20180805112548_delete_ace_help_card.rb} +1 -1
- data/mod/admin/set/self/debugger.rb +3 -0
- data/mod/admin/set/self/trash.rb +1 -1
- data/mod/basic_formats/set/all/all_css.rb +1 -1
- data/mod/basic_formats/set/all/all_csv.rb +1 -1
- data/mod/basic_formats/set/all/base.rb +19 -60
- data/mod/basic_formats/set/self/head.rb +1 -1
- data/mod/basic_types/set/type/html.rb +7 -3
- data/mod/basic_types/set/type/json.rb +1 -1
- data/mod/basic_types/set/type/plain_text.rb +1 -1
- data/mod/{standard → basic_types}/spec/set/type/html_spec.rb +6 -6
- data/mod/basic_types/spec/set/type/plain_text_spec.rb +7 -2
- data/mod/bootstrap/db/migrate_core_cards/20170719163733_update_bootswatch_themes_to_4_beta.rb +3 -3
- data/mod/bootstrap/db/migrate_core_cards/20180423160231_migrate_customized_bootstrap_skin.rb +2 -2
- data/mod/bootstrap/db/migrate_core_cards/20180423170283_add_type_bootswatch_skin.rb +1 -1
- data/mod/bootstrap/db/migrate_core_cards/lib/skin.rb +1 -1
- data/mod/bootstrap/lib/javascript/script_load_select2.js.coffee +26 -18
- data/mod/bootstrap/lib/stylesheets/style_bootstrap_cards.scss +18 -3
- data/mod/bootstrap/set/abstract/bootswatch_theme/html_views.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/helper.rb +9 -4
- data/mod/bootstrap/set/type/customized_bootswatch_skin.rb +1 -1
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors.rb +1 -1
- data/mod/bootstrap/set/type_plus_right/customized_bootswatch_skin/colors/{editor.haml → input.haml} +0 -0
- data/mod/bootstrap/spec/set/all/bootstrap/form_spec.rb +2 -2
- data/mod/carrierwave/set/self/favicon.rb +5 -0
- data/mod/carrierwave/set/self/new_file.rb +1 -1
- data/mod/carrierwave/set/self/new_image.rb +1 -1
- data/mod/carrierwave/set/type/file.rb +1 -1
- data/mod/carrierwave/set/type/image.rb +2 -2
- data/mod/carrierwave/set/type/image/html_views.rb +0 -35
- data/mod/carrierwave/spec/set/type/image_spec.rb +1 -1
- data/mod/core/chunk/link.rb +4 -2
- data/mod/core/chunk/view_stub.rb +5 -4
- data/mod/core/set/abstract/code_file.rb +1 -1
- data/mod/core/set/all/codename.rb +2 -1
- data/mod/core/set/all/content.rb +59 -0
- data/mod/core/set/all/event_conditions.rb +17 -2
- data/mod/core/set/all/location_history.rb +1 -1
- data/mod/core/set/all/name.rb +1 -1
- data/mod/core/set/all/permissions.rb +6 -36
- data/mod/core/set/all/references.rb +9 -2
- data/mod/core/set/all/rules.rb +0 -5
- data/mod/core/set_pattern/03_type.rb +4 -0
- data/mod/core/set_pattern/07_right.rb +4 -0
- data/mod/core/set_pattern/08_type_plus_right.rb +4 -0
- data/mod/core/set_pattern/09_self.rb +4 -0
- data/mod/core/spec/chunk/link_spec.rb +6 -0
- data/mod/core/spec/chunk/nest_spec.rb +2 -2
- data/mod/core/spec/set/all/permissions_spec.rb +0 -10
- data/mod/core/spec/set/all/rules_spec.rb +6 -16
- data/mod/date/set/self/datepicker.rb +6 -0
- data/mod/date/set/type/date.rb +1 -1
- data/mod/date/spec/set/type/date_spec.rb +1 -1
- data/mod/edit/set/all/bridge/account_section.rb +16 -0
- data/mod/edit/set/all/bridge/bridge_pills.rb +47 -0
- data/mod/edit/set/all/bridge/related_section.rb +34 -0
- data/mod/edit/set/all/bridge/tab_views.rb +9 -40
- data/mod/edit/set/all/bridge/tab_visibility.rb +2 -2
- data/mod/edit/set/all/edit_content.rb +3 -3
- data/mod/edit/set/all/edit_inline.rb +15 -4
- data/mod/edit/set/all/edit_name.rb +5 -7
- data/mod/edit/set/all/edit_type.rb +25 -23
- data/mod/edit/set/all/editing.rb +5 -1
- data/mod/edit/set/all/editor.rb +28 -15
- data/mod/edit/set/all/form.rb +38 -17
- data/mod/edit/set/all/form_buttons.rb +11 -2
- data/mod/edit/set/all/formgroup.rb +5 -5
- data/mod/edit/set/all/nest_editor.rb +20 -4
- data/mod/edit/set/all/nest_editor/_help.haml +7 -0
- data/mod/edit/set/all/nest_editor/nest_editor.haml +3 -2
- data/mod/edit/set/all/new.rb +40 -23
- data/mod/edit/set/all/overlay_guide.haml +7 -0
- data/mod/edit/set/all/overlay_guide.rb +9 -0
- data/mod/edit/set/all/template_nest.rb +42 -0
- data/mod/edit/set/type/list.rb +15 -0
- data/mod/edit/set/type/plain_text.rb +13 -0
- data/mod/edit/set/type/pointer.rb +11 -0
- data/mod/edit/spec/set/all/bridge/tab_views_spec.rb +1 -1
- data/mod/email/set/all/email_html.rb +2 -2
- data/mod/email/set/all/email_text.rb +2 -2
- data/mod/follow/lib/card/follower_stash.rb +1 -1
- data/mod/follow/set/all/follow/followed_by.rb +1 -1
- data/mod/follow/set/all/notify/base_views.rb +3 -3
- data/mod/follow/set/right/following.rb +1 -1
- data/mod/follow/set/self/follow_defaults.rb +1 -1
- data/mod/follow/set/type/cardtype.rb +6 -0
- data/mod/follow/set/type_plus_right/user/follow.rb +1 -1
- data/mod/history/lib/card/act/act_renderer.rb +1 -1
- data/mod/history/lib/card/action.rb +2 -1
- data/mod/history/set/all/history_bridge.rb +0 -1
- data/mod/item/set/all/bar.rb +15 -7
- data/mod/machines/file/all_script_machine_output/file.js +38245 -69
- data/mod/machines/file/all_style_machine_output/file.css +4 -4
- data/mod/machines/file/script_html5shiv_printshiv_machine_output/file.js +1 -1
- data/mod/machines/lib/javascript/decko/bridge.js.coffee +4 -0
- data/mod/machines/lib/javascript/decko/card_menu.js.coffee +11 -0
- data/mod/machines/lib/javascript/decko/name_editor.js.coffee +1 -1
- data/mod/machines/lib/javascript/decko/nest_editor.js.coffee +3 -1
- data/mod/machines/lib/javascript/decko/nest_editor_name.js.coffee +29 -6
- data/mod/machines/lib/javascript/decko/overlay.js.coffee +3 -2
- data/mod/machines/lib/javascript/decko/slot.js.coffee +12 -2
- data/mod/machines/lib/stylesheets/style_cards.scss +43 -53
- data/mod/machines/lib/stylesheets/style_jquery_ui_smoothness.css +13 -13
- data/mod/machines/set/abstract/script.rb +1 -1
- data/mod/machines/set/type/css.rb +1 -1
- data/mod/media/lib/stylesheets/style_image_box.scss +79 -0
- data/mod/{utility → media}/set/abstract/media.rb +0 -0
- data/mod/{utility → media}/set/abstract/media/media_snippet.haml +0 -0
- data/mod/media/set/self/style_media.rb +6 -0
- data/mod/media/set/type/image.rb +38 -0
- data/mod/{utility → media}/spec/set/abstract/media_spec.rb +0 -0
- data/mod/navbar/set/right/enabled_roles.rb +1 -1
- data/mod/pointer/lib/javascript/script_pointer_config.js.coffee +13 -0
- data/mod/pointer/lib/javascript/script_pointer_list_editor.js.coffee +7 -2
- data/mod/pointer/set/abstract/02_pointer/html_views.rb +15 -6
- data/mod/pointer/set/abstract/02_pointer/html_views/checkbox_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/html_views/list_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/html_views/list_item.haml +2 -0
- data/mod/pointer/set/abstract/02_pointer/html_views/radio_input.haml +1 -2
- data/mod/pointer/set/abstract/02_pointer/options_api.rb +6 -13
- data/mod/pointer/set/right/{options.rb → content_options.rb} +0 -0
- data/mod/pointer/set/type/link_list.rb +23 -6
- data/mod/pointer/set/type/link_list/link_list_input.haml +24 -0
- data/mod/pointer/set/type/mirrored_list.rb +1 -1
- data/mod/pointer/spec/set/abstract/pointer/html_views_spec.rb +20 -18
- data/mod/pointer/spec/set/abstract/pointer/options_api_spec.rb +2 -1
- data/mod/pointer/spec/set/self/input_options_spec.rb +1 -1
- data/mod/rules/set/right/self.rb +3 -0
- data/mod/rules/set/rule/bar_view.rb +88 -0
- data/mod/rules/set/rule/bridge_rules_editor.rb +5 -10
- data/mod/rules/set/rule/editor.rb +40 -113
- data/mod/rules/set/rule/html_views.rb +13 -0
- data/mod/rules/set/rule/quick_editor.rb +39 -0
- data/mod/rules/set/rule/{editor → quick_editor}/quick_edit.haml +0 -0
- data/mod/rules/set/rule/{editor → quick_editor}/set_info.haml +1 -1
- data/mod/rules/set/rule/rule_form/buttons.rb +3 -1
- data/mod/rules/set/rule/rule_form/form_elements.rb +2 -2
- data/mod/rules/set/rule/rule_form/rule_set_radio.rb +3 -6
- data/mod/rules/set/rule/rule_form/set_selection.rb +3 -10
- data/mod/rules/set/rule/rules.rb +10 -1
- data/mod/rules/set/type/set.rb +37 -20
- data/mod/rules/set/type/set/html_views.rb +17 -35
- data/mod/rules/set/type/set/html_views/group_panel.haml +1 -1
- data/mod/rules/set/type/set/html_views/rule_lists.rb +42 -0
- data/mod/rules/set/type/set/html_views/template.rb +1 -32
- data/mod/rules/set/type/set/rules_filter.rb +24 -10
- data/mod/rules/set/type/set/setting_lists.rb +17 -24
- data/mod/rules/spec/set/rule/bar_view_spec.rb +15 -0
- data/mod/rules/spec/set/rule/editor_spec.rb +15 -1
- data/mod/rules/spec/set/type/set/html_views_spec.rb +0 -13
- data/mod/rules/spec/set/type/set/setting_lists_spec.rb +17 -0
- data/mod/rules/spec/set/type/set_spec.rb +3 -8
- data/mod/search/set/abstract/03_filter/form_helper.rb +9 -7
- data/mod/search/set/abstract/search/views.rb +2 -2
- data/mod/search/set/right/children.rb +4 -0
- data/mod/search/set/right/created.rb +3 -0
- data/mod/search/set/right/edited.rb +3 -0
- data/mod/search/set/right/editors.rb +3 -0
- data/mod/search/set/right/follow.rb +3 -0
- data/mod/search/set/right/linked_to_by.rb +3 -0
- data/mod/search/set/right/links_to.rb +3 -0
- data/mod/search/set/right/mates.rb +3 -0
- data/mod/search/set/right/nested_by.rb +3 -0
- data/mod/search/set/right/nests.rb +3 -0
- data/mod/search/set/right/referred_to_by.rb +3 -0
- data/mod/search/set/right/refers_to.rb +3 -0
- data/mod/search/set/self/search.rb +1 -1
- data/mod/search/set/type/search_type.rb +6 -5
- data/mod/settings/lib/card/setting.rb +17 -4
- data/mod/settings/set/abstract/permission.rb +6 -2
- data/mod/settings/set/all/supports_content_options.rb +7 -0
- data/mod/settings/set/right/content_option_view.rb +10 -0
- data/mod/settings/set/right/content_options.rb +18 -0
- data/mod/settings/set/right/default.rb +18 -2
- data/mod/settings/set/right/help.rb +2 -1
- data/mod/settings/set/right/input_type.rb +35 -0
- data/mod/settings/set/right/script.rb +6 -0
- data/mod/settings/set/right/structure.rb +7 -1
- data/mod/settings/set/right/style.rb +2 -2
- data/mod/settings/set/right/style/{editor.haml → input.haml} +0 -0
- data/mod/settings/set/self/autoname.rb +3 -1
- data/mod/settings/set/self/captcha.rb +4 -1
- data/mod/settings/set/self/content_option_view.rb +10 -0
- data/mod/settings/set/self/content_options.rb +10 -0
- data/mod/settings/set/self/create.rb +2 -1
- data/mod/settings/set/self/default.rb +1 -1
- data/mod/settings/set/self/delete.rb +2 -1
- data/mod/settings/set/self/guide.rb +1 -1
- data/mod/settings/set/self/head.rb +3 -1
- data/mod/settings/set/self/help.rb +3 -1
- data/mod/settings/set/self/input_type.rb +13 -0
- data/mod/settings/set/self/layout.rb +3 -1
- data/mod/settings/set/self/on_create.rb +2 -1
- data/mod/settings/set/self/on_delete.rb +2 -1
- data/mod/settings/set/self/on_update.rb +2 -1
- data/mod/settings/set/self/read.rb +2 -1
- data/mod/settings/set/self/structure.rb +3 -1
- data/mod/settings/set/self/style.rb +3 -1
- data/mod/settings/set/self/table_of_contents.rb +4 -1
- data/mod/settings/set/self/thanks.rb +3 -1
- data/mod/settings/set/self/update.rb +2 -1
- data/mod/settings/set/type/setting.rb +15 -37
- data/mod/settings/spec/set/right/comment_spec.rb +0 -27
- data/mod/settings/spec/set/right/create_spec.rb +1 -1
- data/mod/settings/spec/set/right/structure_spec.rb +13 -10
- data/mod/settings/spec/set/type/setting_spec.rb +1 -8
- data/mod/solid_cache/set/right/solid_cache.rb +3 -3
- data/mod/standard/set/all/comment.rb +1 -1
- data/mod/standard/set/all/error.rb +2 -2
- data/mod/standard/set/all/path.rb +7 -7
- data/mod/standard/set/all/rich_html/content.rb +41 -11
- data/mod/standard/set/all/rich_html/error.rb +14 -22
- data/mod/standard/set/all/rich_html/html_views/guide.rb +1 -1
- data/mod/standard/set/all/rich_html/html_views/help.rb +19 -7
- data/mod/standard/set/all/rich_html/html_views/info.rb +1 -1
- data/mod/standard/set/all/rich_html/menu.rb +50 -2
- data/mod/standard/set/all/rich_html/overlay.rb +23 -1
- data/mod/standard/set/all/rich_html/title.rb +3 -3
- data/mod/standard/set/right/discussion.rb +8 -2
- data/mod/standard/set/right/head.rb +4 -0
- data/mod/standard/set/right/type_plus_right.rb +4 -0
- data/mod/standard/set/self/cardtype.rb +42 -0
- data/mod/standard/set/self/sidebar.rb +5 -0
- data/mod/standard/set/type/basic.rb +1 -1
- data/mod/standard/set/type/cardtype.rb +25 -11
- data/mod/standard/set/type/number.rb +1 -1
- data/mod/standard/set/type/phrase.rb +1 -1
- data/mod/standard/set/type/toggle.rb +9 -1
- data/mod/standard/set/type/uri.rb +1 -1
- data/mod/standard/spec/set/all/error_spec.rb +1 -1
- data/mod/standard/spec/set/type/cardtype_spec.rb +4 -3
- data/mod/standard/spec/set/type/number_spec.rb +1 -1
- data/mod/standard/spec/set/type/phrase_spec.rb +1 -1
- data/mod/standard/spec/set/type/toggle_spec.rb +3 -4
- data/mod/standard/spec/set/type/uri_spec.rb +1 -1
- data/mod/tinymce_editor/set/self/tiny_mce.rb +7 -0
- metadata +116 -52
- data/db/migrate_core_cards/20190710090207_homepage_tweaks.rb +0 -12
- data/db/migrate_core_cards/data/cards/eagle-description +0 -1
- data/mod/account/set/right/token.rb +0 -55
- data/mod/account/spec/set/right/token_spec.rb +0 -23
- data/mod/bootstrap/set/abstract/bootswatch_theme/thumbnail.haml +0 -10
- data/mod/rules/set/rule/table.rb +0 -27
- data/mod/rules/set/rule/table_row.rb +0 -63
- data/mod/rules/set/type/set/html_views/nest_rules.rb +0 -14
- data/mod/rules/set/type/set/html_views/rules_bridge.rb +0 -21
- data/mod/rules/set/type/set/html_views/rules_table.haml +0 -11
- data/mod/rules/set/type/set/html_views/template/template_editor.haml +0 -6
- data/mod/rules/spec/set/rule/table_row_spec.rb +0 -9
- data/mod/rules/spec/set/rule/table_spec.rb +0 -15
- data/mod/settings/set/right/add_help.rb +0 -1
- data/mod/settings/set/self/accountable.rb +0 -3
- data/mod/settings/set/self/add_help.rb +0 -2
- data/mod/settings/set/self/input.rb +0 -3
- data/mod/settings/set/self/options.rb +0 -4
- data/mod/settings/set/self/options_label.rb +0 -4
- data/mod/settings/spec/set/right/add_help_spec.rb +0 -5
@@ -188,82 +188,120 @@ schema_migrations_core_cards_093:
|
|
188
188
|
schema_migrations_core_cards_094:
|
189
189
|
version: '20180712042655'
|
190
190
|
schema_migrations_core_cards_095:
|
191
|
-
version: '
|
191
|
+
version: '20180805112548'
|
192
192
|
schema_migrations_core_cards_096:
|
193
|
-
version: '
|
193
|
+
version: '20180905061534'
|
194
194
|
schema_migrations_core_cards_097:
|
195
|
-
version: '
|
195
|
+
version: '20180905061536'
|
196
196
|
schema_migrations_core_cards_098:
|
197
|
-
version: '
|
197
|
+
version: '20180905061537'
|
198
198
|
schema_migrations_core_cards_099:
|
199
|
-
version: '
|
199
|
+
version: '20181108181219'
|
200
200
|
schema_migrations_core_cards_100:
|
201
|
-
version: '
|
201
|
+
version: '20181120200937'
|
202
202
|
schema_migrations_core_cards_101:
|
203
|
-
version: '
|
203
|
+
version: '20181129140917'
|
204
204
|
schema_migrations_core_cards_102:
|
205
|
-
version: '
|
205
|
+
version: '20190125125150'
|
206
206
|
schema_migrations_core_cards_103:
|
207
|
-
version: '
|
207
|
+
version: '20190204195038'
|
208
208
|
schema_migrations_core_cards_104:
|
209
|
-
version: '
|
209
|
+
version: '20190204195039'
|
210
210
|
schema_migrations_core_cards_105:
|
211
|
-
version: '
|
211
|
+
version: '20190228122633'
|
212
212
|
schema_migrations_core_cards_106:
|
213
|
-
version: '
|
213
|
+
version: '20190228122634'
|
214
214
|
schema_migrations_core_cards_107:
|
215
|
-
version: '
|
215
|
+
version: '20190228122635'
|
216
216
|
schema_migrations_core_cards_108:
|
217
|
-
version: '
|
217
|
+
version: '20190228122636'
|
218
218
|
schema_migrations_core_cards_109:
|
219
|
-
version: '
|
219
|
+
version: '20190228122638'
|
220
220
|
schema_migrations_core_cards_110:
|
221
|
-
version: '
|
221
|
+
version: '20190228122739'
|
222
222
|
schema_migrations_core_cards_111:
|
223
|
-
version: '
|
223
|
+
version: '20190306172622'
|
224
224
|
schema_migrations_core_cards_112:
|
225
|
-
version: '
|
225
|
+
version: '20190306172623'
|
226
226
|
schema_migrations_core_cards_113:
|
227
|
-
version: '
|
227
|
+
version: '20190306172890'
|
228
228
|
schema_migrations_core_cards_114:
|
229
|
-
version: '
|
229
|
+
version: '20190320091257'
|
230
230
|
schema_migrations_core_cards_115:
|
231
|
-
version: '
|
231
|
+
version: '20190321085735'
|
232
232
|
schema_migrations_core_cards_116:
|
233
|
-
version: '
|
233
|
+
version: '20190322095534'
|
234
234
|
schema_migrations_core_cards_117:
|
235
|
-
version: '
|
235
|
+
version: '20190417142612'
|
236
236
|
schema_migrations_core_cards_118:
|
237
|
-
version: '
|
237
|
+
version: '20190424100531'
|
238
238
|
schema_migrations_core_cards_119:
|
239
|
-
version: '
|
239
|
+
version: '20190424101004'
|
240
240
|
schema_migrations_core_cards_120:
|
241
|
-
version: '
|
241
|
+
version: '20190502130024'
|
242
242
|
schema_migrations_core_cards_121:
|
243
|
-
version: '
|
243
|
+
version: '201905021300268'
|
244
244
|
schema_migrations_core_cards_122:
|
245
|
-
version: '
|
245
|
+
version: '20190502130029'
|
246
246
|
schema_migrations_core_cards_123:
|
247
|
-
version: '
|
247
|
+
version: '20190503122738'
|
248
248
|
schema_migrations_core_cards_124:
|
249
|
-
version: '
|
249
|
+
version: '20190503122739'
|
250
250
|
schema_migrations_core_cards_125:
|
251
|
-
version: '
|
251
|
+
version: '20190528131330'
|
252
252
|
schema_migrations_core_cards_126:
|
253
|
-
version: '
|
253
|
+
version: '20190528141530'
|
254
254
|
schema_migrations_core_cards_127:
|
255
|
-
version: '
|
255
|
+
version: '20190605133556'
|
256
256
|
schema_migrations_core_cards_128:
|
257
|
-
version: '
|
257
|
+
version: '20190618110446'
|
258
258
|
schema_migrations_core_cards_129:
|
259
|
-
version: '
|
259
|
+
version: '20190621143156'
|
260
260
|
schema_migrations_core_cards_130:
|
261
|
-
version: '
|
261
|
+
version: '20190625153614'
|
262
262
|
schema_migrations_core_cards_131:
|
263
|
-
version: '
|
263
|
+
version: '20190625153615'
|
264
264
|
schema_migrations_core_cards_132:
|
265
|
-
version: '
|
265
|
+
version: '20190625153616'
|
266
266
|
schema_migrations_core_cards_133:
|
267
|
-
version: '
|
267
|
+
version: '20190710090205'
|
268
268
|
schema_migrations_core_cards_134:
|
269
|
+
version: '20190710090207'
|
270
|
+
schema_migrations_core_cards_135:
|
271
|
+
version: '20190710090208'
|
272
|
+
schema_migrations_core_cards_136:
|
273
|
+
version: '20190710090209'
|
274
|
+
schema_migrations_core_cards_137:
|
275
|
+
version: '20190718140125'
|
276
|
+
schema_migrations_core_cards_138:
|
269
277
|
version: '20190718140126'
|
278
|
+
schema_migrations_core_cards_139:
|
279
|
+
version: '20190820155833'
|
280
|
+
schema_migrations_core_cards_140:
|
281
|
+
version: '20190822093633'
|
282
|
+
schema_migrations_core_cards_141:
|
283
|
+
version: '20190823220017'
|
284
|
+
schema_migrations_core_cards_142:
|
285
|
+
version: '20190823220018'
|
286
|
+
schema_migrations_core_cards_143:
|
287
|
+
version: '20190826132738'
|
288
|
+
schema_migrations_core_cards_144:
|
289
|
+
version: '20190829093961'
|
290
|
+
schema_migrations_core_cards_145:
|
291
|
+
version: '20190829151731'
|
292
|
+
schema_migrations_core_cards_146:
|
293
|
+
version: '20190829205148'
|
294
|
+
schema_migrations_core_cards_147:
|
295
|
+
version: '20190830131820'
|
296
|
+
schema_migrations_core_cards_148:
|
297
|
+
version: '20190902161223'
|
298
|
+
schema_migrations_core_cards_149:
|
299
|
+
version: '20190902193208'
|
300
|
+
schema_migrations_core_cards_150:
|
301
|
+
version: '20190904174403'
|
302
|
+
schema_migrations_core_cards_151:
|
303
|
+
version: '20190909104250'
|
304
|
+
schema_migrations_core_cards_152:
|
305
|
+
version: '20190918200115'
|
306
|
+
schema_migrations_core_cards_153:
|
307
|
+
version: '20190927112151'
|
@@ -4,11 +4,11 @@ require "timecop"
|
|
4
4
|
|
5
5
|
# noinspection RubyResolve
|
6
6
|
class SharedData
|
7
|
-
require_relative "
|
7
|
+
require_relative "../lib/card/model/save_helper"
|
8
8
|
extend Card::Model::SaveHelper
|
9
9
|
|
10
10
|
USERS = [
|
11
|
-
"Joe
|
11
|
+
"Joe Admin", "Joe User", "Joe Camel", "Sample User", "No count",
|
12
12
|
"u1", "u2", "u3",
|
13
13
|
"Big Brother", "Optic fan", "Sunglasses fan", "Narcissist"
|
14
14
|
].freeze
|
@@ -19,7 +19,12 @@ class SharedData
|
|
19
19
|
|
20
20
|
def create_user name, args
|
21
21
|
args[:subcards] = account_args args if args[:email]
|
22
|
-
|
22
|
+
|
23
|
+
if name == "Joe Admin"
|
24
|
+
super name, args
|
25
|
+
else
|
26
|
+
Card::Auth.with("joe_admin") { super name, args }
|
27
|
+
end
|
23
28
|
end
|
24
29
|
|
25
30
|
def account_args hash
|
@@ -40,9 +45,6 @@ class SharedData
|
|
40
45
|
|
41
46
|
create "signup alert email+*to", "signups@wagn.org"
|
42
47
|
# CREATE A CARD OF EACH TYPE
|
43
|
-
create_signup "Sample Signup" # , email: "invitation@request.com"
|
44
|
-
# above still necessary? try commenting out above and 'Sign up' below
|
45
|
-
Card::Auth.current_id = Card::WagnBotID # need to reset after creating sign up, which changes current_id for extend phase
|
46
48
|
|
47
49
|
no_samples = %w[user sign_up set number mirror_list mirrored_list file image
|
48
50
|
customized_bootswatch_skin]
|
@@ -62,11 +64,11 @@ class SharedData
|
|
62
64
|
create_pointer "vertical"
|
63
65
|
|
64
66
|
create_pointer "friends+*right+*default"
|
65
|
-
create_search_type "friends+*right+*options", '{"type":"User"}'
|
67
|
+
create_search_type "friends+*right+*content options", '{"type":"User"}'
|
66
68
|
|
67
69
|
create_pointer "joes"
|
68
|
-
create "joes+*self+*input", "filtered list"
|
69
|
-
create "joes+*self+*options", ["Joe Admin", "Joe User", "Joe Camel"]
|
70
|
+
create "joes+*self+*input type", "filtered list"
|
71
|
+
create "joes+*self+*content options", ["Joe Admin", "Joe User", "Joe Camel"]
|
70
72
|
|
71
73
|
# cards for rename_test
|
72
74
|
# FIXME: could probably refactor these..
|
@@ -157,8 +159,8 @@ class SharedData
|
|
157
159
|
|
158
160
|
def user_and_role_cards
|
159
161
|
Card::Auth.instant_account_activation do
|
160
|
-
create_user "Joe User", content: "I'm number two", email: "joe@user.com"
|
161
162
|
create_user "Joe Admin", content: "I'm number one", email: "joe@admin.com"
|
163
|
+
create_user "Joe User", content: "I'm number two", email: "joe@user.com"
|
162
164
|
create_user "Joe Camel", content: "Mr. Buttz", email: "joe@camel.com"
|
163
165
|
|
164
166
|
# data for testing users and account requests
|
@@ -251,7 +253,7 @@ class SharedData
|
|
251
253
|
|
252
254
|
Card::Auth.current_id = Card::WagnBotID
|
253
255
|
create "Google glass+*self+*follow_fields", ""
|
254
|
-
create "Sunglasses+*self+*follow_fields", "[[#{Card[:
|
256
|
+
create "Sunglasses+*self+*follow_fields", "[[#{Card[:nests].name}]]\n[[_self+price]]\n[[_self+producer]]"
|
255
257
|
create "Sunglasses+tint"
|
256
258
|
create "Sunglasses+price"
|
257
259
|
|
data/lib/card/auth.rb
CHANGED
data/lib/card/auth/current.rb
CHANGED
@@ -103,16 +103,32 @@ class Card
|
|
103
103
|
end
|
104
104
|
|
105
105
|
# set current from token or session
|
106
|
-
def set_current
|
107
|
-
if token
|
108
|
-
|
109
|
-
|
110
|
-
|
106
|
+
def set_current opts={}
|
107
|
+
if opts[:token]
|
108
|
+
set_current_from_token opts[:token]
|
109
|
+
elsif opts[:api_key]
|
110
|
+
set_current_from_api_key opts[:api_key]
|
111
111
|
else
|
112
112
|
set_current_from_session
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
+
# set the current user based on token
|
117
|
+
def set_current_from_token token
|
118
|
+
payload = Token.validate! token
|
119
|
+
self.current_id = payload[:anonymous] ? Card::AnonymousID : payload[:user_id]
|
120
|
+
end
|
121
|
+
|
122
|
+
# set the current user based on api_key
|
123
|
+
def set_current_from_api_key api_key
|
124
|
+
account = find_account_by_api_key api_key
|
125
|
+
unless account&.validate_api_key! api_key
|
126
|
+
raise Card::Error::PermissionDenied, "API key authentication failed"
|
127
|
+
end
|
128
|
+
|
129
|
+
self.current = account.left_id
|
130
|
+
end
|
131
|
+
|
116
132
|
# get :user id from session and set Auth.current_id
|
117
133
|
def set_current_from_session
|
118
134
|
self.current_id =
|
@@ -123,29 +139,11 @@ class Card
|
|
123
139
|
end
|
124
140
|
end
|
125
141
|
|
126
|
-
#
|
127
|
-
def set_current_from_token token, current=nil
|
128
|
-
account = find_account_by_token token
|
129
|
-
if account&.validate_token!(token)
|
130
|
-
unless current && always_ok_usr_id?(account.left_id)
|
131
|
-
# can override current only if admin
|
132
|
-
current = account.left_id
|
133
|
-
end
|
134
|
-
self.current = current
|
135
|
-
elsif Env.params[:live_token]
|
136
|
-
true
|
137
|
-
# Used for activations and resets.
|
138
|
-
# Continue as anonymous and address problem later
|
139
|
-
else
|
140
|
-
false
|
141
|
-
end
|
142
|
-
end
|
143
|
-
|
144
|
-
# find +\*account card by +\*token card
|
142
|
+
# find +\*account card by +\*api card
|
145
143
|
# @param token [String]
|
146
144
|
# @return [+*account card, nil]
|
147
|
-
def
|
148
|
-
find_account_by "
|
145
|
+
def find_account_by_api_key api_key
|
146
|
+
find_account_by "api_key", Card::ApiKeyID, api_key.strip
|
149
147
|
end
|
150
148
|
|
151
149
|
# find +\*account card by +\*email card
|
@@ -165,7 +163,7 @@ class Card
|
|
165
163
|
Card.search({ right_id: Card::AccountID,
|
166
164
|
right_plus: [{ id: field_id },
|
167
165
|
{ content: value }] },
|
168
|
-
"find
|
166
|
+
"find +:account for #{fieldname} (#{value})").first
|
169
167
|
end
|
170
168
|
end
|
171
169
|
|
data/lib/card/auth/setup.rb
CHANGED
@@ -8,9 +8,10 @@ class Card
|
|
8
8
|
# app is not totally set up yet
|
9
9
|
# @return [true/false]
|
10
10
|
def needs_setup?
|
11
|
+
# FIXME: - should not require a cache lookup with every request!!
|
11
12
|
@simulating_setup_need || (
|
12
13
|
!Card.cache.read(SETUP_COMPLETED_KEY) &&
|
13
|
-
!Card.cache.write(SETUP_COMPLETED_KEY,
|
14
|
+
!Card.cache.write(SETUP_COMPLETED_KEY, user_account_count.positive?)
|
14
15
|
)
|
15
16
|
# every deck starts with two accounts: WagnBot and Anonymous
|
16
17
|
end
|
@@ -24,15 +25,7 @@ class Card
|
|
24
25
|
# for testing setup
|
25
26
|
def hide_accounts! mode=true
|
26
27
|
Card.cache.delete(SETUP_COMPLETED_KEY) if mode
|
27
|
-
@hidden_accounts = mode &&
|
28
|
-
end
|
29
|
-
|
30
|
-
def account_ids
|
31
|
-
as_bot do
|
32
|
-
Card.search right_id: AccountID,
|
33
|
-
not: { left_id: ["in", WagnBotID, AnonymousID] },
|
34
|
-
return: :id
|
35
|
-
end
|
28
|
+
@hidden_accounts = mode && user_account_ids
|
36
29
|
end
|
37
30
|
|
38
31
|
def instant_account_activation
|
@@ -44,8 +37,16 @@ class Card
|
|
44
37
|
|
45
38
|
private
|
46
39
|
|
47
|
-
def
|
48
|
-
|
40
|
+
def user_account_ids
|
41
|
+
as_bot { Card.search user_account_wql.merge(return: :id) }
|
42
|
+
end
|
43
|
+
|
44
|
+
def user_account_wql
|
45
|
+
{ right_id: AccountID, creator_id: ["ne", WagnBotID] }
|
46
|
+
end
|
47
|
+
|
48
|
+
def user_account_count
|
49
|
+
wql = user_account_wql
|
49
50
|
wql[:not] = { id: ["in"].concat(@hidden_accounts) } if @hidden_accounts
|
50
51
|
as_bot { Card.count_by_wql wql }
|
51
52
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "jwt"
|
2
|
+
|
3
|
+
class Card
|
4
|
+
module Auth
|
5
|
+
# methods for setting current account
|
6
|
+
module Token
|
7
|
+
SECRET_KEY = Rails.application.secrets.secret_key_base.to_s
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def encode user_id, extra_payload={}
|
11
|
+
payload = { user_id: user_id, exp: expiration }.merge(extra_payload)
|
12
|
+
|
13
|
+
JWT.encode payload, SECRET_KEY
|
14
|
+
end
|
15
|
+
|
16
|
+
# returns Hash if valid, String error message if not
|
17
|
+
|
18
|
+
def validate! token
|
19
|
+
payload = decode token
|
20
|
+
raise Card::Error::PermissionDenied, payload if payload.is_a? String
|
21
|
+
|
22
|
+
payload
|
23
|
+
end
|
24
|
+
|
25
|
+
def decode token
|
26
|
+
decoded = JWT.decode(token, SECRET_KEY)[0]
|
27
|
+
HashWithIndifferentAccess.new decoded
|
28
|
+
rescue JWT::DecodeError => error
|
29
|
+
error.message
|
30
|
+
end
|
31
|
+
|
32
|
+
def expiration
|
33
|
+
Card.config.token_expiry.from_now.to_i
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/card/content.rb
CHANGED
@@ -45,6 +45,10 @@ class Card
|
|
45
45
|
each_chunk.select { |chunk| chunk.is_a?(chunk_type) }
|
46
46
|
end
|
47
47
|
|
48
|
+
def has_chunk? chunk_type
|
49
|
+
each_chunk.any { |chunk| chunk.is_a?(chunk_type)}
|
50
|
+
end
|
51
|
+
|
48
52
|
# sends &block to #process_chunk on each Chunk object
|
49
53
|
def process_chunks &block
|
50
54
|
return custom_process_chunks(&block) if block_given?
|
@@ -98,20 +102,43 @@ class Card
|
|
98
102
|
end
|
99
103
|
|
100
104
|
def without_nests
|
101
|
-
|
102
|
-
|
103
|
-
nests << chunk.text
|
104
|
-
chunk.burn_after_reading "{{#{i}}}"
|
105
|
+
without_chunks Card::Content::Chunk::Nest do |content|
|
106
|
+
yield content
|
105
107
|
end
|
108
|
+
end
|
106
109
|
|
107
|
-
|
108
|
-
Chunk::Nest
|
109
|
-
|
110
|
+
def without_references
|
111
|
+
without_chunks Card::Content::Chunk::Nest, Card::Content::Chunk::Link do |content|
|
112
|
+
yield content
|
110
113
|
end
|
111
114
|
end
|
112
115
|
|
116
|
+
def without_chunks *chunk_classes
|
117
|
+
chunk_classes = ::Set.new Array.wrap(chunk_classes)
|
118
|
+
stash = stash_chunks chunk_classes
|
119
|
+
processed = yield to_s
|
120
|
+
unstash_chunks processed, stash
|
121
|
+
end
|
122
|
+
|
113
123
|
private
|
114
124
|
|
125
|
+
def stash_chunks chunk_classes
|
126
|
+
chunks = []
|
127
|
+
each_chunk do |chunk|
|
128
|
+
next unless chunk_classes.include? chunk.class
|
129
|
+
|
130
|
+
chunk.burn_after_reading "{{#{chunks.size}}}"
|
131
|
+
chunks << chunk.text
|
132
|
+
end
|
133
|
+
chunks
|
134
|
+
end
|
135
|
+
|
136
|
+
def unstash_chunks content, stashed_chunks
|
137
|
+
Chunk::Nest.gsub content do |nest_content|
|
138
|
+
stashed_chunks[nest_content.to_i]
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
115
142
|
def resolve_format format_or_card
|
116
143
|
if format_or_card.is_a?(Card)
|
117
144
|
Format.new format_or_card, format: nil
|