wagn 1.12.13 → 1.13.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +7 -8
- data/.rspec +1 -1
- data/.simplecov +23 -0
- data/.tm_properties +1 -0
- data/Gemfile +15 -13
- data/Guardfile +34 -0
- data/README.rdoc +4 -10
- data/VERSION +1 -1
- data/app/assets/images/smoothness/animated-overlay.gif +0 -0
- data/app/assets/images/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/images/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/app/assets/images/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/app/assets/images/smoothness/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/javascripts/application.js +9 -8
- data/app/assets/javascripts/jquery.ui.autocomplete.html.js +1 -1
- data/app/controllers/card_controller.rb +190 -23
- data/config/environments/development.rb +17 -12
- data/config/initializers/01_init_ruby_extensions.rb +1 -70
- data/config/routes.rb +21 -8
- data/config/version_cards.txt +1 -1
- data/db/bootstrap/card_references.yml +520 -352
- data/db/bootstrap/card_revisions.yml +1818 -1887
- data/db/bootstrap/cards.yml +2279 -1310
- data/db/migrate_cards/20130411191151_renaming_for_menu.rb +0 -5
- data/db/migrate_cards/20130411211600_delete_old_related_tab_cards.rb +0 -6
- data/db/migrate_cards/20130419215612_import_help_text.rb +0 -7
- data/db/migrate_cards/20130823192433_add_style_cards.rb +2 -6
- data/db/migrate_cards/20130910183318_move_styles_to_content.rb +0 -5
- data/db/migrate_cards/20130920214038_jsonize_tinymce.rb +0 -6
- data/db/migrate_cards/20130920291703_update_stylesheets.rb +0 -5
- data/db/migrate_cards/20130927191728_account_events.rb +1 -6
- data/db/migrate_cards/20131016172445_common_css_patch.rb +0 -6
- data/db/migrate_cards/20140110193325_reset_account_request_type.rb +1 -6
- data/db/migrate_cards/20140307231621_user_data_to_cards.rb +78 -0
- data/db/migrate_cards/20140317035504_account_requests_to_signups.rb +45 -0
- data/db/migrate_cards/20140512155840_add_script_cards.rb +85 -0
- data/db/migrate_cards/data/1.12_stylesheets/common.scss +1 -1
- data/features/autonaming.feature +3 -3
- data/features/flexmail.feature +2 -2
- data/features/layouts.feature +1 -1
- data/features/navbox.feature +17 -0
- data/features/notifications.feature +4 -4
- data/features/pointer_inputs.feature +2 -2
- data/features/presetting_content.feature +1 -1
- data/features/reset_password.feature +34 -0
- data/features/{pattern_settings.feature → rules.feature} +7 -7
- data/features/setup.feature +32 -0
- data/features/signup.feature +47 -0
- data/features/step_definitions/email_steps.rb +24 -1
- data/features/step_definitions/wagn_steps.rb +66 -31
- data/features/step_definitions/web_steps.rb +1 -0
- data/features/{content_settings.feature → structure.feature} +3 -6
- data/features/support/env.rb +3 -0
- data/features/support/paths.rb +2 -2
- data/features/support/{wag_env.rb → wagn_env.rb} +1 -1
- data/features/table_of_contents.feature +1 -1
- data/features/update_includers.feature +3 -3
- data/features/watch.feature +2 -2
- data/lib/card.rb +12 -10
- data/lib/{active_record/quoting_and_matching.rb → card/active_record_ext.rb} +25 -20
- data/lib/card/auth.rb +205 -0
- data/lib/card/chunk.rb +70 -69
- data/lib/card/content.rb +1 -1
- data/lib/card/core_ext.rb +74 -0
- data/lib/card/env.rb +66 -0
- data/lib/card/flexmail.rb +43 -37
- data/lib/card/format.rb +42 -29
- data/lib/{generators → card/generators}/card_migration/USAGE +0 -0
- data/lib/{generators → card/generators}/card_migration/card_migration_generator.rb +0 -0
- data/lib/{generators → card/generators}/card_migration/templates/card_migration.erb +0 -6
- data/lib/{generators → card/generators}/format/USAGE +0 -0
- data/lib/{generators → card/generators}/format/format_generator.rb +0 -0
- data/lib/{generators → card/generators}/format/templates/format_spec_template.erb +1 -2
- data/lib/{generators → card/generators}/format/templates/format_template.erb +0 -0
- data/lib/{generators → card/generators}/set/USAGE +0 -0
- data/lib/{generators → card/generators}/set/set_generator.rb +0 -0
- data/lib/{generators → card/generators}/set/templates/set_spec_template.erb +1 -2
- data/lib/card/generators/set/templates/set_template.erb +1 -0
- data/lib/card/loader.rb +145 -0
- data/lib/card/mailer.rb +117 -0
- data/{app/views → lib/card}/mailer/change_notice.html.erb +2 -2
- data/lib/card/mailer/confirmation_email.html.erb +8 -0
- data/{app/views → lib/card}/mailer/flexmail.html.erb +0 -0
- data/lib/card/mailer/password_reset.html.erb +9 -0
- data/{app/views → lib/card}/mailer/signup_alert.html.erb +0 -0
- data/lib/card/name.rb +2 -3
- data/lib/card/query.rb +0 -3
- data/lib/card/query/card_spec.rb +4 -4
- data/lib/card/revision.rb +34 -32
- data/lib/card/set.rb +204 -180
- data/lib/card/set_pattern.rb +126 -101
- data/lib/wagn/all.rb +1 -8
- data/lib/wagn/application.rb +14 -7
- data/lib/wagn/commands/application.rb +1 -1
- data/lib/{generators → wagn/generators}/wagn/USAGE +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/Gemfile +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/Rakefile +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config.ru +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/application.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/boot.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/database.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/frontbase.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/ibm_db.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbc.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcmysql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcpostgresql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/jdbcsqlite3.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/mysql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/oracle.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/postgresql.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/databases/sqlite3.yml +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/config/environment.rb +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/gitignore +0 -0
- data/lib/wagn/generators/wagn/templates/public/files/htaccess +9 -0
- data/{public → lib/wagn/generators/wagn/templates/public}/robots.txt +0 -0
- data/lib/{generators → wagn/generators}/wagn/templates/script/wagn +0 -0
- data/lib/{generators → wagn/generators}/wagn/wagn_generator.rb +12 -0
- data/lib/wagn/location.rb +7 -11
- data/lib/wagn/migration_helper.rb +4 -1
- data/{app/mailers → lib/wagn/tasks}/.gitkeep +0 -0
- data/lib/{tasks → wagn/tasks}/cucumber.rake +0 -0
- data/lib/{tasks → wagn/tasks}/db.rake +0 -0
- data/lib/{tasks → wagn/tasks}/test.rake +5 -2
- data/lib/{tasks → wagn/tasks}/wagn.rake +29 -12
- data/mods/{standard → core}/chunks/include.rb +2 -0
- data/mods/{standard → core}/chunks/link.rb +3 -0
- data/mods/core/formats/html_format.rb +27 -35
- data/mods/core/sets/all/active_card.rb +15 -3
- data/mods/core/sets/all/attribute_tracking.rb +1 -1
- data/mods/core/sets/all/collection.rb +4 -5
- data/mods/core/sets/all/fetch.rb +98 -80
- data/mods/core/sets/all/initialize.rb +2 -0
- data/mods/core/sets/all/name.rb +13 -12
- data/mods/core/sets/all/pattern.rb +0 -9
- data/mods/core/sets/all/permissions.rb +56 -31
- data/mods/core/sets/all/phases.rb +63 -84
- data/mods/core/sets/all/references.rb +0 -1
- data/mods/core/sets/all/rules.rb +3 -4
- data/mods/core/sets/all/templating.rb +2 -3
- data/mods/core/sets/all/tracked_attributes.rb +26 -9
- data/mods/core/sets/all/trash.rb +1 -2
- data/mods/core/sets/all/type.rb +6 -1
- data/mods/core/sets/all/utils.rb +2 -3
- data/mods/standard/files/103/icon-6566.ico +0 -0
- data/mods/standard/files/103/large-6566.ico +0 -0
- data/mods/standard/files/103/medium-6566.ico +0 -0
- data/{public/favicon.ico → mods/standard/files/103/original-6566.ico} +0 -0
- data/mods/standard/files/103/small-6566.ico +0 -0
- data/mods/standard/files/79/icon-6556.png +0 -0
- data/mods/standard/files/79/large-6556.png +0 -0
- data/mods/standard/files/79/medium-6556.png +0 -0
- data/mods/standard/files/79/original-6556.png +0 -0
- data/mods/standard/files/79/small-6556.png +0 -0
- data/mods/standard/files/790/icon-6419.png +0 -0
- data/mods/standard/files/790/large-6419.png +0 -0
- data/mods/standard/files/790/medium-6419.png +0 -0
- data/mods/standard/files/790/original-6419.png +0 -0
- data/mods/standard/files/790/small-6419.png +0 -0
- data/mods/standard/lib/card/machine.rb +152 -0
- data/mods/standard/lib/card/machine_input.rb +40 -0
- data/{public/assets → mods/standard/lib/javascript}/html5shiv-printshiv.js +0 -0
- data/mods/standard/lib/javascript/jquery-ui.js +14913 -0
- data/mods/standard/lib/javascript/jquery.autosize.js +255 -0
- data/mods/standard/lib/javascript/jquery.fileupload.js +1112 -0
- data/mods/standard/lib/javascript/jquery.iframe-transport.js +157 -0
- data/mods/standard/lib/javascript/jquery.js +9473 -0
- data/mods/standard/lib/javascript/jquery.ui.autocomplete.html.js +41 -0
- data/mods/standard/lib/javascript/jquery_ujs.js +429 -0
- data/mods/standard/lib/javascript/jquerymobile.js +8800 -0
- data/mods/standard/lib/javascript/tinymce.js +13 -0
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn.js.coffee +10 -0
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_menu.js +3 -12
- data/{app/assets/javascripts → mods/standard/lib/javascript}/wagn_mod.js.coffee +18 -11
- data/mods/standard/lib/stylesheets/functional.scss +13 -9
- data/mods/standard/lib/stylesheets/jquery-ui-smoothness.css +922 -218
- data/mods/standard/lib/stylesheets/standard.scss +2 -2
- data/mods/standard/sets/all/account.rb +18 -205
- data/mods/standard/sets/all/all_css.rb +2 -3
- data/mods/standard/sets/all/all_csv.rb +0 -1
- data/mods/standard/sets/all/attach.rb +0 -1
- data/mods/standard/sets/all/base.rb +9 -7
- data/mods/standard/sets/all/comment.rb +5 -5
- data/mods/standard/sets/all/email_html.rb +0 -2
- data/mods/standard/sets/all/event_viz.rb +62 -0
- data/mods/standard/sets/all/file.rb +0 -1
- data/mods/standard/sets/all/follow.rb +13 -11
- data/mods/standard/sets/all/history.rb +2 -7
- data/mods/standard/sets/all/json.rb +6 -11
- data/mods/standard/sets/all/rich_html.rb +68 -52
- data/mods/standard/sets/all/rss.rb +4 -5
- data/mods/standard/sets/all/text.rb +0 -1
- data/mods/standard/sets/right/account.rb +100 -1
- data/mods/standard/sets/right/create.rb +8 -2
- data/mods/standard/sets/right/delete.rb +2 -0
- data/mods/standard/sets/right/email.rb +50 -2
- data/mods/standard/sets/right/machine_output.rb +12 -0
- data/mods/standard/sets/right/password.rb +39 -0
- data/mods/standard/sets/right/read.rb +2 -0
- data/mods/standard/sets/right/salt.rb +2 -1
- data/mods/standard/sets/right/script.rb +10 -0
- data/mods/standard/sets/right/stats.rb +35 -0
- data/mods/standard/sets/right/status.rb +9 -0
- data/mods/standard/sets/right/style.rb +7 -53
- data/mods/standard/sets/right/{crypted_password.rb → token.rb} +2 -1
- data/mods/standard/sets/right/update.rb +2 -0
- data/mods/standard/sets/rstar/rules.rb +7 -3
- data/mods/standard/sets/self/account_links.rb +16 -23
- data/mods/standard/sets/self/alerts.rb +0 -1
- data/mods/standard/sets/self/all.rb +21 -0
- data/mods/standard/sets/self/foot.rb +0 -1
- data/mods/standard/sets/self/head.rb +21 -24
- data/mods/standard/sets/self/navbox.rb +0 -1
- data/mods/standard/sets/self/now.rb +0 -1
- data/mods/standard/sets/self/recent.rb +38 -35
- data/mods/standard/sets/self/script_card_menu.rb +8 -0
- data/mods/standard/sets/self/script_html5shiv_printshiv.rb +7 -0
- data/mods/standard/sets/self/script_jquery.rb +8 -0
- data/mods/standard/sets/self/script_jquery_helper.rb +13 -0
- data/mods/standard/sets/self/script_slot.rb +9 -0
- data/mods/standard/sets/self/script_tinymce.rb +8 -0
- data/mods/standard/sets/self/search.rb +0 -1
- data/mods/standard/sets/self/signin.rb +111 -0
- data/mods/standard/sets/self/stats.rb +91 -0
- data/mods/standard/sets/self/style_functional.rb +1 -1
- data/mods/standard/sets/self/style_jquery_ui_smoothness.rb +1 -1
- data/mods/standard/sets/self/style_standard.rb +1 -1
- data/mods/standard/sets/type/basic.rb +15 -14
- data/mods/standard/sets/type/cardtype.rb +2 -3
- data/mods/standard/sets/type/coffee_script.rb +46 -0
- data/mods/standard/sets/type/css.rb +16 -5
- data/mods/standard/sets/type/date.rb +0 -1
- data/mods/standard/sets/type/file.rb +0 -2
- data/mods/standard/sets/type/html.rb +0 -1
- data/mods/standard/sets/type/image.rb +1 -2
- data/mods/standard/sets/type/java_script.rb +32 -0
- data/mods/standard/sets/type/layout_type.rb +1 -1
- data/mods/standard/sets/type/number.rb +0 -1
- data/mods/standard/sets/type/pointer.rb +13 -8
- data/mods/standard/sets/type/scss.rb +17 -3
- data/mods/standard/sets/type/search_type.rb +36 -34
- data/mods/standard/sets/type/set.rb +1 -5
- data/mods/standard/sets/type/setting.rb +1 -2
- data/mods/standard/sets/type/signup.rb +92 -0
- data/mods/standard/sets/type/skin.rb +4 -5
- data/mods/standard/sets/type/toggle.rb +1 -1
- data/mods/standard/sets/type/user.rb +51 -4
- data/public/{404.html → assets/jasmine/404.html} +0 -0
- data/public/{500.html → assets/jasmine/500.html} +0 -0
- data/public/{jasmine → assets/jasmine}/card_form.html +0 -0
- data/public/assets/jquery-ui/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
- data/public/assets/jquery-ui/animated-overlay.gif +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_flat_0_aaaaaa_40x100-7d1197a52442bc56fcad60d0390f4b32.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_flat_75_ffffff_40x100-3c4b974defa5e8bdaf8a603034c4435e.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_55_fbf9ee_1x400-38c2dea4d046fd3f56cc3996e2e6018b.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_65_ffffff_1x400-ddb7ee7527bff283054406c50e597e1e.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_75_dadada_1x400-d618461418b1ebc6b7996979f4c3dc92.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_75_e6e6e6_1x400-48d8d545f708e5870a965ce9df8b0e38.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_glass_95_fef1ec_1x400-f3526b8f82249928f0a6baf044204b15.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100-cec5c56503b8480f834c3fce35dae8df.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/{app/assets/images/images/ui-icons_2e83ff_256x240.png → public/assets/jquery-ui/ui-icons_222222_256x240-b1eb177a51ea7925448318a26d988842.png} +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_222222_256x240.png +0 -0
- data/{app/assets/images/images/ui-icons_454545_256x240.png → public/assets/jquery-ui/ui-icons_2e83ff_256x240-49c2da9cac2dc565265586f716491298.png} +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_2e83ff_256x240.png +0 -0
- data/{app/assets/images/images/ui-icons_888888_256x240.png → public/assets/jquery-ui/ui-icons_454545_256x240-68b2fe3268f7604fb0767a0372e2db85.png} +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_454545_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_888888_256x240-8040cfcc88792375b7788feb59189eef.png +0 -0
- data/public/assets/{images → jquery-ui}/ui-icons_888888_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-d4a62216bf6f0cd0071149890763a5ff.png +0 -0
- data/{app/assets/images/images → public/assets/jquery-ui}/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery.min-388372ef65cc311f6a3df4a6ceac8d22.map +1 -0
- data/public/assets/jquery.min.map +1 -1
- data/public/assets/manifest.yml +61 -31
- data/public/assets/smoothness/animated-overlay-602eee4c79a4796b02bb6442948c9e28.gif +0 -0
- data/public/assets/smoothness/animated-overlay.gif +0 -0
- data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100-31613497e63975a54520b7065b125dea.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100-f4b0e20e6f4c83b9f52cf062ed0f5284.png +0 -0
- data/public/assets/smoothness/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400-e3606d6e7ad67486ffdc83edca64d4c5.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400-dcec96932b90ff4cd4fea91284a6e9a3.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400-a2310f533684ede4f1216d7299b5cd58.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400-d872f3a0a02dea609e4b0321520236d9.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400-9ccaed8a65a3c285c16a73bdf03a69b3.png +0 -0
- data/public/assets/smoothness/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100-2ef1d227b5c0f33ce3c5e45afa953991.png +0 -0
- data/public/assets/smoothness/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/assets/smoothness/ui-icons_222222_256x240-0675a996f0bdc78890f7b312c543b06a.png +0 -0
- data/public/assets/smoothness/ui-icons_222222_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_2e83ff_256x240-6aea736f81a417977efd77f183519a54.png +0 -0
- data/public/assets/smoothness/ui-icons_2e83ff_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_454545_256x240-6f4361f45745fb0cd7b0cc2851dc1cc3.png +0 -0
- data/public/assets/smoothness/ui-icons_454545_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_888888_256x240-8f6818bd8631ba3489de718e26c7e6cf.png +0 -0
- data/public/assets/smoothness/ui-icons_888888_256x240.png +0 -0
- data/public/assets/smoothness/ui-icons_cd0a0a_256x240-2969ddba6d0a9c62603a4aa85a363cda.png +0 -0
- data/public/assets/smoothness/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/controllers/card_controller_spec.rb +77 -61
- data/spec/controllers/location_spec.rb +3 -2
- data/spec/lib/card/auth_spec.rb +17 -0
- data/spec/lib/card/chunk_spec.rb +0 -1
- data/spec/lib/card/codename_spec.rb +12 -18
- data/spec/lib/card/content_spec.rb +0 -1
- data/spec/lib/card/diff_spec.rb +0 -1
- data/spec/lib/card/flexmail_spec.rb +19 -20
- data/spec/lib/card/format_spec.rb +0 -169
- data/spec/lib/{wagn → card}/loader_spec.rb +1 -2
- data/spec/lib/card/name_spec.rb +3 -5
- data/spec/lib/card/query_spec.rb +5 -8
- data/spec/{models → lib}/card/reference_spec.rb +6 -7
- data/spec/lib/card/revision_spec.rb +30 -0
- data/spec/lib/card/set_pattern_spec.rb +0 -1
- data/spec/lib/card/set_spec.rb +9 -9
- data/spec/lib/wagn/cache_spec.rb +0 -1
- data/spec/mailers/mailer_spec.rb +4 -9
- data/spec/models/card/cardtype_spec.rb +12 -14
- data/spec/models/card/create_spec.rb +3 -4
- data/spec/models/card/trash_spec.rb +24 -23
- data/spec/models/card/type_transition_spec.rb +3 -4
- data/spec/models/card/validation_spec.rb +0 -1
- data/spec/models/card_spec.rb +10 -11
- data/spec/mods/core/chunks/literal_spec.rb +0 -1
- data/spec/mods/core/chunks/uri_spec.rb +0 -1
- data/spec/mods/core/formats/data_format_spec.rb +0 -1
- data/spec/mods/core/formats/html_format_spec.rb +17 -18
- data/spec/mods/core/formats/text_format_spec.rb +0 -1
- data/spec/mods/core/sets/all/active_card_spec.rb +1 -2
- data/spec/mods/core/sets/all/attribute_tracking_spec.rb +1 -2
- data/spec/mods/core/sets/all/collection_spec.rb +1 -5
- data/spec/mods/core/sets/all/content_spec.rb +0 -1
- data/spec/mods/core/sets/all/fetch_spec.rb +7 -10
- data/spec/mods/core/sets/all/initialize_spec.rb +0 -1
- data/spec/mods/core/sets/all/name_spec.rb +34 -3
- data/spec/mods/core/sets/all/pattern_spec.rb +6 -9
- data/spec/mods/core/sets/all/permissions_spec.rb +61 -62
- data/spec/mods/core/sets/all/phases_spec.rb +1 -2
- data/spec/mods/core/sets/all/references_spec.rb +0 -1
- data/spec/mods/core/sets/all/rules2_spec.rb +31 -31
- data/spec/mods/core/sets/all/rules_spec.rb +3 -4
- data/spec/mods/core/sets/all/states_spec.rb +1 -2
- data/spec/mods/core/sets/all/templating_spec.rb +11 -12
- data/spec/mods/core/sets/all/tracked_attributes_spec.rb +18 -8
- data/spec/mods/core/sets/all/trash_spec.rb +1 -2
- data/spec/mods/core/sets/all/type_spec.rb +6 -5
- data/spec/mods/core/sets/all/utils_spec.rb +1 -2
- data/spec/mods/standard/chunks/include_spec.rb +14 -15
- data/spec/mods/standard/chunks/link_spec.rb +0 -1
- data/spec/mods/standard/formats/css_format_spec.rb +1 -2
- data/spec/mods/standard/formats/csv_format_spec.rb +0 -1
- data/spec/mods/standard/formats/email_html_format_spec.rb +1 -2
- data/spec/mods/standard/formats/file_format_spec.rb +0 -1
- data/spec/mods/standard/formats/js_format_spec.rb +3 -0
- data/spec/mods/standard/formats/json_format_spec.rb +0 -1
- data/spec/mods/standard/formats/rss_format_spec.rb +1 -2
- data/spec/mods/standard/formats/xml_format_spec.rb +0 -1
- data/spec/mods/standard/lib/machine_input_spec.rb +48 -0
- data/spec/mods/standard/lib/machine_spec.rb +110 -0
- data/spec/mods/standard/sets/all/account_spec.rb +50 -30
- data/spec/mods/standard/sets/all/all_css_spec.rb +0 -1
- data/spec/mods/standard/sets/all/all_csv_spec.rb +0 -1
- data/spec/mods/standard/sets/all/attach_spec.rb +0 -1
- data/spec/mods/standard/sets/all/base_spec.rb +5 -6
- data/spec/mods/standard/sets/all/comment_spec.rb +5 -0
- data/spec/mods/standard/sets/all/email_html_spec.rb +2 -3
- data/spec/mods/standard/sets/all/event_viz_spec.rb +7 -0
- data/spec/mods/standard/sets/all/file_spec.rb +0 -1
- data/spec/mods/standard/sets/all/flexmail_spec.rb +0 -1
- data/spec/mods/standard/sets/all/follow_spec.rb +10 -11
- data/spec/mods/standard/sets/all/history_spec.rb +10 -0
- data/spec/mods/standard/sets/all/json_spec.rb +5 -6
- data/spec/mods/standard/sets/all/rich_html_spec.rb +16 -13
- data/spec/mods/standard/sets/all/rss_spec.rb +4 -2
- data/spec/mods/standard/sets/all/text_spec.rb +1 -2
- data/spec/mods/standard/sets/right/account_spec.rb +86 -2
- data/spec/mods/standard/sets/right/add_help_spec.rb +0 -1
- data/spec/mods/standard/sets/right/comment_spec.rb +37 -2
- data/spec/mods/standard/sets/right/create_spec.rb +6 -2
- data/spec/mods/standard/sets/right/default_spec.rb +0 -1
- data/spec/mods/standard/sets/right/delete_spec.rb +0 -1
- data/spec/mods/standard/sets/right/email_spec.rb +43 -15
- data/spec/mods/standard/sets/right/help_spec.rb +0 -1
- data/spec/mods/standard/sets/right/machine_output_spec.rb +20 -0
- data/spec/mods/standard/sets/right/password_spec.rb +45 -0
- data/spec/mods/standard/sets/right/read_spec.rb +0 -1
- data/spec/mods/standard/sets/right/salt_spec.rb +0 -1
- data/spec/mods/standard/sets/right/script_spec.rb +20 -0
- data/spec/mods/standard/sets/right/stats_spec.rb +13 -0
- data/spec/mods/standard/sets/right/status_spec.rb +5 -0
- data/spec/mods/standard/sets/right/structure_spec.rb +2 -3
- data/spec/mods/standard/sets/right/style_spec.rb +19 -2
- data/spec/mods/standard/sets/right/token_spec.rb +5 -0
- data/spec/mods/standard/sets/right/update_spec.rb +0 -1
- data/spec/mods/standard/sets/right/when_created_spec.rb +0 -1
- data/spec/mods/standard/sets/right/when_last_edited_spec.rb +0 -1
- data/spec/mods/standard/sets/rstar/rules_spec.rb +3 -4
- data/spec/mods/standard/sets/self/account_links_spec.rb +0 -1
- data/spec/mods/standard/sets/self/alerts_spec.rb +0 -1
- data/spec/mods/standard/sets/self/all_spec.rb +47 -0
- data/spec/mods/standard/sets/self/foot_spec.rb +0 -1
- data/spec/mods/standard/sets/self/head_spec.rb +0 -1
- data/spec/mods/standard/sets/self/navbox_spec.rb +0 -1
- data/spec/mods/standard/sets/self/now_spec.rb +0 -1
- data/spec/mods/standard/sets/self/recent_spec.rb +1 -2
- data/spec/mods/standard/sets/self/search_spec.rb +1 -2
- data/spec/mods/standard/sets/self/signin_spec.rb +73 -0
- data/spec/mods/standard/sets/self/stats_spec.rb +12 -0
- data/spec/mods/standard/sets/self/style_functional_spec.rb +1 -2
- data/spec/mods/standard/sets/self/style_jquery_ui_smoothness_spec.rb +1 -2
- data/spec/mods/standard/sets/self/style_standard_spec.rb +1 -2
- data/spec/mods/standard/sets/self/version_spec.rb +0 -1
- data/spec/mods/standard/sets/type/basic_spec.rb +1 -2
- data/spec/mods/standard/sets/type/cardtype_spec.rb +1 -2
- data/spec/mods/standard/sets/type/coffeescript_spec.rb +28 -0
- data/spec/mods/standard/sets/type/css_spec.rb +31 -4
- data/spec/mods/standard/sets/type/date_spec.rb +0 -1
- data/spec/mods/standard/sets/type/file_spec.rb +1 -2
- data/spec/mods/standard/sets/type/html_spec.rb +3 -4
- data/spec/mods/standard/sets/type/image_spec.rb +1 -2
- data/spec/mods/standard/sets/type/javascript_spec.rb +28 -0
- data/spec/mods/standard/sets/type/layout_type_spec.rb +0 -1
- data/spec/mods/standard/sets/type/number_spec.rb +0 -1
- data/spec/mods/standard/sets/type/phrase_spec.rb +0 -1
- data/spec/mods/standard/sets/type/plain_text_spec.rb +0 -1
- data/spec/mods/standard/sets/type/pointer_spec.rb +1 -2
- data/spec/mods/standard/sets/type/scss_spec.rb +47 -2
- data/spec/mods/standard/sets/type/search_type_spec.rb +14 -3
- data/spec/mods/standard/sets/type/set_spec.rb +0 -1
- data/spec/mods/standard/sets/type/setting_spec.rb +6 -2
- data/spec/mods/standard/sets/type/signup_spec.rb +93 -0
- data/spec/mods/standard/sets/type/skin_spec.rb +23 -2
- data/spec/mods/standard/sets/type/toggle_spec.rb +0 -1
- data/spec/mods/standard/sets/type/user_spec.rb +1 -2
- data/{lib/wagn → spec}/spec_helper.rb +59 -14
- data/test/1.10.0-data-dump.sql +327 -0
- data/test/fixtures/card_references.yml +777 -581
- data/test/fixtures/card_revisions.yml +2737 -2488
- data/test/fixtures/cards.yml +4037 -2184
- data/test/performance/card_create_test.rb +1 -1
- data/test/performance/render_test.rb +1 -1
- data/test/seed.rb +36 -63
- data/test/test_helper.rb +1 -1
- data/wagn.gemspec +9 -9
- metadata +257 -237
- data/app/assets/javascripts/html5shiv-printshiv.js +0 -499
- data/app/controllers/account_controller.rb +0 -61
- data/app/controllers/admin_controller.rb +0 -124
- data/app/controllers/stub_card_controller.rb +0 -9
- data/app/controllers/wagn_controller.rb +0 -165
- data/app/mailers/mailer.rb +0 -109
- data/app/models/.gitkeep +0 -0
- data/app/models/account.rb +0 -198
- data/app/models/user.rb +0 -123
- data/app/views/mailer/account_info.text.erb +0 -17
- data/config/initializers/backtrace_silencers.rb +0 -8
- data/config/initializers/schema_views.rb +0 -59
- data/config/initializers/wrap_parameters.rb +0 -15
- data/config/samples/database.yml.erb +0 -34
- data/db/bootstrap/users.yml +0 -29
- data/features/account_requests.feature +0 -22
- data/features/google_maps.feature +0 -31
- data/features/hello_wagn.feature +0 -31
- data/features/step_definitions/notification_steps.rb +0 -23
- data/features/templates.feature +0 -30
- data/features/virtual_cards.feature +0 -11
- data/lib/active_record/foreign_keys.rb +0 -80
- data/lib/card/constant.rb +0 -20
- data/lib/generators/set/templates/set_template.erb +0 -1
- data/lib/tasks/.gitkeep +0 -0
- data/lib/wagn/authenticated_system.rb +0 -38
- data/lib/wagn/env.rb +0 -42
- data/lib/wagn/loader.rb +0 -135
- data/mods/standard/formats/kml_format.rb +0 -6
- data/mods/standard/lib/google_maps_addon.rb +0 -30
- data/mods/standard/sets/all/admin.rb +0 -53
- data/mods/standard/sets/all/geocode.rb +0 -16
- data/mods/standard/sets/all/kml.rb +0 -49
- data/mods/standard/sets/type/account_request.rb +0 -74
- data/mods/standard/sets/type/ruby_and_script.rb +0 -31
- data/public/assets/application-058913c45d4f3262667bad443a03eb45.js +0 -144
- data/public/assets/application-058913c45d4f3262667bad443a03eb45.js.gz +0 -0
- data/public/assets/application.js +0 -144
- data/public/assets/application.js.gz +0 -0
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js +0 -1
- data/public/assets/html5shiv-printshiv-ad36fc7219f4aeaa275f9a7fe2383413.js.gz +0 -0
- data/public/assets/html5shiv-printshiv.js.gz +0 -0
- data/public/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/public/assets/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/public/assets/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240-66e635a2f90b9f90675d402617630b24.png +0 -0
- data/public/assets/images/ui-icons_222222_256x240.png +0 -0
- data/public/assets/images/ui-icons_2e83ff_256x240-2ea4c160a75c1992daa2eeac86255b99.png +0 -0
- data/public/assets/images/ui-icons_454545_256x240-5c7f12676bcead9cb2d4cb8f23f16e95.png +0 -0
- data/public/assets/images/ui-icons_888888_256x240-95fd3047e1f7325d995a21c729b04125.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240-c0c1ec6a8bcf48fec40303e975a4dfa6.png +0 -0
- data/public/assets/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery.min-8b58c0fbf303b938d8e749262f7e50dd.map +0 -1
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js +0 -13
- data/public/assets/tinymce-22b5a139d9ff7df7643afae9ce205508.js.gz +0 -0
- data/public/assets/tinymce.js +0 -13
- data/public/assets/tinymce.js.gz +0 -0
- data/spec/controllers/account_controller_spec.rb +0 -42
- data/spec/controllers/admin_controller_spec.rb +0 -23
- data/spec/controllers/captcha_spec.rb +0 -103
- data/spec/controllers/sets_spec.rb +0 -97
- data/spec/controllers/wagn_controller_spec.rb +0 -5
- data/spec/mailers/account_spec.rb +0 -66
- data/spec/models/account_spec.rb +0 -19
- data/spec/models/card/comment_spec.rb +0 -38
- data/spec/models/card/revision_spec.rb +0 -58
- data/spec/models/user_spec.rb +0 -95
- data/spec/mods/standard/formats/kml_format_spec.rb +0 -6
- data/spec/mods/standard/sets/all/admin_spec.rb +0 -6
- data/spec/mods/standard/sets/all/geocode_spec.rb +0 -37
- data/spec/mods/standard/sets/all/kml_spec.rb +0 -6
- data/spec/mods/standard/sets/right/crypted_password_spec.rb +0 -6
- data/spec/mods/standard/sets/type/account_request_spec.rb +0 -160
- data/spec/mods/standard/sets/type/ruby_and_script_spec.rb +0 -6
- data/spec/spec.opts +0 -6
- data/test/fixtures/users.yml +0 -169
data/lib/card/content.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
3
|
require_dependency 'card/chunk'
|
4
|
-
# you could make the case that Card::Chunk should be Card::Content::Chunk
|
4
|
+
# you could make the case that Card::Chunk should be Card::Content::Chunk...
|
5
5
|
|
6
6
|
class Card
|
7
7
|
class Content < SimpleDelegator
|
@@ -0,0 +1,74 @@
|
|
1
|
+
class Object
|
2
|
+
# FIXME: move this, mixin, don't extend Object
|
3
|
+
def deep_clone
|
4
|
+
case self
|
5
|
+
when Fixnum,Bignum,Float,NilClass,FalseClass,TrueClass,Symbol
|
6
|
+
klone = self
|
7
|
+
when Hash
|
8
|
+
klone = self.clone
|
9
|
+
self.each{|k,v| klone[k] = v.deep_clone}
|
10
|
+
when Array
|
11
|
+
klone = self.clone
|
12
|
+
klone.clear
|
13
|
+
self.each{|v| klone << v.deep_clone}
|
14
|
+
else
|
15
|
+
klone = self.clone
|
16
|
+
end
|
17
|
+
klone.instance_variables.each {|v|
|
18
|
+
klone.instance_variable_set(v,
|
19
|
+
klone.instance_variable_get(v).deep_clone)
|
20
|
+
}
|
21
|
+
klone
|
22
|
+
end
|
23
|
+
|
24
|
+
def send_unless method, *args, &block
|
25
|
+
( block_given? ? yield : self ) or send method, *args
|
26
|
+
end
|
27
|
+
|
28
|
+
def send_if method, *args, &block
|
29
|
+
( block_given? ? yield : self ) and send method, *args
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_name
|
33
|
+
Card::Name.new self
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
class Module
|
40
|
+
RUBY_VERSION_18 = !!(RUBY_VERSION =~ /^1\.8/)
|
41
|
+
|
42
|
+
def const_get_if_defined const
|
43
|
+
args = RUBY_VERSION_18 ? [ const ] : [ const, false ]
|
44
|
+
if const_defined? *args
|
45
|
+
const_get *args
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def const_get_or_set const
|
50
|
+
const_get_if_defined const or const_set const, yield
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
class Hash
|
57
|
+
# FIXME: this is too ugly and narrow for a core extension.
|
58
|
+
class << self
|
59
|
+
def new_from_semicolon_attr_list(attr_string)
|
60
|
+
return {} if attr_string.blank?
|
61
|
+
attr_string.strip.split(';').inject({}) do |result, pair|
|
62
|
+
value, key = pair.split(':').reverse
|
63
|
+
key ||= 'view'
|
64
|
+
key.strip!; value.strip!
|
65
|
+
result[key.to_sym] = value
|
66
|
+
result
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
|
data/lib/card/env.rb
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Card::Env can differ for each request; Wagn.config should not
|
2
|
+
|
3
|
+
class Card
|
4
|
+
module Env
|
5
|
+
class << self
|
6
|
+
def reset args={}
|
7
|
+
@@env = { :main_name => nil }
|
8
|
+
|
9
|
+
if c = args[:controller]
|
10
|
+
self[:controller] = c
|
11
|
+
self[:session] = c.request.session
|
12
|
+
self[:params] = c.request.params
|
13
|
+
self[:ajax] = c.request.xhr? || c.request.params[:simulate_xhr]
|
14
|
+
self[:host] = Wagn.config.override_host || c.request.env['HTTP_HOST']
|
15
|
+
self[:protocol] = Wagn.config.override_protocol || c.request.protocol
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def [] key
|
21
|
+
@@env[key.to_sym]
|
22
|
+
end
|
23
|
+
|
24
|
+
def []= key, value
|
25
|
+
@@env[key.to_sym] = value
|
26
|
+
end
|
27
|
+
|
28
|
+
#hacky - should be in module
|
29
|
+
def recaptcha_on?
|
30
|
+
if self[:recaptcha_on].nil?
|
31
|
+
self[:recaptcha_count] = 0
|
32
|
+
self[:recaptcha_on] = self[:controller] && have_recaptcha_keys? && !Auth.signed_in? && !Auth.needs_setup? && !Auth.always_ok?
|
33
|
+
end
|
34
|
+
self[:recaptcha_on]
|
35
|
+
end
|
36
|
+
|
37
|
+
def params
|
38
|
+
self[:params] ||= {}
|
39
|
+
end
|
40
|
+
|
41
|
+
def session
|
42
|
+
self[:session] ||= {}
|
43
|
+
end
|
44
|
+
|
45
|
+
def ajax?
|
46
|
+
self[:ajax]
|
47
|
+
end
|
48
|
+
|
49
|
+
def method_missing method_id, *args
|
50
|
+
case args.length
|
51
|
+
when 0 ; self[ method_id ]
|
52
|
+
when 1 ; self[ method_id ] = args[0]
|
53
|
+
else ; super
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def have_recaptcha_keys?
|
60
|
+
!!( Wagn.config.recaptcha_public_key && Wagn.config.recaptcha_private_key )
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
Env.reset
|
65
|
+
end
|
66
|
+
|
data/lib/card/flexmail.rb
CHANGED
@@ -1,47 +1,53 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
|
3
|
-
class Card
|
4
|
-
class
|
5
|
-
def configs_for card
|
6
|
-
email_config_cardnames(card).map do |email_config|
|
7
|
-
config = {}
|
8
|
-
|
9
|
-
[:to, :from, :cc, :bcc, :attach].each do |field|
|
10
|
-
config[field] = ( fld_card=Card["#{email_config}+*#{field}"] ).nil? ? '' :
|
11
|
-
# configuration can be anything visible to configurer
|
12
|
-
Account.as( fld_card.updater ) do
|
13
|
-
list = fld_card.extended_list card
|
14
|
-
field == :attach ? list : list * ','
|
15
|
-
end
|
16
|
-
end
|
3
|
+
class Card
|
4
|
+
class Flexmail
|
17
5
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
6
|
+
class << self
|
7
|
+
|
8
|
+
def configs_for card
|
9
|
+
email_config_cardnames(card).map do |email_config|
|
10
|
+
config = {}
|
11
|
+
|
12
|
+
[:to, :from, :cc, :bcc, :attach].each do |field|
|
13
|
+
config[field] = ( fld_card=Card["#{email_config}+*#{field}"] ).nil? ? '' :
|
14
|
+
# configuration can be anything visible to configurer
|
15
|
+
Auth.as( fld_card.updater ) do
|
16
|
+
list = fld_card.extended_list card
|
17
|
+
field == :attach ? list : list * ','
|
18
|
+
end
|
19
|
+
end
|
24
20
|
|
25
|
-
|
26
|
-
|
21
|
+
[:subject, :message].each do |field|
|
22
|
+
config[field] = ( fld_card=Card["#{email_config}+*#{field}"] ).nil? ? '' :
|
23
|
+
Auth.as( fld_card.updater ) do
|
24
|
+
fld_card.contextual_content card, :format=>'email_html'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
config[:subject] = strip_html(config[:subject]).strip
|
29
|
+
config
|
30
|
+
end
|
27
31
|
end
|
28
|
-
end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
def email_config_cardnames card
|
34
|
+
#warn "card is #{card.inspect}"
|
35
|
+
event_card = card.rule_card :send
|
36
|
+
return [] unless event_card
|
37
|
+
Auth.as_bot { event_card.item_names }
|
38
|
+
end
|
36
39
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
40
|
+
def mail_for card
|
41
|
+
configs_for(card).map do |config|
|
42
|
+
Card::Mailer.flexmail config
|
43
|
+
end.compact.each(&:deliver)
|
44
|
+
end
|
42
45
|
|
43
|
-
|
44
|
-
|
46
|
+
def strip_html string
|
47
|
+
string.gsub(/<\/?[^>]*>/, "")
|
48
|
+
end
|
49
|
+
|
45
50
|
end
|
51
|
+
|
46
52
|
end
|
47
|
-
end
|
53
|
+
end
|
data/lib/card/format.rb
CHANGED
@@ -6,7 +6,7 @@ class Card
|
|
6
6
|
|
7
7
|
DEPRECATED_VIEWS = { :view=>:open, :card=>:open, :line=>:closed, :bare=>:core, :naked=>:core }
|
8
8
|
INCLUSION_MODES = { :closed=>:closed, :closed_content=>:closed, :edit=>:edit,
|
9
|
-
:layout=>:layout, :new=>:edit, :normal=>:normal, :template=>:template } #should be set in views
|
9
|
+
:layout=>:layout, :new=>:edit, :setup=>:edit, :normal=>:normal, :template=>:template } #should be set in views
|
10
10
|
|
11
11
|
cattr_accessor :ajax_call, :registered, :max_depth
|
12
12
|
[ :perms, :denial_views, :subset_views, :error_codes, :view_tags, :aliases ].each do |acc|
|
@@ -113,7 +113,7 @@ class Card
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def get_set_key selection_key, opts
|
116
|
-
unless pkey = Card.method_key(opts)
|
116
|
+
unless pkey = Card::Set.method_key(opts)
|
117
117
|
raise "bad method_key opts: #{pkey.inspect} #{opts.inspect}"
|
118
118
|
end
|
119
119
|
key = pkey.blank? ? selection_key : "#{pkey}_#{selection_key}"
|
@@ -155,11 +155,17 @@ class Card
|
|
155
155
|
{ :view => :name }
|
156
156
|
end
|
157
157
|
|
158
|
-
def params
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
def
|
158
|
+
def params
|
159
|
+
Env.params
|
160
|
+
end
|
161
|
+
|
162
|
+
def controller
|
163
|
+
Env[:controller] ||= CardController.new
|
164
|
+
end
|
165
|
+
|
166
|
+
def session
|
167
|
+
Env.session
|
168
|
+
end
|
163
169
|
|
164
170
|
def showname title=nil
|
165
171
|
if title
|
@@ -174,7 +180,7 @@ class Card
|
|
174
180
|
end
|
175
181
|
|
176
182
|
def focal? # meaning the current card is the requested card
|
177
|
-
if
|
183
|
+
if Env.ajax?
|
178
184
|
@depth == 0
|
179
185
|
else
|
180
186
|
main?
|
@@ -353,7 +359,7 @@ class Card
|
|
353
359
|
card.update_references( obj_content, true ) if card.references_expired # I thik we need this genralized
|
354
360
|
|
355
361
|
obj_content.process_content_object do |chunk_opts|
|
356
|
-
|
362
|
+
prepare_nest chunk_opts.merge(opts) { yield }
|
357
363
|
end
|
358
364
|
end
|
359
365
|
|
@@ -435,47 +441,54 @@ class Card
|
|
435
441
|
result
|
436
442
|
end
|
437
443
|
|
438
|
-
def
|
444
|
+
def prepare_nest opts
|
445
|
+
opts ||= {}
|
439
446
|
case
|
440
447
|
when opts.has_key?( :comment ) ; opts[:comment] # as in commented code
|
441
448
|
when @mode == :closed && @char_count > @@max_char_count ; '' # already out of view
|
442
|
-
when opts[:inc_name]=='_main' && !
|
449
|
+
when opts[:inc_name]=='_main' && !Env.ajax? && @depth==0 ; expand_main opts
|
443
450
|
else
|
444
|
-
|
445
|
-
result =
|
451
|
+
nested_card = Card.fetch opts[:inc_name], :new=>new_inclusion_card_args(opts)
|
452
|
+
result = nest nested_card, opts
|
446
453
|
@char_count += result.length if @mode == :closed && result
|
447
454
|
result
|
448
455
|
end
|
449
456
|
end
|
450
457
|
|
451
458
|
def expand_main opts
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
end
|
457
|
-
opts[:view] = @main_view || opts[:view] || :open
|
459
|
+
opts.merge! @main_opts if @main_opts
|
460
|
+
legacy_main_opts_tweaks! opts
|
461
|
+
|
462
|
+
opts[:view] ||= :open
|
458
463
|
with_inclusion_mode :normal do
|
459
464
|
@mainline = true
|
460
|
-
result = wrap_main
|
465
|
+
result = wrap_main nest( root.card, opts )
|
461
466
|
@mainline = false
|
462
467
|
result
|
463
468
|
end
|
464
469
|
end
|
470
|
+
|
471
|
+
def legacy_main_opts_tweaks! opts
|
472
|
+
if val=params[:size] and val.present?
|
473
|
+
opts[:size] = val.to_sym
|
474
|
+
end
|
475
|
+
|
476
|
+
if val=params[:item] and val.present?
|
477
|
+
opts[:items] = (opts[:items] || {}).reverse_merge :view=>val.to_sym
|
478
|
+
end
|
479
|
+
end
|
465
480
|
|
466
481
|
def wrap_main content
|
467
482
|
content #no wrapping in base format
|
468
483
|
end
|
469
484
|
|
470
|
-
def
|
485
|
+
def nest nested_card, opts={}
|
471
486
|
opts.delete_if { |k,v| v.nil? }
|
472
487
|
opts.reverse_merge! inclusion_defaults
|
473
488
|
|
474
|
-
sub = subformat
|
475
|
-
|
476
|
-
|
477
|
-
end
|
478
|
-
sub.inclusion_opts = opts[:items]
|
489
|
+
sub = subformat nested_card
|
490
|
+
sub.inclusion_opts = opts[:items] ? opts[:items].clone : {}
|
491
|
+
|
479
492
|
|
480
493
|
view = canonicalize_view opts.delete :view
|
481
494
|
opts[:home_view] = [:closed, :edit].member?(view) ? :open : view
|
@@ -483,14 +496,14 @@ class Card
|
|
483
496
|
|
484
497
|
view = case
|
485
498
|
when @mode == :edit
|
486
|
-
if @@perms[view]==:none ||
|
499
|
+
if @@perms[view]==:none || nested_card.structure || nested_card.key.blank? # eg {{_self|type}} on new cards
|
487
500
|
:blank
|
488
501
|
else
|
489
502
|
:edit_in_form
|
490
503
|
end
|
491
504
|
when @mode == :template ; :template_rule
|
492
505
|
when @@perms[view]==:none ; view
|
493
|
-
when @mode == :closed ; !
|
506
|
+
when @mode == :closed ; !nested_card.known? ? :closed_missing : :closed_content
|
494
507
|
else ; view
|
495
508
|
end
|
496
509
|
|
@@ -501,7 +514,7 @@ class Card
|
|
501
514
|
content = params[cardname.to_s.gsub(/\+/,'_')]
|
502
515
|
|
503
516
|
# CLEANME This is a hack to get it so plus cards re-populate on failed signups
|
504
|
-
if p = params['
|
517
|
+
if p = params['subcards'] and card_params = p[cardname.to_s]
|
505
518
|
content = card_params['content']
|
506
519
|
end
|
507
520
|
content if content.present? # why is this necessary? - efm
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
|
data/lib/card/loader.rb
ADDED
@@ -0,0 +1,145 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
require_dependency 'wagn/exceptions'
|
4
|
+
|
5
|
+
class Card
|
6
|
+
module Loader
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def load_mods
|
10
|
+
load_set_patterns
|
11
|
+
load_formats
|
12
|
+
load_sets
|
13
|
+
end
|
14
|
+
|
15
|
+
def load_chunks
|
16
|
+
mod_dirs.each do |mod|
|
17
|
+
load_dir "#{mod}/chunks/*.rb"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def load_layouts
|
22
|
+
mod_dirs.inject({}) do |hash, mod|
|
23
|
+
dirname = "#{mod}/layouts"
|
24
|
+
if File.exists? dirname
|
25
|
+
Dir.foreach( dirname ) do |filename|
|
26
|
+
next if filename =~ /^\./
|
27
|
+
hash[ filename.gsub /\.html$/, '' ] = File.read( [dirname, filename] * '/' )
|
28
|
+
end
|
29
|
+
end
|
30
|
+
hash
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def mod_dirs
|
37
|
+
@@mod_dirs ||= begin
|
38
|
+
(Wagn.paths['gem-mods'].existent + Wagn.paths['local-mods'].existent).map do |dirname|
|
39
|
+
Dir.entries( dirname ).sort.map do |filename|
|
40
|
+
"#{dirname}/#{filename}" if filename !~ /^\./
|
41
|
+
end
|
42
|
+
end.flatten.compact
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def load_set_patterns
|
47
|
+
if rewrite_tmp_files?
|
48
|
+
load_set_patterns_from_source
|
49
|
+
end
|
50
|
+
load_dir "#{Wagn.paths['tmp/set_patterns'].first}/*.rb"
|
51
|
+
end
|
52
|
+
|
53
|
+
def load_set_patterns_from_source
|
54
|
+
prepare_tmp_dir 'tmp/set_patterns'
|
55
|
+
seq = 100
|
56
|
+
mod_dirs.each do |mod|
|
57
|
+
dirname = "#{mod}/set_patterns"
|
58
|
+
if Dir.exists? dirname
|
59
|
+
Dir.entries( dirname ).sort.each do |filename|
|
60
|
+
if m = filename.match( /^(\d+_)?([^\.]*).rb/) and key = m[2]
|
61
|
+
filename = [ dirname, filename ] * '/'
|
62
|
+
SetPattern.write_tmp_file key, filename, seq
|
63
|
+
seq = seq + 1
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def load_formats
|
71
|
+
#cheating on load issues now by putting all inherited-from formats in core mod.
|
72
|
+
mod_dirs.each do |mod|
|
73
|
+
load_dir "#{mod}/formats/*.rb"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def load_sets
|
78
|
+
prepare_tmp_dir 'tmp/sets'
|
79
|
+
load_sets_by_pattern
|
80
|
+
Set.process_base_modules
|
81
|
+
Set.clean_empty_modules
|
82
|
+
end
|
83
|
+
|
84
|
+
|
85
|
+
def load_sets_by_pattern
|
86
|
+
Card.set_patterns.reverse.map(&:key).each do |set_pattern|
|
87
|
+
pattern_tmp_dir = "#{Wagn.paths['tmp/sets'].first}/#{set_pattern}"
|
88
|
+
if rewrite_tmp_files?
|
89
|
+
Dir.mkdir pattern_tmp_dir
|
90
|
+
load_implicit_sets_from_source set_pattern
|
91
|
+
end
|
92
|
+
if Dir.exists? pattern_tmp_dir
|
93
|
+
load_dir "#{pattern_tmp_dir}/*.rb"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def load_implicit_sets_from_source set_pattern
|
99
|
+
seq = 1000
|
100
|
+
mod_dirs.each do |mod_dir|
|
101
|
+
dirname = [mod_dir, 'sets', set_pattern] * '/'
|
102
|
+
next unless File.exists?( dirname )
|
103
|
+
|
104
|
+
#FIXME support multiple anchors!
|
105
|
+
Dir.entries( dirname ).sort.each do |anchor_filename|
|
106
|
+
next if anchor_filename =~ /^\./
|
107
|
+
anchor = anchor_filename.gsub /\.rb$/, ''
|
108
|
+
|
109
|
+
filename = [dirname, anchor_filename] * '/'
|
110
|
+
Set.write_tmp_file set_pattern, anchor, filename, seq
|
111
|
+
seq = seq + 1
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
def prepare_tmp_dir path
|
119
|
+
if rewrite_tmp_files?
|
120
|
+
p = Wagn.paths[ path ]
|
121
|
+
if p.existent.first
|
122
|
+
FileUtils.rm_rf p.first, :secure=>true
|
123
|
+
end
|
124
|
+
Dir.mkdir p.first
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def rewrite_tmp_files?
|
129
|
+
if defined?( @@rewrite )
|
130
|
+
@@rewrite
|
131
|
+
else
|
132
|
+
@@rewrite = !( Rails.env.production? and Wagn.paths['tmp/sets'].existent.first )
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
def load_dir dir
|
137
|
+
Dir[dir].sort.each do |file|
|
138
|
+
# puts Benchmark.measure("from #load_dir: rd: #{file}") {
|
139
|
+
require_dependency file
|
140
|
+
# }.format("%n: %t %r")
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|