summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ccc_conventions.rb61
1 files changed, 33 insertions, 28 deletions
diff --git a/lib/ccc_conventions.rb b/lib/ccc_conventions.rb
index c0f9943..b420452 100644
--- a/lib/ccc_conventions.rb
+++ b/lib/ccc_conventions.rb
@@ -4,44 +4,49 @@ module CccConventions
4 4
5 NODE_KINDS = { 5 NODE_KINDS = {
6 "top_level" => { 6 "top_level" => {
7 parent: -> { Node.root }, 7 parent: -> { Node.root },
8 path_prefix: "", 8 parent_match: ->(path) { path == [] },
9 label: "Top Level" 9 path_prefix: "",
10 label: "Top Level"
10 }, 11 },
11 "generic" => { 12 "generic" => {
12 label: "Generic", 13 parent_match: ->(path) { true },
13 hint: "Can be created anywhere - choose the parent below." 14 label: "Generic",
14 # no path_prefix - depends on whatever parent gets chosen; see below 15 hint: "Can be created anywhere - choose the parent below."
15 }, 16 },
16 "update" => { 17 "update" => {
17 parent: -> { Update.find_or_create_parent }, 18 parent: -> { Update.find_or_create_parent },
18 tags: ["update"], 19 parent_match: ->(path) { path[0] == "updates" && (path.length == 1 || path[1] =~ /\A\d{4}\z/) },
19 path_prefix: -> { "updates/#{Time.now.year}" }, 20 tags: ["update"],
20 label: "Update", 21 path_prefix: -> { "updates/#{Time.now.year}" },
21 hint: -> { "Automatically created in /updates/#{Time.now.year}/, gets tag \"update\", and inherits the update template." } 22 label: "Update",
23 hint: -> { "Automatically created in /updates/#{Time.now.year}/, gets tag \"update\", and inherits the update template." }
22 }, 24 },
23 "press_release" => { 25 "press_release" => {
24 parent: -> { Update.find_or_create_parent }, 26 parent: -> { Update.find_or_create_parent },
25 tags: ["update", "pressemitteilung"], 27 parent_match: ->(path) { path[0] == "updates" && (path.length == 1 || path[1] =~ /\A\d{4}\z/) },
26 path_prefix: -> { "updates/#{Time.now.year}" }, 28 tags: ["update", "pressemitteilung"],
27 label: "Pressemitteilung", 29 path_prefix: -> { "updates/#{Time.now.year}" },
28 hint: -> { "Automatically created in /updates/#{Time.now.year}/, gets tags \"update, pressemitteilung\", and inherits the update template." } 30 label: "Pressemitteilung",
31 hint: -> { "Automatically created in /updates/#{Time.now.year}/, gets tags \"update, pressemitteilung\", and inherits the update template." }
29 }, 32 },
30 "erfa" => { 33 "erfa" => {
31 parent: -> { Node.find_by_unique_name!(ERFA_PARENT_NAME) }, 34 parent: -> { Node.find_by_unique_name!(ERFA_PARENT_NAME) },
32 tags: ["erfa-detail"], 35 parent_match: ->(path) { path == ["club", "erfas"] },
33 template: "chapter_detail", 36 tags: ["erfa-detail"],
34 path_prefix: ERFA_PARENT_NAME, 37 template: "chapter_detail",
35 label: "Erfa", 38 path_prefix: ERFA_PARENT_NAME,
36 hint: "Automatically created under the Erfa-Kreise overview page, gets tag \"erfa-detail\", and uses the chapter detail template." 39 label: "Erfa",
40 hint: "Automatically created under the Erfa-Kreise overview page, gets tag \"erfa-detail\", and uses the chapter detail template."
37 }, 41 },
38 "chaostreff" => { 42 "chaostreff" => {
39 parent: -> { Node.find_by_unique_name!(CHAOSTREFF_PARENT_NAME) }, 43 parent: -> { Node.find_by_unique_name!(CHAOSTREFF_PARENT_NAME) },
40 tags: ["chaostreff-detail"], 44 parent_match: ->(path) { path == ["club", "chaostreffs"] },
41 template: "chapter_detail", 45 tags: ["chaostreff-detail"],
42 path_prefix: CHAOSTREFF_PARENT_NAME, 46 template: "chapter_detail",
43 label: "Chaostreff", 47 path_prefix: CHAOSTREFF_PARENT_NAME,
44 hint: "Automatically created under the Chaostreffs overview page, gets tag \"chaostreff-detail\", and uses the chapter detail template." 48 label: "Chaostreff",
49 hint: "Automatically created under the Chaostreffs overview page, gets tag \"chaostreff-detail\", and uses the chapter detail template."
45 } 50 }
46 }.freeze 51 }.freeze
47end 52end