card 1.16.1 → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +60 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/.yardopts +6 -0
- data/README_Developers.rdoc +100 -0
- data/VERSION +1 -1
- data/card.gemspec +18 -18
- data/db/migrate/20150724210803_add_comment_to_actions.rb +5 -0
- data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +70 -0
- data/db/migrate_core_cards/20150807205221_create_references_for_search_cards.rb +10 -0
- data/db/migrate_core_cards/data/1.12_stylesheets/common.scss +4 -2
- data/db/schema.rb +2 -1
- data/db/seed/new/card_actions.yml +2334 -12538
- data/db/seed/new/card_acts.yml +1 -1
- data/db/seed/new/card_changes.yml +7384 -38929
- data/db/seed/new/card_references.yml +207 -207
- data/db/seed/new/cards.yml +1364 -1440
- data/db/seed/test/fixtures/card_actions.yml +3285 -13219
- data/db/seed/test/fixtures/card_acts.yml +107 -107
- data/db/seed/test/fixtures/card_changes.yml +10830 -42375
- data/db/seed/test/fixtures/card_references.yml +393 -393
- data/db/seed/test/fixtures/cards.yml +1701 -1777
- data/db/version.txt +1 -1
- data/db/version_core_cards.txt +1 -1
- data/lib/card.rb +13 -3
- data/lib/card/chunk.rb +22 -15
- data/lib/card/content.rb +9 -8
- data/lib/card/diff.rb +79 -79
- data/lib/card/loader.rb +33 -33
- data/lib/card/name.rb +8 -0
- data/lib/card/set.rb +44 -17
- data/lib/card/set_pattern.rb +8 -0
- data/lib/cardio.rb +19 -3
- data/mod/01_core/chunk/link.rb +7 -6
- data/mod/01_core/chunk/query_reference.rb +65 -0
- data/mod/01_core/set/all/content.rb +1 -1
- data/mod/01_core/set/all/fetch.rb +15 -7
- data/mod/01_core/set/all/initialize.rb +4 -3
- data/mod/01_core/set/all/phases.rb +12 -8
- data/mod/01_core/set/all/references.rb +12 -6
- data/mod/01_core/set/all/rules.rb +14 -11
- data/mod/01_core/set/all/states.rb +2 -1
- data/mod/01_core/set/all/tracked_attributes.rb +14 -0
- data/mod/01_core/spec/set/all/collection_spec.rb +5 -5
- data/mod/01_core/spec/set/all/name_spec.rb +6 -6
- data/mod/01_history/lib/card/act.rb +2 -2
- data/mod/01_history/lib/card/action.rb +11 -2
- data/mod/01_history/set/all/actions.rb +4 -3
- data/mod/01_history/set/all/content_history.rb +1 -1
- data/mod/01_history/set/all/history.rb +55 -66
- data/mod/02_basic_types/set/all/file.rb +26 -3
- data/mod/02_basic_types/set/type/pointer.rb +13 -14
- data/mod/02_basic_types/spec/set/all/file_spec.rb +0 -1
- data/mod/03_machines/lib/card/machine.rb +4 -4
- data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +4 -17
- data/mod/03_machines/lib/stylesheets/style_cards.scss +5 -0
- data/mod/03_machines/set/right/machine_input.rb +3 -0
- data/mod/03_machines/set/right/machine_output.rb +4 -0
- data/mod/04_settings/lib/card/setting.rb +2 -1
- data/mod/04_settings/set/abstract/permission.rb +95 -0
- data/mod/04_settings/set/right/comment.rb +2 -90
- data/mod/04_settings/set/right/create.rb +2 -2
- data/mod/04_settings/set/right/delete.rb +2 -3
- data/mod/04_settings/set/right/read.rb +3 -2
- data/mod/04_settings/set/right/update.rb +3 -2
- data/mod/04_settings/set/self/recent_settings.rb +3 -0
- data/mod/04_settings/set/type/setting.rb +9 -1
- data/mod/05_email/set/all/notify.rb +2 -1
- data/mod/05_email/set/type/email_template.rb +17 -17
- data/mod/05_standard/file/credit_image/image-icon.png +0 -0
- data/mod/05_standard/file/credit_image/image-large.png +0 -0
- data/mod/05_standard/file/credit_image/image-medium.png +0 -0
- data/mod/05_standard/file/credit_image/image-original.png +0 -0
- data/mod/05_standard/file/credit_image/image-small.png +0 -0
- data/mod/05_standard/file/favicon/{icon-image.png → image-icon.png} +0 -0
- data/mod/05_standard/file/favicon/{large-image.png → image-large.png} +0 -0
- data/mod/05_standard/file/favicon/{medium-image.png → image-medium.png} +0 -0
- data/mod/05_standard/file/favicon/{original-image.png → image-original.png} +0 -0
- data/mod/05_standard/file/favicon/{small-image.png → image-small.png} +0 -0
- data/mod/05_standard/file/logo/{icon-image.png → image-icon.png} +0 -0
- data/mod/05_standard/file/logo/{large-image.png → image-large.png} +0 -0
- data/mod/05_standard/file/logo/{medium-image.png → image-medium.png} +0 -0
- data/mod/05_standard/file/logo/{original-image.png → image-original.png} +0 -0
- data/mod/05_standard/file/logo/{small-image.png → image-small.png} +0 -0
- data/mod/05_standard/lib/carrier_wave/cardmount.rb +79 -0
- data/mod/05_standard/lib/file_uploader.rb +127 -0
- data/mod/05_standard/lib/image_uploader.rb +35 -0
- data/mod/05_standard/set/abstract/attachment.rb +85 -0
- data/mod/05_standard/set/all/error.rb +1 -18
- data/mod/05_standard/set/all/event_viz.rb +17 -14
- data/mod/05_standard/set/all/rich_html/editing.rb +10 -10
- data/mod/05_standard/set/all/rich_html/toolbar.rb +44 -37
- data/mod/05_standard/set/right/account.rb +1 -1
- data/mod/05_standard/set/right/password.rb +9 -10
- data/mod/05_standard/set/self/recent.rb +1 -1
- data/mod/05_standard/set/type/file.rb +43 -31
- data/mod/05_standard/set/type/image.rb +22 -6
- data/mod/05_standard/set/type/search_type.rb +4 -2
- data/mod/05_standard/set/type/session.rb +7 -5
- data/mod/05_standard/set/type/set.rb +3 -1
- data/mod/05_standard/spec/set/all/history_spec.rb +1 -1
- data/mod/05_standard/spec/set/type/cardtype_spec.rb +3 -3
- data/mod/05_standard/spec/set/type/file_spec.rb +85 -1
- data/mod/05_standard/spec/set/type/image_spec.rb +89 -5
- data/mod/05_standard/spec/set/type/search_type_spec.rb +16 -1
- data/mod/06_bootstrap/file/{cerulean_skin/icon-image.png → cerulean_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/large-image.png → cerulean_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/medium-image.png → cerulean_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/original-image.png → cerulean_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cerulean_skin/small-image.png → cerulean_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/icon-image.png → cosmo_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/large-image.png → cosmo_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/medium-image.png → cosmo_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/original-image.png → cosmo_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cosmo_skin/small-image.png → cosmo_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/icon-image.png → cyborg_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/large-image.png → cyborg_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/medium-image.png → cyborg_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/original-image.png → cyborg_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{cyborg_skin/small-image.png → cyborg_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/icon-image.png → darkly_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/large-image.png → darkly_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/medium-image.png → darkly_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/original-image.png → darkly_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{darkly_skin/small-image.png → darkly_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/icon-image.png → flatly_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/large-image.png → flatly_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/medium-image.png → flatly_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/original-image.png → flatly_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{flatly_skin/small-image.png → flatly_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/icon-image.png → journal_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/large-image.png → journal_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/medium-image.png → journal_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/original-image.png → journal_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{journal_skin/small-image.png → journal_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/icon-image.png → lumen_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/large-image.png → lumen_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/medium-image.png → lumen_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/original-image.png → lumen_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{lumen_skin/small-image.png → lumen_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/icon-image.png → paper_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/large-image.png → paper_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/medium-image.png → paper_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/original-image.png → paper_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{paper_skin/small-image.png → paper_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/icon-image.png → readable_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/large-image.png → readable_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/medium-image.png → readable_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/original-image.png → readable_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{readable_skin/small-image.png → readable_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/icon-image.png → sandstone_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/large-image.png → sandstone_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/medium-image.png → sandstone_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/original-image.png → sandstone_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{sandstone_skin/small-image.png → sandstone_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/icon-image.png → simplex_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/large-image.png → simplex_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/medium-image.png → simplex_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/original-image.png → simplex_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{simplex_skin/small-image.png → simplex_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/icon-image.png → slate_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/large-image.png → slate_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/medium-image.png → slate_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/original-image.png → slate_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{slate_skin/small-image.png → slate_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/icon-image.png → spacelab_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/large-image.png → spacelab_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/medium-image.png → spacelab_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/original-image.png → spacelab_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{spacelab_skin/small-image.png → spacelab_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/icon-image.png → superhero_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/large-image.png → superhero_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/medium-image.png → superhero_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/original-image.png → superhero_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{superhero_skin/small-image.png → superhero_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/icon-image.png → united_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/large-image.png → united_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/medium-image.png → united_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/original-image.png → united_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{united_skin/small-image.png → united_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/icon-image.png → yeti_skin_image/image-icon.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/large-image.png → yeti_skin_image/image-large.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/medium-image.png → yeti_skin_image/image-medium.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/original-image.png → yeti_skin_image/image-original.png} +0 -0
- data/mod/06_bootstrap/file/{yeti_skin/small-image.png → yeti_skin_image/image-small.png} +0 -0
- data/mod/06_bootstrap/lib/stylesheets/bootstrap_cards.scss +5 -3
- data/spec/lib/card/reference_spec.rb +8 -1
- data/tmpsets/README.md +2 -0
- data/tmpsets/set/mod001-01_core/all/active_card.rb +40 -0
- data/tmpsets/set/mod001-01_core/all/collection.rb +348 -0
- data/tmpsets/set/mod001-01_core/all/content.rb +68 -0
- data/tmpsets/set/mod001-01_core/all/erb.rb +17 -0
- data/tmpsets/set/mod001-01_core/all/fetch.rb +242 -0
- data/tmpsets/set/mod001-01_core/all/haml.rb +13 -0
- data/tmpsets/set/mod001-01_core/all/initialize.rb +56 -0
- data/tmpsets/set/mod001-01_core/all/name.rb +279 -0
- data/tmpsets/set/mod001-01_core/all/pattern.rb +62 -0
- data/tmpsets/set/mod001-01_core/all/permissions.rb +289 -0
- data/tmpsets/set/mod001-01_core/all/phases.rb +187 -0
- data/tmpsets/set/mod001-01_core/all/references.rb +130 -0
- data/tmpsets/set/mod001-01_core/all/rules.rb +324 -0
- data/tmpsets/set/mod001-01_core/all/states.rb +28 -0
- data/tmpsets/set/mod001-01_core/all/templating.rb +132 -0
- data/tmpsets/set/mod001-01_core/all/tracked_attributes.rb +136 -0
- data/tmpsets/set/mod001-01_core/all/trash.rb +56 -0
- data/tmpsets/set/mod001-01_core/all/type.rb +91 -0
- data/tmpsets/set/mod001-01_core/all/utils.rb +162 -0
- data/tmpsets/set/mod001-01_core/all/view_cache.rb +14 -0
- data/tmpsets/set/mod002-01_history/all/actions.rb +54 -0
- data/tmpsets/set/mod002-01_history/all/content_history.rb +140 -0
- data/tmpsets/set/mod002-01_history/all/history.rb +341 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_css.rb +48 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_csv.rb +58 -0
- data/tmpsets/set/mod003-02_basic_types/all/all_js.rb +13 -0
- data/tmpsets/set/mod003-02_basic_types/all/base.rb +128 -0
- data/tmpsets/set/mod003-02_basic_types/all/file.rb +42 -0
- data/tmpsets/set/mod003-02_basic_types/all/json.rb +72 -0
- data/tmpsets/set/mod003-02_basic_types/all/rss.rb +78 -0
- data/tmpsets/set/mod003-02_basic_types/all/text.rb +14 -0
- data/tmpsets/set/mod003-02_basic_types/type/html.rb +33 -0
- data/tmpsets/set/mod003-02_basic_types/type/plain_text.rb +16 -0
- data/tmpsets/set/mod003-02_basic_types/type/pointer.rb +358 -0
- data/tmpsets/set/mod004-03_machines/right/machine_input.rb +8 -0
- data/tmpsets/set/mod004-03_machines/right/machine_output.rb +30 -0
- data/tmpsets/set/mod004-03_machines/self/script_ace.rb +18 -0
- data/tmpsets/set/mod004-03_machines/self/script_card_menu.rb +17 -0
- data/tmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/script_jquery.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb +18 -0
- data/tmpsets/set/mod004-03_machines/self/script_slot.rb +13 -0
- data/tmpsets/set/mod004-03_machines/self/script_tinymce.rb +8 -0
- data/tmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb +11 -0
- data/tmpsets/set/mod004-03_machines/self/style_cards.rb +12 -0
- data/tmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb +9 -0
- data/tmpsets/set/mod004-03_machines/type/coffee_script.rb +67 -0
- data/tmpsets/set/mod004-03_machines/type/css.rb +55 -0
- data/tmpsets/set/mod004-03_machines/type/java_script.rb +43 -0
- data/tmpsets/set/mod004-03_machines/type/scss.rb +28 -0
- data/tmpsets/set/mod004-03_machines/type/skin.rb +18 -0
- data/tmpsets/set/mod005-04_settings/abstract/permission.rb +101 -0
- data/tmpsets/set/mod005-04_settings/right/add_help.rb +17 -0
- data/tmpsets/set/mod005-04_settings/right/comment.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/create.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/default.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/delete.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/help.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/read.rb +9 -0
- data/tmpsets/set/mod005-04_settings/right/script.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/structure.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/style.rb +16 -0
- data/tmpsets/set/mod005-04_settings/right/update.rb +9 -0
- data/tmpsets/set/mod005-04_settings/self/accountable.rb +9 -0
- data/tmpsets/set/mod005-04_settings/self/add_help.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/autoname.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/captcha.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/create.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/default.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/delete.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/help.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/input.rb +7 -0
- data/tmpsets/set/mod005-04_settings/self/layout.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_create.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_delete.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/on_update.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/options.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/options_label.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/read.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/recent_settings.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/script.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/structure.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/style.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/table_of_contents.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/thanks.rb +8 -0
- data/tmpsets/set/mod005-04_settings/self/update.rb +8 -0
- data/tmpsets/set/mod005-04_settings/type/setting.rb +96 -0
- data/tmpsets/set/mod006-05_email/all/email_html.rb +11 -0
- data/tmpsets/set/mod006-05_email/all/email_text.rb +11 -0
- data/tmpsets/set/mod006-05_email/all/follow.rb +260 -0
- data/tmpsets/set/mod006-05_email/all/notify.rb +244 -0
- data/tmpsets/set/mod006-05_email/all/observer.rb +33 -0
- data/tmpsets/set/mod006-05_email/right/bcc.rb +51 -0
- data/tmpsets/set/mod006-05_email/right/cc.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/follow.rb +90 -0
- data/tmpsets/set/mod006-05_email/right/follow_fields.rb +8 -0
- data/tmpsets/set/mod006-05_email/right/followers.rb +35 -0
- data/tmpsets/set/mod006-05_email/right/following.rb +58 -0
- data/tmpsets/set/mod006-05_email/right/from.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/html_message.rb +9 -0
- data/tmpsets/set/mod006-05_email/right/to.rb +9 -0
- data/tmpsets/set/mod006-05_email/self/always.rb +20 -0
- data/tmpsets/set/mod006-05_email/self/created.rb +27 -0
- data/tmpsets/set/mod006-05_email/self/edited.rb +30 -0
- data/tmpsets/set/mod006-05_email/self/follow.rb +8 -0
- data/tmpsets/set/mod006-05_email/self/follow_defaults.rb +71 -0
- data/tmpsets/set/mod006-05_email/self/never.rb +21 -0
- data/tmpsets/set/mod006-05_email/type/email_template.rb +119 -0
- data/tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb +182 -0
- data/tmpsets/set/mod007-05_standard/abstract/attachment.rb +91 -0
- data/tmpsets/set/mod007-05_standard/all/account.rb +73 -0
- data/tmpsets/set/mod007-05_standard/all/comment.rb +45 -0
- data/tmpsets/set/mod007-05_standard/all/error.rb +198 -0
- data/tmpsets/set/mod007-05_standard/all/event_viz.rb +75 -0
- data/tmpsets/set/mod007-05_standard/all/links.rb +153 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/content.rb +248 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/editing.rb +216 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/form.rb +238 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/header.rb +80 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/menu.rb +135 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/modal.rb +98 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/toolbar.rb +271 -0
- data/tmpsets/set/mod007-05_standard/all/rich_html/wrapper.rb +158 -0
- data/tmpsets/set/mod007-05_standard/right/account.rb +187 -0
- data/tmpsets/set/mod007-05_standard/right/discussion.rb +9 -0
- data/tmpsets/set/mod007-05_standard/right/email.rb +57 -0
- data/tmpsets/set/mod007-05_standard/right/password.rb +44 -0
- data/tmpsets/set/mod007-05_standard/right/salt.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/stats.rb +41 -0
- data/tmpsets/set/mod007-05_standard/right/status.rb +15 -0
- data/tmpsets/set/mod007-05_standard/right/token.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/when_created.rb +11 -0
- data/tmpsets/set/mod007-05_standard/right/when_last_edited.rb +11 -0
- data/tmpsets/set/mod007-05_standard/rstar/rules.rb +411 -0
- data/tmpsets/set/mod007-05_standard/self/account_links.rb +55 -0
- data/tmpsets/set/mod007-05_standard/self/alerts.rb +11 -0
- data/tmpsets/set/mod007-05_standard/self/all.rb +28 -0
- data/tmpsets/set/mod007-05_standard/self/foot.rb +14 -0
- data/tmpsets/set/mod007-05_standard/self/head.rb +126 -0
- data/tmpsets/set/mod007-05_standard/self/navbox.rb +39 -0
- data/tmpsets/set/mod007-05_standard/self/now.rb +12 -0
- data/tmpsets/set/mod007-05_standard/self/performance_log.rb +98 -0
- data/tmpsets/set/mod007-05_standard/self/recent.rb +54 -0
- data/tmpsets/set/mod007-05_standard/self/search.rb +49 -0
- data/tmpsets/set/mod007-05_standard/self/signin.rb +130 -0
- data/tmpsets/set/mod007-05_standard/self/stats.rb +109 -0
- data/tmpsets/set/mod007-05_standard/self/version.rb +15 -0
- data/tmpsets/set/mod007-05_standard/type/basic.rb +52 -0
- data/tmpsets/set/mod007-05_standard/type/cardtype.rb +78 -0
- data/tmpsets/set/mod007-05_standard/type/date.rb +14 -0
- data/tmpsets/set/mod007-05_standard/type/file.rb +103 -0
- data/tmpsets/set/mod007-05_standard/type/image.rb +89 -0
- data/tmpsets/set/mod007-05_standard/type/layout_type.rb +21 -0
- data/tmpsets/set/mod007-05_standard/type/number.rb +25 -0
- data/tmpsets/set/mod007-05_standard/type/phrase.rb +9 -0
- data/tmpsets/set/mod007-05_standard/type/search_type.rb +291 -0
- data/tmpsets/set/mod007-05_standard/type/session.rb +42 -0
- data/tmpsets/set/mod007-05_standard/type/set.rb +354 -0
- data/tmpsets/set/mod007-05_standard/type/signup.rb +150 -0
- data/tmpsets/set/mod007-05_standard/type/toggle.rb +18 -0
- data/tmpsets/set/mod007-05_standard/type/uri.rb +17 -0
- data/tmpsets/set/mod007-05_standard/type/user.rb +78 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb +41 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/helper.rb +150 -0
- data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/wrapper.rb +18 -0
- data/tmpsets/set/mod008-06_bootstrap/all/rich_bootstrap.rb +14 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_cards.rb +15 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb +13 -0
- data/tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb +38 -0
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb +13 -0
- data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb +12 -0
- data/tmpsets/set_pattern/100-all.rb +24 -0
- data/tmpsets/set_pattern/101-all_plus.rb +26 -0
- data/tmpsets/set_pattern/102-type.rb +36 -0
- data/tmpsets/set_pattern/103-star.rb +28 -0
- data/tmpsets/set_pattern/104-rstar.rb +30 -0
- data/tmpsets/set_pattern/105-right.rb +33 -0
- data/tmpsets/set_pattern/106-type_plus_right.rb +36 -0
- data/tmpsets/set_pattern/107-self.rb +32 -0
- metadata +306 -107
- data/mod/05_standard/set/all/attach.rb +0 -164
- data/mod/05_standard/spec/set/all/attach_spec.rb +0 -9
@@ -103,30 +103,13 @@ format :html do
|
|
103
103
|
|
104
104
|
|
105
105
|
view :conflict, :error_code=>409 do |args|
|
106
|
-
# FIXME: hack to get the conflicted update as a proper act for the diff view
|
107
|
-
card.current_act.update_attributes! :card_id => card.id
|
108
|
-
card.current_action.update_attributes! :card_id => card.id, :draft=>true # the unsaved action with the new changes
|
109
|
-
card.store_changes # deletes action if there are no changes
|
110
|
-
|
111
|
-
# as a consequence card.current_act.actions can be empty when both users made exactly the same changes
|
112
|
-
# but an act is always supposed to have at least one action, so we have to delete the act to avoid bad things
|
113
|
-
#card.current_act.reload
|
114
|
-
if card.current_act.actions(true).empty?
|
115
|
-
card.current_act.delete
|
116
|
-
card.current_act = nil
|
117
|
-
end
|
118
|
-
|
119
106
|
wrap args.merge( :slot_class=>'error-view' ) do #ENGLISH below
|
120
107
|
alert 'warning' do
|
121
108
|
%{<strong>Conflict!</strong><span class="new-current-revision-id">#{card.last_action_id}</span>
|
122
109
|
<div>#{ card_link card.last_action.act.actor.cardname } has also been making changes.</div>
|
123
110
|
<div>Please examine below, resolve above, and re-submit.</div>
|
124
111
|
#{ wrap do |args|
|
125
|
-
|
126
|
-
_render_act_expanded :act=>card.current_act, :current_rev_nr => 0
|
127
|
-
else
|
128
|
-
"No difference between your changes and #{card.last_action.act.actor.name}'s version."
|
129
|
-
end
|
112
|
+
_render_act_expanded :act=>card.last_action.act, :current_rev_nr => 0
|
130
113
|
end
|
131
114
|
}
|
132
115
|
}
|
@@ -1,21 +1,23 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
|
1
|
+
# the events method is a developer's tool for visualizing the event order for a given card.
|
2
|
+
# For example, from a console you might run
|
3
|
+
#
|
4
|
+
# puts mycard.events :update
|
5
|
+
#
|
6
|
+
# to see the order of events that will be executed on mycard.
|
7
|
+
# The indention and arrows (^v) indicate event dependencies.
|
8
|
+
#
|
9
|
+
# Note: as of yet, the functionality is a bit rough. It does not display events
|
10
|
+
# that are called directly from within other events (like :stored), and certain event
|
11
|
+
# requirements (like the presence of a "current_act") may prevent events from showing
|
12
|
+
# up in the tree.
|
7
13
|
def events action
|
8
14
|
@action = action
|
9
|
-
|
10
|
-
# don't know what this line is for but it breaks with Rails 4
|
11
|
-
# root = _validate_callbacks + _save_callbacks
|
12
|
-
|
13
|
-
events = [ events_tree(:validation), events_tree(:save)]
|
15
|
+
events = [ events_tree(:validation), events_tree(:save) ]
|
14
16
|
@action = nil
|
15
17
|
puts_events events
|
16
18
|
end
|
17
19
|
|
18
|
-
private
|
20
|
+
#private
|
19
21
|
|
20
22
|
def puts_events events, prefix='', depth=0
|
21
23
|
r = ''
|
@@ -54,13 +56,14 @@ def events_tree filt
|
|
54
56
|
hash[callback.kind] << events_tree( callback.filter )
|
55
57
|
end
|
56
58
|
end
|
59
|
+
|
57
60
|
hash
|
58
61
|
end
|
59
|
-
|
62
|
+
|
60
63
|
|
61
64
|
class ::ActiveSupport::Callbacks::Callback
|
62
65
|
def applies? object
|
63
|
-
|
66
|
+
conditions_lambdas.all? { |c| c.call(object, nil) }
|
64
67
|
end
|
65
68
|
end
|
66
69
|
|
@@ -154,11 +154,10 @@ format :html do
|
|
154
154
|
|
155
155
|
view :edit_rules, :tags=>:unknown_ok do |args|
|
156
156
|
view = args[:rule_view] || :common_rules
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
# end
|
157
|
+
slot_args = {
|
158
|
+
:rule_view=>view, :optional_set_navbar=>:show, :optional_set_label=>:hide, :optional_rule_navbar=>:hide
|
159
|
+
}
|
160
|
+
_render_related args.merge(:related=>{:card=>current_set_card, :view=>:open, :slot=>slot_args})
|
162
161
|
end
|
163
162
|
|
164
163
|
def default_edit_rules_args args
|
@@ -167,13 +166,14 @@ format :html do
|
|
167
166
|
|
168
167
|
view :options, {:view=>:edit_rules, :mod=>All::RichHtml::Editing::HtmlFormat} # for backwards compatibility
|
169
168
|
|
170
|
-
|
171
169
|
view :edit_structure do |args|
|
172
|
-
slot_args = {
|
170
|
+
slot_args = {
|
171
|
+
:cancel_slot_selector=>'.card-slot.related-view',
|
172
|
+
:cancel_path=>card.format.path(:view=>:edit),
|
173
|
+
:optional_edit_toolbar=>:hide,
|
174
|
+
:hidden=>{:success=>{:view=>:open, 'slot[subframe]'=>true}}
|
175
|
+
}
|
173
176
|
render_related args.merge(:related=>{:card=>card.structure, :view=>:edit, :slot=>slot_args})
|
174
|
-
# frame args do
|
175
|
-
# nest card.structure, slot_args.merge(:view=>:edit)
|
176
|
-
# end
|
177
177
|
end
|
178
178
|
|
179
179
|
def default_edit_structure_args args
|
@@ -12,7 +12,7 @@ format :html do
|
|
12
12
|
(wrap_with(:form, :class=>'navbar-form navbar-left') do
|
13
13
|
[
|
14
14
|
(account_split_button(args) if card.accountable?),
|
15
|
-
|
15
|
+
activity_split_button(args),
|
16
16
|
rules_split_button(args),
|
17
17
|
edit_split_button(args),
|
18
18
|
]
|
@@ -32,11 +32,11 @@ format :html do
|
|
32
32
|
|
33
33
|
def active_toolbar_button active_view, args
|
34
34
|
case active_view
|
35
|
-
when :follow, :editors
|
36
|
-
'
|
35
|
+
when :follow, :editors, :history
|
36
|
+
'activity'
|
37
37
|
when :edit_rules, :edit_nest_rules
|
38
38
|
'rules'
|
39
|
-
when :edit, :edit_name, :edit_type, :edit_structure, :edit_nests
|
39
|
+
when :edit, :edit_name, :edit_type, :edit_structure, :edit_nests
|
40
40
|
'edit'
|
41
41
|
when :related
|
42
42
|
if args[:related_card] && (tag=args[:related_card].tag)
|
@@ -45,6 +45,8 @@ format :html do
|
|
45
45
|
'engage'
|
46
46
|
when 'account', 'roles', 'edited', 'created', 'follow'
|
47
47
|
'account'
|
48
|
+
when 'structure'
|
49
|
+
'edit'
|
48
50
|
else
|
49
51
|
'rules'
|
50
52
|
end
|
@@ -61,11 +63,12 @@ format :html do
|
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
64
|
-
def
|
65
|
-
discuss = smart_link 'discuss',
|
66
|
-
editors = smart_link 'editors',
|
67
|
-
toolbar_split_button '
|
66
|
+
def activity_split_button args
|
67
|
+
discuss = smart_link 'discuss', { :related=>Card[:discussion].key }
|
68
|
+
editors = smart_link 'editors', { :related=>Card[:editors].key }
|
69
|
+
toolbar_split_button 'activity', { :view=>:history }, args do
|
68
70
|
{
|
71
|
+
:history => (_render_history_link if card.history?),
|
69
72
|
:discuss => discuss,
|
70
73
|
:follow =>_render_follow_link(args),
|
71
74
|
:editors => editors
|
@@ -80,9 +83,9 @@ format :html do
|
|
80
83
|
nests = smart_link 'nests', {:view => :edit_nest_rules, :slot=>{:rule_view=>:field_related_rules}}
|
81
84
|
toolbar_split_button 'rules', {:view => :edit_rules }, args do
|
82
85
|
{
|
83
|
-
:common_rules
|
84
|
-
:grouped_rules
|
85
|
-
:all_rules
|
86
|
+
:common_rules => common,
|
87
|
+
:grouped_rules => group,
|
88
|
+
:all_rules => all,
|
86
89
|
:separator => (separator if args[:nested_fields].present?),
|
87
90
|
:recent_rules => (recent if recently_edited_settings?),
|
88
91
|
:edit_nest_rules => (nests if args[:nested_fields].present?)
|
@@ -92,13 +95,11 @@ format :html do
|
|
92
95
|
def edit_split_button args
|
93
96
|
toolbar_split_button 'edit', {:view=>:edit}, args do
|
94
97
|
{
|
95
|
-
:edit
|
96
|
-
:edit_nests
|
97
|
-
:
|
98
|
-
:edit_name
|
99
|
-
:edit_type
|
100
|
-
:separator => separator,
|
101
|
-
:history => (_render_history_link if card.history?)
|
98
|
+
:edit => _render_edit_content_link(args),
|
99
|
+
:edit_nests => (_render_edit_nests_link if !card.structure && args[:nested_fields].present?),
|
100
|
+
:structure => (smart_link 'structure', {:view => :edit_structure} if structure_editable?),
|
101
|
+
:edit_name => _render_edit_name_link,
|
102
|
+
:edit_type => _render_edit_type_link,
|
102
103
|
}
|
103
104
|
end
|
104
105
|
end
|
@@ -139,37 +140,38 @@ format :html do
|
|
139
140
|
link_opts[:path_opts] = {:slot=>{:subframe=>true}}
|
140
141
|
end
|
141
142
|
|
142
|
-
link = view_link glyphicon('remove'), :home, link_opts
|
143
|
+
link = view_link glyphicon('remove'), :home, link_opts.merge(:class=>'btn-toolbar-control btn btn-primary')
|
143
144
|
css_class = ['nav navbar-nav', args[:class]].compact.join "\n"
|
144
|
-
|
145
|
+
wrap_with :div, :class=>css_class do
|
146
|
+
[
|
147
|
+
toolbar_pin_button,
|
148
|
+
link
|
149
|
+
]
|
150
|
+
end
|
151
|
+
#list_tag link, :class=>css_class
|
152
|
+
end
|
153
|
+
def toolbar_pin_button
|
154
|
+
button_tag glyphicon('pushpin'), :situation=>:primary, :remote=>true, :title=>"#{'un' if toolbar_pinned?}pin", :class=>"btn-toolbar-control toolbar-pin #{'in' unless toolbar_pinned?}active"
|
145
155
|
end
|
146
156
|
|
147
157
|
view :toolbar_buttons do |args|
|
148
158
|
wrap_with(:div, :class=>'btn-group') do
|
149
159
|
[
|
150
|
-
_optional_render(:related_button, args, :show),
|
151
|
-
toolbar_pin_button,
|
152
160
|
_optional_render(:delete_button, args, (card.ok?(:delete) ? :show : :hide)),
|
153
|
-
_optional_render(:refresh_button, args, :
|
161
|
+
_optional_render(:refresh_button, args, :show),
|
162
|
+
_optional_render(:related_button, args, :show),
|
154
163
|
_optional_render(:history_button, args, :hide),
|
155
164
|
]
|
156
165
|
end
|
157
166
|
end
|
158
167
|
|
159
168
|
|
169
|
+
|
170
|
+
|
160
171
|
view :related_button do |args|
|
161
172
|
path_opts = {:slot=>{:show=>:toolbar}}
|
162
|
-
|
163
|
-
if main?
|
164
|
-
menu_item ' refresh', 'refresh', path_opts.merge(:card=>card), args[:html_args]
|
165
|
-
else
|
166
|
-
menu_item ' page', 'new-window', path_opts.merge(:card=>card), args[:html_args]
|
167
|
-
end
|
168
|
-
|
169
|
-
dropdown_button '', :class=>'related', :icon=>'eye-open' do
|
173
|
+
dropdown_button '', :icon=>'education', :class=>'related' do #, :icon=>'eye-open' do
|
170
174
|
[
|
171
|
-
page_link,
|
172
|
-
separator,
|
173
175
|
menu_item(' children', 'baby-formula', path_opts.merge(:related=>'*children')),
|
174
176
|
menu_item(' mates', 'bed', path_opts.merge(:related=>'*mates')),
|
175
177
|
menu_item(' references out', 'log-out', path_opts.merge(:related=>'*refers_to')),
|
@@ -177,6 +179,13 @@ format :html do
|
|
177
179
|
]
|
178
180
|
end
|
179
181
|
end
|
182
|
+
view :refresh_button do |args|
|
183
|
+
path_opts = {:slot=>{:show=>:toolbar},:page=>card}
|
184
|
+
icon = main? ? 'refresh' : 'new-window'
|
185
|
+
toolbar_button('refresh', icon, 'hidden-xs hidden-sm hidden-md hidden-lg', :path_opts=>path_opts)
|
186
|
+
end
|
187
|
+
|
188
|
+
|
180
189
|
view :delete_button do |args|
|
181
190
|
toolbar_button('delete', 'trash', 'hidden-xs hidden-sm hidden-md hidden-lg',
|
182
191
|
:action=>:delete,
|
@@ -187,9 +196,7 @@ format :html do
|
|
187
196
|
)
|
188
197
|
end
|
189
198
|
|
190
|
-
|
191
|
-
button_tag glyphicon('pushpin'), :situation=>:primary, :remote=>true, :title=>"#{'un' if toolbar_pinned?}pin", :class=>"toolbar-pin #{'in' unless toolbar_pinned?}active"
|
192
|
-
end
|
199
|
+
|
193
200
|
|
194
201
|
def toolbar_button text, symbol, hide=nil, tag_args={}
|
195
202
|
hide ||= 'hidden-xs hidden-sm hidden-md hidden-lg'
|
@@ -210,7 +217,7 @@ format :html do
|
|
210
217
|
end
|
211
218
|
|
212
219
|
def autosaved_draft_link
|
213
|
-
view_link('autosaved draft', :edit, :path_opts=>{:edit_draft=>true, :slot=>{:show=>:
|
220
|
+
view_link('autosaved draft', :edit, :path_opts=>{:edit_draft=>true, :slot=>{:show=>:toolbar}}, :class=>'navbar-link slotter pull-right')
|
214
221
|
end
|
215
222
|
|
216
223
|
|
@@ -74,7 +74,7 @@ end
|
|
74
74
|
event :set_default_salt, :on=>:create, :before=>:process_subcards do
|
75
75
|
salt = Digest::SHA1.hexdigest "--#{Time.now.to_s}--"
|
76
76
|
Env[:salt] = salt # HACK!!! need viable mechanism to get this to password
|
77
|
-
subcards["+#{Card[:salt].name}"] ||= {:content => salt }
|
77
|
+
subcards["+#{Card[:salt].name}"] ||= { :content => salt }
|
78
78
|
end
|
79
79
|
|
80
80
|
event :set_default_status, :on=>:create, :before=>:process_subcards do
|
@@ -11,17 +11,16 @@ view :raw do |args|
|
|
11
11
|
'<em>encrypted</em>'
|
12
12
|
end
|
13
13
|
|
14
|
-
event :encrypt_password, :on=>:save, :after=>:process_subcards
|
14
|
+
event :encrypt_password, :on=>:save, :after=>:process_subcards, :changed=>:content,
|
15
|
+
:when => proc{ |c| !Card::Env[:no_password_encryptions] } do
|
16
|
+
# no_password_encryptions = hack for import - fix with api for ignoring events
|
17
|
+
|
15
18
|
salt = (left && left.salt)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
unless Card::Env[:no_password_encryptions] # hack for import - fix with api for ignoring events
|
22
|
-
self.content = Auth.encrypt content, salt
|
23
|
-
end
|
24
|
-
end
|
19
|
+
salt = Card::Env[:salt] unless salt.present? # hack - fix with better ORM handling
|
20
|
+
self.content = Auth.encrypt content, salt
|
21
|
+
|
22
|
+
# errors.add :password, 'need a valid salt'
|
23
|
+
# turns out we have a lot of existing account without a salt. not sure when that broke??
|
25
24
|
end
|
26
25
|
|
27
26
|
event :validate_password, :on=>:save, :before=>:approve do
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
|
-
def item_names(args={}) # needed for flexmail attachments. hacky.
|
3
|
-
[self.cardname]
|
4
|
-
end
|
1
|
+
include Abstract::Attachment
|
5
2
|
|
3
|
+
set_specific_attributes :file, :remote_file_url
|
4
|
+
mount_uploader :file, FileUploader
|
6
5
|
|
7
6
|
format do
|
8
7
|
view :source do |args|
|
9
|
-
card.
|
8
|
+
card.attachment.url
|
10
9
|
end
|
11
10
|
|
12
11
|
view :core do |args|
|
@@ -24,24 +23,24 @@ format do
|
|
24
23
|
end
|
25
24
|
|
26
25
|
|
26
|
+
|
27
27
|
format :file do
|
28
|
-
|
28
|
+
|
29
29
|
view :core do |args| # returns send_file args. not in love with this...
|
30
30
|
if format = card.attachment_format( params[:format] ) # this means we only support known formats. dislike.
|
31
31
|
if params[:explicit_file] and r = controller.response
|
32
32
|
r.headers["Expires"] = 1.year.from_now.httpdate
|
33
33
|
#r.headers["Cache-Control"] = "public" # currently using default "private", because proxy servers could block needed permission checks
|
34
34
|
end
|
35
|
-
|
36
|
-
|
37
|
-
# elsif ![format, 'file'].member? params[:format] # formerly supported redirecting to correct file format
|
38
|
-
# return redirect_to( request.fullpath.sub( /\.#{params[:format]}\b/, '.' + format ) ) #card.attach.url(style) )
|
39
35
|
|
40
|
-
|
41
|
-
|
36
|
+
# elsif ![format, 'file'].member? params[:format] # formerly supported redirecting to correct file format
|
37
|
+
# return redirect_to( request.fullpath.sub( /\.#{params[:format]}\b/, '.' + format ) ) #card.attachment.url(style) )
|
38
|
+
|
39
|
+
file = selected_file_version
|
40
|
+
[ file.path,
|
42
41
|
{
|
43
|
-
:type =>
|
44
|
-
:filename => "#{card.cardname.
|
42
|
+
:type => file.content_type,
|
43
|
+
:filename => "#{card.cardname.safe_key}#{file.extension}",
|
45
44
|
:x_sendfile => true,
|
46
45
|
:disposition => (params[:format]=='file' ? 'attachment' : 'inline' )
|
47
46
|
}
|
@@ -49,13 +48,17 @@ format :file do
|
|
49
48
|
else
|
50
49
|
_render_not_found
|
51
50
|
end
|
52
|
-
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def selected_file_version
|
54
|
+
card.attachment
|
55
|
+
end
|
53
56
|
|
54
57
|
end
|
55
58
|
|
56
59
|
|
57
60
|
format :html do
|
58
|
-
|
61
|
+
|
59
62
|
view :core do |args|
|
60
63
|
handle_source args do |source|
|
61
64
|
"<a href=\"#{source}\">Download #{ showname args[:title] }</a>"
|
@@ -64,22 +67,31 @@ format :html do
|
|
64
67
|
|
65
68
|
view :editor do |args|
|
66
69
|
#Rails.logger.debug "editor for file #{card.inspect}"
|
67
|
-
|
68
|
-
if !card.new_card?
|
69
|
-
out << %{<div class="attachment-preview" :id="#{card.attach_file_name}-preview"> #{_render_core(args)} </div> }
|
70
|
-
end
|
71
|
-
out << %{
|
72
|
-
<div>#{file_field :attach, :class=>'file-upload slotter'}</div>
|
73
|
-
</div>
|
74
|
-
<div class="chosen-file" style="display:none">
|
75
|
-
<div><label>File chosen:</label> <span class="chosen-filename"></span></div>
|
76
|
-
<div><a class="cancel-upload">Unchoose</a></div>
|
77
|
-
</div>
|
78
|
-
}
|
79
|
-
out
|
70
|
+
file_chooser args
|
80
71
|
end
|
81
|
-
|
82
|
-
end
|
83
72
|
|
73
|
+
def file_chooser args, db_column=:file
|
74
|
+
preview =
|
75
|
+
if !card.new_card?
|
76
|
+
content_tag :div, _render_core(args).html_safe,
|
77
|
+
:class=>'attachment-preview', :id=>"#{card.attachment.filename}-preview"
|
78
|
+
end
|
79
|
+
|
80
|
+
<<-HTML
|
81
|
+
<div class="choose-file">
|
82
|
+
#{preview}
|
83
|
+
<div>#{file_field db_column, :class=>'file-upload slotter'}</div>
|
84
|
+
</div>
|
85
|
+
<div class="chosen-file" style="display:none">
|
86
|
+
<div>
|
87
|
+
<label>File chosen:</label>
|
88
|
+
<span class="chosen-filename"></span>
|
89
|
+
</div>
|
90
|
+
<div><a class="cancel-upload">Unchoose</a></div>
|
91
|
+
</div>
|
92
|
+
HTML
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
84
96
|
|
85
97
|
|