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
data/mod/06_bootstrap/file/{journal_skin/original-image.png → journal_skin_image/image-original.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{journal_skin/small-image.png → journal_skin_image/image-small.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{lumen_skin/medium-image.png → lumen_skin_image/image-medium.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{lumen_skin/original-image.png → lumen_skin_image/image-original.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{paper_skin/medium-image.png → paper_skin_image/image-medium.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{paper_skin/original-image.png → paper_skin_image/image-original.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{readable_skin/icon-image.png → readable_skin_image/image-icon.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{readable_skin/large-image.png → readable_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{readable_skin/medium-image.png → readable_skin_image/image-medium.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{readable_skin/small-image.png → readable_skin_image/image-small.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{sandstone_skin/icon-image.png → sandstone_skin_image/image-icon.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{sandstone_skin/large-image.png → sandstone_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{sandstone_skin/medium-image.png → sandstone_skin_image/image-medium.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{sandstone_skin/small-image.png → sandstone_skin_image/image-small.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{simplex_skin/icon-image.png → simplex_skin_image/image-icon.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{simplex_skin/large-image.png → simplex_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{simplex_skin/medium-image.png → simplex_skin_image/image-medium.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{simplex_skin/original-image.png → simplex_skin_image/image-original.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{simplex_skin/small-image.png → simplex_skin_image/image-small.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{slate_skin/medium-image.png → slate_skin_image/image-medium.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{slate_skin/original-image.png → slate_skin_image/image-original.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{spacelab_skin/icon-image.png → spacelab_skin_image/image-icon.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{spacelab_skin/large-image.png → spacelab_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{spacelab_skin/medium-image.png → spacelab_skin_image/image-medium.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{spacelab_skin/small-image.png → spacelab_skin_image/image-small.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{superhero_skin/icon-image.png → superhero_skin_image/image-icon.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{superhero_skin/large-image.png → superhero_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{superhero_skin/medium-image.png → superhero_skin_image/image-medium.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{superhero_skin/small-image.png → superhero_skin_image/image-small.png}
RENAMED
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{united_skin/large-image.png → united_skin_image/image-large.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{united_skin/medium-image.png → united_skin_image/image-medium.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{united_skin/original-image.png → united_skin_image/image-original.png}
RENAMED
File without changes
|
data/mod/06_bootstrap/file/{united_skin/small-image.png → united_skin_image/image-small.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/mod/06_bootstrap/file/{yeti_skin/original-image.png → yeti_skin_image/image-original.png}
RENAMED
File without changes
|
File without changes
|
@@ -145,8 +145,10 @@ body.mceContentBody {
|
|
145
145
|
font-style: italic;
|
146
146
|
}
|
147
147
|
|
148
|
-
.TYPE-image.card-content
|
149
|
-
|
148
|
+
.TYPE-image.card-content, .TYPE-image .card-body {
|
149
|
+
img {
|
150
|
+
max-width: 100%;
|
151
|
+
}
|
150
152
|
}
|
151
153
|
|
152
154
|
/*---------( Search ) ---------- */
|
@@ -223,5 +225,5 @@ body.mceContentBody {
|
|
223
225
|
.modal-menu .close{
|
224
226
|
font-size: 16px;
|
225
227
|
margin-left: 10px;
|
226
|
-
|
228
|
+
|
227
229
|
}
|
@@ -161,7 +161,14 @@ describe Card::Reference do
|
|
161
161
|
expect(Card['beta'].referees.map(&:name)).to eq(['alpha'])
|
162
162
|
expect(Card['alpha'].referencers.map(&:name)).to eq(['beta'])
|
163
163
|
end
|
164
|
-
|
164
|
+
|
165
|
+
it "query" do
|
166
|
+
Card.create :type=>'Search', :name=>'search with references',
|
167
|
+
:content=>'{"name":"X", "right_plus":["Y",{"content":["in","A","B"]}]}'
|
168
|
+
expect(Card['Y'].referencers.map(&:name)).to include('search with references')
|
169
|
+
expect(Card['search with references'].referees.map(&:name).sort).to eq ["A","B","X","Y"]
|
170
|
+
end
|
171
|
+
|
165
172
|
it "should handle commented inclusion" do
|
166
173
|
c = Card.create :name=>'inclusion comment test', :content=>'{{## hi mom }}'
|
167
174
|
expect(c.errors.any?).to be_falsey
|
data/tmpsets/README.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class Card; module Set; module All; module ActiveCard; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/active_card.rb ~~~~~~~~~~~
|
3
|
+
=begin
|
4
|
+
|
5
|
+
# following may be useful, but is neither tested nor in use
|
6
|
+
|
7
|
+
def card_attributes
|
8
|
+
if Card::Set.traits
|
9
|
+
set_modules.each do |mod|
|
10
|
+
if mod_traits = Card::Set.traits[mod]
|
11
|
+
return mod_traits
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def trait_var? var_name
|
19
|
+
!instance_variable_get( var_name ).nil?
|
20
|
+
end
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
def trait_var var_name, &block
|
25
|
+
# FIXME - following optimization attempt needs to handle cache clearing!
|
26
|
+
# instance_variable_get var_name or begin
|
27
|
+
# instance_variable_set var_name, block_given? ? yield : raise("no block?")
|
28
|
+
# end
|
29
|
+
yield
|
30
|
+
end
|
31
|
+
|
32
|
+
#fixme -this needs a better home!
|
33
|
+
def format opts={}
|
34
|
+
opts = { :format=>opts.to_sym } if [Symbol, String].member? opts.class
|
35
|
+
|
36
|
+
Card::Format.new self, opts
|
37
|
+
end
|
38
|
+
|
39
|
+
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/active_card.rb ~~~~~~~~~~~
|
40
|
+
end;end;end;end;
|
@@ -0,0 +1,348 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class Card; module Set; module All; module Collection; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/collection.rb ~~~~~~~~~~~
|
3
|
+
|
4
|
+
module ClassMethods
|
5
|
+
def search spec
|
6
|
+
query = ::Card::Query.new(spec)
|
7
|
+
Card.with_logging :search, :message=>spec, :details=>query.sql.strip do
|
8
|
+
results = query.run
|
9
|
+
if block_given? and Array===results
|
10
|
+
results.each { |result| yield result }
|
11
|
+
end
|
12
|
+
results
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def count_by_wql(spec)
|
17
|
+
spec = spec.clone
|
18
|
+
spec.delete(:offset)
|
19
|
+
search spec.merge(:return=>'count')
|
20
|
+
end
|
21
|
+
|
22
|
+
def find_each(options = {})
|
23
|
+
#this is a copy from rails (3.2.16) and is needed because this is performed by a relation (ActiveRecord::Relation)
|
24
|
+
find_in_batches(options) do |records|
|
25
|
+
records.each { |record| yield record }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def find_in_batches(options = {})
|
30
|
+
if block_given?
|
31
|
+
super(options) do |records|
|
32
|
+
yield(records)
|
33
|
+
Card::Cache.reset_global
|
34
|
+
end
|
35
|
+
else
|
36
|
+
super(options)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def item_names(args={})
|
42
|
+
format._render_raw.split /[,\n]/
|
43
|
+
end
|
44
|
+
|
45
|
+
def item_cards(args={}) ## FIXME this is inconsistent with item_names
|
46
|
+
[self]
|
47
|
+
end
|
48
|
+
|
49
|
+
def item_type
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def item_keys args={}
|
54
|
+
item_names(args).map do |item|
|
55
|
+
item.to_name.key
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def include_item? item
|
60
|
+
key = if Card === item
|
61
|
+
item.cardname.key
|
62
|
+
else
|
63
|
+
item.to_name.key
|
64
|
+
end
|
65
|
+
item_names.map{|name| name.to_name.key}.member? key
|
66
|
+
end
|
67
|
+
|
68
|
+
def add_item item
|
69
|
+
unless include_item? item
|
70
|
+
self.content="#{self.content}\n#{name}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def drop_item item
|
75
|
+
if include_item? item
|
76
|
+
new_names = item_names.reject{ |i| i == item }
|
77
|
+
self.content = new_names.empty? ? '' : new_names.join("\n")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def insert_item index, name
|
82
|
+
new_names = item_names
|
83
|
+
new_names.delete(name)
|
84
|
+
new_names.insert(index,name)
|
85
|
+
self.content = new_names.join "\n"
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
def extended_item_cards context = nil
|
90
|
+
context = (context ? context.cardname : self.cardname)
|
91
|
+
args={ :limit=>'' }
|
92
|
+
items = self.item_cards(args.merge(:context=>context))
|
93
|
+
extended_list = []
|
94
|
+
already_extended = ::Set.new # avoid loops
|
95
|
+
|
96
|
+
while items.size > 0
|
97
|
+
item = items.shift
|
98
|
+
if already_extended.include? item
|
99
|
+
next
|
100
|
+
elsif item.item_cards == [item] # no further level of items
|
101
|
+
extended_list << item
|
102
|
+
already_extended << item
|
103
|
+
else
|
104
|
+
items.unshift(*item.item_cards) # keep items in order
|
105
|
+
already_extended << item
|
106
|
+
end
|
107
|
+
end
|
108
|
+
extended_list
|
109
|
+
end
|
110
|
+
|
111
|
+
def extended_item_contents context = nil
|
112
|
+
extended_item_cards(context).map(&:item_names).flatten
|
113
|
+
end
|
114
|
+
|
115
|
+
def extended_list context = nil
|
116
|
+
context = (context ? context.cardname : self.cardname)
|
117
|
+
args={ :limit=>'' }
|
118
|
+
self.item_cards(args.merge(:context=>context)).map do |x|
|
119
|
+
x.item_cards(args)
|
120
|
+
end.flatten.map do |x|
|
121
|
+
x.item_cards(args)
|
122
|
+
end.flatten.map do |y|
|
123
|
+
y.item_names(args)
|
124
|
+
end.flatten
|
125
|
+
# this could go on and on. more elegant to recurse until you don't have a collection
|
126
|
+
end
|
127
|
+
|
128
|
+
def contextual_content context_card, format_args={}, view_args={}
|
129
|
+
context_card.format(format_args).process_content(
|
130
|
+
self.format(format_args)._render_raw(view_args), view_args
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
format do
|
135
|
+
|
136
|
+
def item_links(args={})
|
137
|
+
raw(render_core).split /[,\n]/
|
138
|
+
end
|
139
|
+
|
140
|
+
def item_view args
|
141
|
+
args[:item] || (@inclusion_opts && @inclusion_opts[:view]) || default_item_view
|
142
|
+
end
|
143
|
+
|
144
|
+
def item_args args
|
145
|
+
i_args = { :view => item_view(args)}
|
146
|
+
if type = card.item_type
|
147
|
+
i_args[:type] = type
|
148
|
+
end
|
149
|
+
i_args
|
150
|
+
end
|
151
|
+
|
152
|
+
def search_params
|
153
|
+
@search_params ||= begin
|
154
|
+
p = default_search_params.clone
|
155
|
+
|
156
|
+
if focal?
|
157
|
+
p[:offset] = params[:offset] if params[:offset]
|
158
|
+
p[:limit] = params[:limit] if params[:limit]
|
159
|
+
p.merge! params[:wql] if params[:wql]
|
160
|
+
end
|
161
|
+
p
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
def default_search_params # wahh?
|
166
|
+
set_default_search_params
|
167
|
+
end
|
168
|
+
|
169
|
+
def set_default_search_params overrides={}
|
170
|
+
@default_search_params ||= begin
|
171
|
+
p = { :default_limit=> 100 }.merge overrides
|
172
|
+
set_search_params_variables! p
|
173
|
+
p
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def set_search_params_variables! hash
|
178
|
+
hash[:vars] = params[:vars] || {}
|
179
|
+
params.each do |key,val|
|
180
|
+
case key.to_s
|
181
|
+
when '_wql' ; hash.merge! val
|
182
|
+
when /^\_(\w+)$/ ; hash[:vars][$1.to_sym] = val
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
|
188
|
+
def each_reference_with_args args={}
|
189
|
+
Card::Content.new(_render_raw(args), card).find_chunks( Card::Chunk::Reference ).each do |chunk|
|
190
|
+
yield(chunk.referee_name.to_s, nest_args(args,chunk))
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
|
195
|
+
def each_nested_chunk args={}
|
196
|
+
Card::Content.new(_render_raw(args), card).find_chunks( Card::Chunk::Include).each do |chunk|
|
197
|
+
yield(chunk) if chunk.referee_name # filter commented nests
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
|
202
|
+
def nested_fields args={}
|
203
|
+
result = []
|
204
|
+
each_nested_field(args) do |chunk|
|
205
|
+
result << chunk
|
206
|
+
end
|
207
|
+
result
|
208
|
+
end
|
209
|
+
|
210
|
+
def unique_chunks chunk, processed_set, &block
|
211
|
+
if !processed_set.include? chunk.referee_name.key
|
212
|
+
processed_set << chunk.referee_name.key
|
213
|
+
block.call(chunk)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def each_nested_field args, &block
|
218
|
+
processed_chunk_keys = ::Set.new([card.key])
|
219
|
+
|
220
|
+
each_nested_chunk(args) do |chunk|
|
221
|
+
# TODO handle structures that are non-virtual
|
222
|
+
if chunk.referee_name.to_name.is_a_field_of? card.name
|
223
|
+
if chunk.referee_card && chunk.referee_card.virtual? && !processed_chunk_keys.include?(chunk.referee_name.key)
|
224
|
+
processed_chunk_keys << chunk.referee_name.key
|
225
|
+
subformat(chunk.referee_card).each_nested_field(args) do |sub_chunk|
|
226
|
+
unique_chunks sub_chunk, processed_chunk_keys, &block
|
227
|
+
end
|
228
|
+
else
|
229
|
+
unique_chunks chunk, processed_chunk_keys, &block
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
def map_references_with_args args={}, &block
|
237
|
+
result = []
|
238
|
+
each_reference_with_args args do |name, n_args|
|
239
|
+
result << block.call(name, n_args)
|
240
|
+
end
|
241
|
+
result
|
242
|
+
end
|
243
|
+
|
244
|
+
# process args for links and nests
|
245
|
+
def nest_args args, chunk=nil
|
246
|
+
r_args = item_args(args)
|
247
|
+
if @inclusion_opts
|
248
|
+
r_args.merge! @inclusion_opts.clone
|
249
|
+
end
|
250
|
+
if chunk.kind_of? Card::Chunk::Include
|
251
|
+
r_args.merge!(chunk.options)
|
252
|
+
elsif chunk.kind_of? Card::Chunk::Link
|
253
|
+
r_args.reverse_merge!(:view=>:link)
|
254
|
+
r_args.reverse_merge!(:title=>chunk.link_text) if chunk.link_text
|
255
|
+
end
|
256
|
+
r_args
|
257
|
+
end
|
258
|
+
|
259
|
+
end
|
260
|
+
|
261
|
+
|
262
|
+
format :html do
|
263
|
+
view :count do |args|
|
264
|
+
card.item_names(args).size
|
265
|
+
end
|
266
|
+
|
267
|
+
view :tabs do |args|
|
268
|
+
tab_buttons = ''
|
269
|
+
tab_panes = ''
|
270
|
+
active_tab = true
|
271
|
+
each_reference_with_args(:item=>:content) do |name, nest_args|
|
272
|
+
id = "#{card.cardname.safe_key}-#{name.to_name.safe_key}"
|
273
|
+
url = nest_path name, nest_args
|
274
|
+
tab_name = nest_args[:title] || name
|
275
|
+
tab_buttons += tab_button( "##{id}", tab_name, active_tab, 'data-url'=>url.html_safe, :class=>(active_tab ? nil : 'load'))
|
276
|
+
|
277
|
+
# only render the first active tab, other tabs get loaded via ajax
|
278
|
+
tab_content = active_tab ? nest(Card.fetch(name, :new=>{}), nest_args) : ''
|
279
|
+
tab_panes += tab_pane( id, tab_content, active_tab )
|
280
|
+
active_tab = false
|
281
|
+
end
|
282
|
+
tab_panel tab_buttons, tab_panes, args[:tab_type]
|
283
|
+
end
|
284
|
+
def default_tabs_args args
|
285
|
+
args[:tab_type] ||= 'tabs'
|
286
|
+
end
|
287
|
+
|
288
|
+
|
289
|
+
# create a path for a nest with respect ot the inclusion options
|
290
|
+
def nest_path name, nest_args
|
291
|
+
path_args = {}
|
292
|
+
path_args[:view] = nest_args[:view]
|
293
|
+
path_args[:slot] = nest_args.clone
|
294
|
+
path_args[:slot].delete(:view)
|
295
|
+
page_path(name, path_args)
|
296
|
+
end
|
297
|
+
|
298
|
+
view :pills, :view=>:tabs
|
299
|
+
def default_pills_args args
|
300
|
+
args[:tab_type] ||= 'pills'
|
301
|
+
end
|
302
|
+
|
303
|
+
view :tabs_static do |args|
|
304
|
+
tab_buttons = ''
|
305
|
+
tab_panes = ''
|
306
|
+
card.item_cards.each_with_index do |item, index|
|
307
|
+
id = "#{card.cardname.safe_key}-#{item.cardname.safe_key}"
|
308
|
+
tab_buttons += tab_button( "##{id}", item.name, index == 0 )
|
309
|
+
tab_content = nest item, item_args(args)
|
310
|
+
tab_panes += tab_pane( id, tab_content, index == 0 )
|
311
|
+
end
|
312
|
+
tab_panel tab_buttons, tab_panes, args[:tab_type]
|
313
|
+
end
|
314
|
+
def default_tabs_static_args args
|
315
|
+
args[:tab_type] ||= 'tabs'
|
316
|
+
end
|
317
|
+
|
318
|
+
view :pills_static, :view=>:tabs
|
319
|
+
def default_tabs_static_args args
|
320
|
+
args[:tab_type] ||= 'pills'
|
321
|
+
end
|
322
|
+
|
323
|
+
def tab_panel tab_buttons, tab_panes, tab_type='tabs'
|
324
|
+
wrap_with :div, :role=>"tabpanel" do
|
325
|
+
[
|
326
|
+
content_tag(:ul, tab_buttons.html_safe, :class=>"nav nav-#{tab_type}", :role=>"tablist"),
|
327
|
+
content_tag(:div, tab_panes.html_safe, :class=>'tab-content')
|
328
|
+
]
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
def tab_button target, text, active=false, link_attr={}
|
333
|
+
link = link_to fancy_title(text), target, link_attr.merge('role'=>'tab','data-toggle'=>'tab')
|
334
|
+
li_args = { :role => :presentation }
|
335
|
+
li_args[:class] = 'active' if active
|
336
|
+
content_tag :li, link, li_args
|
337
|
+
end
|
338
|
+
|
339
|
+
def tab_pane id, content, active=false
|
340
|
+
div_args = {:role => :tabpanel, :id=>id, :class=>"tab-pane #{'active' if active}"}
|
341
|
+
content_tag :div, content.html_safe, div_args
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/01_core/set/all/collection.rb ~~~~~~~~~~~
|
348
|
+
end;end;end;end;
|