card 1.96.0 → 1.96.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/config/initializers/02_patches/kaminari.rb +2 -2
  4. data/config/locales/de.yml +38 -3
  5. data/config/locales/en.yml +39 -4
  6. data/config/locales/es.yml +606 -0
  7. data/db/migrate_core_cards/data/cards/{*header → Xheader} +0 -0
  8. data/db/migrate_core_cards/data/cards/{*main_menu → Xmain_menu} +0 -0
  9. data/lib/card.rb +2 -2
  10. data/lib/card/act_manager.rb +1 -1
  11. data/lib/card/env/success.rb +26 -13
  12. data/lib/card/format/nest/fetch.rb +6 -1
  13. data/lib/card/migration/import/import_data/card_content.rb +1 -1
  14. data/mod/account/set/right/account.rb +115 -101
  15. data/mod/account/set/self/signin.rb +106 -96
  16. data/mod/account/spec/set/all/account_spec.rb +0 -2
  17. data/mod/account/spec/set/right/account_spec.rb +6 -9
  18. data/mod/account/spec/set/self/signin_spec.rb +2 -5
  19. data/mod/admin/set/self/admin_info.rb +4 -4
  20. data/mod/admin/spec/set/self/admin_info_spec.rb +10 -0
  21. data/mod/admin/spec/set/self/trash_spec.rb +7 -0
  22. data/mod/basic_formats/set/all/json.rb +7 -3
  23. data/mod/basic_formats/spec/set/all/head_spec.rb +33 -0
  24. data/mod/basic_types/set/type/json.rb +1 -1
  25. data/mod/basic_types/spec/set/type/plain_text_spec.rb +6 -0
  26. data/mod/bootstrap/set/type/customized_bootswatch_skin.rb +2 -2
  27. data/mod/bootstrap/spec/set/type/customized_bootswatch_skin/html_views_spec.rb +5 -0
  28. data/mod/bootstrap/spec/set/type_plus_right/customized_bootswatch_skin/colors_spec.rb +8 -0
  29. data/mod/carrierwave/set/abstract/attachment/storage_type.rb +12 -13
  30. data/mod/core/set/all/actify.rb +5 -0
  31. data/mod/core/set/all/codename.rb +2 -2
  32. data/mod/core/set/all/event_conditions.rb +2 -1
  33. data/mod/core/set/all/fetch_helper.rb +2 -2
  34. data/mod/core/set/all/i18n.rb +1 -1
  35. data/mod/core/set/all/item.rb +6 -0
  36. data/mod/core/set/all/location_history.rb +12 -1
  37. data/mod/core/set/all/name_events.rb +8 -9
  38. data/mod/core/set/all/permissions.rb +1 -1
  39. data/mod/core/set/all/rename.rb +3 -5
  40. data/mod/core/set/all/trash.rb +4 -9
  41. data/mod/core/set/all/type.rb +7 -5
  42. data/mod/core/set/all/utils.rb +13 -5
  43. data/mod/core/spec/set/abstract/code_file_spec.rb +8 -0
  44. data/mod/core/spec/set/all/tabs_spec.rb +19 -0
  45. data/mod/developer/spec/set/all/view_viz_spec.rb +9 -0
  46. data/mod/follow/spec/set/all/follow/follow_link_spec.rb +7 -0
  47. data/mod/follow/spec/set/all/notify/html_views_spec.rb +7 -0
  48. data/mod/follow/spec/set/right/follow_spec.rb +0 -0
  49. data/mod/follow/spec/set/right/following_spec.rb +6 -0
  50. data/mod/follow/spec/set/type/notification_template_spec.rb +1 -1
  51. data/mod/history/set/all/content_history.rb +1 -1
  52. data/mod/history/spec/set/all/act_view_spec.rb +16 -0
  53. data/mod/history/spec/set/all/action_view_spec.rb +10 -0
  54. data/mod/history/spec/set/all/history_spec.rb +11 -0
  55. data/mod/item/spec/set/all/bar_spec.rb +41 -0
  56. data/mod/machines/lib/javascript/decko_slot.js.coffee +1 -1
  57. data/mod/pointer/set/abstract/02_pointer/other_views.rb +0 -4
  58. data/mod/recaptcha/set/all/recaptcha.rb +1 -1
  59. data/mod/search/spec/set/abstract/search_spec.rb +8 -0
  60. data/mod/standard/set/all/error.rb +48 -26
  61. data/mod/standard/set/all/rich_html/toolbar.rb +6 -1
  62. data/mod/standard/set/type/list.rb +7 -9
  63. data/mod/standard/set/type/number.rb +1 -1
  64. data/mod/standard/set/type/session.rb +1 -1
  65. data/mod/standard/spec/content/chunk/link_spec.rb +3 -3
  66. data/mod/utility/set/abstract/media.rb +13 -9
  67. data/mod/utility/set/abstract/media/media_snippet.haml +5 -3
  68. metadata +22 -6
@@ -212,12 +212,17 @@ format :html do
212
212
 
213
213
  view :delete_button do
214
214
  confirm = "Are you sure you want to delete #{safe_name}?"
215
- success = main? ? "REDIRECT: *previous" : "TEXT: #{card.name} deleted"
215
+ success = main? ? "REDIRECT: *previous" : { view: :just_deleted }
216
216
  toolbar_button "delete", :trash,
217
217
  path: { action: :delete, success: success },
218
218
  class: "slotter", remote: true, 'data-confirm': confirm
219
219
  end
220
220
 
221
+ # TODO: add undo functionality
222
+ view :just_deleted, tag: :unknown_ok do
223
+ wrap { "#{render_title} deleted" }
224
+ end
225
+
221
226
  def toolbar_button text, symbol, opts={}
222
227
  link_text = toolbar_button_text text, symbol, opts.delete(:hide)
223
228
  opts[:class] = [opts[:class], "btn btn-primary"].compact * " "
@@ -1,18 +1,14 @@
1
1
  include_set Pointer
2
2
 
3
3
  event :validate_list_name, :validate, on: :save, changed: :name do
4
- if !junction? || !right || right.type_id != CardtypeID
5
- errors.add :name, "must have a cardtype name as right part"
6
- end
4
+ errors.add :name, tr(:type_right) if !junction? || !right || right.type_id != CardtypeID
7
5
  end
8
6
 
9
7
  event :validate_list_item_type_change, :validate,
10
8
  on: :save, changed: :name do
11
9
  item_cards.each do |item_card|
12
10
  next unless item_card.type_name.key != item_type_name.key
13
- errors.add :name,
14
- "name conflicts with list items' type; " \
15
- "delete content first"
11
+ errors.add :name, tr(:conflict_item_type)
16
12
  end
17
13
  end
18
14
 
@@ -20,9 +16,11 @@ event :validate_list_content, :validate,
20
16
  on: :save, changed: :content do
21
17
  item_cards.each do |item_card|
22
18
  next unless item_card.type_name.key != item_type_name.key
23
- errors.add :content,
24
- "#{item_card.name} has wrong cardtype; " \
25
- "only cards of type #{name.right} are allowed"
19
+ errors.add :content, tr(
20
+ :only_type_allowed,
21
+ cardname: item_card.name,
22
+ cardtype: name.right
23
+ )
26
24
  end
27
25
  end
28
26
 
@@ -6,7 +6,7 @@ format :html do
6
6
  end
7
7
 
8
8
  event :validate_number, :validate, on: :save do
9
- errors.add :content, "'#{content}' is not numeric" unless valid_number?(content)
9
+ errors.add :content, tr(:not_numeric, content: content) unless valid_number?(content)
10
10
  end
11
11
 
12
12
  def valid_number? string
@@ -23,7 +23,7 @@ def content
23
23
  end
24
24
 
25
25
  def content= val
26
- Env.session[key] = val
26
+ self.db_content = Env.session[key] = val
27
27
  end
28
28
 
29
29
  format :html do
@@ -57,9 +57,9 @@ RSpec.describe Card::Content::Chunk::Link do
57
57
  end
58
58
 
59
59
  it "handles relative urls" do
60
- assert_link "[[/recent]]", class: "internal-link",
61
- href: "/recent",
62
- text: "/recent"
60
+ assert_link "[[/*recent]]", class: "internal-link",
61
+ href: "/*recent",
62
+ text: "/*recent"
63
63
  end
64
64
 
65
65
  it "handles absolute urls" do
@@ -12,16 +12,20 @@ format :html do
12
12
  image_card&.name
13
13
  end
14
14
 
15
- def text_with_image_args opts
16
- opts.reverse_merge! title: _render_title, text: "", src: image_src(opts),
17
- alt: image_alt, size: :original
18
- end
19
-
20
15
  def text_with_image opts={}
21
- class_up "media-left", "m-2"
22
16
  @image_card = Card.cardish(opts[:image]) if opts[:image]
23
- opts[:media_opts] = {} unless opts[:media_opts]
24
- text_with_image_args opts
25
- haml :media_snippet, opts
17
+ haml :media_snippet, normalized_text_with_image_opts(opts)
18
+ end
19
+
20
+ private
21
+
22
+ def normalized_text_with_image_opts opts
23
+ opts.reverse_merge! title: _render_title,
24
+ text: "",
25
+ src: image_src(opts),
26
+ alt: image_alt,
27
+ size: :original,
28
+ media_opts: {},
29
+ media_left_extras: ""
26
30
  end
27
31
  end
@@ -1,7 +1,9 @@
1
1
  .media{media_opts}
2
- .image-box{class: [classy("media-left"), size]}
3
- %a{href: "#"}
4
- %img.media-object{class: size, src: src.html_safe, alt: alt}
2
+ .media-left
3
+ .image-box{class: "mr-1 #{size}"}
4
+ %a{href: "#"}
5
+ %img.media-object{class: size, src: src.html_safe, alt: alt}
6
+ = media_left_extras
5
7
  .media-body
6
8
  - if title != ""
7
9
  %h5.media-heading
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.96.0
4
+ version: 1.96.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-07-23 00:00:00.000000000 Z
14
+ date: 2018-08-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cardname
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.6.0
22
+ version: 0.6.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.6.0
29
+ version: 0.6.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: haml
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -317,6 +317,7 @@ files:
317
317
  - config/initializers/uuid_state_file.rb
318
318
  - config/locales/de.yml
319
319
  - config/locales/en.yml
320
+ - config/locales/es.yml
320
321
  - db/migrate/20110511221913_require_earlier_migrations.rb
321
322
  - db/migrate/20120105203350_require_1_8_migrations.rb
322
323
  - db/migrate/20121111025347_require_1_10_migrations.rb
@@ -410,8 +411,8 @@ files:
410
411
  - db/migrate_core_cards/data/1.14_config_descriptions_etc.json
411
412
  - db/migrate_core_cards/data/bootstrap_layout.json
412
413
  - db/migrate_core_cards/data/cards.yml
413
- - db/migrate_core_cards/data/cards/*header
414
- - db/migrate_core_cards/data/cards/*main_menu
414
+ - db/migrate_core_cards/data/cards/Xheader
415
+ - db/migrate_core_cards/data/cards/Xmain_menu
415
416
  - db/migrate_core_cards/data/mailer/follower_notification_email.html
416
417
  - db/migrate_core_cards/data/mailer/follower_notification_email.txt
417
418
  - db/migrate_core_cards/data/mailer/mail_config.json
@@ -1048,7 +1049,9 @@ files:
1048
1049
  - mod/admin/set/self/recaptcha_public_key.rb
1049
1050
  - mod/admin/set/self/trash.rb
1050
1051
  - mod/admin/set/self/version.rb
1052
+ - mod/admin/spec/set/self/admin_info_spec.rb
1051
1053
  - mod/admin/spec/set/self/admin_spec.rb
1054
+ - mod/admin/spec/set/self/trash_spec.rb
1052
1055
  - mod/admin/spec/set/self/version_spec.rb
1053
1056
  - mod/basic_formats/format/css_format.rb
1054
1057
  - mod/basic_formats/format/csv_format.rb
@@ -1071,6 +1074,7 @@ files:
1071
1074
  - mod/basic_formats/spec/set/all/all_csv_spec.rb
1072
1075
  - mod/basic_formats/spec/set/all/base_spec.rb
1073
1076
  - mod/basic_formats/spec/set/all/file_spec.rb
1077
+ - mod/basic_formats/spec/set/all/head_spec.rb
1074
1078
  - mod/basic_formats/spec/set/all/json_spec.rb
1075
1079
  - mod/basic_formats/spec/set/all/rss_spec.rb
1076
1080
  - mod/basic_formats/spec/set/all/text_spec.rb
@@ -1293,6 +1297,7 @@ files:
1293
1297
  - mod/bootstrap/spec/set/all/bootstrap/horizontal_form_spec.rb
1294
1298
  - mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb
1295
1299
  - mod/bootstrap/spec/set/type/bootswatch_skin_spec.rb
1300
+ - mod/bootstrap/spec/set/type/customized_bootswatch_skin/html_views_spec.rb
1296
1301
  - mod/bootstrap/spec/set/type/customized_bootswatch_skin_spec.rb
1297
1302
  - mod/bootstrap/spec/set/type_plus_right/customized_bootswatch_skin/colors_spec.rb
1298
1303
  - mod/bootstrap/vendor/bootstrap-colorpicker/Gruntfile.js
@@ -3901,6 +3906,7 @@ files:
3901
3906
  - mod/core/spec/format/data_format_spec.rb
3902
3907
  - mod/core/spec/format/html_format_spec.rb
3903
3908
  - mod/core/spec/format/text_format_spec.rb
3909
+ - mod/core/spec/set/abstract/code_file_spec.rb
3904
3910
  - mod/core/spec/set/all/actify_spec.rb
3905
3911
  - mod/core/spec/set/all/active_card_spec.rb
3906
3912
  - mod/core/spec/set/all/assign_attributes_spec.rb
@@ -3926,6 +3932,7 @@ files:
3926
3932
  - mod/core/spec/set/all/rules2_spec.rb
3927
3933
  - mod/core/spec/set/all/rules_spec.rb
3928
3934
  - mod/core/spec/set/all/states_spec.rb
3935
+ - mod/core/spec/set/all/tabs_spec.rb
3929
3936
  - mod/core/spec/set/all/templating_spec.rb
3930
3937
  - mod/core/spec/set/all/trash_spec.rb
3931
3938
  - mod/core/spec/set/all/type_spec.rb
@@ -4632,6 +4639,7 @@ files:
4632
4639
  - mod/developer/set/all/view_viz.rb
4633
4640
  - mod/developer/set/right/debug.rb
4634
4641
  - mod/developer/spec/set/all/event_viz_spec.rb
4642
+ - mod/developer/spec/set/all/view_viz_spec.rb
4635
4643
  - mod/developer/spec/set/right/debug_spec.rb
4636
4644
  - mod/email/README
4637
4645
  - mod/email/format/email_html_format.rb
@@ -4678,10 +4686,13 @@ files:
4678
4686
  - mod/follow/set/type_plus_right/user/follow.rb
4679
4687
  - mod/follow/set/type_plus_right/user/follow/follow_editor.haml
4680
4688
  - mod/follow/set/type_plus_right/user/follow/follow_editor_helper.rb
4689
+ - mod/follow/spec/set/all/follow/follow_link_spec.rb
4681
4690
  - mod/follow/spec/set/all/follow_spec.rb
4691
+ - mod/follow/spec/set/all/notify/html_views_spec.rb
4682
4692
  - mod/follow/spec/set/all/notify_email.txt
4683
4693
  - mod/follow/spec/set/all/notify_spec.rb
4684
4694
  - mod/follow/spec/set/right/account_spec.rb
4695
+ - mod/follow/spec/set/right/follow_spec.rb
4685
4696
  - mod/follow/spec/set/right/followers_spec.rb
4686
4697
  - mod/follow/spec/set/right/following_spec.rb
4687
4698
  - mod/follow/spec/set/self/follow_defaults_spec.rb
@@ -4702,11 +4713,15 @@ files:
4702
4713
  - mod/history/set/all/acts.rb
4703
4714
  - mod/history/set/all/content_history.rb
4704
4715
  - mod/history/set/all/history.rb
4716
+ - mod/history/spec/set/all/act_view_spec.rb
4717
+ - mod/history/spec/set/all/action_view_spec.rb
4718
+ - mod/history/spec/set/all/history_spec.rb
4705
4719
  - mod/item/set/all/bar.haml
4706
4720
  - mod/item/set/all/bar.rb
4707
4721
  - mod/item/set/all/box.haml
4708
4722
  - mod/item/set/all/box.rb
4709
4723
  - mod/item/set/all/expanded_bar.haml
4724
+ - mod/item/spec/set/all/bar_spec.rb
4710
4725
  - mod/machines/file/all_script_machine_output/file.js
4711
4726
  - mod/machines/file/all_style_machine_output/file.css
4712
4727
  - mod/machines/file/script_html5shiv_printshiv_machine_output/file.js
@@ -4910,6 +4925,7 @@ files:
4910
4925
  - mod/search/set/self/search.rb
4911
4926
  - mod/search/set/type/search_type.rb
4912
4927
  - mod/search/spec/set/abstract/filter_spec.rb
4928
+ - mod/search/spec/set/abstract/search_spec.rb
4913
4929
  - mod/search/spec/set/self/navbox_spec.rb
4914
4930
  - mod/search/spec/set/self/recent_spec.rb
4915
4931
  - mod/search/spec/set/self/search_spec.rb