card-mod-follow 0.18.1 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/card/follower_stash.rb +1 -1
- data/set/all/follow/follow_link.rb +2 -0
- data/set/all/follow/followed_by.rb +1 -1
- data/set/all/follow/start_follow_link.rb +1 -0
- data/set/all/follow/stop_follow_link.rb +1 -0
- data/set/all/notify/base_views.rb +5 -9
- data/set/all/notify.rb +1 -1
- data/set/right/account.rb +6 -0
- data/set/right/follow.rb +3 -3
- data/set/type_plus_right/user/follow/follow_editor_helper.rb +2 -2
- data/set/type_plus_right/user/follow.rb +1 -1
- metadata +8 -12
- data/data/files/mod_follow_script_asset_output/file.js +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d14102d8ed394d86002ac6e498b63db776f05722719ad1f46460deb415464c
|
4
|
+
data.tar.gz: a73b433160822205be6d676afe7bd3965452145b503839bed78ba020b60952cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba9ec0f8a84fa799776dcee02f665259a881e63f7ff3a2a52c6405609f436e8bb18cc1a628d92f0b06ea6d55401ae8ef027a2767cfda699888e38275059aa60b
|
7
|
+
data.tar.gz: f520310907cd169a5a1d8c0fa7f91941dc84972ea86d789b34aecd5ce95ac123c1b44e5b5298c6aa35e4fd55227641a519a0e7d142597ec0091083d857729e56
|
data/lib/card/follower_stash.rb
CHANGED
@@ -16,7 +16,7 @@ end
|
|
16
16
|
# returns true if according to the follow_field_rule followers of self also
|
17
17
|
# follow changes of field_card
|
18
18
|
def followed_field? field_card
|
19
|
-
return unless (follow_field_rule = rule_card(:follow_fields))
|
19
|
+
return false unless (follow_field_rule = rule_card(:follow_fields))
|
20
20
|
|
21
21
|
follow_field_rule.item_names(context: self).find do |item|
|
22
22
|
case item.to_name.key
|
@@ -1,7 +1,11 @@
|
|
1
|
+
RELEVANT_FIELDS_BY_ACTION = { create: %i[cardtype content],
|
2
|
+
update: %i[name cardtype content],
|
3
|
+
delete: %i[content] }.freeze
|
4
|
+
|
1
5
|
format do
|
2
6
|
view :list_of_changes, denial: :blank, cache: :never do
|
3
7
|
action = notification_action voo.action_id
|
4
|
-
|
8
|
+
RELEVANT_FIELDS_BY_ACTION[action.action_type].map do |type|
|
5
9
|
edit_info_for(type, action)
|
6
10
|
end.compact.join
|
7
11
|
end
|
@@ -50,14 +54,6 @@ format do
|
|
50
54
|
card: { subcards: { rule_name => :never.cardname } })
|
51
55
|
end
|
52
56
|
|
53
|
-
def relevant_fields action
|
54
|
-
case action.action_type
|
55
|
-
when :create then %i[cardtype content]
|
56
|
-
when :update then %i[name cardtype content]
|
57
|
-
when :delete then %i[content]
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
57
|
def name_before_action action
|
62
58
|
(action.value(:name) && action.previous_value(:name)) || card.name
|
63
59
|
end
|
data/set/all/notify.rb
CHANGED
data/set/right/account.rb
CHANGED
@@ -6,6 +6,12 @@ def send_change_notice act, followed_set, follow_option
|
|
6
6
|
end
|
7
7
|
end
|
8
8
|
|
9
|
+
def changes_visible? act
|
10
|
+
act.actions_affecting(act.card).any? { |action| action.card.ok? :read }
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
9
15
|
def notify_of_act act
|
10
16
|
Auth.as(left.id) do
|
11
17
|
Card[:follower_notification_email].deliver(
|
data/set/right/follow.rb
CHANGED
@@ -44,13 +44,13 @@ def permit action, verb=nil
|
|
44
44
|
if action.in?(%i[create delete update]) && allowed_to_change_follow_status?
|
45
45
|
true
|
46
46
|
else
|
47
|
-
super
|
47
|
+
super
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
def allowed_to_change_follow_status?
|
52
|
-
Auth.signed_in? &&
|
53
|
-
((user = rule_user) && Auth.current_id == user.id) || Auth.always_ok?
|
52
|
+
(Auth.signed_in? &&
|
53
|
+
((user = rule_user) && Auth.current_id == user.id)) || Auth.always_ok?
|
54
54
|
end
|
55
55
|
|
56
56
|
format :html do
|
@@ -8,7 +8,7 @@ format :html do
|
|
8
8
|
rule_opt_array = following_rule_options_hash.map do |key, val|
|
9
9
|
[(Card.fetch key, new: {}), val]
|
10
10
|
end
|
11
|
-
rules_and_options_by_set_pattern
|
11
|
+
rules_and_options_by_set_pattern rule_opt_array.to_h, &block
|
12
12
|
end
|
13
13
|
|
14
14
|
# constructs hash of rules/options for "Ignore" tab
|
@@ -25,7 +25,7 @@ format :html do
|
|
25
25
|
def ignore_rules
|
26
26
|
never = :never.cardname.key
|
27
27
|
card.item_cards.select do |follow_rule|
|
28
|
-
follow_rule.item_names.
|
28
|
+
follow_rule.item_names.any? { |n| n.key == never }
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-follow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
8
8
|
- Philipp Kühl
|
9
9
|
- Gerry Gleason
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: card
|
@@ -18,28 +17,28 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - '='
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
20
|
+
version: 1.109.1
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - '='
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
27
|
+
version: 1.109.1
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
29
|
name: card-mod-carrierwave
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
32
31
|
requirements:
|
33
32
|
- - '='
|
34
33
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
34
|
+
version: 0.19.1
|
36
35
|
type: :runtime
|
37
36
|
prerelease: false
|
38
37
|
version_requirements: !ruby/object:Gem::Requirement
|
39
38
|
requirements:
|
40
39
|
- - '='
|
41
40
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
41
|
+
version: 0.19.1
|
43
42
|
description: ''
|
44
43
|
email:
|
45
44
|
- info@decko.org
|
@@ -52,7 +51,6 @@ files:
|
|
52
51
|
- assets/script/follow.js.coffee
|
53
52
|
- assets/style/follow.scss
|
54
53
|
- config/admin.yml
|
55
|
-
- data/files/mod_follow_script_asset_output/file.js
|
56
54
|
- data/real.yml
|
57
55
|
- data/test.yml
|
58
56
|
- data/test/rules.yml
|
@@ -105,7 +103,6 @@ metadata:
|
|
105
103
|
documentation_url: http://docs.decko.org/
|
106
104
|
card-mod: follow
|
107
105
|
card-mod-group: gem-defaults
|
108
|
-
post_install_message:
|
109
106
|
rdoc_options: []
|
110
107
|
require_paths:
|
111
108
|
- lib
|
@@ -113,15 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
110
|
requirements:
|
114
111
|
- - ">="
|
115
112
|
- !ruby/object:Gem::Version
|
116
|
-
version: '3.
|
113
|
+
version: '3.2'
|
117
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
115
|
requirements:
|
119
116
|
- - ">="
|
120
117
|
- !ruby/object:Gem::Version
|
121
118
|
version: '0'
|
122
119
|
requirements: []
|
123
|
-
rubygems_version: 3.
|
124
|
-
signing_key:
|
120
|
+
rubygems_version: 3.6.8
|
125
121
|
specification_version: 4
|
126
122
|
summary: follower notifications
|
127
123
|
test_files: []
|
@@ -1,2 +0,0 @@
|
|
1
|
-
// follow.js.coffee
|
2
|
-
(function(){$(window).ready(function(){return $("body").on("click",".btn-item",function(){return $(this).find("i").html("hourglass_full")}),$("body").on("mouseenter",".btn-item-delete",function(){return $(this).find("i").html("remove"),$(this).addClass("btn-danger").removeClass("btn-primary")}),$("body").on("mouseleave",".btn-item-delete",function(){return $(this).find("i").html("check"),$(this).addClass("btn-primary").removeClass("btn-danger")}),$("body").on("submit",".edit-view.SELF-Xfollow_default .card-form",function(){var n;if((n=$(this).find(".confirm_update_all-view")).is(":hidden"))return $(this).find(".follow-updater").show(),n.show("blind"),!1})})}).call(this);
|