Merge branch 'work'
This commit is contained in:
commit
442c80ea98
@ -3,3 +3,9 @@ document.body.addEventListener('configRequest.htmx', (e) => {
|
||||
e.detail.parameters['__anti-forgery-token'] = __csrfToken;
|
||||
}
|
||||
});
|
||||
|
||||
document.querySelectorAll('.bbc-spoiler').forEach(elem => {
|
||||
elem.addEventListener('click', e => {
|
||||
e.target.classList.toggle('active');
|
||||
});
|
||||
});
|
||||
|
@ -14,6 +14,15 @@
|
||||
:pagenumber page}]
|
||||
{:href base-url :params query})))
|
||||
|
||||
(defn do-login []
|
||||
(let [login-url (str url "account.php")
|
||||
cs (clj-http.cookies/cookie-store)]
|
||||
(client/post login-url {:form-params {:action "login"
|
||||
:username "xf86enodev"
|
||||
:password "triebhaftigke1t"}
|
||||
:cookie-store cs})
|
||||
(clj-http.cookies/get-cookies cs)))
|
||||
|
||||
(defn thread-response [session url]
|
||||
(with-open [client (http/create-client)]
|
||||
(let [{:keys [href params]} url
|
||||
|
@ -30,13 +30,14 @@
|
||||
(include-js "/js/main.js")]))
|
||||
|
||||
(defn index-page [req]
|
||||
(main-template {}
|
||||
(main-template
|
||||
{}
|
||||
[:div.container
|
||||
[:pre
|
||||
(clojure.pprint/pprint req)]]))
|
||||
[:pre.output
|
||||
[:code (with-out-str (clojure.pprint/pprint req))]]]))
|
||||
|
||||
(defn paginate [id cur last]
|
||||
[:nav.container.pagination {:hx-boot "false"}
|
||||
[:nav.container.box.pagination {:hx-boot "false"}
|
||||
[:a.pagination-previous
|
||||
{:href (format "/thread/%d?page=%d" id (dec cur))} "<"]
|
||||
[:a.pagination-next
|
||||
@ -66,10 +67,16 @@
|
||||
[:h1.is-size-3.mb-4 title]]
|
||||
[:section.thread
|
||||
(for [post content]
|
||||
[:article.container.box.columns
|
||||
[:aside.userinfo.column
|
||||
[:article.container.box
|
||||
[:div.tile.is-ancestor
|
||||
[:aside.userinfo.tile.is-3.is-parent
|
||||
(:ui post)]
|
||||
[:main.postbody.content.column.is-four-fifths
|
||||
(:pb post)]])]
|
||||
[:main.postbody.content.tile.is-9.is-parent.is-vertical
|
||||
[:div.tile.is-child
|
||||
(:pb post)]
|
||||
[:div.level.tile.is-child.is-12
|
||||
[:div.level-right
|
||||
[:span.postdate.level-item
|
||||
(:pd post)]]]]]])]
|
||||
[:section
|
||||
(paginate id page page-count)])))
|
||||
|
Loading…
Reference in New Issue
Block a user