invoices page works, needs dialog.

This commit is contained in:
2024-03-09 21:25:55 -08:00
parent d73a3153bb
commit fb2eefc9ac
8 changed files with 636 additions and 51 deletions

View File

@@ -6,6 +6,7 @@
[auto-ap.routes.admin.transaction-rules :as transaction-rules]
[auto-ap.routes.admin.vendors :as v-routes]
[auto-ap.routes.payments :as payment-routes]
[auto-ap.routes.invoice :as invoice-route]
[auto-ap.ssr-routes :as ssr-routes]
[auto-ap.ssr.hiccup-helper :as hh]
[auto-ap.ssr.hx :as hx]
@@ -78,17 +79,21 @@
:icon svg/accounting-invoice-mail}
"Invoices")
(sub-menu- (hx/alpine-appear {:x-show "open"})
(menu-button- {:href (bidi/path-for client-routes/routes
:invoices)}
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/page)
{:date-range "month"})}
"All")
(menu-button- {:href (bidi/path-for client-routes/routes
:paid-invoices)}
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/page)
{:date-range "month"})}
"Paid")
(menu-button- {:href (bidi/path-for client-routes/routes
:unpaid-invoices)}
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/unpaid-page)
{:date-range "month"})}
"Unpaid")
(menu-button- {:href (bidi/path-for client-routes/routes
:voided-invoices)}
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/voided-page)
{:date-range "month"})}
"Voided"))]
[:li {:x-data (hx/json {:open false})}
(menu-button- {:icon svg/receipt-register-1

View File

@@ -0,0 +1,30 @@
(ns auto-ap.ssr.components.link-dropdown
(:require [auto-ap.ssr.components :as com]
[auto-ap.ssr.hx :as hx]
[auto-ap.ssr.svg :as svg]))
(defn link-dropdown [links]
(if (<= (count links) 2)
[:div.flex.flex-col.gap-y-2
(for [l links]
[:div.flex-initial
[:a {:href (:link l)}
(com/pill {:color (or (:color l) :primary) :class "truncate"}
(:content l))]])]
[:div {:x-data (hx/json {:popper nil
:show false})
"@click.outside" "show=false"
:x-init "popper = Popper.createPopper($refs.link, $refs.tooltip, {placement: 'bottom', strategy: 'fixed'})"}
(com/a-icon-button {:x-ref "link" "@click.prevent" "show=!show; $nextTick(() => popper.update());" :class "relative"}
svg/three-dots
(com/badge {} (count links)))
[:div.divide-y.divide-gray-200.bg-white.rounded-lg.shadow (hx/alpine-appear {:x-ref "tooltip" :x-show "show" :data-key "show"})
[:div {:class "p-3 overflow-y-auto text-sm text-gray-700 dark:text-gray-200"}
[:div.flex.flex-col.gap-y-2
(for [l links]
[:div.flex-initial
[:a {:href (:link l)}
(com/pill {:color (or (:color l) :primary) :class "truncate w-24 block shrink grow-0"}
(:content l))]])]]]]))