Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ module:
target: "static/css/@fontsource"
- source: "node_modules/@material-symbols/svg-700/rounded"
target: "static/icons/material-symbols-rounded"
- source: "node_modules/decap-cms/dist"
target: "static/admin/decap-cms"
- source: "node_modules/@sveltia/cms/dist"
target: "static/admin/sveltia-cms"
hugoVersion:
min: "0.164.0"

Expand Down
211 changes: 95 additions & 116 deletions layouts/admin/section.cmsconfig.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{{- if hugo.IsServer }}
local_backend: true
{{ end -}}
backend:
name: github
repo: fipguide/fipguide.github.io
Expand All @@ -9,6 +6,8 @@ backend:
open_authoring: true
site_domain: fipguide.netlify.app
publish_mode: editorial_workflow
output:
omit_empty_optional_fields: true
logo:
src: /images/logo.svg
show_in_header: true
Expand All @@ -23,62 +22,6 @@ i18n:
locales: [en, de, fr]
default_locale: en

x_fip_validity_target_fields_coupon: &fip_validity_target_fields_coupon
- label: "Active Employees"
name: "active"
widget: "fip-validity-select"
group_type: "fip-coupon"
- label: "Relatives of Active Employees"
name: "active-relatives"
widget: "fip-validity-select"
group_type: "fip-coupon"
- label: "Retirees"
name: "retired"
widget: "fip-validity-select"
group_type: "fip-coupon"
- label: "Relatives of Retirees"
name: "retired-relatives"
widget: "fip-validity-select"
group_type: "fip-coupon"
- label: "Widows, Widowers and Orphans"
name: "widows"
widget: "fip-validity-select"
group_type: "fip-coupon"

x_fip_validity_target_fields_reduced: &fip_validity_target_fields_reduced
- label: "Active Employees"
name: "active"
widget: "fip-validity-select"
group_type: "fip-reduced-ticket"
- label: "Relatives of Active Employees"
name: "active-relatives"
widget: "fip-validity-select"
group_type: "fip-reduced-ticket"
- label: "Retirees"
name: "retired"
widget: "fip-validity-select"
group_type: "fip-reduced-ticket"
- label: "Relatives of Retirees"
name: "retired-relatives"
widget: "fip-validity-select"
group_type: "fip-reduced-ticket"
- label: "Widows, Widowers and Orphans"
name: "widows"
widget: "fip-validity-select"
group_type: "fip-reduced-ticket"

x_fip_validity_columns: &fip_validity_columns
- label: "FIP Coupon"
name: "fip-coupon"
widget: "object"
hint: "Number and validity of FIP Coupons available to this target group."
fields: *fip_validity_target_fields_coupon
- label: "FIP Reduced Ticket"
name: "fip-reduced-ticket"
widget: "object"
hint: "Discount on FIP Reduced Tickets (FIP 50 / FIP 75) available to this target group."
fields: *fip_validity_target_fields_reduced

collections:
- name: "news"
label: "News"
Expand Down Expand Up @@ -302,66 +245,103 @@ collections:
- name: "fip-validity"
label: "FIP Validity Tables"
label_singular: "FIP Validity Table"
folder: "content/application"
path: "{{"{{"}}slug}}/validity"
extension: "yaml"
format: "yaml"
summary: "{{"{{"}}dirname}}"
create: true
publish: false
delete: false
hide: true
editor:
preview: false
fields:
- label: "Validity Groups"
name: "groups"
widget: "list"
summary: "{{"{{"}}fields.name}} ({{"{{"}}fields.type}}, {{"{{"}}fields.status}})"
hint: "The validity groups available for this issuer. Referenced by name in the Operators section below."
hide: false
files:
{{- range (sort (where site.RegularPages "Type" "operator") "File.ContentBaseName") }}
{{- $slug := .File.ContentBaseName }}
{{- $appPage := site.GetPage (printf "/application/%s" $slug) }}
{{- if and $appPage ($appPage.Resources.Get "validity.yaml") }}
- name: {{ printf "%q" $slug }}
label: {{ printf "%q" .Title }}
file: {{ printf "%q" (printf "content/application/%s/validity.yaml" $slug) }}
editor:
preview: false
fields:
- label: "Name"
name: "name"
widget: "string"
hint: 'Unique identifier of this group, e.g. "coupon-1".'
- label: "Type"
name: "type"
widget: "select"
options: ["fip-coupon", "fip-reduced-ticket"]
required: false
hint: "Which FIP product this group applies to. Restricts which dropdowns it shows up in below. Leave unset to show it under both."
- label: "Status"
name: "status"
widget: "select"
options: ["valid", "invalid", "unknown"]
- label: "Text"
name: "text"
widget: "object"
- label: "Validity Groups"
name: "groups"
widget: "list"
summary: "{{"{{"}}fields.name}} ({{"{{"}}fields.type}}, {{"{{"}}fields.status}})"
hint: "The validity groups available for this issuer. Referenced by name in the Operators section below."
fields:
- label: "Deutsch"
name: "de"
widget: "markdown"
minimal: true
- label: "English"
name: "en"
widget: "markdown"
minimal: true
- label: "Français"
name: "fr"
widget: "markdown"
minimal: true
- label: "Operators"
name: "operators"
widget: "object"
collapsed: true
hint: "For each target operator, select the applicable validity group per FIP product and target group."
fields:
{{- range (sort (where site.RegularPages "Type" "operator") "File.ContentBaseName") }}
- label: {{ printf "%q" .Title }}
name: {{ printf "%q" .File.ContentBaseName }}
- label: "Name"
name: "name"
widget: "string"
hint: 'Unique identifier of this group, e.g. "coupon-1".'
- label: "Type"
name: "type"
widget: "select"
options: ["fip-coupon", "fip-reduced-ticket"]
required: false
hint: "Which FIP product this group applies to. Leave unset to show it under both."
- label: "Status"
name: "status"
widget: "select"
options: ["valid", "invalid", "unknown"]
- label: "Text"
name: "text"
widget: "object"
fields:
- label: "Deutsch"
name: "de"
widget: "markdown"
editor_components: []
minimal: true
- label: "English"
name: "en"
widget: "markdown"
editor_components: []
minimal: true
- label: "Français"
name: "fr"
widget: "markdown"
editor_components: []
minimal: true
- label: "Operators"
name: "operators"
widget: "object"
collapsed: true
fields: *fip_validity_columns
hint: "For each target operator, select the applicable validity group per FIP product and target group."
fields:
{{- range (sort (where site.RegularPages "Type" "operator") "File.ContentBaseName") }}
- label: {{ printf "%q" .Title }}
name: {{ printf "%q" .File.ContentBaseName }}
widget: "object"
collapsed: true
fields:
- label: "FIP Coupon"
name: "fip-coupon"
widget: "object"
hint: "Number and validity of FIP Coupons available to this target group."
fields:
{{- range $fieldName, $fieldLabel := (dict "active" "Active Employees" "active-relatives" "Relatives of Active Employees" "retired" "Retirees" "retired-relatives" "Relatives of Retirees" "widows" "Widows, Widowers and Orphans") }}
- label: {{ printf "%q" $fieldLabel }}
name: {{ printf "%q" $fieldName }}
widget: "relation"
collection: "fip-validity"
file: {{ printf "%q" $slug }}
required: false
value_field: "{{"{{"}}groups.*.name}}"
display_fields: ["{{"{{"}}groups.*.name}} ({{"{{"}}groups.*.type}}, {{"{{"}}groups.*.status}})"]
search_fields: ["{{"{{"}}groups.*.name}}"]
{{- end }}
- label: "FIP Reduced Ticket"
name: "fip-reduced-ticket"
widget: "object"
hint: "Discount on FIP Reduced Tickets (FIP 50 / FIP 75) available to this target group."
fields:
{{- range $fieldName, $fieldLabel := (dict "active" "Active Employees" "active-relatives" "Relatives of Active Employees" "retired" "Retirees" "retired-relatives" "Relatives of Retirees" "widows" "Widows, Widowers and Orphans") }}
- label: {{ printf "%q" $fieldLabel }}
name: {{ printf "%q" $fieldName }}
widget: "relation"
collection: "fip-validity"
file: {{ printf "%q" $slug }}
required: false
value_field: "{{"{{"}}groups.*.name}}"
display_fields: ["{{"{{"}}groups.*.name}} ({{"{{"}}groups.*.type}}, {{"{{"}}groups.*.status}})"]
search_fields: ["{{"{{"}}groups.*.name}}"]
{{- end }}
{{- end }}
{{- end }}
{{- end }}

- name: "booking"
Expand Down Expand Up @@ -454,7 +434,6 @@ collections:
name: email_templates
widget: object
required: false
collapsed: true
i18n: true
hint: "Email templates for each booking type. Only used when Type is 'email'."
fields:
Expand Down
Loading
Loading