moving to frontend. done
This commit is contained in:
parent
52a35fd114
commit
fb067ae2ba
4 changed files with 27 additions and 3 deletions
|
@ -56,8 +56,10 @@ getMediumR mediumId = do
|
|||
, CommentParent !=. Nothing ]
|
||||
[ Desc CommentTime ]
|
||||
let tr = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb medium) []
|
||||
let pr = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview medium) []
|
||||
let ir = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPath medium) []
|
||||
pr = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPreview medium) []
|
||||
ir = StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumPath medium) []
|
||||
lic = T.pack $ show (toEnum (mediumLicence medium) :: Licence)
|
||||
link = url (toEnum (mediumLicence medium) :: Licence)
|
||||
defaultLayout $ do
|
||||
setTitle $ toHtml ("Eidolon :: Medium " `T.append` (mediumTitle medium))
|
||||
rssLink (CommentFeedRssR mediumId) $ "Comment feed of medium " `T.append` mediumTitle medium
|
||||
|
|
|
@ -51,6 +51,7 @@ postMediumSettingsR mediumId = do
|
|||
[ MediumTitle =. mediumTitle temp
|
||||
, MediumDescription =. mediumDescription temp
|
||||
, MediumTags =. mediumTags temp
|
||||
, MediumLicence =. mediumLicence temp
|
||||
]
|
||||
setMessage "Medium settings changed succesfully"
|
||||
redirect $ MediumR mediumId
|
||||
|
|
16
Model.hs
16
Model.hs
|
@ -28,6 +28,9 @@ import qualified System.FilePath as FP
|
|||
share [mkPersist sqlSettings, mkMigrate "migrateAll"]
|
||||
$(persistFileWith lowerCaseSettings "config/models")
|
||||
|
||||
class ShowUrl a where
|
||||
url :: a -> Maybe String
|
||||
|
||||
data Licence
|
||||
= AllRightsReserved
|
||||
| CC0
|
||||
|
@ -39,7 +42,19 @@ data Licence
|
|||
| CCByNcNd4
|
||||
| PublicDomain
|
||||
|
||||
instance ShowUrl Licence where
|
||||
url PublicDomain = Nothing
|
||||
url AllRightsReserved = Nothing
|
||||
url CC0 = Just "https://creativecommons.org/publicdomain/zero/1.0/"
|
||||
url CCBy4 = Just "https://creativecommons.org/licenses/by/4.0"
|
||||
url CCBySa4 = Just "https://creativecommons.org/licenses/by-sa/4.0"
|
||||
url CCByNd4 = Just "https://creativecommons.org/licenses/by-nd/4.0"
|
||||
url CCByNc4 = Just "https://creativecommons.org/licenses/by-nc/4.0"
|
||||
url CCByNcSa4 = Just "https://creativecommons.org/licenses/by-nc-sa/4.0"
|
||||
url CCByNcNd4 = Just "https://creativecommons.org/licenses/by-nc-nd/4.0"
|
||||
|
||||
instance Show Licence where
|
||||
show PublicDomain = "Public Domain"
|
||||
show AllRightsReserved = "All rights reserved"
|
||||
show CC0 = "CC0 1.0"
|
||||
show CCBy4 = "CC-BY 4.0 International"
|
||||
|
@ -48,7 +63,6 @@ instance Show Licence where
|
|||
show CCByNc4 = "CC-BY-NC 4.0 International"
|
||||
show CCByNcSa4 = "CC-BY-NC-SA 4.0 International"
|
||||
show CCByNcNd4 = "CC-BY-NC-ND 4.0 International"
|
||||
show PublicDomain = "Public Domain"
|
||||
|
||||
instance Enum Licence where
|
||||
fromEnum PublicDomain = -2
|
||||
|
|
|
@ -11,6 +11,13 @@
|
|||
<img src=@{pr} title=#{mediumTitle medium}>
|
||||
|
||||
<div .medium>
|
||||
<p>
|
||||
Licence:
|
||||
<p>
|
||||
$maybe thing <- link
|
||||
<a href=#{thing}>#{lic}
|
||||
$nothing
|
||||
#{lic}
|
||||
<p>
|
||||
Uploaded on: #{formatTime defaultTimeLocale "%A %F %H:%M" (mediumTime medium)}<br>
|
||||
$maybe d <- mediumDescription medium
|
||||
|
|
Loading…
Reference in a new issue