use pretty formatting on not found page, remove github PR link fixes #54 fixes #27 fixes #23

This commit is contained in:
Morgan Astra 2016-08-07 05:47:00 -07:00
parent 40c2a440a6
commit cd832bcd70

View File

@ -120,17 +120,30 @@
(contact-block)]))) (contact-block)])))
(defn not-found [] (defn not-found []
(str "We couldn't find those pronouns in our database, please ask us to " (let [title "Pronoun Island: English Language Examples"]
"add them, or issue a pull request at " (html
"https://github.com/witch-house/pronoun.is/blob/master/resources/pronouns.tab")) [:html
[:head
[:title title]
[:meta {:name "viewport" :content "width=device-width"}]
[:link {:rel "stylesheet" :href "/pronouns.css"}]]
[:body
(title-block title)
[:div {:class "examples"}
[:p [:h2 (str "We couldn't find those pronouns in our database."
"If you think we should have them, please reach out!")]]]
(about-block)
(contact-block)]])))
(defn pronouns [params pronouns-table] (defn pronouns [params pronouns-table]
(let [path (params :*) (let [path (params :*)
alts (or (params "or") []) alts (or (params "or") [])
pronouns (concat [path] (u/vec-coerce alts)) pronouns (concat [path] (u/vec-coerce alts))
pronoun-declensions (map #(lookup-pronouns (escape-html %) pronoun-declensions (filter some? (map #(lookup-pronouns (escape-html %)
pronouns-table) pronouns-table)
pronouns)] pronouns))]
(if pronoun-declensions (println path)
(println pronoun-declensions)
(if (seq pronoun-declensions)
(format-pronoun-examples pronoun-declensions) (format-pronoun-examples pronoun-declensions)
(not-found)))) (not-found))))