Update nav and tabs
This commit is contained in:
parent
46fe449091
commit
6365f744b4
2 changed files with 20 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
(:file "alert")
|
(:file "alert")
|
||||||
(:file "dropdown")
|
(:file "dropdown")
|
||||||
(:file "table")
|
(:file "table")
|
||||||
|
(:file "navbar")
|
||||||
(:file "header"))))
|
(:file "header"))))
|
||||||
:description ""
|
:description ""
|
||||||
:in-order-to ((test-op (test-op "cl-sbt/tests"))))
|
:in-order-to ((test-op (test-op "cl-sbt/tests"))))
|
||||||
|
|
19
src/component/nav-tab.lisp
Normal file
19
src/component/nav-tab.lisp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
(in-package :cl-sbt)
|
||||||
|
|
||||||
|
(defun tabpanel-class (active fade)
|
||||||
|
(concatenate 'string "tab-pane " (if fade " fade " nil) (if active " in active " nil)))
|
||||||
|
|
||||||
|
(defmacro nav-item (title active url)
|
||||||
|
`(spinneret:with-html
|
||||||
|
(:li :role "presentation"
|
||||||
|
:class ,(if active "active" "")
|
||||||
|
(:a :href (format nil "#~a" ,url)
|
||||||
|
:data-toggle "tab" ,title))))
|
||||||
|
|
||||||
|
(defmacro nav ((&key (tabs nil)) &rest rest)
|
||||||
|
`(spinneret:with-html
|
||||||
|
(:ul :class "nav"
|
||||||
|
:role "tablist"
|
||||||
|
,@(loop for tab in rest
|
||||||
|
collect (destructuring-bind (&key title active id content) tab
|
||||||
|
`(tab-nav ,title ,active ,id))))))
|
Loading…
Add table
Reference in a new issue