Skip to content

Commit

Permalink
Change form-helper label and submit to take & args as kvs
Browse files Browse the repository at this point in the history
  • Loading branch information
swlkr committed Jan 9, 2020
1 parent f6fd931 commit 857582b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/joy/form-helper.janet
Expand Up @@ -22,13 +22,12 @@
(hidden-field action :_method))]))


(defn label [key &opt attrs]
(default attrs [:for (string key)])
(defn label [key & args]
(let [str (string key)]
[:label (merge {:for str :style "display: block;"} (apply table attrs)) str]))
[:label (merge {:for str :style "display: block;"} (table ;args))
str]))


(defn submit [value &opt attrs]
(default attrs [])
[:input (merge {:type "submit" :value value :style "display: block"} (apply table attrs))])
(defn submit [value & args]
[:input (merge {:type "submit" :value value :style "display: block"} (apply table args))])

0 comments on commit 857582b

Please sign in to comment.