card-mod-rules 0.13.1 → 0.14.0

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: 9aa26c96d0fbc7966e795721bd26f712fe1f383aa03ad579dc6b9f37fe0ca55c
4
- data.tar.gz: 3c08cd02da65230d64beb8547397756df45fb589046df7c8412abab559acb3b0
3
+ metadata.gz: 30469534e8d60d7fd32a19643dbcbebe15771aa5cb2c6e07784d2a0e213b65c3
4
+ data.tar.gz: 36fcb0868026a8ea922bacfbfc39526a7e9fa92b2b620e2143e133f071e5e2b3
5
5
  SHA512:
6
- metadata.gz: 2e09624c9aebf1bc536226333a157959c7c0afe6d213700ea936c7f030f9f308c93fceb1b11d10aa45429fe8ab720a5c7ccbe68e9deb8320ecf3f8cdee211940
7
- data.tar.gz: b67a96fb3d3ca7dc46b17fc0eac5f21ec015131f8abb7a2a2befa030e126722f17f2952802d2b7f8119b203bf00651aa31245af37d0007ce12048961678db911
6
+ metadata.gz: 7a42cedbaf64413f7cb84109de5efdfb7a5af98c6a6575d29fd566f7ca8989c9b5302b5b64db48c0924b22cd3d1eece66ccd405f8600ab342ebab37676d491a8
7
+ data.tar.gz: 342490dd90c29515cc248c33ae057cdb6a8233d77c17cfd8252ae1fbebc9522cc14ea20eb6f3fa65d36389f0674dcbb07255f59a385aa17242f2a4c91b648db6
@@ -0,0 +1,23 @@
1
+ $(window).ready ->
2
+ # permissions mod
3
+ $('body').on 'click', '.perm-vals input', ->
4
+ $(this).slot().find('#inherit').attr('checked',false)
5
+
6
+ $('body').on 'click', '.perm-editor #inherit', ->
7
+ slot = $(this).slot()
8
+ slot.find('.perm-group input:checked').attr('checked', false)
9
+ slot.find('.perm-indiv input').val('')
10
+
11
+ # rstar mod
12
+ $('body').on 'click', '._rule-submit-button', ->
13
+ f = $(this).closest('form')
14
+ checked = f.find('.set-editor input:checked')
15
+ if checked.val()
16
+ if checked.attr('warning')
17
+ confirm checked.attr('warning')
18
+ else
19
+ true
20
+ else
21
+ f.find('.set-editor').addClass('attention')
22
+ $(this).notify 'To what Set does this Rule apply?'
23
+ false
data/locales/de.yml ADDED
@@ -0,0 +1,9 @@
1
+ de:
2
+ rules_config: Konfiguration
3
+ rules_event: Ereignisse
4
+ rules_other: Sonstige
5
+ rules_permission: Berechtigungen
6
+ rules_pointer: Zeiger
7
+ rules_templating: Schablonen
8
+ rules_webpage: Webseite
9
+ rules_editing: Bearbeiten
data/locales/en.yml ADDED
@@ -0,0 +1,9 @@
1
+ en:
2
+ rules_config: Config
3
+ rules_event: Events
4
+ rules_other: Other
5
+ rules_permission: Permissions
6
+ rules_pointer: Pointer
7
+ rules_templating: Templating
8
+ rules_webpage: Webpage
9
+ rules_editing: Editing
@@ -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 live-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
@@ -1,7 +1,7 @@
1
1
  event :save_recently_edited_settings, :integrate, on: :save, changed: %i[type content] do
2
2
  if (recent = Card[:recent_settings])
3
3
  recent.insert_item 0, name.right
4
- attach_subcard recent
4
+ subcard recent
5
5
  end
6
6
  end
7
7
 
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
- Card.set_patterns.find { |set| set.pattern_code == current_set_pattern_code }
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
- Card.set_patterns.reverse.map do |set_class|
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.13.1
4
+ version: 0.14.0
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-08-06 00:00:00.000000000 Z
13
+ date: 2021-12-22 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.103.1
21
+ version: 1.104.0
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.103.1
28
+ version: 1.104.0
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.13.1
35
+ version: 0.14.0
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.13.1
42
+ version: 0.14.0
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.13.1
49
+ version: 0.14.0
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.13.1
56
+ version: 0.14.0
57
57
  description: ''
58
58
  email:
59
59
  - info@decko.org
@@ -61,7 +61,10 @@ executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
- - file/mod_rules_script_local_machine_output/file.js
64
+ - assets/script/script_rules.js.coffee
65
+ - locales/de.yml
66
+ - locales/en.yml
67
+ - set/all/cardtype_groups.rb
65
68
  - set/all/related_sets.rb
66
69
  - set/right/self.rb
67
70
  - set/right/type_plus_right.rb
@@ -116,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
119
  - !ruby/object:Gem::Version
117
120
  version: '0'
118
121
  requirements: []
119
- rubygems_version: 3.1.6
122
+ rubygems_version: 3.2.15
120
123
  signing_key:
121
124
  specification_version: 4
122
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);