more parallelism
This commit is contained in:
parent
aef34a52b2
commit
4a4815bbe3
8 changed files with 60 additions and 43 deletions
|
@ -4,6 +4,7 @@ import Import
|
|||
import Handler.Commons
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.List as L
|
||||
import Data.Maybe
|
||||
import System.FilePath
|
||||
import System.Directory
|
||||
|
||||
|
@ -50,7 +51,7 @@ getAdminAlbumSettingsR albumId = do
|
|||
entities <- runDB $ selectList [UserId !=. (albumOwner album)] [Desc UserName]
|
||||
users <- return $ map (\u -> (userName $ entityVal u, entityKey u)) entities
|
||||
(adminAlbumSettingsWidget, enctype) <- generateFormPost $ adminAlbumSettingsForm album albumId users
|
||||
defaultLayout $ do
|
||||
formLayout $ do
|
||||
setTitle "Administration: Album settings"
|
||||
$(widgetFile "adminAlbumSet")
|
||||
Nothing -> do
|
||||
|
@ -73,7 +74,7 @@ postAdminAlbumSettingsR albumId = do
|
|||
((res, _), _) <- runFormPost $ adminAlbumSettingsForm album albumId users
|
||||
case res of
|
||||
FormSuccess temp -> do
|
||||
width <- getThumbWidth $ albumSamplePic temp
|
||||
width <- getThumbWidth $ Just $ L.tail $ fromMaybe ['a'] $ albumSamplePic temp
|
||||
_ <- runDB $ update albumId
|
||||
[ AlbumTitle =. albumTitle temp
|
||||
, AlbumShares =. albumShares temp
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
$newline always
|
||||
<h3>Media from #{albumTitle album}
|
||||
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<h1>Media from #{albumTitle album}
|
||||
$if null media
|
||||
#{albumTitle album} has no media yet
|
||||
$else
|
||||
<ul>
|
||||
<p>#{albumTitle album} has no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<li>
|
||||
<article class="item" data-width="200">
|
||||
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}
|
||||
<figure class="thumbnail">
|
||||
<img src=#{mediumThumb m}>
|
||||
<figcaption>#{mediumTitle m}
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
$newline always
|
||||
<h3>Album settings
|
||||
|
||||
<div class="left">
|
||||
<form method="post" enctype=#{enctype}>
|
||||
<div id="header" class="item" data-width="400">
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<h1>Album settings
|
||||
^{adminAlbumSettingsWidget}
|
||||
<div>
|
||||
<input type=submit value="Change settings">
|
||||
|
||||
<a href=@{AdminAlbumDeleteR albumId}>Delete this album
|
||||
|
||||
<div class="right">
|
||||
<ul>
|
||||
<li>
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div class="inner">
|
||||
<p>
|
||||
<a href=@{AdminAlbumMediaR albumId}>Media in this album
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
$newline always
|
||||
<h3>Albums
|
||||
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<h1>Albums
|
||||
$if null albums
|
||||
There are no albums yet
|
||||
$else
|
||||
<p>There are no albums yet
|
||||
|
||||
$forall (Entity aId a) <- albums
|
||||
<ul>
|
||||
<li>
|
||||
<article class="item" data-width=#{albumSampleWidth a}>
|
||||
<a href=@{AdminAlbumSettingsR aId}>#{albumTitle a}
|
||||
<figure class="thumbnail">
|
||||
$if (albumSamplePic a) == Nothing
|
||||
<img src="/static/img/album.jpg">
|
||||
$else
|
||||
<img src=#{T.pack $ fromJust $ albumSamplePic a}>
|
||||
<figcaption>#{albumTitle a}
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
$newline always
|
||||
<h3>Media
|
||||
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<h1>Media
|
||||
$if null media
|
||||
There are no media yet
|
||||
$else
|
||||
<ul>
|
||||
<p>There are no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<li>
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}
|
||||
<figure class="thumbnail">
|
||||
<img src=#{mediumThumb m}>
|
||||
<figcaption>#{mediumTitle m}
|
||||
|
|
|
@ -7,7 +7,11 @@ $newline always
|
|||
#{userSlug owner} has no albums yet
|
||||
|
||||
$forall (Entity aId a) <- albums
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div class="inner">
|
||||
<p>
|
||||
<article class="item" data-width=#{albumSampleWidth a}>
|
||||
<a href=@{AdminAlbumSettingsR aId}>#{albumTitle a}
|
||||
<figure class="thumbnail">
|
||||
$if (albumSamplePic a) == Nothing
|
||||
<img src="/static/img/album.jpg">
|
||||
$else
|
||||
<img src=#{T.pack $ fromJust $ albumSamplePic a}>
|
||||
<figcaption>#{albumTitle a}
|
||||
|
|
|
@ -7,7 +7,8 @@ $newline always
|
|||
#{userSlug owner} has no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div class="inner">
|
||||
<p>
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}
|
||||
<figure class="thumbnail">
|
||||
<img src=#{mediumThumb m}>
|
||||
<figcaption>#{mediumTitle m}
|
||||
|
|
|
@ -18,7 +18,7 @@ $forall (Entity albumId album) <- userAlbs
|
|||
<a href=@{AlbumR albumId}>
|
||||
<figure class="thumbnail">
|
||||
$if (albumSamplePic album) == Nothing
|
||||
<img src="/static/img/album.jpg"><br>
|
||||
<img src="/static/img/album.jpg">
|
||||
$else
|
||||
<img src=#{T.pack $ fromJust $ albumSamplePic album}>
|
||||
<figcaption>#{albumTitle album}
|
||||
|
@ -34,7 +34,7 @@ $else
|
|||
<a href=@{AlbumR albumId}>
|
||||
<figure class="thumbnail">
|
||||
$if (albumSamplePic album) == Nothing
|
||||
<img src="/static/img/album.jpg"><br>
|
||||
<img src="/static/img/album.jpg">
|
||||
$else
|
||||
<img src=#{T.pack $ fromJust $ albumSamplePic album}>
|
||||
<figcaption>#{albumTitle album}
|
||||
|
|
Loading…
Reference in a new issue