Sha256: bb5c0071f2c224f6b415a6fe6af20f1f341616c83de3df48629c264c3102af06

Contents?: true

Size: 1.05 KB

Versions: 12

Compression:

Stored size: 1.05 KB

Contents

# TODO: Use codenames instead of names
GROUP = {
  "Text" => %w[RichText PlainText Markdown Phrase HTML],
  "Data" => %w[Number Toggle Date URI],
  "Upload" => %w[File Image],
  "Custom" => [],
  "Organize" => ["List", "Pointer", "Search", "Link list", "Nest list"],
  "Template" => ["Notification template", "Email template", "Twitter template"],
  "Admin" => ["Cardtype", "User", "Role", "Sign up", "Session", "Set", "Setting"],
  "Styling" => ["Layout", "Skin", "Bootswatch skin", "CSS", "SCSS"],
  "Scripting" => %w[JSON JavaScript CoffeeScript]
}.freeze

# DEFAULT_RULE_GROUPS = ["Text", "Data", "Upload", "Organize - Search"]
# STRUCTURE_RULE_GROUPS = ["Text", "Organize > Search"]

# group for each cardtype: { "RichText => "Content", "Layout" => "Admin", ... }
GROUP_MAP = GROUP.each_with_object({}) do |(cat, types), h|
  types.each { |t| h[t] = cat }
end

format :html do
  def custom_types
    custom_types = []

    Auth.createable_types.each do |type|
      custom_types << type unless All::CardtypeGroups::GROUP_MAP[type]
    end

    custom_types
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-mod-rules-0.18.1 set/all/cardtype_groups.rb
card-mod-rules-0.18.0 set/all/cardtype_groups.rb
card-mod-rules-0.17.0 set/all/cardtype_groups.rb
card-mod-rules-0.16.0 set/all/cardtype_groups.rb
card-mod-rules-0.15.6 set/all/cardtype_groups.rb
card-mod-rules-0.15.5 set/all/cardtype_groups.rb
card-mod-rules-0.15.4 set/all/cardtype_groups.rb
card-mod-rules-0.15.3 set/all/cardtype_groups.rb
card-mod-rules-0.15.2.pre1 set/all/cardtype_groups.rb
card-mod-rules-0.15.1.1 set/all/cardtype_groups.rb
card-mod-rules-0.15.1 set/all/cardtype_groups.rb
card-mod-rules-0.15.0 set/all/cardtype_groups.rb