nrepl, linting, refactoring
This commit is contained in:
parent
b837fa5a7d
commit
1ef117de29
@ -10,7 +10,8 @@
|
||||
[hickory "0.7.1"]
|
||||
[environ "1.1.0"]]
|
||||
:plugins [[lein-ring "0.12.5"]]
|
||||
:ring {:handler clojsa.handler/app}
|
||||
:ring {:handler clojsa.handler/app
|
||||
:nrepl {:start? true :port 9000}}
|
||||
:uberjar-name "clojsa-standalone.jar"
|
||||
:profiles
|
||||
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
|
||||
|
@ -1,6 +1,5 @@
|
||||
(ns clojsa.saclient
|
||||
(:require [clojure.string :as string]
|
||||
[http.async.client :as http]))
|
||||
(:require [http.async.client :as http]))
|
||||
|
||||
|
||||
(def url "https://forums.somethingawful.com/")
|
||||
|
@ -1,8 +1,6 @@
|
||||
(ns clojsa.views
|
||||
(:use [hiccup core page])
|
||||
(:require [clojure.string :as string]
|
||||
[clojure.pprint]
|
||||
[clojure.java.io :as io]
|
||||
(:require [clojure.pprint]
|
||||
[ring.util.anti-forgery :refer [anti-forgery-field]]))
|
||||
|
||||
|
||||
@ -46,38 +44,42 @@
|
||||
[:label.label {:for "username"}
|
||||
"username"]
|
||||
[:div.control
|
||||
[:input#username.input {:name "username" :type "text" :placeholder "enter your username"}]]]
|
||||
[:input#username.input {:name "username" :type "text"
|
||||
:placeholder "enter your username"}]]]
|
||||
[:div.field
|
||||
[:label.label {:for "password"}
|
||||
"password"]
|
||||
[:div.control
|
||||
[:input#password.input {:name "password" :type "password" :placeholder "enter your password"}]]]
|
||||
[:input#password.input {:name "password" :type "password"
|
||||
:placeholder "enter your password"}]]]
|
||||
[:div.field
|
||||
[:div.control
|
||||
[:button.button.is-primary "Submit"]]]]]))
|
||||
|
||||
(defn paginate [base cur last]
|
||||
(let [page-fstring "%s?page=%d"
|
||||
href (partial format page-fstring base)]
|
||||
[:nav.container.box.pagination {:hx-boot "false"}
|
||||
[:a.pagination-previous
|
||||
{:href (format "%s?page=%d" base (dec cur))} "<"]
|
||||
{:href (href (dec cur))} "<"]
|
||||
[:a.pagination-next
|
||||
{:href (format "%s?page=%d" base (inc cur))} ">"]
|
||||
{:href (href (inc cur))} ">"]
|
||||
[:ul.pagination-list
|
||||
[:li
|
||||
[:a.pagination-link
|
||||
{:href (format "%s?page=%d" base 1)} (str 1)]]
|
||||
{:href (href 1)} (str 1)]]
|
||||
[:li
|
||||
[:span.pagination-ellipsis "…"]]
|
||||
(for [i (range (- cur 2) (+ cur 3))]
|
||||
[:li
|
||||
[:a.pagination-link
|
||||
{:href (format "%s?page=%d" base i)
|
||||
{:href (href i)
|
||||
:class (when (= i cur) "is-current")} (str i)]])
|
||||
[:li
|
||||
[:span.pagination-ellipsis "…"]]
|
||||
[:li
|
||||
[:a.pagination-link
|
||||
{:href (format "%s?page=%d" base last)} (str last)]]]])
|
||||
{:href (href last)} (str last)]]]]))
|
||||
|
||||
(defn thread-page [thread]
|
||||
(let [{:keys [id title page page-count content]} thread]
|
||||
|
Loading…
Reference in New Issue
Block a user