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
@@ -362,7 +362,7 @@ del.diffmod,
|
|
362
362
|
}
|
363
363
|
|
364
364
|
|
365
|
-
#credit, /*
|
365
|
+
#credit, /* these are both deprecated */
|
366
366
|
.flash-notice {
|
367
367
|
color: #333;
|
368
368
|
font-size: 1.1em;
|
@@ -581,7 +581,7 @@ h2.set-label {
|
|
581
581
|
/*-------------------------- */
|
582
582
|
|
583
583
|
.ui-icon {
|
584
|
-
background-image: url([[/assets/
|
584
|
+
background-image: url([[/assets/smoothness/ui-icons_454545_256x240.png]])
|
585
585
|
}
|
586
586
|
|
587
587
|
.instruction {
|
@@ -5,23 +5,28 @@ module ClassMethods
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def account
|
8
|
-
|
8
|
+
fetch :trait=>:account
|
9
9
|
end
|
10
10
|
|
11
11
|
def accountable?
|
12
|
-
Card.toggle( rule
|
13
|
-
fetch( :trait=>:account, :new=>{} ).permitted?( :create) #don't use #ok? here because we don't want to check part permissions
|
12
|
+
Card.toggle( rule :accountable )
|
14
13
|
end
|
15
14
|
|
16
15
|
def parties
|
17
16
|
@parties ||= (all_roles << self.id).flatten.reject(&:blank?)
|
18
17
|
end
|
19
18
|
|
20
|
-
def among?
|
21
|
-
|
22
|
-
return true if parties.member?
|
19
|
+
def among? ok_ids
|
20
|
+
ok_ids.each do |ok_id|
|
21
|
+
return true if parties.member? ok_id
|
23
22
|
end
|
24
|
-
|
23
|
+
ok_ids.member? Card::AnyoneID
|
24
|
+
end
|
25
|
+
|
26
|
+
def is_own_account?
|
27
|
+
# card is +*account card of signed_in user.
|
28
|
+
cardname.part_names[0].key == Auth.as_card.key and
|
29
|
+
cardname.part_names[1].key == Card[:account].key
|
25
30
|
end
|
26
31
|
|
27
32
|
def read_rules
|
@@ -40,215 +45,23 @@ end
|
|
40
45
|
|
41
46
|
def all_roles
|
42
47
|
@all_roles ||=
|
43
|
-
if id == Card::
|
48
|
+
if id == Card::AnonymousID
|
44
49
|
[]
|
45
50
|
else
|
46
|
-
|
51
|
+
Auth.as_bot do
|
47
52
|
role_trait = fetch :trait=>:roles
|
48
|
-
[ Card::
|
53
|
+
[ Card::AnyoneSignedInID ] + ( role_trait ? role_trait.item_ids : [] )
|
49
54
|
end
|
50
55
|
end
|
51
56
|
end
|
52
57
|
|
53
58
|
|
54
|
-
|
55
|
-
|
56
|
-
email_params = params[:email] || {}
|
57
|
-
subject = email_params[:subject] || Card.setting('*invite+*subject') || ''
|
58
|
-
message = email_params[:message] || Card.setting('*invite+*message') || ''
|
59
|
-
|
60
|
-
success = Card.setting "#{ Card[:invite].name }+#{ Card[:thanks].name }"
|
61
|
-
args[:buttons] = %{
|
62
|
-
#{ submit_tag 'Invite' }
|
63
|
-
#{ link_to 'Cancel', previous_location }
|
64
|
-
}
|
65
|
-
|
66
|
-
%{
|
67
|
-
#{ hidden_field_tag :success, "REDIRECT: #{success}" if success }
|
68
|
-
#{ fieldset :subject, text_field( :email, :subject, :value=>subject, :size=>60 ) }
|
69
|
-
#{ fieldset :message, text_area( :email, :message, :value=>message, :rows=>10, :cols => 60 ),
|
70
|
-
:help => "We'll create a password and attach it to the email." }
|
71
|
-
#{ _optional_render :button_fieldset, args }
|
72
|
-
}
|
73
|
-
end
|
74
|
-
|
75
|
-
|
76
|
-
view :account, :perms=> lambda { |r| r.card.update_account_ok? } do |args|
|
77
|
-
frame_and_form :update, args, 'notify-success'=>'account details updated' do
|
78
|
-
%{
|
79
|
-
#{ render_account_detail }
|
80
|
-
#{ _optional_render :button_fieldset, args }
|
81
|
-
}
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def default_account_args args
|
86
|
-
default_new_account_args args
|
87
|
-
args[:buttons] = submit_tag 'Save Changes'
|
88
|
-
end
|
89
|
-
|
90
|
-
|
91
|
-
view :account_detail, :perms=>lambda { |r| r.card.update_account_ok? } do |args|
|
92
|
-
account = args[:account] || card.account
|
93
|
-
|
94
|
-
%{
|
95
|
-
#{ fieldset :email,
|
96
|
-
text_field( 'card[account_args]', :email, :autocomplete => :off, :value=>account.email ),
|
97
|
-
:editor => 'content'
|
98
|
-
}
|
99
|
-
#{ fieldset :password,
|
100
|
-
password_field( 'card[account_args]', :password ),
|
101
|
-
:help => (args[:setup] ? nil : 'no change if blank'),
|
102
|
-
:editor => 'content'
|
103
|
-
}
|
104
|
-
#{ fieldset 'confirm password',
|
105
|
-
password_field( 'card[account_args]', :password_confirmation ),
|
106
|
-
:editor => 'content'
|
107
|
-
}
|
108
|
-
#{
|
109
|
-
if !args[:setup] && Account.user.id != account.id
|
110
|
-
fieldset :block, check_box_tag( 'card[account_args][blocked]', '1', account.blocked? ), :help=>'prevents sign-ins'
|
111
|
-
end
|
112
|
-
}
|
113
|
-
}
|
114
|
-
|
115
|
-
end
|
116
|
-
|
117
|
-
|
118
|
-
view :new_account, :perms=> lambda { |r| r.card.accountable? && !r.card.account } do |args|
|
119
|
-
frame_and_form :update, args do
|
120
|
-
%{
|
121
|
-
#{ _render_email_fieldset }
|
122
|
-
#{ _render_invitation_field }
|
123
|
-
}
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
def default_new_account_args args
|
128
|
-
args[:hidden] = { :success => { :id=>'_self', :view=>'account' } }
|
129
|
-
end
|
130
|
-
|
131
|
-
|
132
|
-
view :email_fieldset do |args|
|
133
|
-
fieldset :email, text_field( 'card[account_args]', :email ), :editor=>'content'
|
134
|
-
end
|
135
|
-
|
136
|
-
|
137
|
-
view :signin_and_forgot_password, :perms=>:none do |args|
|
138
|
-
%{
|
139
|
-
<div id="sign-in">#{ _render_signin args }</div>
|
140
|
-
<div id="forgot-password">#{ _render_forgot_password args }</div>
|
141
|
-
}
|
142
|
-
end
|
143
|
-
|
144
|
-
view :signin, :perms=>:none do |args|
|
145
|
-
args.merge!( {
|
146
|
-
:title=>'Sign In',
|
147
|
-
:optional_help=>:show,
|
148
|
-
:optional_menu=>:never,
|
149
|
-
:hidden=>{ :success=>'REDIRECT:*previous' },
|
150
|
-
:buttons=> submit_tag( 'Sign in' )
|
151
|
-
})
|
152
|
-
if Card.new(:type_id=>Card::AccountRequestID).ok? :create
|
153
|
-
args[:buttons] += link_to( '...or sign up!', wagn_path("new/:account_request"))
|
154
|
-
end
|
155
|
-
|
156
|
-
frame_and_form 'account/signin', args, :recaptcha=>:off do
|
157
|
-
[
|
158
|
-
fieldset( :email, text_field_tag( 'login', params[:login], :id=>'login_field' ) ),
|
159
|
-
fieldset( :password, password_field_tag( 'password' ) ),
|
160
|
-
_optional_render( :button_fieldset, args )
|
161
|
-
]
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
view :forgot_password, :perms=>:none do |args|
|
166
|
-
args.merge!( {
|
167
|
-
:title=>'Forgot Password',
|
168
|
-
:optional_help=>:show,
|
169
|
-
:optional_menu=>:never,
|
170
|
-
:hidden => { :success => { :view=>:forgot_password }},
|
171
|
-
:buttons => submit_tag( 'Reset my password' )
|
172
|
-
} )
|
173
|
-
|
174
|
-
frame_and_form 'account/forgot_password', args, :recaptcha=>:off,
|
175
|
-
'notify-success'=>"Check your email for your new temporary password" do
|
176
|
-
[
|
177
|
-
fieldset( :email, text_field_tag( 'email', params[:email] ) ),
|
178
|
-
_optional_render( :button_fieldset, args )
|
179
|
-
]
|
180
|
-
end
|
181
|
-
end
|
59
|
+
event :generate_token do
|
60
|
+
Digest::SHA1.hexdigest "--#{Time.now.to_s}--#{rand 10}--"
|
182
61
|
end
|
183
62
|
|
184
|
-
|
185
63
|
event :set_stamper, :before=>:approve do
|
186
|
-
self.updater_id =
|
64
|
+
self.updater_id = Auth.current_id
|
187
65
|
self.creator_id = self.updater_id if new_card?
|
188
66
|
end
|
189
67
|
|
190
|
-
event :create_account, :after=>:store, :on=>:save do
|
191
|
-
if @account_args && !account && Card.toggle( rule :accountable )
|
192
|
-
|
193
|
-
# note - following must be done here because subcard handling happens later (after mods loaded)
|
194
|
-
# and account card must be created before user entry
|
195
|
-
# when all are cards, neither the as_bot nor the special treatment should be necessary.
|
196
|
-
account_card = Account.as_bot do
|
197
|
-
Card.create! :name=>"#{ name }+#{ Card[:account].name }"
|
198
|
-
end
|
199
|
-
|
200
|
-
@account_args[:status] = 'pending' unless accountable?
|
201
|
-
@account_args.reverse_merge! :card_id => self.id, :status => 'active', :account_id => account_card.id
|
202
|
-
|
203
|
-
user = User.new @account_args
|
204
|
-
handle_user_save user
|
205
|
-
@newly_activated_account = user if user.active?
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
event :update_account, :after=>:store, :on=>:update do
|
210
|
-
if @account_args && account && update_account_ok?
|
211
|
-
@account_args[:blocked] = account_args[:blocked] == '1'
|
212
|
-
if Account.as_id == id and account_args[:blocked]
|
213
|
-
raise Card::Oops, "can't block own account"
|
214
|
-
end
|
215
|
-
user = account
|
216
|
-
user.attributes = @account_args
|
217
|
-
handle_user_save user
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
def handle_user_save user
|
222
|
-
unless user.save
|
223
|
-
user.errors.each do |key,err|
|
224
|
-
errors.add key,err
|
225
|
-
end
|
226
|
-
raise ActiveRecord::Rollback
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
|
231
|
-
activation_ready = proc do |c|
|
232
|
-
Wagn::Env.params[:activate] and c.accountable? and c.account
|
233
|
-
end
|
234
|
-
|
235
|
-
event :activate_account, :after=>:store, :on=>:update, :when=>activation_ready do
|
236
|
-
account.update_attributes :status=>'active'
|
237
|
-
@newly_activated_account = account
|
238
|
-
end
|
239
|
-
|
240
|
-
|
241
|
-
event :notify_accounted, :after=>:extend do
|
242
|
-
if @newly_activated_account && @newly_activated_account.active?
|
243
|
-
email_args = Wagn::Env.params[:email] || {}
|
244
|
-
email_args[:message] ||= Card.setting('*signup+*message') || "Thanks for signing up to #{Card.setting('*title')}!"
|
245
|
-
email_args[:subject] ||= Card.setting('*signup+*subject') || "Account info for #{Card.setting('*title')}!"
|
246
|
-
@newly_activated_account.send_account_info email_args
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
250
|
-
event :block_deleted_user, :after=>:store, :on=>:delete do
|
251
|
-
if account = Account[ self.id ]
|
252
|
-
account.update_attributes :status=>'blocked'
|
253
|
-
end
|
254
|
-
end
|
@@ -1,8 +1,7 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
1
|
|
3
2
|
format do
|
4
|
-
def show args
|
5
|
-
view
|
3
|
+
def show view, args
|
4
|
+
view ||= :core
|
6
5
|
render view, args
|
7
6
|
end
|
8
7
|
end
|
@@ -22,6 +21,12 @@ view :link, :perms=>:none do |args|
|
|
22
21
|
end
|
23
22
|
|
24
23
|
|
24
|
+
# DATE VIEWS
|
25
|
+
|
26
|
+
view :created_at do |args| time_ago_in_words card.created_at end
|
27
|
+
view :updated_at do |args| time_ago_in_words card.updated_at end
|
28
|
+
|
29
|
+
|
25
30
|
# CONTENT VIEWS
|
26
31
|
|
27
32
|
view :raw do |args|
|
@@ -45,6 +50,7 @@ view :closed_content do |args|
|
|
45
50
|
Card::Content.truncatewords_with_closing_tags _render_core(args) #{ yield }
|
46
51
|
end
|
47
52
|
|
53
|
+
|
48
54
|
# note: content and open_content may look like they should be aliased to core, but it's important that they render
|
49
55
|
# core explicitly so that core view overrides work. the titled and labeled views below, however, are not intended
|
50
56
|
# for frequent override, so this shortcut is fine.
|
@@ -97,10 +103,6 @@ view :bad_address, :perms=>:none, :error_code=>404 do |args|
|
|
97
103
|
%{ 404: Bad Address }
|
98
104
|
end
|
99
105
|
|
100
|
-
view :no_card, :perms=>:none, :error_code=>404 do |args|
|
101
|
-
%{ 404: No Card! }
|
102
|
-
end
|
103
|
-
|
104
106
|
view :too_deep, :perms=>:none do |args|
|
105
107
|
%{ Man, you're too deep. (Too many levels of inclusions at a time) }
|
106
108
|
end
|
@@ -2,12 +2,12 @@ event :add_comment, :after=>:approve, :on=>:save, :when=> proc {|c| c.comment }
|
|
2
2
|
self.content = %{
|
3
3
|
#{ content }
|
4
4
|
#{ '<hr>' unless content.blank? }
|
5
|
-
#{ comment.
|
5
|
+
#{ comment.split(/\n/).map {|line| "<p>#{line.strip.empty? ? ' ' : line}</p>"} * "\n" }
|
6
6
|
<div class="w-comment-author">--#{
|
7
|
-
if
|
8
|
-
"[[#{
|
7
|
+
if Auth.signed_in?
|
8
|
+
"[[#{Auth.current.name}]]"
|
9
9
|
else
|
10
|
-
|
10
|
+
Env.session[:comment_author] = comment_author if Env.session
|
11
11
|
"#{ comment_author } (Not signed in)"
|
12
12
|
end
|
13
13
|
}.....#{Time.now}</div>
|
@@ -26,7 +26,7 @@ view( :comment_box, :denial=>:blank, :tags=>:unknown_ok, :perms=>lambda { |r| r.
|
|
26
26
|
#{ f.text_area :comment, :rows=>3 }
|
27
27
|
<div class="comment-buttons">
|
28
28
|
#{
|
29
|
-
unless
|
29
|
+
unless Auth.signed_in?
|
30
30
|
card.comment_author= (session[:comment_author] || params[:comment_author] || "Anonymous") #ENGLISH
|
31
31
|
%{<label>My Name is:</label> #{ f.text_field :comment_author }}
|
32
32
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#~~~~~~~~~~~~~~~~
|
2
|
+
# EXPERIMENTAL
|
3
|
+
# the following methods are for visualing card events
|
4
|
+
# not ready for prime time!
|
5
|
+
|
6
|
+
def events action
|
7
|
+
@action = action
|
8
|
+
root = _validate_callbacks + _save_callbacks
|
9
|
+
events = [ events_tree(:validation), events_tree(:save)]
|
10
|
+
@action = nil
|
11
|
+
puts_events events
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def puts_events events, prefix='', depth=0
|
17
|
+
r = ''
|
18
|
+
depth += 1
|
19
|
+
events.each do |e|
|
20
|
+
space = ' ' * (depth * 2)
|
21
|
+
|
22
|
+
#FIXME - this is not right. before and around callbacks are processed in declaration order regardless of kind.
|
23
|
+
# not all befores then all arounds
|
24
|
+
|
25
|
+
if e[:before]
|
26
|
+
r += puts_events( e[:before], space+'v ', depth)
|
27
|
+
end
|
28
|
+
if e[:around]
|
29
|
+
r += puts_events( e[:around], space+'vv ', depth )
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
output = "#{prefix}#{e[:name]}"
|
34
|
+
#warn output
|
35
|
+
r+= "#{output}\n"
|
36
|
+
|
37
|
+
if e[:after]
|
38
|
+
r += puts_events( e[:after ].reverse, space+'^ ', depth )
|
39
|
+
end
|
40
|
+
end
|
41
|
+
r
|
42
|
+
end
|
43
|
+
|
44
|
+
def events_tree filt
|
45
|
+
hash = {:name => filt }
|
46
|
+
if respond_to? "_#{filt}_callbacks"
|
47
|
+
send( "_#{filt}_callbacks" ).each do |callback|
|
48
|
+
next unless callback.applies? self
|
49
|
+
hash[callback.kind] ||= []
|
50
|
+
hash[callback.kind] << events_tree( callback.filter )
|
51
|
+
end
|
52
|
+
end
|
53
|
+
hash
|
54
|
+
end
|
55
|
+
#FIXME - this doesn't belong here!!
|
56
|
+
|
57
|
+
class ::ActiveSupport::Callbacks::Callback
|
58
|
+
def applies? object
|
59
|
+
object.send :eval, "value=nil;halted=false;!!(#{@compiled_options})"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
format :html do
|
2
2
|
|
3
|
-
watch_perms = lambda { |r|
|
3
|
+
watch_perms = lambda { |r| Auth.signed_in? && !r.card.new_card? }
|
4
4
|
view :watch, :tags=>[:unknown_ok, :no_wrap_comments], :denial=>:blank, :perms=>watch_perms do |args|
|
5
5
|
|
6
6
|
wrap args do
|
@@ -38,7 +38,7 @@ end
|
|
38
38
|
|
39
39
|
event :notify_followers, :after=>:extend do
|
40
40
|
begin
|
41
|
-
return false if Card.record_timestamps==false
|
41
|
+
return false if Card.record_timestamps==false
|
42
42
|
# userstamps and timestamps are turned off in cases like updating read_rules that are automated and
|
43
43
|
# generally not of enough interest to warrant notification
|
44
44
|
|
@@ -47,8 +47,12 @@ event :notify_followers, :after=>:extend do
|
|
47
47
|
@trunk_watcher_watched_pairs ||= trunk_watcher_watched_pairs
|
48
48
|
@watcher_watched_pairs ||= watcher_watched_pairs
|
49
49
|
|
50
|
-
@watcher_watched_pairs.reject
|
51
|
-
|
50
|
+
@watcher_watched_pairs.reject do |p|
|
51
|
+
@trunk_watcher_watched_pairs.map(&:first).include? p.first
|
52
|
+
end.each do |watcher, watched|
|
53
|
+
watcher and
|
54
|
+
mail = Mailer.change_notice( watcher, self, action, watched.to_s, nested_notifications ) and
|
55
|
+
mail.deliver
|
52
56
|
end
|
53
57
|
|
54
58
|
if @supercard
|
@@ -72,18 +76,16 @@ attr_accessor :nested_notifications
|
|
72
76
|
def trunk_watcher_watched_pairs
|
73
77
|
# do the watchers lookup before the includer test since it's faster.
|
74
78
|
if cardname.junction?
|
75
|
-
#warn "trunk_watcher_pairs #{cardname}, #{cardname.trunk_name.inspect}, #{includers.inspect}"
|
76
79
|
tcard = Card[tname=cardname.trunk_name]
|
77
80
|
tcard and pairs = tcard.watcher_watched_pairs
|
78
|
-
|
81
|
+
#fixme - includers not working on structured cards, so this is commented for now
|
79
82
|
return pairs if !pairs.nil? and includers.map(&:key).member?(tname.key)
|
80
|
-
#warn "twatch empty ..."
|
81
83
|
end
|
82
84
|
[]
|
83
85
|
end
|
84
86
|
|
85
|
-
def watching_type?; watcher_pairs(false, :type).member?
|
86
|
-
def watching?; watcher_pairs(false). member?
|
87
|
+
def watching_type?; watcher_pairs(false, :type).member? Auth.current_id end
|
88
|
+
def watching?; watcher_pairs(false). member? Auth.current_id end
|
87
89
|
|
88
90
|
def watchers
|
89
91
|
watcher_watched_pairs false
|
@@ -95,7 +97,7 @@ def watcher_watched_pairs pairs=true
|
|
95
97
|
end
|
96
98
|
|
97
99
|
def watcher_pairs pairs=true, kind=:name, hash={}
|
98
|
-
#warn "wp #{inspect} P:#{pairs}, k:#{kind}, uid:#{
|
100
|
+
#warn "wp #{inspect} P:#{pairs}, k:#{kind}, uid:#{Auth.current_id} #{hash.inspect}, OI:#{hash.object_id}"
|
99
101
|
|
100
102
|
wname, rc = (kind == :type) ?
|
101
103
|
[ self.type_name, self.type_card.fetch(:trait=>:watchers) ] :
|
@@ -106,7 +108,7 @@ def watcher_pairs pairs=true, kind=:name, hash={}
|
|
106
108
|
if hash.any?
|
107
109
|
#warn "wp #{pairs}, #{kind}, #{hash.inspect}"
|
108
110
|
if pairs
|
109
|
-
hash.each.reject {|i,wname| i ==
|
111
|
+
hash.each.reject {|i,wname| i == Auth.current_id }.map {|i,wname| [ i, wname ] }
|
110
112
|
else
|
111
113
|
hash.keys
|
112
114
|
end
|