multiple content displayed when exists

This commit is contained in:
David Botton 2022-05-10 13:07:09 -04:00
parent eb3f82579c
commit 013f474652
2 changed files with 43 additions and 47 deletions

View file

@ -224,14 +224,14 @@ CAN-SHOW-COMMENTS and if CAN-EDIT unless they are set to nil."
(when follow-url-page
(when (second url)
(setf page (second url))))
(let ((content (car (load-content
sql-connection table page))))
;; Page Content Display
(let ((pages (load-content sql-connection table page)))
(dolist (content pages)
(when content
(when on-content
(setf content (funcall on-content obj content)))
(funcall theme obj :content-body
(list :content content
:base-url (format nil "~A/~A" base-url page)
:save-edit (when (clog-auth:is-authorized-p roles can-edit)
(lambda (content)
(when on-edit
@ -269,7 +269,8 @@ CAN-SHOW-COMMENTS and if CAN-EDIT unless they are set to nil."
(when content
(dbi:do-sql
sql-connection
(sql-insert* comment-table content)))))))))
(sql-insert* comment-table content))))))))))
;; Comments Display
(when (and (clog-auth:is-authorized-p roles can-show-comments)
comment-table)
(let ((comments (load-content sql-connection comment-table page
@ -280,10 +281,6 @@ CAN-SHOW-COMMENTS and if CAN-EDIT unless they are set to nil."
(setf comment (funcall on-comment obj comment)))
(funcall theme obj :content-comment
(list :content comment
:base-url (format nil "~A/~A/comment/~A"
base-url
page
(getf comment :|key|))
:do-delete (when (or (clog-auth:is-authorized-p roles can-admin)
(and (getf prof :|username|)
(equalp (getf comment :|username|)

View file

@ -64,7 +64,6 @@ Page properties:
(signup-link (get-setting website :signup-link "/signup"))
(username-link (get-setting website :username-link "/logout"))
(menu-property (get-property properties :menu "w3-black"))
(base-url (get-property properties :base-url "/"))
(content (get-property properties :content "")))
(cond ((or (eq page :content-body) ; data based content layout
(eq page :blog-body)) ; blog based content layout