mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-27 17:14:52 +09:00
Show creation date in group page
This commit is contained in:
parent
b50f892d32
commit
b7d443d031
5 changed files with 41 additions and 5 deletions
|
@ -39,6 +39,7 @@ import Vervis.Foundation
|
||||||
import Vervis.Model
|
import Vervis.Model
|
||||||
import Vervis.Model.Ident (ShrIdent, shr2text)
|
import Vervis.Model.Ident (ShrIdent, shr2text)
|
||||||
import Vervis.Settings (widgetFile)
|
import Vervis.Settings (widgetFile)
|
||||||
|
import Vervis.Time (showDate)
|
||||||
import Vervis.Widget.Sharer (groupLinkW, personLinkW)
|
import Vervis.Widget.Sharer (groupLinkW, personLinkW)
|
||||||
|
|
||||||
getGroupsR :: Handler Html
|
getGroupsR :: Handler Html
|
||||||
|
|
34
src/Vervis/Time.hs
Normal file
34
src/Vervis/Time.hs
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{- This file is part of Vervis.
|
||||||
|
-
|
||||||
|
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
|
||||||
|
-
|
||||||
|
- ♡ Copying is an act of love. Please copy, reuse and share.
|
||||||
|
-
|
||||||
|
- The author(s) have dedicated all copyright and related and neighboring
|
||||||
|
- rights to this software to the public domain worldwide. This software is
|
||||||
|
- distributed without any warranty.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the CC0 Public Domain Dedication along
|
||||||
|
- with this software. If not, see
|
||||||
|
- <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
|
-}
|
||||||
|
|
||||||
|
module Vervis.Time
|
||||||
|
( showDate
|
||||||
|
)
|
||||||
|
where
|
||||||
|
|
||||||
|
import Prelude
|
||||||
|
|
||||||
|
import Data.Text (Text)
|
||||||
|
import Data.Time.Calendar (toGregorian)
|
||||||
|
import Data.Time.Clock (UTCTime (..))
|
||||||
|
import Formatting (sformat, (%), int, left)
|
||||||
|
|
||||||
|
import qualified Data.Text as T (take)
|
||||||
|
|
||||||
|
showDate :: UTCTime -> Text
|
||||||
|
showDate t =
|
||||||
|
let (y, m, d) = toGregorian $ utctDay t
|
||||||
|
padded = left 2 '0'
|
||||||
|
in sformat (int % "-" % padded % "-" % padded) y m d
|
|
@ -35,6 +35,7 @@ import Data.Revision.Local
|
||||||
import Development.DarcsRev (darcsTotalPatches, darcsRevision)
|
import Development.DarcsRev (darcsTotalPatches, darcsRevision)
|
||||||
import Vervis.Settings (widgetFile)
|
import Vervis.Settings (widgetFile)
|
||||||
import Vervis.Style
|
import Vervis.Style
|
||||||
|
import Vervis.Time (showDate)
|
||||||
|
|
||||||
breadcrumbsW :: YesodBreadcrumbs site => WidgetT site IO ()
|
breadcrumbsW :: YesodBreadcrumbs site => WidgetT site IO ()
|
||||||
breadcrumbsW = do
|
breadcrumbsW = do
|
||||||
|
@ -43,11 +44,7 @@ breadcrumbsW = do
|
||||||
|
|
||||||
revisionW :: WidgetT site IO ()
|
revisionW :: WidgetT site IO ()
|
||||||
revisionW =
|
revisionW =
|
||||||
let fmtTime t =
|
let cgTimeFmt = showDate . cgTime
|
||||||
let (y, m, d) = toGregorian $ utctDay t
|
|
||||||
padded = left 2 '0'
|
|
||||||
in sformat (int % "-" % padded % "-" % padded) y m d
|
|
||||||
cgTimeFmt = fmtTime . cgTime
|
|
||||||
mrev = $darcsRevision
|
mrev = $darcsRevision
|
||||||
sharer = "fr33domlover" :: Text
|
sharer = "fr33domlover" :: Text
|
||||||
repo = "vervis" :: Text
|
repo = "vervis" :: Text
|
||||||
|
|
|
@ -15,6 +15,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
|
||||||
<h2>
|
<h2>
|
||||||
#{fromMaybe (shr2text $ sharerIdent group) $ sharerName group}
|
#{fromMaybe (shr2text $ sharerIdent group) $ sharerName group}
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Created on #{showDate $ sharerCreated group}.
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Members:
|
Members:
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,7 @@ library
|
||||||
Vervis.Ssh
|
Vervis.Ssh
|
||||||
Vervis.Style
|
Vervis.Style
|
||||||
Vervis.TicketFilter
|
Vervis.TicketFilter
|
||||||
|
Vervis.Time
|
||||||
Vervis.Widget
|
Vervis.Widget
|
||||||
Vervis.Widget.Discussion
|
Vervis.Widget.Discussion
|
||||||
Vervis.Widget.Repo
|
Vervis.Widget.Repo
|
||||||
|
|
Loading…
Reference in a new issue