card 1.20.2 → 1.20.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/card.gemspec +3 -1
  4. data/config/initializers/01_core_extensions/array.rb +1 -1
  5. data/config/initializers/01_core_extensions/module.rb +1 -1
  6. data/config/initializers/02_patches/active_record.rb +66 -0
  7. data/config/initializers/patches.rb +4 -0
  8. data/db/migrate_core_cards/20170314175313_add_notification_event_card.rb +21 -0
  9. data/db/seed/new/card_actions.yml +723 -475
  10. data/db/seed/new/card_acts.yml +45 -45
  11. data/db/seed/new/card_changes.yml +2306 -1675
  12. data/db/seed/new/card_references.yml +389 -116
  13. data/db/seed/new/cards.yml +2537 -2067
  14. data/db/seed/test/fixtures/card_actions.yml +1709 -1445
  15. data/db/seed/test/fixtures/card_acts.yml +302 -290
  16. data/db/seed/test/fixtures/card_changes.yml +5494 -4818
  17. data/db/seed/test/fixtures/card_references.yml +1137 -794
  18. data/db/seed/test/fixtures/cards.yml +3631 -3120
  19. data/db/version_core_cards.txt +1 -1
  20. data/lib/card/auth/current.rb +21 -0
  21. data/lib/card/env.rb +7 -2
  22. data/lib/card/env/success.rb +13 -3
  23. data/lib/card/format/render.rb +13 -4
  24. data/lib/card/migration.rb +4 -6
  25. data/lib/card/mod/loader.rb +8 -0
  26. data/lib/card/model/save_helper.rb +45 -0
  27. data/lib/card/name/view_name.rb +8 -6
  28. data/lib/card/query/join.rb +4 -2
  29. data/lib/card/query/sorting.rb +26 -22
  30. data/lib/card/reference.rb +2 -2
  31. data/lib/card/set/advanced_api.rb +31 -6
  32. data/lib/card/set/event.rb +16 -8
  33. data/lib/card/set/format.rb +15 -0
  34. data/lib/card/set/format/haml_views.rb +78 -0
  35. data/lib/card/set/loader.rb +3 -2
  36. data/lib/cardio.rb +17 -1
  37. data/mod/Modfile +2 -1
  38. data/mod/account/spec/set/all/account_spec.rb +1 -1
  39. data/mod/basic_formats/set/all/all_css.rb +4 -5
  40. data/mod/bootstrap/set/all/bootstrap/navbar.rb +6 -0
  41. data/mod/bootstrap/set/all/bootstrap/tabs.rb +13 -6
  42. data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +6 -0
  43. data/mod/core/set/all/assign_attributes.rb +3 -0
  44. data/mod/core/set/all/fetch.rb +3 -3
  45. data/mod/core/spec/set/all/collection_spec.rb +5 -3
  46. data/mod/history/lib/card/change.rb +2 -2
  47. data/mod/machines/file/all_script_machine_output/file.js +37 -121
  48. data/mod/machines/file/all_style_machine_output/file.css +4 -4
  49. data/mod/machines/lib/javascript/wagn.js.coffee +4 -0
  50. data/mod/machines/lib/javascript/wagn_mod.js.coffee +0 -2
  51. data/mod/machines/set/type/css.rb +6 -0
  52. data/mod/{email → notifications}/format/email_html_format.rb +0 -0
  53. data/mod/{email → notifications}/format/email_text_format.rb +0 -0
  54. data/mod/{email → notifications}/lib/card/follow_option.rb +0 -0
  55. data/mod/{email → notifications}/set/abstract/test_context.rb +0 -0
  56. data/mod/{email → notifications}/set/all/email_html.rb +0 -0
  57. data/mod/{email → notifications}/set/all/email_text.rb +0 -0
  58. data/mod/{email → notifications}/set/all/follow.rb +0 -0
  59. data/mod/notifications/set/all/observer.rb +22 -0
  60. data/mod/{email/set/all/notify.rb → notifications/set/all/send_notifications.rb} +0 -0
  61. data/mod/notifications/set/all/show_notifications.rb +7 -0
  62. data/mod/{email → notifications}/set/right/bcc.rb +0 -0
  63. data/mod/{email → notifications}/set/right/cc.rb +0 -0
  64. data/mod/{email → notifications}/set/right/follow.rb +0 -0
  65. data/mod/{email → notifications}/set/right/follow_fields.rb +0 -0
  66. data/mod/{email → notifications}/set/right/followers.rb +0 -0
  67. data/mod/{email → notifications}/set/right/following.rb +0 -0
  68. data/mod/{email → notifications}/set/right/from.rb +0 -0
  69. data/mod/{email → notifications}/set/right/html_message.rb +0 -0
  70. data/mod/{email → notifications}/set/right/subject.rb +0 -0
  71. data/mod/{email → notifications}/set/right/text_message.rb +0 -0
  72. data/mod/{email → notifications}/set/right/to.rb +0 -0
  73. data/mod/{email → notifications}/set/self/always.rb +0 -0
  74. data/mod/{email → notifications}/set/self/created.rb +0 -0
  75. data/mod/{email → notifications}/set/self/edited.rb +0 -0
  76. data/mod/{email → notifications}/set/self/follow.rb +0 -0
  77. data/mod/{email → notifications}/set/self/follow_defaults.rb +0 -0
  78. data/mod/{email → notifications}/set/self/never.rb +0 -0
  79. data/mod/{email → notifications}/set/type/email_template.rb +0 -0
  80. data/mod/{email → notifications}/set/type/email_template/email_config.rb +0 -0
  81. data/mod/notifications/set/type/notification_template.rb +23 -0
  82. data/mod/{email → notifications}/set/type_plus_right/user/follow.rb +0 -0
  83. data/mod/{email → notifications}/spec/set/all/follow_spec.rb +14 -5
  84. data/mod/{email → notifications}/spec/set/all/notify_spec.rb +1 -1
  85. data/mod/{email → notifications}/spec/set/all/observer_spec.rb +1 -1
  86. data/mod/{email → notifications}/spec/set/right/followers_spec.rb +0 -0
  87. data/mod/{email → notifications}/spec/set/right/following_spec.rb +0 -0
  88. data/mod/{email → notifications}/spec/set/self/follow_defaults_spec.rb +0 -0
  89. data/mod/notifications/spec/set/type/notification_template_spec.rb +58 -0
  90. data/mod/{standard/set/abstract/search/paging.rb → pointer/set/abstract/00_paging.rb} +10 -1
  91. data/mod/{standard/set/abstract/search/paging → pointer/set/abstract/00_paging}/paging_links.rb +0 -0
  92. data/mod/pointer/set/abstract/01_pointer.rb +13 -1
  93. data/mod/pointer/spec/set/type/pointer_spec.rb +7 -0
  94. data/mod/standard/set/abstract/01_search_params.rb +4 -0
  95. data/mod/standard/set/abstract/search.rb +1 -0
  96. data/mod/standard/set/abstract/wql_search.rb +6 -4
  97. data/mod/standard/set/all/rich_html/toolbar.rb +31 -16
  98. data/mod/standard/set/all/rich_html/wrapper.rb +3 -1
  99. data/mod/standard/set/self/search.rb +28 -8
  100. data/mod/standard/set/type/search_type.rb +10 -8
  101. data/mod/standard/spec/set/all/rich_html/editing_spec.rb +2 -1
  102. data/mod/standard/spec/set/all/rich_html/form_spec.rb +2 -2
  103. data/mod/standard/spec/set/self/search_spec.rb +8 -1
  104. data/mod/standard/spec/set/type/phrase_spec.rb +2 -1
  105. data/mod/twitter/Gemfile +3 -0
  106. data/mod/twitter/db/migrate_cards/20170305112346_add_twitter_cards.rb +30 -0
  107. data/mod/twitter/set/type/twitter_template.rb +22 -0
  108. data/spec/lib/card/query/sorting_spec.rb +68 -0
  109. data/spec/lib/card/query_spec.rb +0 -65
  110. metadata +78 -40
  111. data/mod/email/set/all/observer.rb +0 -26
  112. data/mod/standard/spec/set/all/email_html_spec.rb +0 -15
@@ -1,26 +0,0 @@
1
- def send_action_mails args
2
- setting = "on_#{args[:on]}".to_sym
3
- email_templates_for(setting) do |mailcard|
4
- mailcard.deliver(context: self)
5
- end
6
- end
7
-
8
- def email_templates_for setting
9
- if (email_templates = @email_template_cache ||
10
- ((event_card = rule_card(setting)) && event_card.extended_item_cards))
11
- email_templates.each do |mailcard|
12
- yield(mailcard)
13
- end
14
- end
15
- end
16
-
17
- [:create, :update, :delete].each do |action|
18
- event "observer_#{action}".to_sym, :integrate, on: action do
19
- send_action_mails on: action
20
- end
21
- end
22
-
23
- event :cache_delete_email_templates, :store, on: :delete do
24
- event_card = rule_card(:on_delete)
25
- @email_template_cache = event_card && event_card.extended_item_cards
26
- end
@@ -1,15 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- describe Card::Format::EmailHtmlFormat do
4
- it "renders full urls" do
5
- Card::Env[:protocol] = "http://"
6
- Card::Env[:host] = "www.fake.com"
7
- expect(render_content("[[B]]", format: "email_html")).to eq('<a class="known-card" href="http://www.fake.com/B">B</a>')
8
- end
9
-
10
- describe "raw view" do
11
- it "renders missing included cards as blank" do
12
- expect(render_content("{{strombooby}}", format: "email_html")).to eq("")
13
- end
14
- end
15
- end