Meda mediua descriptions non-obligatory
This commit is contained in:
parent
8b8784731e
commit
b8a8a28195
6 changed files with 19 additions and 11 deletions
|
@ -91,7 +91,7 @@ adminMediumSetForm medium = renderDivs $ Medium
|
||||||
<*> pure (mediumMime medium)
|
<*> pure (mediumMime medium)
|
||||||
<*> pure (mediumTime medium)
|
<*> pure (mediumTime medium)
|
||||||
<*> pure (mediumOwner medium)
|
<*> pure (mediumOwner medium)
|
||||||
<*> areq textareaField "Description" (Just $ mediumDescription medium)
|
<*> aopt textareaField "Description" (Just $ mediumDescription medium)
|
||||||
<*> areq tagField "Tags" (Just $ mediumTags medium)
|
<*> areq tagField "Tags" (Just $ mediumTags medium)
|
||||||
<*> pure (mediumWidth medium)
|
<*> pure (mediumWidth medium)
|
||||||
<*> pure (mediumThumbWidth medium)
|
<*> pure (mediumThumbWidth medium)
|
||||||
|
|
|
@ -66,7 +66,7 @@ mediumSettingsForm medium = renderDivs $ Medium
|
||||||
<*> pure (mediumMime medium)
|
<*> pure (mediumMime medium)
|
||||||
<*> pure (mediumTime medium)
|
<*> pure (mediumTime medium)
|
||||||
<*> pure (mediumOwner medium)
|
<*> pure (mediumOwner medium)
|
||||||
<*> areq textareaField "Description" (Just $ mediumDescription medium)
|
<*> aopt textareaField "Description" (Just $ mediumDescription medium)
|
||||||
<*> areq tagField "tags" (Just $ mediumTags medium)
|
<*> areq tagField "tags" (Just $ mediumTags medium)
|
||||||
<*> pure (mediumWidth medium)
|
<*> pure (mediumWidth medium)
|
||||||
<*> pure (mediumThumbWidth medium)
|
<*> pure (mediumThumbWidth medium)
|
||||||
|
|
|
@ -84,7 +84,10 @@ instance RepFeed RepAtom where
|
||||||
>
|
>
|
||||||
<id>#{fromJust $ lookup mediumId $ fromRight [] links}
|
<id>#{fromJust $ lookup mediumId $ fromRight [] links}
|
||||||
<published>#{iso8601 $ utcToZonedTime tz $ mediumTime medium}
|
<published>#{iso8601 $ utcToZonedTime tz $ mediumTime medium}
|
||||||
<summary>#{mediumDescription medium}
|
$maybe d <- mediumDescription medium
|
||||||
|
<summary>#{d}
|
||||||
|
$nothing
|
||||||
|
<summary>No description given
|
||||||
<link rel="icon"
|
<link rel="icon"
|
||||||
href=#{url $ StaticR $ mediumStaticThumbRoute medium}
|
href=#{url $ StaticR $ mediumStaticThumbRoute medium}
|
||||||
>
|
>
|
||||||
|
@ -139,7 +142,10 @@ instance RepFeed RepRss where
|
||||||
<title>#{mediumTitle medium}
|
<title>#{mediumTitle medium}
|
||||||
<link>#{fromJust $ lookup mediumId $ fromRight [] links}
|
<link>#{fromJust $ lookup mediumId $ fromRight [] links}
|
||||||
<language>en
|
<language>en
|
||||||
<description>#{mediumDescription medium}
|
$maybe d <- mediumDescription medium
|
||||||
|
<description>#{d}
|
||||||
|
$nothing
|
||||||
|
<description>No description given
|
||||||
<guid isPermaLink="true">#{fromJust $ lookup mediumId $ fromRight [] links}
|
<guid isPermaLink="true">#{fromJust $ lookup mediumId $ fromRight [] links}
|
||||||
<pubDate>#{rfc822 $ mediumTime medium}
|
<pubDate>#{rfc822 $ mediumTime medium}
|
||||||
<image>
|
<image>
|
||||||
|
|
|
@ -133,7 +133,6 @@ generateThumb path userId albumId = do
|
||||||
FP.</> newName
|
FP.</> newName
|
||||||
(iWidth, tWidth) <- liftIO $ withMagickWandGenesis $ do
|
(iWidth, tWidth) <- liftIO $ withMagickWandGenesis $ do
|
||||||
(_ , w) <- magickWand
|
(_ , w) <- magickWand
|
||||||
p <- pixelWand
|
|
||||||
readImage w (decodeString path)
|
readImage w (decodeString path)
|
||||||
w1 <- getImageWidth w
|
w1 <- getImageWidth w
|
||||||
h1 <- getImageHeight w
|
h1 <- getImageHeight w
|
||||||
|
@ -166,7 +165,7 @@ dUploadForm userId albumId = renderDivs $ FileBulk
|
||||||
<*> areq multiFileField "Select file(s)" Nothing
|
<*> areq multiFileField "Select file(s)" Nothing
|
||||||
<*> lift (liftIO getCurrentTime)
|
<*> lift (liftIO getCurrentTime)
|
||||||
<*> pure userId
|
<*> pure userId
|
||||||
<*> areq textareaField "Description" Nothing
|
<*> aopt textareaField "Description" Nothing
|
||||||
<*> areq tagField "Enter tags" Nothing
|
<*> areq tagField "Enter tags" Nothing
|
||||||
<*> pure albumId
|
<*> pure albumId
|
||||||
|
|
||||||
|
@ -175,7 +174,7 @@ data FileBulk = FileBulk
|
||||||
, fileBulkFiles :: [FileInfo]
|
, fileBulkFiles :: [FileInfo]
|
||||||
, fileBulkTime :: UTCTime
|
, fileBulkTime :: UTCTime
|
||||||
, fileBulkOwner :: UserId
|
, fileBulkOwner :: UserId
|
||||||
, fileBulkDesc :: Textarea
|
, fileBulkDesc :: Maybe Textarea
|
||||||
, fileBulkTags :: [Text]
|
, fileBulkTags :: [Text]
|
||||||
, fileBulkAlbum :: AlbumId
|
, fileBulkAlbum :: AlbumId
|
||||||
}
|
}
|
||||||
|
@ -208,7 +207,7 @@ bulkUploadForm userId = renderDivs $ (\a b c d e f g -> FileBulk b c d e f g a)
|
||||||
<*> areq multiFileField "Select file(s)" Nothing
|
<*> areq multiFileField "Select file(s)" Nothing
|
||||||
<*> lift (liftIO getCurrentTime)
|
<*> lift (liftIO getCurrentTime)
|
||||||
<*> pure userId
|
<*> pure userId
|
||||||
<*> areq textareaField "Description" Nothing
|
<*> aopt textareaField "Description" Nothing
|
||||||
<*> areq tagField "Enter tags" Nothing
|
<*> areq tagField "Enter tags" Nothing
|
||||||
where
|
where
|
||||||
albums = do
|
albums = do
|
||||||
|
|
|
@ -48,7 +48,7 @@ Medium
|
||||||
mime Text
|
mime Text
|
||||||
time UTCTime
|
time UTCTime
|
||||||
owner UserId
|
owner UserId
|
||||||
description Textarea
|
description Textarea Maybe
|
||||||
tags Texts
|
tags Texts
|
||||||
width Int
|
width Int
|
||||||
thumbWidth Int
|
thumbWidth Int
|
||||||
|
|
|
@ -12,8 +12,11 @@
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<p class="desc">
|
<p class="desc">
|
||||||
Uploaded on: #{formatTime defaultTimeLocale "%A %F %H:%M" (mediumTime medium)}<br>
|
Uploaded on: #{formatTime defaultTimeLocale "%A %F %H:%M" (mediumTime medium)}<br>
|
||||||
Description:<br>
|
$maybe d <- mediumDescription medium
|
||||||
#{mediumDescription medium}
|
Description:<br>
|
||||||
|
#{d}
|
||||||
|
$nothing
|
||||||
|
No description given
|
||||||
|
|
||||||
<div class="tags">
|
<div class="tags">
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in a new issue