2016-05-24 05:46:54 +09:00
|
|
|
{- 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/>.
|
|
|
|
-}
|
|
|
|
|
2016-05-25 06:48:21 +09:00
|
|
|
module Vervis.Widget.Sharer
|
2016-05-24 05:46:54 +09:00
|
|
|
( sharerLinkW
|
2016-05-25 06:48:21 +09:00
|
|
|
, personLinkW
|
|
|
|
, groupLinkW
|
2016-05-24 05:46:54 +09:00
|
|
|
)
|
|
|
|
where
|
|
|
|
|
|
|
|
import Prelude
|
|
|
|
|
2016-05-25 06:48:21 +09:00
|
|
|
import Yesod.Core (Route)
|
|
|
|
|
2016-05-24 05:46:54 +09:00
|
|
|
import Vervis.Foundation
|
|
|
|
import Vervis.Model
|
2016-05-25 06:48:21 +09:00
|
|
|
import Vervis.Model.Ident (ShrIdent, shr2text)
|
2016-05-24 05:46:54 +09:00
|
|
|
import Vervis.Settings (widgetFile)
|
|
|
|
|
2016-05-25 06:48:21 +09:00
|
|
|
link :: (ShrIdent -> Route App) -> Sharer -> Widget
|
|
|
|
link route sharer = $(widgetFile "sharer-link")
|
|
|
|
|
2016-05-24 05:46:54 +09:00
|
|
|
sharerLinkW :: Sharer -> Widget
|
2016-05-25 06:48:21 +09:00
|
|
|
sharerLinkW = link SharerR
|
|
|
|
|
|
|
|
personLinkW :: Sharer -> Widget
|
|
|
|
personLinkW = link PersonR
|
2016-05-24 05:46:54 +09:00
|
|
|
|
2016-05-25 06:48:21 +09:00
|
|
|
groupLinkW :: Sharer -> Widget
|
|
|
|
groupLinkW = link GroupR
|