card-mod-rules 0.13.2 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/locales/de.yml +9 -0
- data/set/all/cardtype_groups.rb +33 -0
- data/set/rule/editor.rb +1 -1
- data/set/rule/rules.rb +1 -1
- data/set/self/cardtype.rb +2 -32
- data/set/type/set.rb +1 -1
- data/set/type/setting.rb +1 -12
- metadata +11 -10
- data/file/mod_rules_script_local_machine_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: 76df841565cfbc1af14cc8254bcfe6ccd2c55165d1eb89ccf50fae1f8c97cbc5
|
4
|
+
data.tar.gz: 55b2f4f2544cdaa76b48f34d6ac3f43ea131e94d8044c466bf3a17bfcb3932e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fee7431bbf244515d5d7725cf5fee4165f1f16ed32b5a0befca81fbf0736015d6bed77ab265d1f3831f20dc6a90e8fe617b187267ab4672511038d506b1067a
|
7
|
+
data.tar.gz: f859e166cd5dbd272128c6f646b1ecc818a06330f34579279fde7b7879bcd13226bdfdce3027d1150e153c77c5ebdc7fc2fe961ec17ffb4143a8eb85b89c80b5
|
data/locales/de.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# TODO: Use codenames instead of names
|
2
|
+
GROUP = {
|
3
|
+
"Text" => %w[RichText PlainText Markdown Phrase HTML],
|
4
|
+
"Data" => %w[Number Toggle Date URI],
|
5
|
+
"Upload" => %w[File Image],
|
6
|
+
"Custom" => [],
|
7
|
+
"Organize" => ["List", "Pointer", "Search", "Link list", "Nest list"],
|
8
|
+
"Template" => ["Notification template", "Email template", "Twitter template"],
|
9
|
+
"Admin" => ["Cardtype", "User", "Role", "Sign up", "Session", "Set", "Setting"],
|
10
|
+
"Styling" => ["Layout", "Skin", "Bootswatch skin", "Customized bootswatch skin",
|
11
|
+
"CSS", "SCSS"],
|
12
|
+
"Scripting" => %w[JSON JavaScript CoffeeScript]
|
13
|
+
}.freeze
|
14
|
+
|
15
|
+
# DEFAULT_RULE_GROUPS = ["Text", "Data", "Upload", "Organize - Search"]
|
16
|
+
# STRUCTURE_RULE_GROUPS = ["Text", "Organize > Search"]
|
17
|
+
|
18
|
+
# group for each cardtype: { "RichText => "Content", "Layout" => "Admin", ... }
|
19
|
+
GROUP_MAP = GROUP.each_with_object({}) do |(cat, types), h|
|
20
|
+
types.each { |t| h[t] = cat }
|
21
|
+
end
|
22
|
+
|
23
|
+
format :html do
|
24
|
+
def custom_types
|
25
|
+
custom_types = []
|
26
|
+
|
27
|
+
Auth.createable_types.each do |type|
|
28
|
+
custom_types << type unless All::CardtypeGroups::GROUP_MAP[type]
|
29
|
+
end
|
30
|
+
|
31
|
+
custom_types
|
32
|
+
end
|
33
|
+
end
|
data/set/rule/editor.rb
CHANGED
@@ -79,7 +79,7 @@ format :html do
|
|
79
79
|
wrap_type_formgroup do
|
80
80
|
type_field(
|
81
81
|
href: path(mark: success[:id], view: :rule_form, assign: true),
|
82
|
-
class: "type-field rule-type-field
|
82
|
+
class: "type-field rule-type-field _live-type-field",
|
83
83
|
"data-remote" => true
|
84
84
|
)
|
85
85
|
end
|
data/set/rule/rules.rb
CHANGED
data/set/self/cardtype.rb
CHANGED
@@ -1,42 +1,12 @@
|
|
1
|
-
GROUP = {
|
2
|
-
"Text" => %w[RichText PlainText Markdown Phrase HTML],
|
3
|
-
"Data" => %w[Number Toggle Date URI],
|
4
|
-
"Upload" => %w[File Image],
|
5
|
-
"Custom" => [],
|
6
|
-
"Organize" => ["List", "Pointer", "Search", "Link list", "Nest list"],
|
7
|
-
"Template" => ["Notification template", "Email template", "Twitter template"],
|
8
|
-
"Admin" => ["Cardtype", "User", "Role", "Sign up", "Session", "Set", "Setting"],
|
9
|
-
"Styling" => ["Layout", "Skin", "Bootswatch skin", "Customized bootswatch skin",
|
10
|
-
"CSS", "SCSS"],
|
11
|
-
"Scripting" => %w[JSON JavaScript CoffeeScript]
|
12
|
-
}.freeze
|
13
1
|
|
14
|
-
# DEFAULT_RULE_GROUPS = ["Text", "Data", "Upload", "Organize - Search"]
|
15
|
-
# STRUCTURE_RULE_GROUPS = ["Text", "Organize > Search"]
|
16
|
-
|
17
|
-
# group for each cardtype: { "RichText => "Content", "Layout" => "Admin", ... }
|
18
|
-
GROUP_MAP = GROUP.each_with_object({}) do |(cat, types), h|
|
19
|
-
types.each { |t| h[t] = cat }
|
20
|
-
end
|
21
2
|
|
22
3
|
format :html do
|
23
4
|
view :grouped_list do
|
24
|
-
GROUP.keys.map do |group|
|
25
|
-
type_list = group == "Custom" ? custom_types : GROUP[group]
|
5
|
+
All::CardtypeGroups::GROUP.keys.map do |group|
|
6
|
+
type_list = group == "Custom" ? custom_types : All::CardtypeGroups::GROUP[group]
|
26
7
|
next if type_list.empty?
|
27
8
|
|
28
9
|
[wrap_with(:h5, group), wrap_with(:p, listing(type_list))]
|
29
10
|
end.flatten.join "\n"
|
30
11
|
end
|
31
|
-
|
32
|
-
def custom_types
|
33
|
-
custom_types = []
|
34
|
-
|
35
|
-
Card.search(type_id: Card::CardtypeID, return: "name").each do |name|
|
36
|
-
next if ::Card::Set::Self::Cardtype::GROUP_MAP[name]
|
37
|
-
|
38
|
-
custom_types << name
|
39
|
-
end
|
40
|
-
custom_types
|
41
|
-
end
|
42
12
|
end
|
data/set/type/set.rb
CHANGED
@@ -26,7 +26,7 @@ end
|
|
26
26
|
|
27
27
|
def subclass_for_set
|
28
28
|
current_set_pattern_code = pattern.codename
|
29
|
-
|
29
|
+
Pattern.concrete.find { |set| set.pattern_code == current_set_pattern_code }
|
30
30
|
end
|
31
31
|
|
32
32
|
def junction_only?
|
data/set/type/setting.rb
CHANGED
@@ -1,14 +1,3 @@
|
|
1
|
-
# require "json"
|
2
|
-
|
3
|
-
def self.member_names
|
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
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
1
|
format :data do
|
13
2
|
view :core do
|
14
3
|
cql = { left: { type: SetID },
|
@@ -23,7 +12,7 @@ def count
|
|
23
12
|
end
|
24
13
|
|
25
14
|
def set_classes_with_rules
|
26
|
-
|
15
|
+
Pattern.concrete.reverse.map do |set_class|
|
27
16
|
rules = rules_for_set_class set_class
|
28
17
|
[set_class, rules] unless rules.empty?
|
29
18
|
end.compact
|
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.
|
4
|
+
version: 0.14.1
|
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:
|
13
|
+
date: 2022-01-04 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.
|
21
|
+
version: 1.104.1
|
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.
|
28
|
+
version: 1.104.1
|
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.
|
35
|
+
version: 0.14.1
|
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.
|
42
|
+
version: 0.14.1
|
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.
|
49
|
+
version: 0.14.1
|
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.
|
56
|
+
version: 0.14.1
|
57
57
|
description: ''
|
58
58
|
email:
|
59
59
|
- info@decko.org
|
@@ -62,8 +62,9 @@ extensions: []
|
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
64
|
- assets/script/script_rules.js.coffee
|
65
|
-
-
|
65
|
+
- locales/de.yml
|
66
66
|
- locales/en.yml
|
67
|
+
- set/all/cardtype_groups.rb
|
67
68
|
- set/all/related_sets.rb
|
68
69
|
- set/right/self.rb
|
69
70
|
- set/right/type_plus_right.rb
|
@@ -118,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
119
|
- !ruby/object:Gem::Version
|
119
120
|
version: '0'
|
120
121
|
requirements: []
|
121
|
-
rubygems_version: 3.
|
122
|
+
rubygems_version: 3.2.15
|
122
123
|
signing_key:
|
123
124
|
specification_version: 4
|
124
125
|
summary: rules
|
@@ -1,2 +0,0 @@
|
|
1
|
-
// script_rules.js.coffee
|
2
|
-
(function(){$(window).ready(function(){return $("body").on("click",".perm-vals input",function(){return $(this).slot().find("#inherit").attr("checked",!1)}),$("body").on("click",".perm-editor #inherit",function(){var t;return(t=$(this).slot()).find(".perm-group input:checked").attr("checked",!1),t.find(".perm-indiv input").val("")}),$("body").on("click","._rule-submit-button",function(){var t,i;return(t=(i=$(this).closest("form")).find(".set-editor input:checked")).val()?!t.attr("warning")||confirm(t.attr("warning")):(i.find(".set-editor").addClass("attention"),$(this).notify("To what Set does this Rule apply?"),!1)})})}).call(this);
|