Meda mediua descriptions non-obligatory

This commit is contained in:
nek0 2015-08-27 20:58:28 +02:00
parent 8b8784731e
commit b8a8a28195
6 changed files with 19 additions and 11 deletions

View file

@ -91,7 +91,7 @@ adminMediumSetForm medium = renderDivs $ Medium
<*> pure (mediumMime medium)
<*> pure (mediumTime medium)
<*> pure (mediumOwner medium)
<*> areq textareaField "Description" (Just $ mediumDescription medium)
<*> aopt textareaField "Description" (Just $ mediumDescription medium)
<*> areq tagField "Tags" (Just $ mediumTags medium)
<*> pure (mediumWidth medium)
<*> pure (mediumThumbWidth medium)

View file

@ -66,7 +66,7 @@ mediumSettingsForm medium = renderDivs $ Medium
<*> pure (mediumMime medium)
<*> pure (mediumTime medium)
<*> pure (mediumOwner medium)
<*> areq textareaField "Description" (Just $ mediumDescription medium)
<*> aopt textareaField "Description" (Just $ mediumDescription medium)
<*> areq tagField "tags" (Just $ mediumTags medium)
<*> pure (mediumWidth medium)
<*> pure (mediumThumbWidth medium)

View file

@ -84,7 +84,10 @@ instance RepFeed RepAtom where
>
<id>#{fromJust $ lookup mediumId $ fromRight [] links}
<published>#{iso8601 $ utcToZonedTime tz $ mediumTime medium}
<summary>#{mediumDescription medium}
$maybe d <- mediumDescription medium
<summary>#{d}
$nothing
<summary>No description given
<link rel="icon"
href=#{url $ StaticR $ mediumStaticThumbRoute medium}
>
@ -139,7 +142,10 @@ instance RepFeed RepRss where
<title>#{mediumTitle medium}
<link>#{fromJust $ lookup mediumId $ fromRight [] links}
<language>en
<description>#{mediumDescription medium}
$maybe d <- mediumDescription medium
<description>#{d}
$nothing
<description>No description given
<guid isPermaLink="true">#{fromJust $ lookup mediumId $ fromRight [] links}
<pubDate>#{rfc822 $ mediumTime medium}
<image>

View file

@ -133,7 +133,6 @@ generateThumb path userId albumId = do
FP.</> newName
(iWidth, tWidth) <- liftIO $ withMagickWandGenesis $ do
(_ , w) <- magickWand
p <- pixelWand
readImage w (decodeString path)
w1 <- getImageWidth w
h1 <- getImageHeight w
@ -166,7 +165,7 @@ dUploadForm userId albumId = renderDivs $ FileBulk
<*> areq multiFileField "Select file(s)" Nothing
<*> lift (liftIO getCurrentTime)
<*> pure userId
<*> areq textareaField "Description" Nothing
<*> aopt textareaField "Description" Nothing
<*> areq tagField "Enter tags" Nothing
<*> pure albumId
@ -175,7 +174,7 @@ data FileBulk = FileBulk
, fileBulkFiles :: [FileInfo]
, fileBulkTime :: UTCTime
, fileBulkOwner :: UserId
, fileBulkDesc :: Textarea
, fileBulkDesc :: Maybe Textarea
, fileBulkTags :: [Text]
, 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
<*> lift (liftIO getCurrentTime)
<*> pure userId
<*> areq textareaField "Description" Nothing
<*> aopt textareaField "Description" Nothing
<*> areq tagField "Enter tags" Nothing
where
albums = do

View file

@ -48,7 +48,7 @@ Medium
mime Text
time UTCTime
owner UserId
description Textarea
description Textarea Maybe
tags Texts
width Int
thumbWidth Int

View file

@ -12,8 +12,11 @@
<div class="inner">
<p class="desc">
Uploaded on: #{formatTime defaultTimeLocale "%A %F %H:%M" (mediumTime medium)}<br>
Description:<br>
#{mediumDescription medium}
$maybe d <- mediumDescription medium
Description:<br>
#{d}
$nothing
No description given
<div class="tags">
<p>