;; Events pages — auto-mounted with absolute paths

;; Calendar admin
(defpage calendar-admin
  :path "/<slug>/<calendar_slug>/admin/"
  :auth :admin
  :layout :events-calendar-admin
  :content (calendar-admin-content calendar-slug))

;; Day admin
(defpage day-admin
  :path "/<slug>/<calendar_slug>/day/<int:year>/<int:month>/<int:day>/admin/"
  :auth :admin
  :layout :events-day-admin
  :content (day-admin-content calendar-slug year month day))

;; Slots listing
(defpage slots-listing
  :path "/<slug>/<calendar_slug>/slots/"
  :auth :public
  :layout :events-slots
  :content (slots-content calendar-slug))

;; Slot detail
(defpage slot-detail
  :path "/<slug>/<calendar_slug>/slots/<int:slot_id>/"
  :auth :admin
  :layout :events-slot
  :content (slot-content calendar-slug slot-id))

;; Entry detail
(defpage entry-detail
  :path "/<slug>/<calendar_slug>/day/<int:year>/<int:month>/<int:day>/entries/<int:entry_id>/"
  :auth :admin
  :layout :events-entry
  :content (entry-content calendar-slug entry-id)
  :menu (entry-menu calendar-slug entry-id))

;; Entry admin
(defpage entry-admin
  :path "/<slug>/<calendar_slug>/day/<int:year>/<int:month>/<int:day>/entries/<int:entry_id>/admin/"
  :auth :admin
  :layout :events-entry-admin
  :content (entry-admin-content calendar-slug entry-id)
  :menu (admin-menu))

;; Ticket types listing
(defpage ticket-types-listing
  :path "/<slug>/<calendar_slug>/day/<int:year>/<int:month>/<int:day>/entries/<int:entry_id>/ticket-types/"
  :auth :public
  :layout :events-ticket-types
  :content (ticket-types-content calendar-slug entry-id year month day)
  :menu (admin-menu))

;; Ticket type detail
(defpage ticket-type-detail
  :path "/<slug>/<calendar_slug>/day/<int:year>/<int:month>/<int:day>/entries/<int:entry_id>/ticket-types/<int:ticket_type_id>/"
  :auth :admin
  :layout :events-ticket-type
  :content (ticket-type-content calendar-slug entry-id ticket-type-id year month day)
  :menu (admin-menu))

;; My tickets
(defpage my-tickets
  :path "/tickets/"
  :auth :public
  :layout :root
  :content (tickets-content))

;; Ticket detail
(defpage ticket-detail
  :path "/tickets/<code>/"
  :auth :public
  :layout :root
  :content (ticket-detail-content code))

;; Ticket admin dashboard
(defpage ticket-admin
  :path "/admin/tickets/"
  :auth :admin
  :layout :root
  :content (ticket-admin-content))

;; Markets
(defpage events-markets
  :path "/<slug>/markets/"
  :auth :public
  :layout :events-markets
  :content (markets-content))
