card 1.16.1 → 1.16.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (372) hide show
  1. checksums.yaml +4 -4
  2. data/.yardoc/checksums +60 -0
  3. data/.yardoc/object_types +0 -0
  4. data/.yardoc/objects/root.dat +0 -0
  5. data/.yardoc/proxy_types +0 -0
  6. data/.yardopts +6 -0
  7. data/README_Developers.rdoc +100 -0
  8. data/VERSION +1 -1
  9. data/card.gemspec +18 -18
  10. data/db/migrate/20150724210803_add_comment_to_actions.rb +5 -0
  11. data/db/migrate_core_cards/20150724123438_update_file_and_image_cards.rb +70 -0
  12. data/db/migrate_core_cards/20150807205221_create_references_for_search_cards.rb +10 -0
  13. data/db/migrate_core_cards/data/1.12_stylesheets/common.scss +4 -2
  14. data/db/schema.rb +2 -1
  15. data/db/seed/new/card_actions.yml +2334 -12538
  16. data/db/seed/new/card_acts.yml +1 -1
  17. data/db/seed/new/card_changes.yml +7384 -38929
  18. data/db/seed/new/card_references.yml +207 -207
  19. data/db/seed/new/cards.yml +1364 -1440
  20. data/db/seed/test/fixtures/card_actions.yml +3285 -13219
  21. data/db/seed/test/fixtures/card_acts.yml +107 -107
  22. data/db/seed/test/fixtures/card_changes.yml +10830 -42375
  23. data/db/seed/test/fixtures/card_references.yml +393 -393
  24. data/db/seed/test/fixtures/cards.yml +1701 -1777
  25. data/db/version.txt +1 -1
  26. data/db/version_core_cards.txt +1 -1
  27. data/lib/card.rb +13 -3
  28. data/lib/card/chunk.rb +22 -15
  29. data/lib/card/content.rb +9 -8
  30. data/lib/card/diff.rb +79 -79
  31. data/lib/card/loader.rb +33 -33
  32. data/lib/card/name.rb +8 -0
  33. data/lib/card/set.rb +44 -17
  34. data/lib/card/set_pattern.rb +8 -0
  35. data/lib/cardio.rb +19 -3
  36. data/mod/01_core/chunk/link.rb +7 -6
  37. data/mod/01_core/chunk/query_reference.rb +65 -0
  38. data/mod/01_core/set/all/content.rb +1 -1
  39. data/mod/01_core/set/all/fetch.rb +15 -7
  40. data/mod/01_core/set/all/initialize.rb +4 -3
  41. data/mod/01_core/set/all/phases.rb +12 -8
  42. data/mod/01_core/set/all/references.rb +12 -6
  43. data/mod/01_core/set/all/rules.rb +14 -11
  44. data/mod/01_core/set/all/states.rb +2 -1
  45. data/mod/01_core/set/all/tracked_attributes.rb +14 -0
  46. data/mod/01_core/spec/set/all/collection_spec.rb +5 -5
  47. data/mod/01_core/spec/set/all/name_spec.rb +6 -6
  48. data/mod/01_history/lib/card/act.rb +2 -2
  49. data/mod/01_history/lib/card/action.rb +11 -2
  50. data/mod/01_history/set/all/actions.rb +4 -3
  51. data/mod/01_history/set/all/content_history.rb +1 -1
  52. data/mod/01_history/set/all/history.rb +55 -66
  53. data/mod/02_basic_types/set/all/file.rb +26 -3
  54. data/mod/02_basic_types/set/type/pointer.rb +13 -14
  55. data/mod/02_basic_types/spec/set/all/file_spec.rb +0 -1
  56. data/mod/03_machines/lib/card/machine.rb +4 -4
  57. data/mod/03_machines/lib/javascript/wagn_mod.js.coffee +4 -17
  58. data/mod/03_machines/lib/stylesheets/style_cards.scss +5 -0
  59. data/mod/03_machines/set/right/machine_input.rb +3 -0
  60. data/mod/03_machines/set/right/machine_output.rb +4 -0
  61. data/mod/04_settings/lib/card/setting.rb +2 -1
  62. data/mod/04_settings/set/abstract/permission.rb +95 -0
  63. data/mod/04_settings/set/right/comment.rb +2 -90
  64. data/mod/04_settings/set/right/create.rb +2 -2
  65. data/mod/04_settings/set/right/delete.rb +2 -3
  66. data/mod/04_settings/set/right/read.rb +3 -2
  67. data/mod/04_settings/set/right/update.rb +3 -2
  68. data/mod/04_settings/set/self/recent_settings.rb +3 -0
  69. data/mod/04_settings/set/type/setting.rb +9 -1
  70. data/mod/05_email/set/all/notify.rb +2 -1
  71. data/mod/05_email/set/type/email_template.rb +17 -17
  72. data/mod/05_standard/file/credit_image/image-icon.png +0 -0
  73. data/mod/05_standard/file/credit_image/image-large.png +0 -0
  74. data/mod/05_standard/file/credit_image/image-medium.png +0 -0
  75. data/mod/05_standard/file/credit_image/image-original.png +0 -0
  76. data/mod/05_standard/file/credit_image/image-small.png +0 -0
  77. data/mod/05_standard/file/favicon/{icon-image.png → image-icon.png} +0 -0
  78. data/mod/05_standard/file/favicon/{large-image.png → image-large.png} +0 -0
  79. data/mod/05_standard/file/favicon/{medium-image.png → image-medium.png} +0 -0
  80. data/mod/05_standard/file/favicon/{original-image.png → image-original.png} +0 -0
  81. data/mod/05_standard/file/favicon/{small-image.png → image-small.png} +0 -0
  82. data/mod/05_standard/file/logo/{icon-image.png → image-icon.png} +0 -0
  83. data/mod/05_standard/file/logo/{large-image.png → image-large.png} +0 -0
  84. data/mod/05_standard/file/logo/{medium-image.png → image-medium.png} +0 -0
  85. data/mod/05_standard/file/logo/{original-image.png → image-original.png} +0 -0
  86. data/mod/05_standard/file/logo/{small-image.png → image-small.png} +0 -0
  87. data/mod/05_standard/lib/carrier_wave/cardmount.rb +79 -0
  88. data/mod/05_standard/lib/file_uploader.rb +127 -0
  89. data/mod/05_standard/lib/image_uploader.rb +35 -0
  90. data/mod/05_standard/set/abstract/attachment.rb +85 -0
  91. data/mod/05_standard/set/all/error.rb +1 -18
  92. data/mod/05_standard/set/all/event_viz.rb +17 -14
  93. data/mod/05_standard/set/all/rich_html/editing.rb +10 -10
  94. data/mod/05_standard/set/all/rich_html/toolbar.rb +44 -37
  95. data/mod/05_standard/set/right/account.rb +1 -1
  96. data/mod/05_standard/set/right/password.rb +9 -10
  97. data/mod/05_standard/set/self/recent.rb +1 -1
  98. data/mod/05_standard/set/type/file.rb +43 -31
  99. data/mod/05_standard/set/type/image.rb +22 -6
  100. data/mod/05_standard/set/type/search_type.rb +4 -2
  101. data/mod/05_standard/set/type/session.rb +7 -5
  102. data/mod/05_standard/set/type/set.rb +3 -1
  103. data/mod/05_standard/spec/set/all/history_spec.rb +1 -1
  104. data/mod/05_standard/spec/set/type/cardtype_spec.rb +3 -3
  105. data/mod/05_standard/spec/set/type/file_spec.rb +85 -1
  106. data/mod/05_standard/spec/set/type/image_spec.rb +89 -5
  107. data/mod/05_standard/spec/set/type/search_type_spec.rb +16 -1
  108. data/mod/06_bootstrap/file/{cerulean_skin/icon-image.png → cerulean_skin_image/image-icon.png} +0 -0
  109. data/mod/06_bootstrap/file/{cerulean_skin/large-image.png → cerulean_skin_image/image-large.png} +0 -0
  110. data/mod/06_bootstrap/file/{cerulean_skin/medium-image.png → cerulean_skin_image/image-medium.png} +0 -0
  111. data/mod/06_bootstrap/file/{cerulean_skin/original-image.png → cerulean_skin_image/image-original.png} +0 -0
  112. data/mod/06_bootstrap/file/{cerulean_skin/small-image.png → cerulean_skin_image/image-small.png} +0 -0
  113. data/mod/06_bootstrap/file/{cosmo_skin/icon-image.png → cosmo_skin_image/image-icon.png} +0 -0
  114. data/mod/06_bootstrap/file/{cosmo_skin/large-image.png → cosmo_skin_image/image-large.png} +0 -0
  115. data/mod/06_bootstrap/file/{cosmo_skin/medium-image.png → cosmo_skin_image/image-medium.png} +0 -0
  116. data/mod/06_bootstrap/file/{cosmo_skin/original-image.png → cosmo_skin_image/image-original.png} +0 -0
  117. data/mod/06_bootstrap/file/{cosmo_skin/small-image.png → cosmo_skin_image/image-small.png} +0 -0
  118. data/mod/06_bootstrap/file/{cyborg_skin/icon-image.png → cyborg_skin_image/image-icon.png} +0 -0
  119. data/mod/06_bootstrap/file/{cyborg_skin/large-image.png → cyborg_skin_image/image-large.png} +0 -0
  120. data/mod/06_bootstrap/file/{cyborg_skin/medium-image.png → cyborg_skin_image/image-medium.png} +0 -0
  121. data/mod/06_bootstrap/file/{cyborg_skin/original-image.png → cyborg_skin_image/image-original.png} +0 -0
  122. data/mod/06_bootstrap/file/{cyborg_skin/small-image.png → cyborg_skin_image/image-small.png} +0 -0
  123. data/mod/06_bootstrap/file/{darkly_skin/icon-image.png → darkly_skin_image/image-icon.png} +0 -0
  124. data/mod/06_bootstrap/file/{darkly_skin/large-image.png → darkly_skin_image/image-large.png} +0 -0
  125. data/mod/06_bootstrap/file/{darkly_skin/medium-image.png → darkly_skin_image/image-medium.png} +0 -0
  126. data/mod/06_bootstrap/file/{darkly_skin/original-image.png → darkly_skin_image/image-original.png} +0 -0
  127. data/mod/06_bootstrap/file/{darkly_skin/small-image.png → darkly_skin_image/image-small.png} +0 -0
  128. data/mod/06_bootstrap/file/{flatly_skin/icon-image.png → flatly_skin_image/image-icon.png} +0 -0
  129. data/mod/06_bootstrap/file/{flatly_skin/large-image.png → flatly_skin_image/image-large.png} +0 -0
  130. data/mod/06_bootstrap/file/{flatly_skin/medium-image.png → flatly_skin_image/image-medium.png} +0 -0
  131. data/mod/06_bootstrap/file/{flatly_skin/original-image.png → flatly_skin_image/image-original.png} +0 -0
  132. data/mod/06_bootstrap/file/{flatly_skin/small-image.png → flatly_skin_image/image-small.png} +0 -0
  133. data/mod/06_bootstrap/file/{journal_skin/icon-image.png → journal_skin_image/image-icon.png} +0 -0
  134. data/mod/06_bootstrap/file/{journal_skin/large-image.png → journal_skin_image/image-large.png} +0 -0
  135. data/mod/06_bootstrap/file/{journal_skin/medium-image.png → journal_skin_image/image-medium.png} +0 -0
  136. data/mod/06_bootstrap/file/{journal_skin/original-image.png → journal_skin_image/image-original.png} +0 -0
  137. data/mod/06_bootstrap/file/{journal_skin/small-image.png → journal_skin_image/image-small.png} +0 -0
  138. data/mod/06_bootstrap/file/{lumen_skin/icon-image.png → lumen_skin_image/image-icon.png} +0 -0
  139. data/mod/06_bootstrap/file/{lumen_skin/large-image.png → lumen_skin_image/image-large.png} +0 -0
  140. data/mod/06_bootstrap/file/{lumen_skin/medium-image.png → lumen_skin_image/image-medium.png} +0 -0
  141. data/mod/06_bootstrap/file/{lumen_skin/original-image.png → lumen_skin_image/image-original.png} +0 -0
  142. data/mod/06_bootstrap/file/{lumen_skin/small-image.png → lumen_skin_image/image-small.png} +0 -0
  143. data/mod/06_bootstrap/file/{paper_skin/icon-image.png → paper_skin_image/image-icon.png} +0 -0
  144. data/mod/06_bootstrap/file/{paper_skin/large-image.png → paper_skin_image/image-large.png} +0 -0
  145. data/mod/06_bootstrap/file/{paper_skin/medium-image.png → paper_skin_image/image-medium.png} +0 -0
  146. data/mod/06_bootstrap/file/{paper_skin/original-image.png → paper_skin_image/image-original.png} +0 -0
  147. data/mod/06_bootstrap/file/{paper_skin/small-image.png → paper_skin_image/image-small.png} +0 -0
  148. data/mod/06_bootstrap/file/{readable_skin/icon-image.png → readable_skin_image/image-icon.png} +0 -0
  149. data/mod/06_bootstrap/file/{readable_skin/large-image.png → readable_skin_image/image-large.png} +0 -0
  150. data/mod/06_bootstrap/file/{readable_skin/medium-image.png → readable_skin_image/image-medium.png} +0 -0
  151. data/mod/06_bootstrap/file/{readable_skin/original-image.png → readable_skin_image/image-original.png} +0 -0
  152. data/mod/06_bootstrap/file/{readable_skin/small-image.png → readable_skin_image/image-small.png} +0 -0
  153. data/mod/06_bootstrap/file/{sandstone_skin/icon-image.png → sandstone_skin_image/image-icon.png} +0 -0
  154. data/mod/06_bootstrap/file/{sandstone_skin/large-image.png → sandstone_skin_image/image-large.png} +0 -0
  155. data/mod/06_bootstrap/file/{sandstone_skin/medium-image.png → sandstone_skin_image/image-medium.png} +0 -0
  156. data/mod/06_bootstrap/file/{sandstone_skin/original-image.png → sandstone_skin_image/image-original.png} +0 -0
  157. data/mod/06_bootstrap/file/{sandstone_skin/small-image.png → sandstone_skin_image/image-small.png} +0 -0
  158. data/mod/06_bootstrap/file/{simplex_skin/icon-image.png → simplex_skin_image/image-icon.png} +0 -0
  159. data/mod/06_bootstrap/file/{simplex_skin/large-image.png → simplex_skin_image/image-large.png} +0 -0
  160. data/mod/06_bootstrap/file/{simplex_skin/medium-image.png → simplex_skin_image/image-medium.png} +0 -0
  161. data/mod/06_bootstrap/file/{simplex_skin/original-image.png → simplex_skin_image/image-original.png} +0 -0
  162. data/mod/06_bootstrap/file/{simplex_skin/small-image.png → simplex_skin_image/image-small.png} +0 -0
  163. data/mod/06_bootstrap/file/{slate_skin/icon-image.png → slate_skin_image/image-icon.png} +0 -0
  164. data/mod/06_bootstrap/file/{slate_skin/large-image.png → slate_skin_image/image-large.png} +0 -0
  165. data/mod/06_bootstrap/file/{slate_skin/medium-image.png → slate_skin_image/image-medium.png} +0 -0
  166. data/mod/06_bootstrap/file/{slate_skin/original-image.png → slate_skin_image/image-original.png} +0 -0
  167. data/mod/06_bootstrap/file/{slate_skin/small-image.png → slate_skin_image/image-small.png} +0 -0
  168. data/mod/06_bootstrap/file/{spacelab_skin/icon-image.png → spacelab_skin_image/image-icon.png} +0 -0
  169. data/mod/06_bootstrap/file/{spacelab_skin/large-image.png → spacelab_skin_image/image-large.png} +0 -0
  170. data/mod/06_bootstrap/file/{spacelab_skin/medium-image.png → spacelab_skin_image/image-medium.png} +0 -0
  171. data/mod/06_bootstrap/file/{spacelab_skin/original-image.png → spacelab_skin_image/image-original.png} +0 -0
  172. data/mod/06_bootstrap/file/{spacelab_skin/small-image.png → spacelab_skin_image/image-small.png} +0 -0
  173. data/mod/06_bootstrap/file/{superhero_skin/icon-image.png → superhero_skin_image/image-icon.png} +0 -0
  174. data/mod/06_bootstrap/file/{superhero_skin/large-image.png → superhero_skin_image/image-large.png} +0 -0
  175. data/mod/06_bootstrap/file/{superhero_skin/medium-image.png → superhero_skin_image/image-medium.png} +0 -0
  176. data/mod/06_bootstrap/file/{superhero_skin/original-image.png → superhero_skin_image/image-original.png} +0 -0
  177. data/mod/06_bootstrap/file/{superhero_skin/small-image.png → superhero_skin_image/image-small.png} +0 -0
  178. data/mod/06_bootstrap/file/{united_skin/icon-image.png → united_skin_image/image-icon.png} +0 -0
  179. data/mod/06_bootstrap/file/{united_skin/large-image.png → united_skin_image/image-large.png} +0 -0
  180. data/mod/06_bootstrap/file/{united_skin/medium-image.png → united_skin_image/image-medium.png} +0 -0
  181. data/mod/06_bootstrap/file/{united_skin/original-image.png → united_skin_image/image-original.png} +0 -0
  182. data/mod/06_bootstrap/file/{united_skin/small-image.png → united_skin_image/image-small.png} +0 -0
  183. data/mod/06_bootstrap/file/{yeti_skin/icon-image.png → yeti_skin_image/image-icon.png} +0 -0
  184. data/mod/06_bootstrap/file/{yeti_skin/large-image.png → yeti_skin_image/image-large.png} +0 -0
  185. data/mod/06_bootstrap/file/{yeti_skin/medium-image.png → yeti_skin_image/image-medium.png} +0 -0
  186. data/mod/06_bootstrap/file/{yeti_skin/original-image.png → yeti_skin_image/image-original.png} +0 -0
  187. data/mod/06_bootstrap/file/{yeti_skin/small-image.png → yeti_skin_image/image-small.png} +0 -0
  188. data/mod/06_bootstrap/lib/stylesheets/bootstrap_cards.scss +5 -3
  189. data/spec/lib/card/reference_spec.rb +8 -1
  190. data/tmpsets/README.md +2 -0
  191. data/tmpsets/set/mod001-01_core/all/active_card.rb +40 -0
  192. data/tmpsets/set/mod001-01_core/all/collection.rb +348 -0
  193. data/tmpsets/set/mod001-01_core/all/content.rb +68 -0
  194. data/tmpsets/set/mod001-01_core/all/erb.rb +17 -0
  195. data/tmpsets/set/mod001-01_core/all/fetch.rb +242 -0
  196. data/tmpsets/set/mod001-01_core/all/haml.rb +13 -0
  197. data/tmpsets/set/mod001-01_core/all/initialize.rb +56 -0
  198. data/tmpsets/set/mod001-01_core/all/name.rb +279 -0
  199. data/tmpsets/set/mod001-01_core/all/pattern.rb +62 -0
  200. data/tmpsets/set/mod001-01_core/all/permissions.rb +289 -0
  201. data/tmpsets/set/mod001-01_core/all/phases.rb +187 -0
  202. data/tmpsets/set/mod001-01_core/all/references.rb +130 -0
  203. data/tmpsets/set/mod001-01_core/all/rules.rb +324 -0
  204. data/tmpsets/set/mod001-01_core/all/states.rb +28 -0
  205. data/tmpsets/set/mod001-01_core/all/templating.rb +132 -0
  206. data/tmpsets/set/mod001-01_core/all/tracked_attributes.rb +136 -0
  207. data/tmpsets/set/mod001-01_core/all/trash.rb +56 -0
  208. data/tmpsets/set/mod001-01_core/all/type.rb +91 -0
  209. data/tmpsets/set/mod001-01_core/all/utils.rb +162 -0
  210. data/tmpsets/set/mod001-01_core/all/view_cache.rb +14 -0
  211. data/tmpsets/set/mod002-01_history/all/actions.rb +54 -0
  212. data/tmpsets/set/mod002-01_history/all/content_history.rb +140 -0
  213. data/tmpsets/set/mod002-01_history/all/history.rb +341 -0
  214. data/tmpsets/set/mod003-02_basic_types/all/all_css.rb +48 -0
  215. data/tmpsets/set/mod003-02_basic_types/all/all_csv.rb +58 -0
  216. data/tmpsets/set/mod003-02_basic_types/all/all_js.rb +13 -0
  217. data/tmpsets/set/mod003-02_basic_types/all/base.rb +128 -0
  218. data/tmpsets/set/mod003-02_basic_types/all/file.rb +42 -0
  219. data/tmpsets/set/mod003-02_basic_types/all/json.rb +72 -0
  220. data/tmpsets/set/mod003-02_basic_types/all/rss.rb +78 -0
  221. data/tmpsets/set/mod003-02_basic_types/all/text.rb +14 -0
  222. data/tmpsets/set/mod003-02_basic_types/type/html.rb +33 -0
  223. data/tmpsets/set/mod003-02_basic_types/type/plain_text.rb +16 -0
  224. data/tmpsets/set/mod003-02_basic_types/type/pointer.rb +358 -0
  225. data/tmpsets/set/mod004-03_machines/right/machine_input.rb +8 -0
  226. data/tmpsets/set/mod004-03_machines/right/machine_output.rb +30 -0
  227. data/tmpsets/set/mod004-03_machines/self/script_ace.rb +18 -0
  228. data/tmpsets/set/mod004-03_machines/self/script_card_menu.rb +17 -0
  229. data/tmpsets/set/mod004-03_machines/self/script_html5shiv_printshiv.rb +8 -0
  230. data/tmpsets/set/mod004-03_machines/self/script_jquery.rb +8 -0
  231. data/tmpsets/set/mod004-03_machines/self/script_jquery_helper.rb +18 -0
  232. data/tmpsets/set/mod004-03_machines/self/script_slot.rb +13 -0
  233. data/tmpsets/set/mod004-03_machines/self/script_tinymce.rb +8 -0
  234. data/tmpsets/set/mod004-03_machines/self/style_bootstrap_compatible.rb +11 -0
  235. data/tmpsets/set/mod004-03_machines/self/style_cards.rb +12 -0
  236. data/tmpsets/set/mod004-03_machines/self/style_jquery_ui_smoothness.rb +9 -0
  237. data/tmpsets/set/mod004-03_machines/type/coffee_script.rb +67 -0
  238. data/tmpsets/set/mod004-03_machines/type/css.rb +55 -0
  239. data/tmpsets/set/mod004-03_machines/type/java_script.rb +43 -0
  240. data/tmpsets/set/mod004-03_machines/type/scss.rb +28 -0
  241. data/tmpsets/set/mod004-03_machines/type/skin.rb +18 -0
  242. data/tmpsets/set/mod005-04_settings/abstract/permission.rb +101 -0
  243. data/tmpsets/set/mod005-04_settings/right/add_help.rb +17 -0
  244. data/tmpsets/set/mod005-04_settings/right/comment.rb +9 -0
  245. data/tmpsets/set/mod005-04_settings/right/create.rb +9 -0
  246. data/tmpsets/set/mod005-04_settings/right/default.rb +9 -0
  247. data/tmpsets/set/mod005-04_settings/right/delete.rb +9 -0
  248. data/tmpsets/set/mod005-04_settings/right/help.rb +9 -0
  249. data/tmpsets/set/mod005-04_settings/right/read.rb +9 -0
  250. data/tmpsets/set/mod005-04_settings/right/script.rb +16 -0
  251. data/tmpsets/set/mod005-04_settings/right/structure.rb +16 -0
  252. data/tmpsets/set/mod005-04_settings/right/style.rb +16 -0
  253. data/tmpsets/set/mod005-04_settings/right/update.rb +9 -0
  254. data/tmpsets/set/mod005-04_settings/self/accountable.rb +9 -0
  255. data/tmpsets/set/mod005-04_settings/self/add_help.rb +8 -0
  256. data/tmpsets/set/mod005-04_settings/self/autoname.rb +8 -0
  257. data/tmpsets/set/mod005-04_settings/self/captcha.rb +8 -0
  258. data/tmpsets/set/mod005-04_settings/self/create.rb +8 -0
  259. data/tmpsets/set/mod005-04_settings/self/default.rb +8 -0
  260. data/tmpsets/set/mod005-04_settings/self/delete.rb +8 -0
  261. data/tmpsets/set/mod005-04_settings/self/help.rb +8 -0
  262. data/tmpsets/set/mod005-04_settings/self/input.rb +7 -0
  263. data/tmpsets/set/mod005-04_settings/self/layout.rb +8 -0
  264. data/tmpsets/set/mod005-04_settings/self/on_create.rb +8 -0
  265. data/tmpsets/set/mod005-04_settings/self/on_delete.rb +8 -0
  266. data/tmpsets/set/mod005-04_settings/self/on_update.rb +8 -0
  267. data/tmpsets/set/mod005-04_settings/self/options.rb +8 -0
  268. data/tmpsets/set/mod005-04_settings/self/options_label.rb +8 -0
  269. data/tmpsets/set/mod005-04_settings/self/read.rb +8 -0
  270. data/tmpsets/set/mod005-04_settings/self/recent_settings.rb +8 -0
  271. data/tmpsets/set/mod005-04_settings/self/script.rb +8 -0
  272. data/tmpsets/set/mod005-04_settings/self/structure.rb +8 -0
  273. data/tmpsets/set/mod005-04_settings/self/style.rb +8 -0
  274. data/tmpsets/set/mod005-04_settings/self/table_of_contents.rb +8 -0
  275. data/tmpsets/set/mod005-04_settings/self/thanks.rb +8 -0
  276. data/tmpsets/set/mod005-04_settings/self/update.rb +8 -0
  277. data/tmpsets/set/mod005-04_settings/type/setting.rb +96 -0
  278. data/tmpsets/set/mod006-05_email/all/email_html.rb +11 -0
  279. data/tmpsets/set/mod006-05_email/all/email_text.rb +11 -0
  280. data/tmpsets/set/mod006-05_email/all/follow.rb +260 -0
  281. data/tmpsets/set/mod006-05_email/all/notify.rb +244 -0
  282. data/tmpsets/set/mod006-05_email/all/observer.rb +33 -0
  283. data/tmpsets/set/mod006-05_email/right/bcc.rb +51 -0
  284. data/tmpsets/set/mod006-05_email/right/cc.rb +9 -0
  285. data/tmpsets/set/mod006-05_email/right/follow.rb +90 -0
  286. data/tmpsets/set/mod006-05_email/right/follow_fields.rb +8 -0
  287. data/tmpsets/set/mod006-05_email/right/followers.rb +35 -0
  288. data/tmpsets/set/mod006-05_email/right/following.rb +58 -0
  289. data/tmpsets/set/mod006-05_email/right/from.rb +9 -0
  290. data/tmpsets/set/mod006-05_email/right/html_message.rb +9 -0
  291. data/tmpsets/set/mod006-05_email/right/to.rb +9 -0
  292. data/tmpsets/set/mod006-05_email/self/always.rb +20 -0
  293. data/tmpsets/set/mod006-05_email/self/created.rb +27 -0
  294. data/tmpsets/set/mod006-05_email/self/edited.rb +30 -0
  295. data/tmpsets/set/mod006-05_email/self/follow.rb +8 -0
  296. data/tmpsets/set/mod006-05_email/self/follow_defaults.rb +71 -0
  297. data/tmpsets/set/mod006-05_email/self/never.rb +21 -0
  298. data/tmpsets/set/mod006-05_email/type/email_template.rb +119 -0
  299. data/tmpsets/set/mod006-05_email/type_plus_right/user/follow.rb +182 -0
  300. data/tmpsets/set/mod007-05_standard/abstract/attachment.rb +91 -0
  301. data/tmpsets/set/mod007-05_standard/all/account.rb +73 -0
  302. data/tmpsets/set/mod007-05_standard/all/comment.rb +45 -0
  303. data/tmpsets/set/mod007-05_standard/all/error.rb +198 -0
  304. data/tmpsets/set/mod007-05_standard/all/event_viz.rb +75 -0
  305. data/tmpsets/set/mod007-05_standard/all/links.rb +153 -0
  306. data/tmpsets/set/mod007-05_standard/all/rich_html/content.rb +248 -0
  307. data/tmpsets/set/mod007-05_standard/all/rich_html/editing.rb +216 -0
  308. data/tmpsets/set/mod007-05_standard/all/rich_html/form.rb +238 -0
  309. data/tmpsets/set/mod007-05_standard/all/rich_html/header.rb +80 -0
  310. data/tmpsets/set/mod007-05_standard/all/rich_html/menu.rb +135 -0
  311. data/tmpsets/set/mod007-05_standard/all/rich_html/modal.rb +98 -0
  312. data/tmpsets/set/mod007-05_standard/all/rich_html/toolbar.rb +271 -0
  313. data/tmpsets/set/mod007-05_standard/all/rich_html/wrapper.rb +158 -0
  314. data/tmpsets/set/mod007-05_standard/right/account.rb +187 -0
  315. data/tmpsets/set/mod007-05_standard/right/discussion.rb +9 -0
  316. data/tmpsets/set/mod007-05_standard/right/email.rb +57 -0
  317. data/tmpsets/set/mod007-05_standard/right/password.rb +44 -0
  318. data/tmpsets/set/mod007-05_standard/right/salt.rb +11 -0
  319. data/tmpsets/set/mod007-05_standard/right/stats.rb +41 -0
  320. data/tmpsets/set/mod007-05_standard/right/status.rb +15 -0
  321. data/tmpsets/set/mod007-05_standard/right/token.rb +11 -0
  322. data/tmpsets/set/mod007-05_standard/right/when_created.rb +11 -0
  323. data/tmpsets/set/mod007-05_standard/right/when_last_edited.rb +11 -0
  324. data/tmpsets/set/mod007-05_standard/rstar/rules.rb +411 -0
  325. data/tmpsets/set/mod007-05_standard/self/account_links.rb +55 -0
  326. data/tmpsets/set/mod007-05_standard/self/alerts.rb +11 -0
  327. data/tmpsets/set/mod007-05_standard/self/all.rb +28 -0
  328. data/tmpsets/set/mod007-05_standard/self/foot.rb +14 -0
  329. data/tmpsets/set/mod007-05_standard/self/head.rb +126 -0
  330. data/tmpsets/set/mod007-05_standard/self/navbox.rb +39 -0
  331. data/tmpsets/set/mod007-05_standard/self/now.rb +12 -0
  332. data/tmpsets/set/mod007-05_standard/self/performance_log.rb +98 -0
  333. data/tmpsets/set/mod007-05_standard/self/recent.rb +54 -0
  334. data/tmpsets/set/mod007-05_standard/self/search.rb +49 -0
  335. data/tmpsets/set/mod007-05_standard/self/signin.rb +130 -0
  336. data/tmpsets/set/mod007-05_standard/self/stats.rb +109 -0
  337. data/tmpsets/set/mod007-05_standard/self/version.rb +15 -0
  338. data/tmpsets/set/mod007-05_standard/type/basic.rb +52 -0
  339. data/tmpsets/set/mod007-05_standard/type/cardtype.rb +78 -0
  340. data/tmpsets/set/mod007-05_standard/type/date.rb +14 -0
  341. data/tmpsets/set/mod007-05_standard/type/file.rb +103 -0
  342. data/tmpsets/set/mod007-05_standard/type/image.rb +89 -0
  343. data/tmpsets/set/mod007-05_standard/type/layout_type.rb +21 -0
  344. data/tmpsets/set/mod007-05_standard/type/number.rb +25 -0
  345. data/tmpsets/set/mod007-05_standard/type/phrase.rb +9 -0
  346. data/tmpsets/set/mod007-05_standard/type/search_type.rb +291 -0
  347. data/tmpsets/set/mod007-05_standard/type/session.rb +42 -0
  348. data/tmpsets/set/mod007-05_standard/type/set.rb +354 -0
  349. data/tmpsets/set/mod007-05_standard/type/signup.rb +150 -0
  350. data/tmpsets/set/mod007-05_standard/type/toggle.rb +18 -0
  351. data/tmpsets/set/mod007-05_standard/type/uri.rb +17 -0
  352. data/tmpsets/set/mod007-05_standard/type/user.rb +78 -0
  353. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/form.rb +41 -0
  354. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/helper.rb +150 -0
  355. data/tmpsets/set/mod008-06_bootstrap/all/bootstrap/wrapper.rb +18 -0
  356. data/tmpsets/set/mod008-06_bootstrap/all/rich_bootstrap.rb +14 -0
  357. data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_cards.rb +15 -0
  358. data/tmpsets/set/mod008-06_bootstrap/self/bootstrap_js.rb +13 -0
  359. data/tmpsets/set/mod008-06_bootstrap/self/bootswatch_shared.rb +38 -0
  360. data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_css.rb +13 -0
  361. data/tmpsets/set/mod008-06_bootstrap/self/smartmenu_js.rb +12 -0
  362. data/tmpsets/set_pattern/100-all.rb +24 -0
  363. data/tmpsets/set_pattern/101-all_plus.rb +26 -0
  364. data/tmpsets/set_pattern/102-type.rb +36 -0
  365. data/tmpsets/set_pattern/103-star.rb +28 -0
  366. data/tmpsets/set_pattern/104-rstar.rb +30 -0
  367. data/tmpsets/set_pattern/105-right.rb +33 -0
  368. data/tmpsets/set_pattern/106-type_plus_right.rb +36 -0
  369. data/tmpsets/set_pattern/107-self.rb +32 -0
  370. metadata +306 -107
  371. data/mod/05_standard/set/all/attach.rb +0 -164
  372. data/mod/05_standard/spec/set/all/attach_spec.rb +0 -9
@@ -0,0 +1,238 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class Card; module Set; module All; module RichHtml; module Form; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/form.rb ~~~~~~~~~~~
3
+ format :html do
4
+ def edit_slot args={}
5
+ #note: @mode should already be :edit here...
6
+ if args[:structure] || card.structure
7
+ # multi-card editing
8
+
9
+ if args[:core_edit] #need better name
10
+ _render_core args
11
+ else
12
+ process_relative_tags :optional_toolbar=>:hide, :structure=>args[:structure]
13
+ end
14
+
15
+ else
16
+ # single-card edit mode
17
+ field = content_field form, args
18
+
19
+ if [ args[:optional_type_formgroup], args[:optional_name_formgroup] ].member? :show
20
+ # display content field in formgroup for consistency with other fields
21
+ formgroup '', field, :editor=>:content
22
+ else
23
+ editor_wrap( :content ) { field }
24
+ end
25
+ end
26
+ end
27
+
28
+
29
+ def form_for_multi
30
+ card.name = card.name.gsub(/^#{Regexp.escape(root.card.name)}\+/, '+') if root.card.new_card? ##FIXME -- need to match other relative inclusions.
31
+
32
+ # doesn't work anymore in Rails 4
33
+ # TODO -- check whether forms work with the new instantiate_builder call
34
+ # block = Proc.new {}
35
+ # builder = ActionView::Base.default_form_builder
36
+ # builder.new("card[subcards][#{card.relative_name}]", card, template, {}, block)
37
+ builder = instantiate_builder("card[subcards][#{card.relative_name}]", card, {})
38
+ end
39
+
40
+ def form
41
+ @form ||= form_for_multi
42
+ end
43
+
44
+ def card_form action, opts={}
45
+ hidden_args = opts.delete :hidden
46
+ form_for card, card_form_opts(action, opts) do |form|
47
+ @form = form
48
+ %{
49
+ #{ hidden_tags hidden_args if hidden_args }
50
+ #{ yield form }
51
+ }
52
+ end
53
+ end
54
+
55
+ def card_form_opts action, html={}
56
+ url, action = case action
57
+ when Symbol ; [ path(:action=>action) , action ]
58
+ when Hash ; [ path(action) , action[:action] ]
59
+ when String ; [ card_path(action) , nil ] #deprecated
60
+ else ; raise Card::Error, "unsupported card_form action class: #{action.class}"
61
+ end
62
+
63
+ klasses = Array.wrap( html[:class] )
64
+ klasses << 'card-form slotter'
65
+ klasses << 'autosave' if action == :update
66
+ html[:class] = klasses.join ' '
67
+
68
+ html[:recaptcha] ||= 'on' if card.recaptcha_on?
69
+ html.delete :recaptcha if html[:recaptcha] == :off
70
+
71
+ { :url=>url, :remote=>true, :html=>html }
72
+ end
73
+
74
+ def editor_wrap type=nil
75
+ content_tag( :div, :class=>"editor#{ " #{type}-editor" if type }" ) { yield.html_safe }
76
+ end
77
+
78
+ def formgroup title, content, opts={}
79
+ help_text =
80
+ case opts[:help]
81
+ when String ; _render_help :help_class=>'help-block', :help_text=> opts[:help]
82
+ when true ; _render_help :help_class=>'help-block'
83
+ else ; nil
84
+ end
85
+
86
+ div_args = { :class=>['form-group', opts[:class]].compact*' ' }
87
+ div_args[:card_id ] = card.id if card.real?
88
+ div_args[:card_name] = h card.name if card.name.present?
89
+
90
+ wrap_with :div, div_args do
91
+ %{
92
+ <label>#{ title }</label>
93
+ <div>
94
+ #{ editor_wrap( opts[:editor] ) { content } }
95
+ #{ help_text }
96
+ </div>
97
+ }
98
+ end
99
+ end
100
+
101
+ def hidden_tags hash, base=nil
102
+ # convert hash into a collection of hidden tags
103
+ result = ''
104
+ hash ||= {}
105
+ hash.each do |key, val|
106
+ result += if Hash === val
107
+ hidden_tags val, key
108
+ else
109
+ name = base ? "#{base}[#{key}]" : key
110
+ hidden_field_tag name, val
111
+ end
112
+ end
113
+ result
114
+ end
115
+
116
+
117
+ # FIELDSET VIEWS
118
+
119
+ view :name_formgroup do |args|
120
+ formgroup 'name', raw( name_field form ), :editor=>'name', :help=>args[:help]
121
+ end
122
+
123
+ view :type_formgroup do |args|
124
+ field = if args[:variety] == :edit #FIXME dislike this api -ef
125
+ type_field :class=>'type-field edit-type-field'
126
+ else
127
+ type_field :class=>"type-field live-type-field", :href=>path(:view=>:new), 'data-remote'=>true
128
+ end
129
+ formgroup 'type', field, :editor => 'type', :class=>'type-formgroup'
130
+ end
131
+
132
+
133
+ view :button_formgroup do |args|
134
+ %{<div class="form-group"><div>#{ args[:buttons] }</div></div>}
135
+ end
136
+
137
+ view :content_formgroup do |args|
138
+ raw %{
139
+ <fieldset class="card-editor editor">
140
+ #{ edit_slot args }
141
+ </fieldset>
142
+ }
143
+ end
144
+
145
+
146
+ def name_field form=nil, options={}
147
+ form ||= self.form
148
+ text_field( :name, {
149
+ :value=>card.name, #needed because otherwise gets wrong value if there are updates
150
+ :autocomplete=>'off'
151
+ }.merge(options))
152
+ end
153
+
154
+ def type_field args={}
155
+ typelist = Auth.createable_types
156
+ current_type = unless args.delete :no_current_type
157
+ unless card.new_card? || typelist.include?( card.type_name )
158
+ # current type should be an option on existing cards, regardless of create perms
159
+ typelist = (typelist << card.type_name).sort
160
+ end
161
+ Card[ card ? card.type_id : Card.default_type_id ].name
162
+ end
163
+
164
+ options = options_from_collection_for_select typelist, :to_s, :to_s, current_type
165
+ template.select_tag 'card[type]', options, args
166
+ end
167
+
168
+ def content_field form, options={}
169
+ @form = form
170
+ @nested = options[:nested]
171
+ card.last_action_id_before_edit = card.last_action_id
172
+ revision_tracking = if card && !card.new_card? && !options[:skip_rev_id]
173
+ hidden_field :last_action_id_before_edit, :class=>'current_revision_id'
174
+ #hidden_field_tag 'card[last_action_id_before_edit]', card.last_action_id, :class=>'current_revision_id'
175
+ end
176
+ %{
177
+ #{ revision_tracking
178
+ }
179
+ #{ _render_editor options }
180
+ }
181
+ end
182
+
183
+
184
+ # FIELD VIEWS
185
+
186
+ view :editor do |args|
187
+ text_area :content, :rows=>3, :class=>'tinymce-textarea card-content', :id=>unique_id
188
+ end
189
+
190
+ view :edit_in_form, :perms=>:update, :tags=>:unknown_ok do |args|
191
+ eform = form_for_multi
192
+
193
+ content = content_field eform, args.merge( :nested=>true )
194
+ opts = { :editor=>'content', :help=>true, :class=>'card-editor' }
195
+
196
+ content += raw( "\n #{ eform.hidden_field :type_id }" ) if card.new_card?
197
+ opts[:class] += " RIGHT-#{ card.cardname.tag_name.safe_key }" if card.cardname.junction?
198
+
199
+ formgroup fancy_title( args[:title] ), content, opts
200
+ end
201
+
202
+ def process_relative_tags args
203
+ nested_fields(args).map do |chunk|
204
+ nested_card = fetch_nested_card chunk.options
205
+ nest nested_card, chunk.options.reverse_merge(args)
206
+ end.join "\n"
207
+ # _render_raw(args).scan( /\{\{\s*\+[^\}]*\}\}/ ).map do |inc| #fixme - wrong place for regexp!
208
+ # process_content( inc ).strip
209
+ # end.join
210
+ end
211
+
212
+ # form helpers
213
+
214
+ FIELD_HELPERS = %w{hidden_field color_field date_field datetime_field datetime_local_field
215
+ email_field month_field number_field password_field phone_field
216
+ range_field search_field telephone_field text_area text_field time_field
217
+ url_field week_field file_field}
218
+
219
+
220
+ FIELD_HELPERS.each do |method_name|
221
+ define_method(method_name) do |name, options = {}|
222
+ form.send(method_name, name, options)
223
+ end
224
+ end
225
+
226
+ def check_box method, options={}, checked_value = "1", unchecked_value = "0"
227
+ form.check_box method, options, checked_value, unchecked_value
228
+ end
229
+
230
+ def radio_button method, tag_value, options = {}
231
+ form.radio_button method, tag_value, options
232
+ end
233
+
234
+ end
235
+
236
+
237
+ # ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/form.rb ~~~~~~~~~~~
238
+ end;end;end;end;end;
@@ -0,0 +1,80 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class Card; module Set; module All; module RichHtml; module Header; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/header.rb ~~~~~~~~~~~
3
+ format :html do
4
+
5
+ view :header do |args|
6
+
7
+ %{
8
+ <div class="card-header #{ args[:header_class] }">
9
+ <div class="card-header-title #{ args[:title_class] }">
10
+ #{ _optional_render :toggle, args, :hide }
11
+ #{ _optional_render :title, args }
12
+ </div>
13
+ #{ _optional_render :type_info, args, :hide }
14
+ </div>
15
+ #{ _optional_render :toolbar, args, :hide }
16
+ }
17
+ end
18
+
19
+ def default_header_args args
20
+ if @slot_view == :open
21
+ if (show_view?(:toolbar,args.merge(:default_visibility=>:hide)) || toolbar_pinned?) && card.type_code != :basic
22
+ args[:optional_type_info] ||= :show
23
+ end
24
+ if toolbar_pinned?
25
+ args[:optional_toolbar] ||= :show
26
+ end
27
+ end
28
+ end
29
+
30
+ view :subheader do |args|
31
+ args[:subheader] ||= toolbar_view_title(@slot_view) || _render_title(args)
32
+ %{
33
+ <div class="card-subheader navbar-inverse btn-primary active">
34
+ #{ args[:subheader] }
35
+ #{ autosaved_draft_link if card.drafts.present? && @slot_view == :edit }
36
+ </div>
37
+ }
38
+ end
39
+
40
+
41
+ view :toggle do |args|
42
+ verb, adjective, direction = ( args[:toggle_mode] == :close ? %w{ open open expand } : %w{ close closed collapse-down } )
43
+
44
+ link_to glyphicon(direction),
45
+ path( :view=>adjective ),
46
+ :remote => true,
47
+ :title => "#{verb} #{card.name}",
48
+ :class => "#{verb}-icon toggler slotter nodblclick"
49
+ end
50
+
51
+ view :link_list do |args|
52
+ content_tag :ul, :class=>args[:class] do
53
+ item_links(args).map do |al|
54
+ content_tag :li, raw(al)
55
+ end.join "\n"
56
+ end
57
+ end
58
+
59
+ view :navbar_right do |args|
60
+ render_link_list args.merge(:class=>"nav navbar-nav navbar-right")
61
+ end
62
+
63
+ view :navbar_left do |args|
64
+ render_link_list args.merge(:class=>"nav navbar-nav navbar-left")
65
+ end
66
+
67
+ def show_follow?
68
+ Auth.signed_in? && !card.new_card? && card.followable?
69
+ end
70
+
71
+ def structure_editable?
72
+ card.structure && card.template.ok?(:update)
73
+ end
74
+
75
+ end
76
+
77
+
78
+
79
+ # ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/header.rb ~~~~~~~~~~~
80
+ end;end;end;end;end;
@@ -0,0 +1,135 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class Card; module Set; module All; module RichHtml; module Menu; extend Card::Set # ~~~~~~~~~~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/menu.rb ~~~~~~~~~~~
3
+ format :html do
4
+ view :menu, :denial=>:blank, :tags=>:unknown_ok do |args|
5
+ return _render_template_closer if args[:menu_hack] == :template_closer
6
+ return '' if card.unknown?
7
+ wrap_with :div, :class=>'menu-slot nodblclick' do
8
+ [
9
+ _optional_render(:horizontal_menu, args, :hide),
10
+ _render_menu_link(args),
11
+ _render_modal_slot(args.merge(:modal_id=>card.cardname.safe_key))
12
+ ]
13
+ end
14
+ end
15
+
16
+ view :menu_link do |args|
17
+ path_opts = {:slot => {:home_view=>args[:home_view]}}
18
+ path_opts[:is_main] = true if main?
19
+ css_class = if show_view?(:horizontal_menu,args.merge(:default_visibility=>:hide, :optional=>true))
20
+ 'visible-xs'
21
+ else
22
+ 'show-on-hover'
23
+ end
24
+ wrap_with :div, :class=>"vertical-card-menu card-menu #{css_class}" do
25
+ content_tag :div, :class=>'btn-group slotter card-slot pull-right' do
26
+ view_link(glyphicon(args[:menu_icon]), :vertical_menu, :path_opts=>path_opts).html_safe
27
+ end
28
+ end
29
+ end
30
+
31
+ view :vertical_menu, :tags=>:unknown_ok do |args|
32
+ items = menu_item_list(args).map {|item| "<li class='#{args[:item_class]}'>#{item}</li>"}.join "\n"
33
+ wrap_with :ul, :class=>'btn-group pull-right slotter' do
34
+ [
35
+ content_tag( :span, "<a href='#'>#{ glyphicon args[:menu_icon] }</a>".html_safe,
36
+ :class=>'open-menu dropdown-toggle', 'data-toggle'=>'dropdown', 'aria-expanded'=>'false'),
37
+ content_tag( :ul, items.html_safe, :class=>'dropdown-menu', :role=>'menu'),
38
+ ]
39
+ end
40
+ end
41
+
42
+ view :horizontal_menu do |args|
43
+ content_tag :div, :class=>'btn-group slotter pull-right card-menu horizontal-card-menu hidden-xs' do
44
+ menu_item_list(args.merge(:html_args=>{:class=>'btn btn-default'})).join("\n").html_safe
45
+ end
46
+ end
47
+
48
+ def menu_item_list args
49
+ menu_items = []
50
+ menu_items << menu_edit_link(args) if args[:show_menu_item][:edit]
51
+ menu_items << menu_discuss_link(args) if args[:show_menu_item][:discuss]
52
+ menu_items << _render_follow_link(args.merge(:icon=>true)) if args[:show_menu_item][:follow]
53
+ menu_items << menu_page_link(args) if args[:show_menu_item][:page]
54
+ menu_items << menu_rules_link(args) if args[:show_menu_item][:rules]
55
+ menu_items << menu_account_link(args) if args[:show_menu_item][:account]
56
+ menu_items << menu_more_link(args) if args[:show_menu_item][:more]
57
+ menu_items
58
+ end
59
+
60
+ def menu_edit_link args
61
+ path_opts = { :view=>:edit }
62
+ menu_item('edit', 'edit', path_opts, args[:html_args] )
63
+ end
64
+
65
+ def menu_discuss_link args
66
+ menu_item('discuss', 'comment', { :related=>Card[:discussion].key }, args[:html_args])
67
+ end
68
+
69
+ def menu_page_link args
70
+ menu_item('page', 'new-window', {:card=>card}, args[:html_args])
71
+ end
72
+
73
+ def menu_rules_link args
74
+ menu_item('rules', 'wrench', {:view=>:options}, args[:html_args])
75
+ end
76
+
77
+ def menu_account_link args
78
+ path_opts = { :related=>{:name=>'+*account',:view=>:edit} }
79
+ menu_item('account', 'user', path_opts, args[:html_args])
80
+ end
81
+
82
+ def menu_more_link args
83
+ path_opts = {
84
+ :view=>args[:home_view] || :open,
85
+ :slot=>{:show=>:toolbar}
86
+ }
87
+ menu_item('', 'option-horizontal', path_opts, args[:html_args])
88
+ end
89
+
90
+
91
+ def menu_item text, icon, target, html_args={}
92
+ link_text = "#{glyphicon(icon)}<span class='menu-item-label'>#{text}</span>".html_safe
93
+ smart_link link_text, target, html_args || {}
94
+ end
95
+
96
+
97
+ def default_menu_link_args args
98
+ args[:menu_icon] ||= 'cog'
99
+ end
100
+
101
+ def default_vertical_menu_args args
102
+ default_menu_link_args args
103
+ args.merge! :show_menu_item=>show_menu_items
104
+ end
105
+
106
+ def default_horizontal_menu_args args
107
+ args.merge! :show_menu_item=>show_menu_items
108
+ end
109
+
110
+ def show_menu_items
111
+ disc_tagname = Card.fetch(:discussion, :skip_modules=>true).cardname
112
+ disc_card = unless card.new_card? or card.junction? && card.cardname.tag_name.key == disc_tagname.key
113
+ Card.fetch "#{card.name}+#{disc_tagname}", :skip_virtual=>true, :skip_modules=>true, :new=>{}
114
+ end
115
+
116
+ res = {
117
+ :discuss => disc_card && disc_card.ok?( disc_card.new_card? ? :comment : :read ),
118
+ :page => card.name.present? && !main?,
119
+ :rules => card.virtual?
120
+ }
121
+ if card.real?
122
+ res.merge!(
123
+ :edit => card.ok?(:update) || structure_editable?,
124
+ :account => card.account && card.ok?(:update),
125
+ :follow => show_follow?,
126
+ :more => true
127
+ )
128
+ end
129
+ res
130
+ end
131
+ end
132
+
133
+
134
+ # ~~~~~~~~~~~ below autogenerated; above pulled from /Users/ethan/dev/wagn/gem/card/mod/05_standard/set/all/rich_html/menu.rb ~~~~~~~~~~~
135
+ end;end;end;end;end;