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
@@ -0,0 +1,98 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class Card; module Set; module All; module RichHtml; module Modal; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/modal.rb ~~~~~~~~~~~
|
3
|
+
format :html do
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
view :modal_link do |args|
|
9
|
+
path_opts = args[:path_opts] || {}
|
10
|
+
path_opts.merge!(:layout=>:modal)
|
11
|
+
html_args = args[:html_args] || {}
|
12
|
+
#html_args.merge!('data-target'=>"#modal-#{card.cardname.safe_key}#{args[:modal_slot_id_postfix]}",
|
13
|
+
html_args.merge!('data-target'=>"#modal-main-slot",
|
14
|
+
'data-toggle'=>'modal')
|
15
|
+
link_to(args[:text] || _render_title(args), path(path_opts), html_args)
|
16
|
+
end
|
17
|
+
|
18
|
+
view :modal_slot do |args|
|
19
|
+
#wrap_with(:div, :class=>'modal fade', :role=>'dialog', :id=>"modal-#{card.cardname.safe_key}#{args[:modal_slot_id_postfix]}") do
|
20
|
+
id = "modal-"
|
21
|
+
id += (args[:modal_id] || 'main-slot')
|
22
|
+
wrap_with(:div, :class=>'modal fade', :role=>'dialog', :id=>id) do
|
23
|
+
wrap_with(:div, :class=>'modal-dialog') do
|
24
|
+
content_tag :div, :class=>'modal-content' do
|
25
|
+
''
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
view :modal_menu, :tags=>:unknown_ok do |args|
|
33
|
+
popout_params = {}
|
34
|
+
popout_params[:view] = params[:view] if params[:view]
|
35
|
+
# we probably want to pass on a lot more params than just view, but not all of them
|
36
|
+
# (eg we don't want layout, id, controller...)
|
37
|
+
wrap_with :div, :class=>'modal-menu' do
|
38
|
+
[
|
39
|
+
link_to( glyphicon('remove'), '', :class=>'close-modal pull-right close', 'data-dismiss'=>'modal'),
|
40
|
+
link_to( glyphicon('new-window'), popout_params, :class=>'pop-out-modal pull-right close ' )
|
41
|
+
]
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
view :modal_footer, :tags=>:unknown_ok do |args|
|
46
|
+
args[:buttons] || ''
|
47
|
+
end
|
48
|
+
|
49
|
+
def default_modal_footer_args args
|
50
|
+
args[:buttons] ||= button_tag 'Close', :class=>'btn-xs close-modal pull-right', 'data-dismiss'=>'modal'
|
51
|
+
end
|
52
|
+
|
53
|
+
=begin
|
54
|
+
def default_modal_content_args args
|
55
|
+
args[:buttons] ||= button_tag 'Close', 'data-dismiss'=>'modal'
|
56
|
+
end
|
57
|
+
|
58
|
+
view :modal_link_and_dialog do |args|
|
59
|
+
_render_modal_link(args) + _render_modal(args)
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
# use modal_content for ajax calls to fill a modal_slot with content
|
65
|
+
view :modal_content do |args|
|
66
|
+
output [
|
67
|
+
wrap_with( :div, _render_modal_header(args), :class=>'modal-header' ),
|
68
|
+
wrap_with( :div, _render_modal_body(args), :class=>'modal-body' ),
|
69
|
+
wrap_with( :div, _render_modal_footer(args), :class=>'modal-footer' ),
|
70
|
+
]
|
71
|
+
end
|
72
|
+
|
73
|
+
view :modal_header do |args|
|
74
|
+
_render_modal_title(args)
|
75
|
+
end
|
76
|
+
|
77
|
+
view :modal_body do |args|
|
78
|
+
_render_core(args)
|
79
|
+
end
|
80
|
+
|
81
|
+
view :modal_footer do |args|
|
82
|
+
args[:buttons] || ''
|
83
|
+
end
|
84
|
+
|
85
|
+
view :modal_title do |args|
|
86
|
+
"<h4>#{_render_title args.merge(:title_class=>'modal-title')}</h4>"
|
87
|
+
end
|
88
|
+
|
89
|
+
view :modal do |args|
|
90
|
+
_render_modal_slot args.merge(:optional_modal_content=>:show)
|
91
|
+
end
|
92
|
+
=end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/modal.rb ~~~~~~~~~~~
|
98
|
+
end;end;end;end;end;
|
@@ -0,0 +1,271 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class Card; module Set; module All; module RichHtml; module Toolbar; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/toolbar.rb ~~~~~~~~~~~
|
3
|
+
|
4
|
+
format :html do
|
5
|
+
def toolbar_pinned?
|
6
|
+
Card[:toolbar_pinned].content == 'true'
|
7
|
+
end
|
8
|
+
|
9
|
+
view :toolbar do |args|
|
10
|
+
navbar "toolbar-#{card.cardname.safe_key}-#{args[:home_view]}", :toggle_align=>:left, :class=>"slotter toolbar", :navbar_type=>'inverse',
|
11
|
+
:collapsed_content=>close_link(args.merge(:class=>'pull-right visible-xs')) do
|
12
|
+
[
|
13
|
+
close_link(args.merge(:class=>'hidden-xs navbar-right')),
|
14
|
+
(wrap_with(:form, :class=>'navbar-form navbar-left') do
|
15
|
+
[
|
16
|
+
(account_split_button(args) if card.accountable?),
|
17
|
+
activity_split_button(args),
|
18
|
+
rules_split_button(args),
|
19
|
+
edit_split_button(args),
|
20
|
+
]
|
21
|
+
end),
|
22
|
+
(wrap_with(:form, :class=>'navbar-form navbar-right') do
|
23
|
+
content_tag :div, :class=>'form-group' do
|
24
|
+
_optional_render(:toolbar_buttons, args, :show)
|
25
|
+
end
|
26
|
+
end)
|
27
|
+
]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
def default_toolbar_args args
|
31
|
+
args[:nested_fields] = nested_fields(args)
|
32
|
+
args[:active_toolbar_button] ||= active_toolbar_button @slot_view, args
|
33
|
+
end
|
34
|
+
|
35
|
+
def active_toolbar_button active_view, args
|
36
|
+
case active_view
|
37
|
+
when :follow, :editors, :history
|
38
|
+
'activity'
|
39
|
+
when :edit_rules, :edit_nest_rules
|
40
|
+
'rules'
|
41
|
+
when :edit, :edit_name, :edit_type, :edit_structure, :edit_nests
|
42
|
+
'edit'
|
43
|
+
when :related
|
44
|
+
if args[:related_card] && (tag=args[:related_card].tag)
|
45
|
+
case tag.codename
|
46
|
+
when 'discussion', 'editors'
|
47
|
+
'engage'
|
48
|
+
when 'account', 'roles', 'edited', 'created', 'follow'
|
49
|
+
'account'
|
50
|
+
when 'structure'
|
51
|
+
'edit'
|
52
|
+
else
|
53
|
+
'rules'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
|
60
|
+
def toolbar_view_title view
|
61
|
+
if view == :edit_rules
|
62
|
+
current_set_card.name
|
63
|
+
else
|
64
|
+
{:edit=>'content', :edit_name=>'name', :edit_type=>'type', :edit_structure=>'structure', :edit_nests=>'nests', :history=>'history', :common_rules=>'common', :recent_rules=>'recent', :grouped_rules=>'all', :edit_nest_rules=>'nests'}[view]
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def activity_split_button args
|
69
|
+
discuss = smart_link 'discuss', { :related=>Card[:discussion].key }
|
70
|
+
editors = smart_link 'editors', { :related=>Card[:editors].key }
|
71
|
+
toolbar_split_button 'activity', { :view=>:history }, args do
|
72
|
+
{
|
73
|
+
:history => (_render_history_link if card.history?),
|
74
|
+
:discuss => discuss,
|
75
|
+
:follow =>_render_follow_link(args),
|
76
|
+
:editors => editors
|
77
|
+
}
|
78
|
+
end
|
79
|
+
end
|
80
|
+
def rules_split_button args
|
81
|
+
recent = smart_link 'recent', {:view => :edit_rules, :slot=>{:rule_view=>:recent_rules}}
|
82
|
+
common = smart_link 'common', {:view => :edit_rules, :slot=>{:rule_view=>:common_rules}}
|
83
|
+
group = smart_link 'by group', {:view => :edit_rules, :slot=>{:rule_view=>:grouped_rules}}
|
84
|
+
all = smart_link 'by name', {:view => :edit_rules, :slot=>{:rule_view=>:all_rules}}
|
85
|
+
nests = smart_link 'nests', {:view => :edit_nest_rules, :slot=>{:rule_view=>:field_related_rules}}
|
86
|
+
toolbar_split_button 'rules', {:view => :edit_rules }, args do
|
87
|
+
{
|
88
|
+
:common_rules => common,
|
89
|
+
:grouped_rules => group,
|
90
|
+
:all_rules => all,
|
91
|
+
:separator => (separator if args[:nested_fields].present?),
|
92
|
+
:recent_rules => (recent if recently_edited_settings?),
|
93
|
+
:edit_nest_rules => (nests if args[:nested_fields].present?)
|
94
|
+
}
|
95
|
+
end
|
96
|
+
end
|
97
|
+
def edit_split_button args
|
98
|
+
toolbar_split_button 'edit', {:view=>:edit}, args do
|
99
|
+
{
|
100
|
+
:edit => _render_edit_content_link(args),
|
101
|
+
:edit_nests => (_render_edit_nests_link if !card.structure && args[:nested_fields].present?),
|
102
|
+
:structure => (smart_link 'structure', {:view => :edit_structure} if structure_editable?),
|
103
|
+
:edit_name => _render_edit_name_link,
|
104
|
+
:edit_type => _render_edit_type_link,
|
105
|
+
}
|
106
|
+
end
|
107
|
+
end
|
108
|
+
def account_split_button args
|
109
|
+
toolbar_split_button 'account', {:related=>Card[:account].key}, args do
|
110
|
+
{
|
111
|
+
:account => smart_link('details',{:related=>{:name=>"#{card.name}+#{Card[:account].key}", :view=>:edit}}),
|
112
|
+
:roles => smart_link('roles', {:related=>Card[:roles].key}),
|
113
|
+
:created => smart_link('created',{:related=>Card[:created].key}),
|
114
|
+
:edited => smart_link('edited', {:related=>Card[:edited].key}),
|
115
|
+
:follow => smart_link('follow', {:related=>Card[:follow].key})
|
116
|
+
}
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
def toolbar_split_button name, button_args, args
|
122
|
+
button = button_link name, button_args, :class=>('active' if args[:active_toolbar_button] == name)
|
123
|
+
active_item =
|
124
|
+
if @slot_view == :related
|
125
|
+
if args[:rule_view]
|
126
|
+
args[:rule_view].to_sym
|
127
|
+
elsif args[:related_card] && (r = args[:related_card].right) && (cn = r.codename)
|
128
|
+
cn.to_sym
|
129
|
+
end
|
130
|
+
else
|
131
|
+
@slot_view
|
132
|
+
end
|
133
|
+
split_button button, args.merge(:active_item=>active_item) do
|
134
|
+
yield
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
|
139
|
+
def close_link args
|
140
|
+
link_opts = {:title=>'cancel'}
|
141
|
+
if args[:subslot]
|
142
|
+
link_opts[:path_opts] = {:slot=>{:subframe=>true}}
|
143
|
+
end
|
144
|
+
|
145
|
+
link = view_link glyphicon('remove'), :home, link_opts.merge(:class=>'btn-toolbar-control btn btn-primary')
|
146
|
+
css_class = ['nav navbar-nav', args[:class]].compact.join "\n"
|
147
|
+
wrap_with :div, :class=>css_class do
|
148
|
+
[
|
149
|
+
toolbar_pin_button,
|
150
|
+
link
|
151
|
+
]
|
152
|
+
end
|
153
|
+
#list_tag link, :class=>css_class
|
154
|
+
end
|
155
|
+
def toolbar_pin_button
|
156
|
+
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"
|
157
|
+
end
|
158
|
+
|
159
|
+
view :toolbar_buttons do |args|
|
160
|
+
wrap_with(:div, :class=>'btn-group') do
|
161
|
+
[
|
162
|
+
_optional_render(:delete_button, args, (card.ok?(:delete) ? :show : :hide)),
|
163
|
+
_optional_render(:refresh_button, args, :show),
|
164
|
+
_optional_render(:related_button, args, :show),
|
165
|
+
_optional_render(:history_button, args, :hide),
|
166
|
+
]
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
view :related_button do |args|
|
174
|
+
path_opts = {:slot=>{:show=>:toolbar}}
|
175
|
+
dropdown_button '', :icon=>'education', :class=>'related' do #, :icon=>'eye-open' do
|
176
|
+
[
|
177
|
+
menu_item(' children', 'baby-formula', path_opts.merge(:related=>'*children')),
|
178
|
+
menu_item(' mates', 'bed', path_opts.merge(:related=>'*mates')),
|
179
|
+
menu_item(' references out', 'log-out', path_opts.merge(:related=>'*refers_to')),
|
180
|
+
menu_item(' references in', 'log-in', path_opts.merge(:related=>'*referred_to_by'))
|
181
|
+
]
|
182
|
+
end
|
183
|
+
end
|
184
|
+
view :refresh_button do |args|
|
185
|
+
path_opts = {:slot=>{:show=>:toolbar},:page=>card}
|
186
|
+
icon = main? ? 'refresh' : 'new-window'
|
187
|
+
toolbar_button('refresh', icon, 'hidden-xs hidden-sm hidden-md hidden-lg', :path_opts=>path_opts)
|
188
|
+
end
|
189
|
+
|
190
|
+
|
191
|
+
view :delete_button do |args|
|
192
|
+
toolbar_button('delete', 'trash', 'hidden-xs hidden-sm hidden-md hidden-lg',
|
193
|
+
:action=>:delete,
|
194
|
+
:class => 'slotter',
|
195
|
+
:remote => true,
|
196
|
+
:path_opts=> {:success => main? ? 'REDIRECT: *previous' : "TEXT: #{card.name} deleted"},
|
197
|
+
:'data-confirm' => "Are you sure you want to delete #{card.name}?"
|
198
|
+
)
|
199
|
+
end
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
def toolbar_button text, symbol, hide=nil, tag_args={}
|
204
|
+
hide ||= 'hidden-xs hidden-sm hidden-md hidden-lg'
|
205
|
+
tag_args[:class] = [ tag_args[:class], 'btn btn-primary' ].compact * ' '
|
206
|
+
tag_args[:title] ||= text
|
207
|
+
link_text = "#{glyphicon symbol}<span class='menu-item-label #{hide}'>#{text}</span>"
|
208
|
+
|
209
|
+
if cardname = tag_args.delete(:page)
|
210
|
+
card_link cardname, :class=>klass, :text=>link_text
|
211
|
+
elsif viewname = tag_args.delete(:view)
|
212
|
+
tag_args[:path_opts] ||= {:slot=>{:show=>:toolbar}}
|
213
|
+
view_link link_text, viewname, tag_args
|
214
|
+
else
|
215
|
+
path_opts = tag_args.delete(:path_opts) || {}
|
216
|
+
path_opts.merge! :action=>tag_args.delete(:action) if tag_args[:action]
|
217
|
+
link_to link_text, path_opts, tag_args
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
def autosaved_draft_link
|
222
|
+
view_link('autosaved draft', :edit, :path_opts=>{:edit_draft=>true, :slot=>{:show=>:toolbar}}, :class=>'navbar-link slotter pull-right')
|
223
|
+
end
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
def default_edit_content_link_args args
|
228
|
+
args[:title] ||= 'content'
|
229
|
+
end
|
230
|
+
view :edit_content_link do |args|
|
231
|
+
toolbar_view_link :edit, args
|
232
|
+
end
|
233
|
+
def default_edit_name_link_args args
|
234
|
+
args[:title] ||= 'name'
|
235
|
+
end
|
236
|
+
view :edit_name_link do |args|
|
237
|
+
toolbar_view_link :edit_name, args
|
238
|
+
end
|
239
|
+
def default_edit_type_link_args args
|
240
|
+
args[:title] ||= 'type'
|
241
|
+
end
|
242
|
+
view :edit_type_link do |args|
|
243
|
+
toolbar_view_link :edit_type, args
|
244
|
+
end
|
245
|
+
def default_history_link_args args
|
246
|
+
args[:title] ||= 'history'
|
247
|
+
end
|
248
|
+
view :history_link do |args|
|
249
|
+
toolbar_view_link :history, args
|
250
|
+
end
|
251
|
+
def default_edit_nests_link_args args
|
252
|
+
args[:title] ||= 'nests'
|
253
|
+
end
|
254
|
+
view :edit_nests_link do |args|
|
255
|
+
toolbar_view_link :edit_nests, args
|
256
|
+
end
|
257
|
+
|
258
|
+
def toolbar_view_link view, args
|
259
|
+
text = args.delete(:title)
|
260
|
+
view_link text, view, args
|
261
|
+
end
|
262
|
+
|
263
|
+
|
264
|
+
def recently_edited_settings?
|
265
|
+
(rs = Card[:recent_settings]) && rs.item_names.present?
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
|
270
|
+
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/toolbar.rb ~~~~~~~~~~~
|
271
|
+
end;end;end;end;end;
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
class Card; module Set; module All; module RichHtml; module Wrapper; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/wrapper.rb ~~~~~~~~~~~
|
3
|
+
format :html do
|
4
|
+
def slot_options args
|
5
|
+
@@slot_option_keys ||= Card::Chunk::Include.options.reject { |k| k == :view }.unshift :home_view
|
6
|
+
options_hash = {}
|
7
|
+
|
8
|
+
if @context_names.present?
|
9
|
+
options_hash['name_context'] = @context_names.map( &:key ) * ','
|
10
|
+
end
|
11
|
+
|
12
|
+
options_hash[:subslot] = 'true' if args[:subslot]
|
13
|
+
|
14
|
+
@@slot_option_keys.inject(options_hash) do |hash, opt|
|
15
|
+
hash[opt] = args[opt] if args[opt].present?
|
16
|
+
hash
|
17
|
+
end
|
18
|
+
|
19
|
+
JSON( options_hash )
|
20
|
+
end
|
21
|
+
|
22
|
+
def wrap args = {}
|
23
|
+
@slot_view = @current_view
|
24
|
+
classes = [
|
25
|
+
( 'card-slot' unless args[:no_slot] ),
|
26
|
+
"#{ @current_view }-view",
|
27
|
+
( args[:slot_class] if args[:slot_class] ),
|
28
|
+
( "STRUCTURE-#{args[:structure].to_name.key}" if args[:structure]),
|
29
|
+
card.safe_set_keys
|
30
|
+
].compact.join ' '
|
31
|
+
data = {
|
32
|
+
'card-id' => card.id,
|
33
|
+
'card-name' => h(card.name),
|
34
|
+
'slot' => html_escape_except_quotes(slot_options( args ))
|
35
|
+
}
|
36
|
+
div =
|
37
|
+
content_tag :div, output(yield).html_safe,
|
38
|
+
:id=>card.cardname.url_key, :data=>data, :style=>h(args[:style]), :class=>classes
|
39
|
+
|
40
|
+
if params[:debug] == 'slot' && !tagged( @current_view, :no_wrap_comments )
|
41
|
+
name = h card.name
|
42
|
+
space = ' ' * @depth
|
43
|
+
%{<!--\n\n#{ space }BEGIN SLOT: #{ name }\n\n-->#{ div }<!--\n\n#{space}END SLOT: #{ name }\n\n-->}
|
44
|
+
else
|
45
|
+
div
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def wrap_body args={}
|
50
|
+
css_classes = [ 'card-body' ]
|
51
|
+
css_classes << args[:body_class] if args[:body_class]
|
52
|
+
css_classes += [ 'card-content', card.safe_set_keys ] if args[:content]
|
53
|
+
content_tag :div, :class=>css_classes.compact*' ' do
|
54
|
+
yield args
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def panel args={}
|
59
|
+
wrap_with :div, :class=>"card-frame #{args[:panel_class]}" do
|
60
|
+
output(yield)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def frame args={}, &block
|
65
|
+
if args[:subframe]
|
66
|
+
args.delete(:panel_class)
|
67
|
+
subframe args, &block
|
68
|
+
else
|
69
|
+
show_subheader = show_view?(:toolbar, args.merge(:default_visibility=>:hide)) && @current_view != :related && @current_view != :open
|
70
|
+
wrap args do
|
71
|
+
[
|
72
|
+
_optional_render( :menu, args ),
|
73
|
+
panel(args) do
|
74
|
+
[
|
75
|
+
_optional_render( :header, args, :show),
|
76
|
+
_optional_render( :subheader, args,(show_subheader ? :show : :hide)),
|
77
|
+
_optional_render( :help, args.merge(:help_class=>'alert alert-info'), :hide),
|
78
|
+
wrap_body(args) { output( block.call(args) ) } ,
|
79
|
+
]
|
80
|
+
end
|
81
|
+
]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def subframe args={}
|
87
|
+
wrap args do
|
88
|
+
[
|
89
|
+
_optional_render( :menu, args.merge(:optional_horizontal_menu=>:hide) ),
|
90
|
+
_optional_render( :subheader, args, :show),
|
91
|
+
_optional_render( :help, args.merge(:help_class=>'alert alert-info'), :hide),
|
92
|
+
panel(args) do
|
93
|
+
[
|
94
|
+
_optional_render( :header, args, :hide),
|
95
|
+
wrap_body(args) { output( yield args ) } ,
|
96
|
+
]
|
97
|
+
end
|
98
|
+
]
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def frame_and_form action, args={}, form_opts={}
|
103
|
+
form_opts.merge! args.delete(:form_opts) if args[:form_opts]
|
104
|
+
form_opts[:hidden] = args.delete(:hidden)
|
105
|
+
frame args do
|
106
|
+
card_form action, form_opts do
|
107
|
+
output( yield args )
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
# alert_types: 'success', 'info', 'warning', 'danger'
|
114
|
+
def alert alert_type, args={}
|
115
|
+
css_class = "alert alert-#{alert_type} "
|
116
|
+
css_class += 'alert-dismissible ' if args[:dismissible]
|
117
|
+
css_class += args[:alert_class] if args[:alert_class]
|
118
|
+
close_button = args[:dismissible] ? %{
|
119
|
+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
120
|
+
<span aria-hidden="true">×</span>
|
121
|
+
</button>
|
122
|
+
} : ''
|
123
|
+
content_tag :div, :class=>css_class, :role=>'alert' do
|
124
|
+
close_button + output( yield args)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
def wrap_main(content)
|
129
|
+
return content if Env.ajax? || params[:layout]=='none'
|
130
|
+
%{<div id="main">#{content}</div>}
|
131
|
+
end
|
132
|
+
|
133
|
+
def wrap_with tag, content_or_args={}, html_args={}
|
134
|
+
if block_given?
|
135
|
+
content_tag( tag, content_or_args ) do
|
136
|
+
output( yield ).html_safe
|
137
|
+
end
|
138
|
+
else
|
139
|
+
content_tag( tag, html_args ) do
|
140
|
+
output( content_or_args ).html_safe
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def wrap_each_with tag, content_or_args={}, args={}
|
146
|
+
content = block_given? ? yield(args) : content_or_args
|
147
|
+
args = block_given? ? content_or_args : args
|
148
|
+
content.compact.map do |item|
|
149
|
+
wrap_with tag, args do
|
150
|
+
item
|
151
|
+
end
|
152
|
+
end.join "\n"
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
|
157
|
+
# ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/wrapper.rb ~~~~~~~~~~~
|
158
|
+
end;end;end;end;end;
|