Bit closer

This commit is contained in:
Simon Brooke 2019-02-17 19:22:58 +00:00
parent d6afc46cb5
commit 5a572b10af
5 changed files with 169 additions and 26 deletions

View file

@ -19,4 +19,4 @@
(POST "/ocr/:uri" []
:return String
:path-params [uri :- String]
(ocr (url-decode uri))))))
{:i-read (ocr (url-decode uri))}))))

View file

@ -34,9 +34,8 @@
[b/NavbarToggler {:on-click #(swap! expanded? not)}]
[b/Collapse {:is-open @expanded? :navbar true}
[b/Nav {:class-name "mr-auto" :navbar true}
[nav-link "#/" "Home" :home]
[nav-link "#/about" "About" :about]
[nav-link "#/transcribe" "Transcribe" :transcribe]]]]))
[nav-link "#/" "Transcribe" :transcribe]
[nav-link "#/about" "About" :about]]]]))
(defn about-page []
[:div.container
@ -67,7 +66,7 @@
(secretary/set-config! :prefix "#")
(secretary/defroute "/" []
(rf/dispatch [:navigate :home]))
(rf/dispatch [:navigate :transcribe]))
(secretary/defroute "/about" []
(rf/dispatch [:navigate :about]))

View file

@ -13,9 +13,8 @@
(defn form-page []
[:div
[:h1 "Transcribe the text of an image"]
[:div.container {:id "main-container"}
[:h1 "Transcribe the text of an image"]
[:div
[:p.widget
[b/Label {:for "image-url" :title "URL of the image you wish to transcribe"}"Image URL"]
@ -24,6 +23,5 @@
[:p.widget
[b/Label {:for "send"} "To transcribe the image"]
[b/Button {:id "send" :on-click #(rf/dispatch [:fetch-transcription])} "Transcribe!"]]]
[:div.transcription @(rf/subscribe [:transcription])]
]])
[:div.transcription @(rf/subscribe [:transcription])]])