Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HTML jobs

  • Loading branch information...
commit 6f528af6e9a71f792ab9d9961b1fe43ed140911b 1 parent bf6fe4d
@snoyberg authored
Showing with 10 additions and 3 deletions.
  1. +4 −2 Handler/Job.hs
  2. +1 −0  entities
  3. +5 −1 hamlet/job.hamlet
View
6 Handler/Job.hs
@@ -11,6 +11,7 @@ import Control.Applicative
import Data.Maybe (fromMaybe)
import Data.Time
import Yesod.Form.Jquery
+import Yesod.Form.Nic
import Control.Monad (unless)
import Yesod.Feed
import Yesod.Auth
@@ -29,9 +30,10 @@ jobFormlet uid now mj = renderTable $ Job
<*> areq (jqueryDayField def) "Filling by" (fmap jobFillingBy mj)
<*> areq boolField "Full time option?" (fmap jobFullTime mj)
<*> areq boolField "Part time option?" (fmap jobPartTime mj)
- <*> areq textareaField "Description"
+ <*> pure (Textarea "Please see HTML description")
+ <*> fmap Just (areq nicHtmlField "Description"
{ fsId = Just "desc"
- } (fmap jobDesc mj)
+ } (mj >>= jobDescHtml))
getJobsR :: Handler RepHtml
getJobsR = do
View
1  entities
@@ -58,6 +58,7 @@ Job
fullTime Bool
partTime Bool
desc Textarea
+ descHtml Html Maybe
ScreenName no-json
user UserId Eq
service Service Asc
View
6 hamlet/job.hamlet
@@ -30,4 +30,8 @@
<tr>
<th>Location
<td>#{jobLocation job}
-<div id="desc">#{jobDesc job}
+<div id="desc">
+ $maybe h <- jobDescHtml job
+ #{h}
+ $nothing
+ #{jobDesc job}
Please sign in to comment.
Something went wrong with that request. Please try again.