From 0e80d93994511197af56419720cacbb7ef266183 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 9 Oct 2017 19:54:58 +1100 Subject: [PATCH] Nicer layout for h-entry, with cute icons --- src/Widget/Entry.hs | 5 ++++- templates/mf2/h-entry.cassius | 7 +++++++ templates/mf2/h-entry.hamlet | 22 +++++++++++++--------- 3 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 templates/mf2/h-entry.cassius diff --git a/src/Widget/Entry.hs b/src/Widget/Entry.hs index 07e02a7..392b92f 100644 --- a/src/Widget/Entry.hs +++ b/src/Widget/Entry.hs @@ -8,7 +8,10 @@ import Import import Data.Time.Format ( defaultTimeLocale, formatTime, iso8601DateFormat ) import Data.Time.Format.Human ( humanReadableTime ) -data FormattedTime = FormattedTime { timeUnfriendly :: String, timeFriendly :: String } +data FormattedTime = FormattedTime + { timeUnfriendly :: String + , timeFriendly :: String + } deriving Eq toFormattedTime :: MonadIO m => UTCTime -> m FormattedTime toFormattedTime time = FormattedTime (unfriendly time) <$> friendly time diff --git a/templates/mf2/h-entry.cassius b/templates/mf2/h-entry.cassius new file mode 100644 index 0000000..6bf132c --- /dev/null +++ b/templates/mf2/h-entry.cassius @@ -0,0 +1,7 @@ +article.h-entry + > .card-footer + display: flex + flex-wrap: wrap + justify-content: space-evenly + > * + margin-right: 1em diff --git a/templates/mf2/h-entry.hamlet b/templates/mf2/h-entry.hamlet index 379fccf..45ca638 100644 --- a/templates/mf2/h-entry.hamlet +++ b/templates/mf2/h-entry.hamlet @@ -1,15 +1,19 @@

#{entryName entry} - $maybe author <- maybeAuthor -

- published by - #{userFullName author}

#{entryContent entry} - permalink