diff of f1353c390f7e0a640c86d2408ebde6dede396334
f1353c390f7e0a640c86d2408ebde6dede396334
diff --git a/src/views/blog-main.lisp b/src/views/blog-main.lisp
index 2efe8a0..7ba1845 100644
--- a/src/views/blog-main.lisp
+++ b/src/views/blog-main.lisp
@@ -36,23 +36,7 @@
(murja.views.components.page:page page-posts)))
-
-
-
-
-(defroute blog-root-view ("/blog/" :method :get
- :decorators (@transaction
- @newui
- (@ssr-authenticated :require-authentication nil)
- @check-if-initial
- @dispatcher)) ()
- '/)
-
-(defroute /only-logged-in-handler ("/only-logged-in"
- :method :get
- :decorators (@transaction
- @newui
- (@ssr-authenticated :require-authentication nil)
- @check-if-initial
- @dispatcher)) ()
- '/only-logged-in)
+
+
+
+
diff --git a/src/views/middleware/newui-dispatcher.lisp b/src/views/middleware/newui-dispatcher.lisp
index 1c48b0a..5307245 100644
--- a/src/views/middleware/newui-dispatcher.lisp
+++ b/src/views/middleware/newui-dispatcher.lisp
@@ -1,6 +1,9 @@
(defpackage murja.newui.dispatcher
(:use :cl :murja.views.components.root :murja.views.components.tab :cl-hash-util)
- (:import-from :murja.newui :c)
+ (:import-from :murja.middleware.db :@transaction)
+ (:import-from :easy-routes :defroute)
+ (:import-from :murja.newui :c :@newui)
+ (:import-from :murja.routes.root-routes :@check-if-initial)
(:import-from :murja.middleware.auth :@ssr-authenticated :*user*)
(:export :@dispatcher :deftab))
@@ -33,14 +36,25 @@
require-login
needed-abilities)
&body rst)
- `(setf (gethash (quote ,sym) *tabs*)
+ `(progn
+ (setf (gethash (quote ,sym) *tabs*)
(make-instance 'tab :route ,route
:abilities ,needed-abilities
:require-login ,require-login
:title ,title
:component (lambda ()
(c :div ()
- ,@rst)))))
+ ,@rst))))
+
+ (defroute ,(intern (format nil "~a-sym" sym)) (,route
+ :method :get
+ :decorators (@transaction
+ @newui
+ (@ssr-authenticated :require-authentication ,require-login )
+ @check-if-initial
+ @dispatcher)) ()
+ (quote ,sym))))
+
(defun @dispatcher (next)
(let* ((sym (funcall next))
(tab (gethash sym *tabs*))