about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMorgan Astra <m@morganastra.me>2016-08-07 05:47:00 -0700
committerMorgan Astra <m@morganastra.me>2016-08-07 05:47:00 -0700
commitcd832bcd7049e9d4ce80ef2907e084edc5813319 (patch)
tree56b5ac4263eeb785dea76ab8422b92df3fae3271 /src
parent40c2a440a64884f7cabdeefca5a333be86528491 (diff)
use pretty formatting on not found page, remove github PR link fixes #54 fixes #27 fixes #23
Diffstat (limited to 'src')
-rw-r--r--src/pronouns/pages.clj27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj
index f73a12e..bf67f75 100644
--- a/src/pronouns/pages.clj
+++ b/src/pronouns/pages.clj
@@ -120,17 +120,30 @@
       (contact-block)])))
 
 (defn not-found []
-  (str "We couldn't find those pronouns in our database, please ask us to "
-       "add them, or issue a pull request at "
-       "https://github.com/witch-house/pronoun.is/blob/master/resources/pronouns.tab"))
+  (let [title "Pronoun Island: English Language Examples"]
+    (html
+     [: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]
   (let [path (params :*)
         alts (or (params "or") [])
         pronouns (concat [path] (u/vec-coerce alts))
-        pronoun-declensions (map #(lookup-pronouns (escape-html %)
-                                          pronouns-table)
-                        pronouns)]
-    (if pronoun-declensions
+        pronoun-declensions (filter some? (map #(lookup-pronouns (escape-html %)
+                                                                pronouns-table)
+                                              pronouns))]
+    (println path)
+    (println pronoun-declensions)
+    (if (seq pronoun-declensions)
       (format-pronoun-examples pronoun-declensions)
       (not-found))))