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*
|
dist*
|
||||||
static/tmp/
|
static/tmp/
|
||||||
static/combined/
|
static/combined/
|
||||||
|
static/uploads/
|
||||||
config/client_session_key.aes
|
config/client_session_key.aes
|
||||||
*.hi
|
*.hi
|
||||||
*.o
|
*.o
|
||||||
|
|
|
@ -29,6 +29,7 @@ Entry
|
||||||
kind EntryKind maxlen=255
|
kind EntryKind maxlen=255
|
||||||
name Text Maybe maxlen=255
|
name Text Maybe maxlen=255
|
||||||
content Markdown sqltype=longtext
|
content Markdown sqltype=longtext
|
||||||
|
photo Text Maybe maxlen=190
|
||||||
published UTCTime
|
published UTCTime
|
||||||
updated UTCTime
|
updated UTCTime
|
||||||
authorId UserId
|
authorId UserId
|
||||||
|
|
|
@ -10,6 +10,7 @@ import Database.Esqueleto ( (^.) )
|
||||||
import qualified Database.Esqueleto as E
|
import qualified Database.Esqueleto as E
|
||||||
import Data.Time.Format ( defaultTimeLocale, formatTime, iso8601DateFormat )
|
import Data.Time.Format ( defaultTimeLocale, formatTime, iso8601DateFormat )
|
||||||
import Data.Time.Format.Human ( humanReadableTime )
|
import Data.Time.Format.Human ( humanReadableTime )
|
||||||
|
import Model.Entry ( entryTitle )
|
||||||
import Web.Slug ( mkSlug )
|
import Web.Slug ( mkSlug )
|
||||||
|
|
||||||
data FormattedTime = FormattedTime
|
data FormattedTime = FormattedTime
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<article .h-entry .card.bg-dark>
|
<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>
|
<div .card-body>
|
||||||
$maybe name <- entryName entry
|
$maybe name <- entryName entry
|
||||||
<h4 .p-name .card-title>#{name}
|
<h4 .p-name .card-title>#{name}
|
||||||
|
|
Loading…
Reference in a new issue