local_backend:
  url: http://localhost:8082/api/v1
  allowed_hosts: ["192.168.0.1"]

backend:
  name: git-gateway

media_folder: "public/media"
public_folder: "/media"

media_library:
  name: cloudinary
  config:
    cloud_name: dsllxh346
    api_key: 916775776984758
    multiple: true

slug:
  encoding: "ascii"
  clean_accents: true

collections:
  - label: "Podstrony"
    name: "pages"
    files:
      - label: "Strona główna"
        name: "home"
        file: "content/pages/homepage.md"
        fields:
          - { label: "Tytuł", name: "title", widget: "string" }
          - { label: "Podtytuł", name: "subtitle", widget: "text" }
          - { label: "Długi tekst", name: "longtext", widget: "text" }
          - {
              label: "Tło",
              name: "backgroundImage",
              widget: "image",
              required: false,
            }
          - {
              label: "Social media",
              name: "socialMedia",
              widget: "list",
              required: false,
              fields:
                [
                  { label: "Link", name: "url", widget: "string" },
                  {
                    label: "Rodzaj",
                    name: "type",
                    widget: "select",
                    options:
                      [
                        { label: "Instagram", value: "ig" },
                        { label: "Facebook", value: "fb" },
                      ],
                    default: "ig",
                  },
                ],
            }
          - {
              label: "FAQ",
              name: "faq",
              widget: "object",
              fields:
                [
                  { label: "Tytuł", name: "title", widget: "string" },
                  { label: "Podtytuł", name: "subtitle", widget: "string" },
                  {
                    label: "Pytania i odpowiedzi",
                    name: "faqList",
                    widget: "list",
                    fields:
                      [
                        {
                          label: "Treść pytania",
                          name: "question",
                          widget: "string",
                        },
                        {
                          label: "Teksty i odnośniki",
                          name: "sections",
                          widget: "list",
                          fields:
                            [
                              {
                                label: "Tekst",
                                name: "text",
                                widget: "markdown",
                              },
                              {
                                label: "Przyciski (odnośniki)",
                                name: "buttons",
                                widget: "list",
                                required: false,
                                fields:
                                  [
                                    {
                                      label: "Tekst przycisku",
                                      name: "label",
                                      widget: "string",
                                    },
                                    {
                                      label: "Odnośnik",
                                      name: "url",
                                      widget: "string",
                                    },
                                  ],
                              },
                            ],
                        },
                      ],
                  },
                ],
            }
          - {
              label: "Sekcja ze zdjęciem",
              name: "imageSection",
              widget: "object",
              fields:
                [
                  { label: "Tytuł", name: "title", widget: "string" },
                  {
                    label: "Miejsca pracy",
                    name: "workLocations",
                    widget: "list",
                    fields:
                      [
                        {
                          label: "Typ pracy",
                          name: "workType",
                          widget: "select",
                          options: ["Stacjonarnie", "Hybrydowo", "Zdalnie"],
                          default: ["Stacjonarnie"],
                        },
                        {
                          label: "Lokalizacja",
                          name: "workLocation",
                          widget: "string",
                        },
                      ],
                  },
                  {
                    label: "Tło (zdjęcie)",
                    name: "backgroundImage",
                    widget: "image",
                  },
                ],
            }
          - {
              label: "Opinie",
              name: "testimonials",
              widget: "object",
              fields:
                [
                  { label: "Tytuł", name: "title", widget: "string" },
                  {
                    label: "Opinie",
                    name: "testimonialList",
                    widget: "list",
                    fields:
                      [
                        {
                          label: "Imię i nazwisko",
                          name: "fullName",
                          widget: "string",
                        },
                        {
                          label: "Tekst opinii",
                          name: "testimonialText",
                          widget: "text",
                        },
                      ],
                  },
                ],
            }
          - {
              label: "O nas",
              name: "about",
              widget: "object",
              fields:
                [
                  { label: "Tytuł", name: "title", widget: "string" },
                  {
                    label: "Sekcje",
                    name: "sections",
                    widget: "list",
                    fields:
                      [
                        { label: "Nagłówek", name: "header", widget: "string" },
                        {
                          label: "Tekst",
                          name: "text",
                          widget: "text",
                          required: false,
                        },
                        {
                          label: "Kafelki",
                          name: "tiles",
                          widget: "list",
                          required: false,
                          fields:
                            [
                              {
                                label: "Nagłówek kafelka",
                                name: "tileHeader",
                                widget: "string",
                              },
                              {
                                label: "Tekst kafelka",
                                name: "tileText",
                                widget: "text",
                              },
                            ],
                        },
                      ],
                  },
                ],
            }

      - label: "Kontakt"
        name: "contact"
        file: "content/pages/contact.md"
        fields:
          - { label: "Title", name: "title", widget: "string" }
          - { label: "Subtitle", name: "subtitle", widget: "string" }

      - label: "Cennik"
        name: "price-list"
        file: "content/pages/price-list.md"
        fields:
          - { label: "Title", name: "title", widget: "string" }
          - { label: "Subtitle", name: "subtitle", widget: "string" }

      - label: "Porfolio"
        name: "portfolio"
        file: "content/pages/portfolio.md"
        fields:
          - { label: "Tytuł", name: "title", widget: "string" }
          - {
              label: "Paragrafy",
              name: "paragraphs",
              widget: "list",
              summary: "{{fields.paragraph}}",
              field: { label: "Tekst", name: "paragraph", widget: "text" },
            }

  - label: "Projekty"
    name: "projects"
    widget: "object"
    folder: "content/projects"
    sortable_fields: ["order", "title"]
    summary: "{{fields.order}}. {{fields.title}} {{fields.isOnHomepage | ternary('STRONA GŁÓWNA','')}}"
    create: true
    fields:
      - label: "Kolejność"
        name: "order"
        widget: "number"
        default: 1
        value_type: "int"
        min: 1
        step: 1
      - label: "Strona główna"
        name: "isOnHomepage"
        widget: "boolean"
        required: false
      - label: "Tytuł"
        name: "title"
        widget: "string"
      - label: "Opis"
        name: "description"
        widget: "text"
      - label: "Lokalizacja"
        name: "location"
        widget: "string"
        required: false
      - label: "Data"
        name: "date"
        widget: "string"
        required: false
      - label: "Typ projektu"
        name: "projectType"
        widget: "string"
        required: false
      - label: "Instagram"
        name: "instaLink"
        widget: "string"
        required: false
      - label: "Zdjęcia"
        name: "images"
        widget: "list"
        required: true
        summary: "{{fields.image}}"
        fields:
          - { label: "Obraz", name: "image", widget: "image" }
          - { label: "Krótki opis", name: "alt", widget: "string" }
          - { label: "Wysokość zdjęcia", name: "height", widget: "number" }
          - { label: "Szerokość zdjęcia", name: "width", widget: "number" }

  - label: "Cenniki"
    name: "price-lists"
    widget: "object"
    folder: "content/price-list"
    create: true
    fields:
      - label: "Tytuł"
        name: "title"
        widget: "string"
      - label: "Opis"
        name: "description"
        widget: "text"
      - label: "Rodzaj"
        name: "type"
        widget: "select"
        options:
          - { label: "Pakiety podstawowe", value: "basic" }
          - { label: "Usługi dodatkowe", value: "additional" }
        default: "basic"
      - label: "Zdjęcie"
        name: "image"
        widget: "image"
      - label: "Oferta"
        name: "offer"
        widget: "list"
        fields:
          - label: "Tytuł"
            name: "title"
            widget: "text"
          - label: "Opis"
            name: "description"
            widget: "text"
          - label: "Odnośniki"
            name: "urls"
            multiple: true
            max: 2
            required: false
            widget: "relation"
            collection: "price-lists"
            search_fields: ["title", "description"]
            value_field: "{{slug}}__{{title}}"
            display_fields: ["title", "description"]
          - label: "Zdjęcie"
            name: "image"
            widget: "image"
            required: false

  - label: "Stopka"
    name: "footer"
    widget: "object"
    files:
      - label: "Dane stopki"
        name: "footerData"
        file: "content/footer.md"
        fields:
          - label: "Tytuł"
            name: "title"
            widget: "string"
          - label: "Dane osobowe"
            name: "fullnames"
            widget: "list"
            fields:
              - label: "Imię i nazwisko"
                name: "fullname"
                widget: "string"
          - label: "Lokalizacje"
            name: "locations"
            widget: "list"
            fields:
              - label: "Nazwa lokalizacji"
                name: "location"
                widget: "string"
          - label: "Numery telefonów"
            name: "phoneNumbers"
            widget: "list"
            fields:
              - label: "Numer telefonu"
                name: "phoneNumber"
                widget: "string"
          - label: "Email"
            name: "email"
            widget: "string"
          - label: "Social media"
            name: "socialMedia"
            widget: "list"
            fields:
              - label: "Rodzaj"
                name: "type"
                widget: "select"
                options:
                  - label: "Instagram"
                    value: "ig"
                  - label: "Facebook"
                    value: "fb"
                default: "ig"
              - label: "Link"
                name: "url"
                widget: "string"
