##
## Comment out the following 'backend' config
## when doing local development on Decap CMS
##

backend:
  name: github
  repo: OIG-SSAgov/federalist-uswds-jekyll2
  base_url: https://pages.cloud.gov
  auth_endpoint: external/auth/github
  preview_context: pages/build
  branch: main

##
## Uncomment when doing local development on Decap CMS
## Run `npx decap-server` to start working locally
## In another terminal, start the app with `npm start`
## See https://decapcms.org/docs/working-with-a-local-git-repository/
##

# backend:
#   name: git-gateway
# local_backend: true

media_folder: /assets/uploads
public_folder: /assets/uploads
images_folder: /assets/uploads
publish_mode: editorial_workflow
logo_url: /assets/images/OIG_Long_Logo.svg

collections:
  - label: About OIG
    name: about_oig
    folder: _about_oig/
    create: true
    slug: "{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Audit Reports
    name: audit_reports
    folder: _audit_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "audit_report",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - {
          label: "Audit Report Number",
          name: "audit_number",
          widget: "string",
          required: true,
        }
      - {
          label: "Full Report URL",
          name: "full_report",
          widget: "string",
          required: false,
        }
      - {
          label: "Summary Report URL",
          name: "summary_report",
          widget: "string",
          required: false,
        }
      - {
          label: "Published",
          name: "published",
          widget: "boolean",
          default: true,
        }
      - {
          label: "Management Challenge",
          name: "category",
          widget: "select",
          options:
            [
              "Improve Administration of the Disability Programs",
              "Improve Service Delivery",
              "Improve the Prevention, Detection, and Recovery of Improper Payments",
              "Manage Human Capital",
              "Modernize Information Technology",
              "Protect the Confidentiality, Integrity, and Availability of SSA’s information Systems and Data",
              "SSA’s Response to the 2019 Novel Coronavirus Pandemic",
            ],
          required: false,
        }
      - { label: "Tags", name: "tags", widget: "list" }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Audit Work Plans
    name: audit_work_plans
    folder: _audit_work_plans/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "audit_work_plan",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Congressional Testimony
    name: congressional_testimony
    folder: _congressional_testimony/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "congressional_testimony",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - {
          label: "OIG Official",
          name: "official",
          widget: "string",
          required: true,
        }
      - {
          label: "Committee/Subcommittee",
          name: "committee",
          widget: "string",
          required: true,
        }
      - { label: "Link", name: "link", widget: "string", required: true }
      - {
          label: "Published",
          name: "published",
          widget: "boolean",
          default: true,
        }
      - { label: "Body", name: "body", widget: "markdown", required: false }

  - label: Espanol
    name: espanol
    folder: _espanol/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Fraud Reporting
    name: fraud_reporting
    folder: _fraud_reporting/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Law Enforcement-Related Publications
    name: law_enforcement_related_publications
    folder: _law_enforcement_related_publications/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "publications",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Link", name: "link", widget: "string" }
      - { label: "Body", name: "body", widget: "markdown", required: false }

  - label: News Releases
    name: news_releases
    folder: _news_releases/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "newsroom",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - {
          label: "Source",
          name: "source",
          widget: "relation",
          collection: "file_collection",
          file: "news_sources",
          search_fields: ["sources.*.name"],
          display_fields: ["sources.*.name"],
          value_field: "sources.*.name",
          options_length: -1,
        }
      - {
          label: "Topic",
          name: "topic",
          widget: "relation",
          collection: "file_collection",
          file: "news_topics",
          search_fields: ["topics.*.name"],
          display_fields: ["topics.*.name"],
          value_field: "topics.*.name",
          options_length: -1,
        }      
      - { label: "Link", name: "link", widget: "string", required: true }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Offices
    name: Offices
    folder: _about_oig/offices
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Other Reports
    name: other_reports
    folder: _other_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "post" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Link", name: "link", widget: "string" }
      - { label: "Body", name: "body", widget: "markdown", required: false }

  - label: Peer Review Reports
    name: peer_review_reports
    folder: _peer_review_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "peer_review_reports",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Performance Reports
    name: performance_reports
    folder: _performance_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "performance_reports",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Quarterly Scam Reports
    name: quarterly_scam_reports
    folder: _quarterly_scam_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "quarterly_scam_reports",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - {
          label: "Report URL",
          name: "report",
          widget: "string",
          required: true,
        }
      - { label: "Body", name: "body", widget: "markdown", required: false }

  - label: Semiannual Reports
    name: semiannual_reports
    folder: _semiannual_reports/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - {
          label: "Layout",
          name: "layout",
          widget: "hidden",
          default: "semiannual_reports",
        }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - {
          label: "Report URL",
          name: "report",
          widget: "string",
          required: true,
        }
      - { label: "Body", name: "body", widget: "markdown", required: false }

  - label: Scam Alerts
    name: scam_alerts
    folder: _scam_alerts/
    create: true
    publish: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Link", name: "link", widget: "string", required: true }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Scam Awareness
    name: scam_awareness
    folder: _scam_awareness/
    create: true
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Other pages
    name: page
    folder: _pages/
    create: true
    slug: "{{slug}}"
    editor:
      preview: true
    fields:
      - { label: "Layout", name: "layout", widget: "hidden", default: "page" }
      - { label: "Title", name: "title", widget: "string" }
      - {
          label: "Publish Date",
          name: "date",
          widget: "datetime",
          format: "YYYY-MM-DD",
          date_format: "YYYY-MM-DD",
          time_format: false,
        }
      - { label: "Excerpt", name: "excerpt", widget: "string", required: false }
      - { label: "Body", name: "body", widget: "markdown" }

  - label: Homepage
    name: homepage
    files:
      - label: Home
        name: home
        file: "/index.html"
        create: false
        editor:
          preview: false
        fields:
          - label: Main feature
            name: feature_main
            widget: object
            required: false
            fields:
              - { label: Title, name: title, widget: string }
              - { label: Description, name: description, widget: string }
              - label: "Link"
                name: "link"
                widget: "object"
                fields:
                  - { label: "URL", name: "url", widget: "string" }
                  - { label: "Label", name: "label", widget: "string" }
              - label: "Image"
                name: "image"
                widget: "object"
                fields:
                  - { label: Image, name: image, widget: image }
                  - { label: "Alt text", name: "alt_text", widget: "string" }
          - label: Other features
            name: feature_other
            widget: list
            required: false
            fields:
              - { label: Title, name: title, widget: string }
              - { label: Description, name: description, widget: string }
              - label: "Link"
                name: "link"
                widget: "object"
                fields:
                  - { label: "URL", name: "url", widget: "string" }
                  - { label: "Label", name: "label", widget: "string" }
              - label: "Image"
                name: "image"
                widget: "object"
                required: false
                fields:
                  - {
                      label: Image,
                      name: image,
                      widget: image,
                      required: false,
                    }
                  - {
                      label: "Alt text",
                      name: "alt_text",
                      widget: "string",
                      required: false,
                    }

  - label: "Files Collection"
    name: "file_collection"
    editor:
      preview: false
    files:
      - label: "News Release Sources"
        name: "news_sources"
        file: "_data/sources.yml"
        fields:
          - label: Sources
            name: sources
            widget: list
            fields:
              - { label: "Name", name: "name", widget: "string" }
      - label: "News Topics"
        name: "news_topics"
        file: "_data/news_topics.yaml"
        fields:
          - label: Topics
            name: topics
            widget: list
            fields:
              - { label: "Name", name: "name", widget: "string" }
        
