Use global views for navbar
This commit is contained in:
parent
3179d72c81
commit
07340a4374
9 changed files with 27 additions and 13 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
(defsystem "dev.metalisp.survey"
|
||||
:description "Create questionnaires and analyze the results."
|
||||
:version "0.5.22"
|
||||
:version "0.5.23"
|
||||
:author "Marcus Kammer <marcus.kammer@mailbox.org>"
|
||||
:source-control (:git "https://code.metalisp.dev/marcuskammer/dev.metalisp.survey.git")
|
||||
:licence "MIT"
|
||||
|
@ -15,8 +15,12 @@
|
|||
:components ((:file "package")
|
||||
(:file "survey")
|
||||
(:file "questionnaire")))
|
||||
(:module "views/"
|
||||
:serial t
|
||||
:components ((:file "package")
|
||||
(:file "navbar")))
|
||||
(:module "survey/"
|
||||
:depends-on ("models/")
|
||||
:depends-on ("models/" "views/")
|
||||
:serial t
|
||||
:components ((:file "package")
|
||||
(:file "view")
|
||||
|
@ -28,13 +32,13 @@
|
|||
(:file "view")
|
||||
(:file "handler")))
|
||||
(:module "surveys/"
|
||||
:depends-on ("models/")
|
||||
:depends-on ("models/" "views/")
|
||||
:serial t
|
||||
:components ((:file "package")
|
||||
(:file "view")
|
||||
(:file "handler")))
|
||||
(:module "create/"
|
||||
:depends-on ("models/")
|
||||
:depends-on ("models/" "views/")
|
||||
:serial t
|
||||
:components ((:file "package")
|
||||
(:file "view")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; -*- mode: lisp; coding: utf-8; -*-
|
||||
(defpackage :ml-survey/create
|
||||
(:use #:cl #:ml-survey/models)
|
||||
(:use #:cl #:ml-survey/models #:ml-survey/views)
|
||||
(:import-from #:hunchentoot
|
||||
#:define-easy-handler)
|
||||
(:import-from #:ml-sbt/navbar
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
(lang "en"))
|
||||
(with-page (:title "Create")
|
||||
(with-body-header "fluid" "Create" lang
|
||||
(with-navbar "fluid" "metalisp.survey" "/" "Create"
|
||||
"Home" "/" "Create" "/create"))
|
||||
(survey-navbar "Create"))
|
||||
(with-body-main "fluid"
|
||||
;; If `questionnaires' is an empty list, show the user an warning
|
||||
;; message.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; -*- mode: lisp; coding: utf-8; -*-
|
||||
(defpackage :ml-survey/survey
|
||||
(:use #:cl #:ml-survey/models)
|
||||
(:use #:cl #:ml-survey/models #:ml-survey/views)
|
||||
(:import-from #:hunchentoot
|
||||
#:define-easy-handler)
|
||||
(:import-from #:ml-sbt/section
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
(let ((lang "en"))
|
||||
(with-page (:title "Survey Details")
|
||||
(with-body-header "fluid" "Survey Details" lang
|
||||
(with-navbar "fluid" "metalisp.survey" "/" "Surveys"
|
||||
"Surveys" "/" "Create" "/create"))
|
||||
(survey-navbar "Surveys"))
|
||||
(with-body-main "fluid"
|
||||
(:div :class "row"
|
||||
(with-section-props (with-title-bar "Properties")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
;;; -*- mode: lisp; coding: utf-8; -*-
|
||||
(defpackage :ml-survey/surveys
|
||||
(:use #:cl #:ml-survey/models)
|
||||
(:use #:cl #:ml-survey/models #:ml-survey/views)
|
||||
(:import-from #:hunchentoot
|
||||
#:define-easy-handler)
|
||||
(:import-from #:ml-sbt/navbar
|
||||
|
|
|
@ -18,8 +18,7 @@ SURVEYS: List of survey objects."
|
|||
(let ((lang "en"))
|
||||
(with-page (:title "Surveys")
|
||||
(with-body-header "fluid" "Surveys" lang
|
||||
(with-navbar "fluid" "metalisp.survey" "/" "Surveys"
|
||||
"Surveys" "/" "Create" "/create"))
|
||||
(survey-navbar "Surveys"))
|
||||
(with-body-main "fluid"
|
||||
(when surveys
|
||||
(with-section
|
||||
|
|
8
src/views/navbar.lisp
Normal file
8
src/views/navbar.lisp
Normal file
|
@ -0,0 +1,8 @@
|
|||
;;; -*- mode: lisp; coding: utf-8; -*-
|
||||
|
||||
(in-package :ml-survey/views)
|
||||
|
||||
(defmacro survey-navbar (active-item)
|
||||
`(ml-sbt/navbar:with-navbar "fluid" "metalisp.survey" "/"
|
||||
,active-item
|
||||
"Surveys" "/" "Create" "/create"))
|
5
src/views/package.lisp
Normal file
5
src/views/package.lisp
Normal file
|
@ -0,0 +1,5 @@
|
|||
;;; -*- mode: lisp; coding: utf-8; -*-
|
||||
|
||||
(defpackage :ml-survey/views
|
||||
(:use #:cl)
|
||||
(:export #:survey-navbar))
|
Loading…
Add table
Reference in a new issue