Add an optional photo field to entries, which becomes a card-topping u-photo when displayed

This commit is contained in:
Danielle McLean 2017-10-16 08:29:21 +11:00
parent cdda4e2eee
commit bf970db801
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
4 changed files with 5 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,6 +1,7 @@
dist*
static/tmp/
static/combined/
static/uploads/
config/client_session_key.aes
*.hi
*.o

View file

@ -29,6 +29,7 @@ Entry
kind EntryKind maxlen=255
name Text Maybe maxlen=255
content Markdown sqltype=longtext
photo Text Maybe maxlen=190
published UTCTime
updated UTCTime
authorId UserId

View file

@ -10,6 +10,7 @@ import Database.Esqueleto ( (^.) )
import qualified Database.Esqueleto as E
import Data.Time.Format ( defaultTimeLocale, formatTime, iso8601DateFormat )
import Data.Time.Format.Human ( humanReadableTime )
import Model.Entry ( entryTitle )
import Web.Slug ( mkSlug )
data FormattedTime = FormattedTime

View file

@ -1,4 +1,6 @@
<article .h-entry .card.bg-dark>
$maybe photo <- entryPhoto entry
<img .card-img-top.u-photo src=@{staticR ["uploads", photo]} alt=#{entryTitle entry}>
<div .card-body>
$maybe name <- entryName entry
<h4 .p-name .card-title>#{name}