# Sveltia CMS configuration (Decap-compatible).
# Admins sign in at /admin — every save is a git commit to the GitHub repo,
# which triggers the Azure Static Web Apps GitHub Action and redeploys (~2 min).
#
# AUTH: this uses the GitHub backend. The quickest login (no server needed) is
# the "Sign In with Token" button on the /admin login screen — paste a GitHub
# Personal Access Token that has write access to the repo. To give non-technical
# admins a one-click "Sign in with GitHub" button instead, set up an OAuth app +
# auth worker and uncomment base_url below (see README → "CMS setup").

backend:
  name: github
  repo: Crsknnth1/HopeCenterss
  branch: main
  # ONE-CLICK "Sign in with GitHub": deploy the auth worker, then uncomment the
  # line below and set it to your Cloudflare Worker URL (no trailing slash).
  # base_url: https://sveltia-cms-auth.YOUR_SUBDOMAIN.workers.dev
  commit_messages:
    create: "content: create {{collection}} “{{slug}}”"
    update: "content: update {{collection}} “{{slug}}”"
    delete: "content: delete {{collection}} “{{slug}}”"
    uploadMedia: "content: upload “{{path}}”"
    deleteMedia: "content: delete “{{path}}”"

site_url: https://www.africanhopecenters.org
logo_url: /favicon.svg

# Drag-and-drop uploads (photos, newsletter PDFs) land here:
media_folder: public/uploads
public_folder: /uploads

collections:
  - name: settings
    label: Site Settings
    icon: settings
    files:
      - name: site
        label: Contact Info & Donation Links
        file: content/settings/site.json
        fields:
          - { name: orgName, label: Organization name, widget: string }
          - { name: orgShortName, label: Short name, widget: string }
          - { name: tagline, label: Tagline, widget: string }
          - { name: logo, label: Logo image, widget: image, required: false, hint: "Shown in the site header. Use a PNG with a transparent background for best results." }
          - { name: phone, label: Phone, widget: string }
          - { name: email, label: Email, widget: string }
          - { name: address, label: Mailing address, widget: string }
          - { name: checkPayee, label: Make checks payable to, widget: string }
          - { name: stripeOneTimeUrl, label: Stripe Payment Link (one-time), widget: string, required: false, hint: "Create in Stripe Dashboard → Payment Links, then paste the URL here." }
          - { name: stripeMonthlyUrl, label: Stripe Payment Link (monthly), widget: string, required: false }
          - { name: paypalUrl, label: PayPal donate URL, widget: string, required: false }
          - { name: venmoQrImage, label: Venmo QR code image, widget: image, required: false }
          - { name: venmoHandle, label: Venmo handle (without @), widget: string, required: false }
          - { name: web3formsKey, label: Web3Forms access key (contact form), widget: string, required: false, hint: "Free key from web3forms.com — enables the contact form." }
          - { name: facebookUrl, label: Facebook page URL, widget: string, required: false }

  - name: pages
    label: Page Content
    icon: article
    folder: content/pages
    create: false
    delete: false
    fields:
      - { name: title, label: Page title, widget: string }
      - { name: heroHeadline, label: Headline, widget: string, required: false }
      - { name: heroSub, label: Subheadline, widget: string, required: false }
      - { name: heroImage, label: Hero image, widget: image, required: false }
      - { name: intro, label: Intro paragraph, widget: text, required: false }
      - name: stats
        label: Stats (home page)
        widget: list
        required: false
        fields:
          - { name: value, label: Number, widget: string }
          - { name: label, label: Label, widget: string }
      - name: locations
        label: Location cards (home page)
        widget: list
        required: false
        fields:
          - { name: name, label: Place, widget: string }
          - { name: country, label: Country, widget: string }
          - { name: description, label: Description, widget: text }
          - { name: image, label: Photo, widget: image }
          - { name: link, label: "Links to (page URL)", widget: string, required: false, hint: "e.g. /locations/luweero/" }
      - name: services
        label: Services (New Here page)
        widget: list
        required: false
        fields:
          - { name: title, label: Title, widget: string }
          - { name: description, label: Description, widget: text }
      - { name: funds, label: "Donation funds (Donate page)", widget: list, required: false, field: { name: fund, label: Fund, widget: string } }
      - { name: body, label: Page text, widget: markdown, required: false }

  - name: locations
    label: Locations
    label_singular: Location
    icon: place
    folder: content/locations
    create: true
    sortable_fields: [order, name]
    summary: "{{name}} — {{country}}"
    fields:
      - { name: name, label: Location name, widget: string }
      - { name: country, label: Country, widget: string }
      - { name: order, label: Display order, widget: number, default: 99 }
      - { name: heroImage, label: Hero image, widget: image, required: false }
      - { name: intro, label: Intro paragraph, widget: text, required: false }
      - name: stats
        label: Stats
        widget: list
        required: false
        fields:
          - { name: value, label: Number, widget: string }
          - { name: label, label: Label, widget: string }
      - { name: galleryLink, label: "Related photo album link", widget: string, required: false, hint: "e.g. /gallery/bogoro-hope-center/" }
      - { name: body, label: Story, widget: markdown, required: false }

  - name: newsletters
    label: Newsletters
    label_singular: Newsletter
    icon: newspaper
    folder: content/newsletters
    create: true
    sortable_fields: [date, title]
    summary: "{{title}} ({{date | date('MMM YYYY')}})"
    fields:
      - { name: title, label: Title, widget: string, hint: "e.g. Spring 2026" }
      - { name: date, label: Issue date, widget: datetime, time_format: false, format: "YYYY-MM-DD" }
      - { name: pdf, label: Newsletter PDF, widget: file, hint: "Drag and drop the PDF here — it uploads automatically." }

  - name: galleries
    label: Photo Galleries
    label_singular: Album
    icon: photo_library
    folder: content/galleries
    create: true
    sortable_fields: [date, title]
    fields:
      - { name: title, label: Album title, widget: string }
      - { name: date, label: Date, widget: datetime, time_format: false, format: "YYYY-MM-DD" }
      - { name: description, label: Short description, widget: text, required: false }
      - { name: cover, label: Cover photo, widget: image }
      - name: images
        label: Photos
        widget: list
        hint: "Add photos one by one, or drag multiple files onto the image field."
        fields:
          - { name: image, label: Photo, widget: image }
          - { name: caption, label: Caption, widget: string, required: false }
      - { name: body, label: Album intro text, widget: markdown, required: false }

  - name: staff
    label: Staff & Board
    label_singular: Person
    icon: groups
    folder: content/staff
    create: true
    sortable_fields: [order, name]
    summary: "{{name}} — {{role}}"
    fields:
      - { name: name, label: Name, widget: string }
      - { name: role, label: Role / title, widget: string }
      - { name: photo, label: Photo, widget: image, required: false }
      - { name: email, label: Email, widget: string, required: false }
      - { name: phone, label: Phone, widget: string, required: false }
      - { name: order, label: Display order, widget: number, default: 99 }
      - { name: body, label: Bio, widget: markdown, required: false }

  - name: history
    label: History Timeline
    label_singular: Milestone
    icon: history_edu
    folder: content/history
    create: true
    sortable_fields: [order]
    summary: "{{year}} — {{title}}"
    fields:
      - { name: year, label: Year (e.g. 2014 or 2004–2005), widget: string }
      - { name: title, label: Milestone title, widget: string }
      - { name: order, label: Timeline position (1 = first), widget: number }
      - { name: image, label: Photo, widget: image, required: false }
      - { name: body, label: What happened, widget: markdown }
