Add an optional photo field to entries, which becomes a card-topping u-photo when displayed
This commit is contained in:
parent
cdda4e2eee
commit
bf970db801
4 changed files with 5 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,6 +1,7 @@
|
|||
dist*
|
||||
static/tmp/
|
||||
static/combined/
|
||||
static/uploads/
|
||||
config/client_session_key.aes
|
||||
*.hi
|
||||
*.o
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue