card-mod-rules 0.11.1 → 0.11.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d61d9cb8d905355b6698991b9131e5ba19c07f7aac88c22dcddfb295508d0417
4
- data.tar.gz: 496c7a0bb956e2c81b22875c3acd994ff57fa7e66373f245c7d4ec3338a882de
3
+ metadata.gz: 3725c08f7adc9b0be2cc977b0d2012277b083cc92f8f801084a72420de073d68
4
+ data.tar.gz: d5fda4c435c25b4de016ff58ca57c2a4d19e7f5cc8ce1532fbd616d55bb33acf
5
5
  SHA512:
6
- metadata.gz: 81f63580006fc27ef34284144a56eac21a7196bd6da67778982fff3717a138bfdf1eaf7a6239d104d391f713f563300ead63e3fba52aeeac1e0087b07fe0147a
7
- data.tar.gz: 3c7608d144d0fe8a1d6dbd092dba3785ab8bbdca06e3c75ca0b0936d79d46b4859484fa974d8704ceafb62c8e38039abe9025fb87ebc594877937668517147f9
6
+ metadata.gz: 94d0fbccca550036185be9c5ae2cf5862269b34e289c6a9f82bf9e7e8dd2365df88b905a4262344f1e3393cbe7867e54fa31d146df881f6cd1447d9496f7143d
7
+ data.tar.gz: ee8ac0a72663ea9160f7f342b996a4694295948693d12ef42c6416f5495b98a630e2fd67d11d08d7ac465aa4e382a2d5e90168f43fdd01fae69ee9a5763d9ea7
@@ -0,0 +1,25 @@
1
+ def related_sets with_self=false
2
+ # refers to sets that users may configure from the current card -
3
+ # NOT to sets to which the current card belongs
4
+
5
+ [].tap do |sets|
6
+ sets << [self_set_name, self_set_label] if with_self
7
+ sets << [right_set_name, right_set_label] if known? && simple?
8
+ end
9
+ end
10
+
11
+ def self_set_name
12
+ Name[name, :self]
13
+ end
14
+
15
+ def self_set_label
16
+ Card::Set::Self.label name
17
+ end
18
+
19
+ def right_set_name
20
+ Name[name, :right]
21
+ end
22
+
23
+ def right_set_label
24
+ Card::Set::Right.label name
25
+ end
@@ -1,8 +1,7 @@
1
-
2
1
  def rule_user_name
3
- is_preference? ? name.trunk_name.tag : nil
2
+ preference? ? name.trunk_name.tag : nil
4
3
  end
5
4
 
6
5
  def rule_user
7
- is_preference? ? self[-2] : nil
6
+ preference? ? self[-2] : nil
8
7
  end
data/set/rule/bar_view.rb CHANGED
@@ -54,8 +54,9 @@ format :html do
54
54
  def rule_short_content
55
55
  return "" unless existing_rule_card
56
56
 
57
- nest existing_rule_card, { view: :one_line_content },
58
- set_context: card.name.trunk_name
57
+ nest existing_rule_card,
58
+ { view: :one_line_content },
59
+ { set_context: card.name.trunk_name }
59
60
  end
60
61
 
61
62
  def bar_title
data/set/rule/editor.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  def left_type_for_nest_editor_set_selection
2
2
  return super unless is_template?
3
3
 
4
- case Card.fetch_id rule_set_pattern_name
4
+ case rule_set_pattern_name.card_id
5
5
  when TypeID
6
6
  rule_set.anchor_name
7
7
  when SelfID
@@ -41,7 +41,7 @@ format :html do
41
41
 
42
42
  def edit_rule_form success_view, &block
43
43
  @rule_context ||= card
44
- @edit_rule_success = edit_rule_success(success_view)
44
+ @edit_rule_success = edit_rule_success success_view
45
45
  action_args = { action: :update, no_mark: true }
46
46
  card_form action_args, rule_form_args, &block
47
47
  end
@@ -51,7 +51,6 @@ format :html do
51
51
  end
52
52
 
53
53
  def edit_rule_success view="overlay_rule"
54
- { id: @rule_context.name.url_key,
55
- view: view }
54
+ { mark: @rule_context.name.url_key, view: view }
56
55
  end
57
56
  end
@@ -19,8 +19,7 @@ format :html do
19
19
 
20
20
  delete_opts = {
21
21
  confirm: delete_confirm(args[:fallback_set]),
22
- # success: @edit_rule_success,
23
- no_success: true,
22
+ success: {},
24
23
  "data-slotter-mode": "silent-success",
25
24
  class: "_close-#{form_type}-on-success"
26
25
  }
@@ -32,10 +32,10 @@ format :html do
32
32
  set_context && Card.fetch(set_context).prototype.related_sets
33
33
  end
34
34
 
35
- def option_list title
35
+ def option_list title, &block
36
36
  formgroup title, input: "set", class: "col-xs-6", help: false do
37
37
  wrap_with :ul do
38
- wrap_each_with(:li, class: "radio") { yield }
38
+ wrap_each_with(:li, class: "radio", &block)
39
39
  end
40
40
  end
41
41
  end
@@ -1,6 +1,7 @@
1
1
  #! no set module
2
2
  class RuleSetRadio
3
3
  attr_reader :format
4
+
4
5
  delegate :link_to_card, :radio_button, :wrap_with, :icon_tag,
5
6
  to: :format
6
7
 
data/set/rule/rules.rb CHANGED
@@ -10,7 +10,7 @@ def rule_set_key
10
10
  end
11
11
 
12
12
  def rule_set_name
13
- if is_preference?
13
+ if preference?
14
14
  name.trunk_name.trunk_name
15
15
  else
16
16
  name.trunk_name
@@ -22,7 +22,7 @@ def rule_set_pattern_name
22
22
  end
23
23
 
24
24
  def rule_set
25
- if is_preference?
25
+ if preference?
26
26
  self[0..-3]
27
27
  else
28
28
  trunk
@@ -46,7 +46,7 @@ def rule_setting_title
46
46
  end
47
47
 
48
48
  def rule_user_setting_name
49
- if is_preference?
49
+ if preference?
50
50
  "#{rule_user_name}+#{rule_setting_name}"
51
51
  else
52
52
  rule_setting_name
@@ -71,7 +71,7 @@ def first_set_option_index candidates
71
71
  end
72
72
 
73
73
  def set_prototype
74
- if is_preference?
74
+ if preference?
75
75
  self[0..-3].prototype
76
76
  else
77
77
  trunk.prototype
@@ -101,7 +101,7 @@ def state_of_existing_set
101
101
  end
102
102
 
103
103
  def state_of_nonexisting_set
104
- @sets_with_existing_rules == 1 ? :current : :overwritten
104
+ @sets_with_existing_rules.positive? ? :overwritten : :available
105
105
  end
106
106
 
107
107
  def rule_for_set? set_name
data/set/type/set.rb CHANGED
@@ -17,7 +17,7 @@ def pattern
17
17
  end
18
18
 
19
19
  def inheritable?
20
- junction_only? || (anchor_name&.junction? && self_set?)
20
+ junction_only? || (anchor_name&.compound? && self_set?)
21
21
  end
22
22
 
23
23
  def self_set?
@@ -3,7 +3,7 @@
3
3
  .card
4
4
  .card-header{ role: "tab", id: heading_id }
5
5
  %h5.mb-0
6
- = link_to (Card::Setting.group_names[group_key] || group_key.to_s),
6
+ = link_to (t("rules_#{group_key}") || group_key.to_s),
7
7
  href: "##{collapse_id}",
8
8
  "data-toggle": "collapse", "aria-expanded": "false",
9
9
  "data-parent": "#accordion", "aria-controls": collapse_id
@@ -9,7 +9,7 @@ format :html do
9
9
 
10
10
  def setting_options
11
11
  [["Categories", SETTING_OPTIONS],
12
- ["Groups", Card::Setting.group_names.keys],
12
+ ["Groups", Card::Setting.groups.keys],
13
13
  ["Single rules", card.visible_setting_codenames]]
14
14
  end
15
15
 
data/set/type/setting.rb CHANGED
@@ -1,13 +1,11 @@
1
1
  # require "json"
2
2
 
3
3
  def self.member_names
4
- @@member_names ||= begin
5
- Card.search(
6
- { type_id: SettingID, return: "key" },
7
- "all setting cards"
8
- ).each_with_object({}) do |card_key, hash|
9
- hash[card_key] = true
10
- end
4
+ @@member_names ||= Card.search(
5
+ { type_id: SettingID, return: "key" },
6
+ "all setting cards"
7
+ ).each_with_object({}) do |card_key, hash|
8
+ hash[card_key] = true
11
9
  end
12
10
  end
13
11
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-rules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-03-02 00:00:00.000000000 Z
13
+ date: 2021-05-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,42 +18,42 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.101.1
21
+ version: 1.101.6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.101.1
28
+ version: 1.101.6
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-format
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.11.1
35
+ version: 0.11.6
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.11.1
42
+ version: 0.11.6
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-search
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.11.1
49
+ version: 0.11.6
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.11.1
56
+ version: 0.11.6
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -62,6 +62,7 @@ extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
64
  - lib/javascript/script_rules.js.coffee
65
+ - set/all/related_sets.rb
65
66
  - set/right/self.rb
66
67
  - set/right/type_plus_right.rb
67
68
  - set/rstar/rule_user.rb
@@ -91,10 +92,15 @@ files:
91
92
  - set/type/set/rules_filter.rb
92
93
  - set/type/set/setting_lists.rb
93
94
  - set/type/setting.rb
94
- homepage: http://decko.org
95
+ homepage: https://decko.org
95
96
  licenses:
96
97
  - GPL-3.0
97
98
  metadata:
99
+ source_code_uri: https://github.com/decko-commons/decko
100
+ homepage_uri: https://decko.org
101
+ bug_tracker_uri: https://github.com/decko-commons/decko/issues
102
+ wiki_uri: https://decko.org
103
+ documentation_url: http://docs.decko.org/
98
104
  card-mod: rules
99
105
  post_install_message:
100
106
  rdoc_options: []
@@ -111,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
117
  - !ruby/object:Gem::Version
112
118
  version: '0'
113
119
  requirements: []
114
- rubygems_version: 3.0.3
120
+ rubygems_version: 3.1.4
115
121
  signing_key:
116
122
  specification_version: 4
117
123
  summary: rules