fix error with single pronoun set

This commit is contained in:
Morgan Astra 2016-08-07 03:55:53 -07:00
parent 3c2bf7a8f8
commit 1afca666f4

View File

@ -75,7 +75,7 @@
(defn format-pronoun-examples (defn format-pronoun-examples
[pronoun-declension alternates] [pronoun-declensions]
(let [title "Pronoun Island: English Language Examples"] (let [title "Pronoun Island: English Language Examples"]
(html (html
[:html [:html
@ -85,8 +85,7 @@
[:link {:rel "stylesheet" :href "/pronouns.css"}]] [:link {:rel "stylesheet" :href "/pronouns.css"}]]
[:body [:body
(title-block title) (title-block title)
(apply examples-block pronoun-declension) (map #(apply examples-block %) pronoun-declensions)
(map #(apply examples-block %) alternates)
(about-block) (about-block)
(contact-block)]]))) (contact-block)]])))
@ -127,12 +126,11 @@
(defn pronouns [params pronouns-table] (defn pronouns [params pronouns-table]
(let [path (params :*) (let [path (params :*)
ors (u/vec-coerce (params "or")) alts (or (params "or") [])
pronoun-declension (lookup-pronouns (escape-html path) pronouns (concat [path] (u/vec-coerce alts))
pronoun-declensions (map #(lookup-pronouns (escape-html %)
pronouns-table) pronouns-table)
alternates (map #(lookup-pronouns (escape-html %) pronouns)]
pronouns-table) (if pronoun-declensions
ors)] (format-pronoun-examples pronoun-declensions)
(if pronoun-declension
(format-pronoun-examples pronoun-declension alternates)
(not-found)))) (not-found))))