---
#SETTING UP REUSABLE ALIASES
aliases:
  - &TITLE
    label: 'Title'
    name: 'title'
    widget: 'string'
  - &DATE
    label: Date
    name: date
    widget: datetime
    picker_utc: true
  - &POST_CATEGORIES
    label: Post Category
    name: categories
    widget: select
    options: ["Announcements", "Tips And Tricks", "Case Studies", "Others"]
    field: { name: categories, widget: string }
    allow_add: true
  - &PORT_CATEGORIES
    label: Porrtfolio Category
    name: portfolio_category
    widget: select
    options: ["immersive-experiences", "unreal-engine-support", "virtual-production", "corporate-trainings", "Others"]
    multiple: true
    field: { name: categories, widget: string }
    hint: You can only add portfolio categories from the list above, which implies that it can only be an existing service page or "Others".
    allow_add: true
  - &POST_TAGS
    label: Post Tags
    name: tags
    widget: list
    allow_add: true
    field: { name: tags, widget: string }
    required: false
    collapsed: false
  - &IMAGE
    label: Image
    name: image
    widget: image
    required: false
  - &IMAGE_MULTIPLE
    name: image
    label: images
    widget: list
    allow_add: true
    field: *IMAGE
    collapsed: false
  - &TOPTEXT
    label: Top Banner Text
    name: toptext
    widget: string
    required: false
  - &BOTTOMTEXT
    label: Bottom Banner Text
    name: bottomText
    widget: string
    required: false
  - &SUMMARY
    label: Short description/summary
    hint: Shows up on list pages
    name: summary
    widget: string
    required: false
  - &LINK_PATTERN ['(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-?=%.]+','Needs to be a valid link.']
  - &BODY
    label: Body
    name: body
    widget: markdown
    required: false
  - &DRAFT
    label: Draft
    name: draft
    widget: boolean
    default: false
    required: false
  - &SEO_TITLE
    label: SEO Title
    name: seotitle
    widget: string
    required: false
  - &SEO_DESCRIPTION
    label: SEO Description
    name: seodescription
    widget: text
    required: false
  - &AUTHOR_EMAILS
    label: Author Emails
    name: authors
    widget: list
    field:
      label: Email
      name: email
      widget: string
      pattern: ['^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$', 'Check Email Format']
    required: false
    pattern: *LINK_PATTERN
  - &EMAILBASE
    label: Email Address
    name: email
    widget: string
    hint: Please Confirm Before Updating
    pattern: ['^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$', 'Check Email Format']
  - &EMAIL
    <<: *EMAILBASE
    required: true
  - &EMAIL_OPTIONAL
    <<: *EMAILBASE
    required: false

  - &PRIVATE
    label: private
    name: private
    widget: boolean
    default: false
    required: false
    hint: Should this post be hidden from the sitemap?

  - &CANONICAL
    label: Canonical Link
    name: canonical
    required: false
    widget: string
    pattern: *LINK_PATTERN
    hint: Enter the exact canonical link. Leave blank if not valid.
  - &SLUG
    widget: string
    name: slug
    label: Slug
    required: false
    pattern: ['^[a-z0-9]+(?:-[a-z0-9]+)*$','A slug can have no spaces or special characters']
    hint: >-
      The post URL (do not include folder or file extension)

  - &IS_INDEX
    label: "is_index"
    name: "is_index"
    widget: hidden
    default: false

  - &FILTER_SETTINGS
    filter: { field: "is_index", value: false }
  - &NO_INDEX
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *DATE
      - <<: *IMAGE
      - <<: *TOPTEXT
      - <<: *BOTTOMTEXT
      - <<: *PRIVATE
      - <<: *DRAFT
      - label: Body
        name: body
        widget: markdown
        required: false
        hint: Actual body text.
        default: <!-- BODY TEXT -->
      - <<: *IS_INDEX 
    editor:
      preview: false
  - &NO_EDIT_INDEX
    fields:
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *IMAGE
    editor:
      preview: false
backend:
  # name: proxy
  # proxy_url: http://localhost:8081/api/v1
  # branch: master # optional, defaults to master
  name: github
  repo: Green-Rain-Studios/Green-Rain-Website
  branch: v2  # Branch to update (optional; defaults to master)
  base_url: https://green-rain-website.pages.dev
  auth_endpoint: /api/auth

local_backend: true
media_folder: "/images/" # Media files will be stored in the repo under images/uploads
public_folder: "/images/" # The src attribute for uploaded media will begin with /images/uploads

collections:
  - name: consulting
    label: Services
    folder: /content/consulting
    media_folder: '/static/images/'
    public_folder: '/images/'
    create: true
    << : *FILTER_SETTINGS
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *SLUG
      - <<: *DATE
      - <<: *TOPTEXT
      - <<: *BOTTOMTEXT
      - <<: *IMAGE
      - <<: *BODY
      - <<: *DRAFT
      - << : *IS_INDEX
    editor:
      preview: false

  - name: portfolio
    label: Portfolio
    folder: /content/portfolio
    media_folder: '/static/images/'
    public_folder: '/images/'
    create: true
    << : *FILTER_SETTINGS
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *SLUG
      - <<: *DATE
      - <<: *TOPTEXT
      - <<: *BOTTOMTEXT
      - <<: *IMAGE
      - << : *IS_INDEX
      - name: highlights
        label: Highlights
        widget: list
        fields:
        - name: title
          label: Title
          widget: string
        - name: content
          label: Content
          widget: string
      - <<: *PORT_CATEGORIES
        default: "Others"
      - <<: *BODY
      - <<: *DRAFT
    editor:
      preview: false

  - name: blog
    label: Blogs
    folder: /content/blog
    media_folder: '/static/images/'
    public_folder: '/images/'
    << : *FILTER_SETTINGS
    create: true
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *SLUG
      - <<: *DATE
      - <<: *TOPTEXT
      - <<: *BOTTOMTEXT
      - <<: *AUTHOR_EMAILS
      - <<: *IMAGE
      - <<: *POST_CATEGORIES
        default: "Announcements"
      - <<: *POST_TAGS
      - <<: *BODY
      - <<: *DRAFT
      - << : *IS_INDEX
    editor:
      preview: false

  - name: Training
    label: Trainings
    folder: /content/training
    media_folder: '/images/training/'
    public_folder: '/images/training/'
    sortable_fields: ['date', 'title', 'commit_author', 'training_start_date']
    slug: '{{slug}}-{{day}}{{month}}{{year}}'
    create: true
    << : *FILTER_SETTINGS
    fields:
      - <<: *TITLE
      - <<: *SEO_TITLE
      - <<: *SEO_DESCRIPTION
      - <<: *SLUG
      - <<: *DATE
      - <<: *TOPTEXT
      - <<: *BOTTOMTEXT
      - << : *IS_INDEX
      - label: "Training Start Date"
        name: "training_start_date"
        widget: "datetime"
        format: "YYYY-MM-DDTHH:mm:ss+05:30"
      - label: "Training End Date"
        name: "training_end_date"
        widget: "datetime"
        format: "YYYY-MM-DDTHH:mm:ss+05:30"
      - label: "RSVP Link"
        name: "rsvp_link"
        widget: "string"
        required: false
      - label: "Training Website"
        name: "training_website"
        widget: "string"
        required: false
      - label: "Training Join Link"
        name: "training_join_link"
        widget: "string"
        required: false
      - label: "Venue Address"
        name: "venue_address"
        widget: "string"
        required: false
      - label: "Venue Link"
        name: "venue_link"
        widget: "string"
        required: false
      - label: "Sell Link"
        name: "sell_link"
        widget: "object"
        required: false
        fields:
          - label: "USD"
            name: "usd"
            widget: "string"
            required: false
          - label: "INR"
            name: "inr"
            widget: "string"
            required: false
      - label: "Schedules"
        name: "schedules"
        widget: "list"
        required: false
        fields:
        - label: "Title"
          name: "title"
          widget: "string"
          required: false
        - label: "Description"
          name: "description"
          widget: "text"
          required: false
        - label: "Trainings"
          name: "trainings"
          widget: "list"
          required: false
          fields:
            - label: "Module Name"
              name: "module_name"
              widget: "string"
              required: false
            - label: "Module Description"
              name: "module_description"
              widget: "text"
              required: false
            - label: "Module Join Link"
              name: "module_join_link"
              widget: "string"
              required: false
            - label: "Module Start Date"
              name: "module_start_date"
              widget: "datetime"
              required: false
              format: "YYYY-MM-DDTHH:mm:ss+05:30"
            - label: "Module End Date"
              name: "module_end_date"
              widget: "datetime"
              required: false
              format: "YYYY-MM-DDTHH:mm:ss+05:30"
            - label: "Module ID"
              name: "module_id"
              required: false
              widget: "string"
      - <<: *BODY
      - <<: *DRAFT
      - label: "Base64Snippet"
        name: "base64snippet"
        widget: "text"
        required: false
    editor:
      preview: false

  - name: "disclaimer"
    label: "Disclaimer"
    folder: "content/disclaimer"
    sortable_fields: [title','date']
    create: true
    << : *FILTER_SETTINGS
    fields:
      - << : *TITLE
      - << : *SUMMARY
      - << : *DATE
      - << : *SEO_TITLE
      - << : *SEO_DESCRIPTION
      - << : *TOPTEXT
      - << : *BOTTOMTEXT
      - << : *IMAGE
      - << : *IS_INDEX
      - << : *SLUG
      - << : *BODY
      - << : *DRAFT
      - << : *PRIVATE
      - << : *CANONICAL
      - {label: "layout", name: "layout", widget: "hidden", default: "simple"}
    editor:
      preview: false

  - label: "Parent Pages 📃"
    name: "parent-pages"
    files:
      - label: "Portfolio"
        name: "portfolio"
        file: "content/portfolio/_index.md"
        <<: *NO_INDEX
      - label: "Blog Parent Page"
        name: "blog"
        file: "content/blog/_index.md"
        <<: *NO_INDEX
      - label: "Disclaimer Parent Page"
        name: "disclaimer"
        file: "content/disclaimer/_index.md"
        <<: *NO_INDEX
      - label: "About (ONLY EDIT SEO DATA)"
        name: "about"
        file: "content/about/_index.md"
        <<: *NO_EDIT_INDEX
      - label: "Homepage (ONLY EDIT SEO DATA)"
        name: "homepage"
        file: "content/_index.md"
        <<: *NO_EDIT_INDEX