Last active
August 29, 2015 14:06
-
-
Save lbradstreet/48d6c61e0a8eb533232a to your computer and use it in GitHub Desktop.
multipart upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[:div | |
[:b "Now that you've submitted your message, you can upload an image of your own, or read the messages"] | |
[:form.form-horizontal {:action "/upload" :method "post" :encType "multipart/form-data"} | |
[:div.form-group | |
[:input.form-control {:name "file" | |
:on-change (fn [e] (om/set-state! owner :can-upload-image true)) | |
:type "file" | |
:size "20"}] | |
[:label.control-label "Who are you?"] | |
[:input.form-control {:name "person"}] | |
[:label.control-label "Image description:"] | |
[:input.form-control {:name "description"}] | |
[:button.btn.btn-success.form-control | |
{:type "submit" | |
:class "btn success" | |
:bs-style "success" | |
:on-click (fn [e] | |
(let [confirm-result (js/confirm (str "Note, this will clear any words you have written" | |
" wishing Ling happy birthday! Please confirm!"))] | |
(if (and can-upload-image? | |
confirm-result) | |
(do (om/set-state! owner :upload-image nil) | |
true) | |
false))) | |
:name "submit"} | |
"Submit"]]]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment