looks ready. time to get critique.
This commit is contained in:
parent
6b62e83099
commit
d41bea427b
30 changed files with 164 additions and 225 deletions
|
@ -19,6 +19,7 @@ module Handler.AlbumSettings where
|
|||
import Import
|
||||
import Handler.Commons
|
||||
import qualified Data.Text as T
|
||||
import Data.Maybe
|
||||
import System.Directory
|
||||
import System.FilePath
|
||||
import qualified Data.List as L
|
||||
|
@ -107,7 +108,9 @@ postAlbumSettingsR albumId = do
|
|||
else do
|
||||
return [()]
|
||||
-- nothing to do here
|
||||
width <- getThumbWidth $ albumSamplePic temp
|
||||
sample <- runDB $ selectFirst
|
||||
[MediumThumb ==. (fromMaybe "" $ albumSamplePic temp)] []
|
||||
let width = if isNothing sample then 230 else mediumThumbWidth $ entityVal $ fromJust sample
|
||||
_ <- runDB $ update albumId
|
||||
[ AlbumTitle =. albumTitle temp
|
||||
, AlbumShares =. newShares
|
||||
|
|
|
@ -53,7 +53,7 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
|
|||
list-style: none;
|
||||
display: block;
|
||||
margin: 80px 80px 0;
|
||||
padding: 0;
|
||||
padding: 4em 0 4em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ footer {
|
|||
}
|
||||
|
||||
.middle {
|
||||
margin-top: 50px;
|
||||
/*margin-top: 50px;*/
|
||||
}
|
||||
|
||||
@media (max-width: 755px) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div .item>
|
||||
<noscript>You need to have Javascript enabled
|
||||
<form class="inner login">
|
||||
<form .login>
|
||||
<h3>Activate your account
|
||||
<p>
|
||||
<label for="password1">Password:
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Media from #{albumTitle album}
|
||||
$if null media
|
||||
<p>#{albumTitle album} has no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<div .item>
|
||||
<a href=@{AdminMediumSettingsR mId}>
|
||||
<figure>
|
||||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div .medium>
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<h1>Album settings
|
||||
^{adminAlbumSettingsWidget}
|
||||
|
||||
<a href=@{AdminAlbumDeleteR albumId}>Delete this album
|
||||
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div .item>
|
||||
<div class="inner">
|
||||
<p>
|
||||
<a href=@{AdminAlbumMediaR albumId}>Media in this album
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Albums
|
||||
$if null albums
|
||||
<p>There are no albums yet
|
||||
|
||||
$forall (Entity aId a) <- albums
|
||||
<article class="item" data-width=#{albumSampleWidth a}>
|
||||
<div .item>
|
||||
<a href=@{AdminAlbumSettingsR aId}>
|
||||
<figure>
|
||||
$if (albumSamplePic a) == Nothing
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
/*templates/medium.cassius*/
|
||||
|
||||
img
|
||||
position: relative !important
|
||||
max-width: 100% !important
|
||||
width: auto !important
|
||||
display: block !important
|
||||
margin-left: auto !important
|
||||
margin-right: auto !important
|
||||
|
||||
.comment
|
||||
border: 5px solid rgb(255, 255, 255)
|
||||
padding: 2em 3em
|
||||
background: #d64760 url('/static/css/images/overlay.png')
|
||||
|
||||
.reply
|
||||
background: #47d65f url('/static/css/images/overlay.png')
|
||||
|
||||
.image
|
||||
width: 100% !important
|
||||
|
||||
#wrapper
|
||||
overflow: auto !important
|
||||
|
||||
#reel
|
||||
width: 90% !important
|
||||
max-height: auto !important
|
||||
|
||||
#reel .item
|
||||
float: none !important
|
||||
display: inline-block !important
|
||||
width: 100% !important
|
||||
|
||||
div #main
|
||||
margin-top: 60px !important
|
||||
position: static !important
|
||||
|
||||
#footer
|
||||
position: static !important
|
|
@ -1,21 +1,19 @@
|
|||
$newline never
|
||||
<div id="header" class="item">
|
||||
<div class="inner">
|
||||
<div .column>
|
||||
<div .subheader .medium>
|
||||
<h1>Comments by medium
|
||||
|
||||
|
||||
$if null comments
|
||||
<div id="header" class="item">
|
||||
<div class="inner">
|
||||
<div .subheader .medium>
|
||||
<p>There are no comments yet
|
||||
$else
|
||||
$forall (Entity mediumId medium) <- media
|
||||
<div id="header" class="item">
|
||||
<div class="inner">
|
||||
<div .subheader .medium>
|
||||
<h3>#{mediumTitle medium}
|
||||
$forall (Entity commentId comment) <- comments
|
||||
$if commentOrigin comment == mediumId
|
||||
<article class="comment">
|
||||
<div .medium .comment>
|
||||
#{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
|
||||
<hr>
|
||||
#{commentContent comment}
|
||||
|
@ -23,7 +21,7 @@ $else
|
|||
$forall (Entity replyId reply) <- replies
|
||||
$if commentParent reply == Just commentId
|
||||
$if commentOrigin reply == mediumId
|
||||
<article class="comment reply">
|
||||
<div .medium .comment .reply>
|
||||
#{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
|
||||
<hr>
|
||||
#{commentContent reply}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Media
|
||||
$if null media
|
||||
<p>There are no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<div .item>
|
||||
<a href=@{AdminMediumSettingsR mId}>
|
||||
<figure>
|
||||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<div .medium>
|
||||
<form method="post" enctype=#{enctype}>
|
||||
<h1>Medium settings
|
||||
^{adminMediumSetWidget}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<div .medium>
|
||||
<form method="post" enctype=#{enctype}>
|
||||
<h1>Profile Settings
|
||||
^{adminProfileSetWidget}
|
||||
|
||||
<a href=@{AdminProfileDeleteR userId}>Delete user
|
||||
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div .item>
|
||||
<div class="inner">
|
||||
<ul>
|
||||
<li>
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>User profiles
|
||||
$if null profiles
|
||||
<p>
|
||||
There are no profiles yet (How can you even see this?)
|
||||
|
||||
$forall (Entity uId u) <- profiles
|
||||
<div id="header" class="item" data-width="200">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<a href=@{AdminProfileSettingsR uId}>#{userSlug u}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Albums of #{userSlug owner}
|
||||
<p>
|
||||
$if null albums
|
||||
<p>
|
||||
#{userSlug owner} has no albums yet
|
||||
|
||||
$forall (Entity aId a) <- albums
|
||||
<article class="item" data-width=#{albumSampleWidth a}>
|
||||
<a href=@{AdminAlbumSettingsR aId}>#{albumTitle a}
|
||||
<div .item>
|
||||
<a href=@{AdminAlbumSettingsR aId}>
|
||||
<figure>
|
||||
$if (albumSamplePic a) == Nothing
|
||||
<img src="/static/img/album.jpg">
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Media of #{userSlug owner}
|
||||
$if null media
|
||||
<p>
|
||||
#{userSlug owner} has no media yet
|
||||
|
||||
$forall (Entity mId m) <- media
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m}
|
||||
<div .item>
|
||||
<a href=@{AdminMediumSettingsR mId}>
|
||||
<figure>
|
||||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>
|
||||
<figcaption>#{mediumTitle m}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h3>Delete Album #{albumTitle album}
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<div .item>
|
||||
<form method="post" enctype=#{enctype}>
|
||||
<h3>Album settings
|
||||
^{albumSettingsWidget}
|
||||
$if ownerPresence == True
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h3>Delete comment
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<div id="header" class="item" data-width="600">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h4>Reply to comment
|
||||
<strong>#{commentAuthorSlug comment}</strong> posted on #{formatTime defaultTimeLocale "%A %F %H:%M" (commentTime comment)}:
|
||||
<hr>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div .medium .middle>
|
||||
<div .medium>
|
||||
<form method=post enctype=#{enctype}>
|
||||
Image upload to album #{albumTitle album}
|
||||
^{dUploadWidget}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
$newline always
|
||||
<div .medium .middle>
|
||||
<div .medium>
|
||||
<noscript>Please enable Javascript
|
||||
<h3>Login
|
||||
<form>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h3>Delete Medium #{mediumTitle medium}
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h3>Medium settings
|
||||
|
||||
<form method="post" enctype=#{enctype}>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div .medium .middle>
|
||||
<div .medium>
|
||||
<h3>Create new Album
|
||||
<form class="inner r" method=post enctype=#{enctype}>
|
||||
^{albumWidget}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h1>Delete User #{userSlug user}
|
||||
|
||||
<p>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<form class="inner" method="post" enctype=#{enctype}>
|
||||
<div .item>
|
||||
<form method="post" enctype=#{enctype}>
|
||||
<h3>Profile settings
|
||||
^{profileSettingsWidget}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .item>
|
||||
<h3>Reset Password
|
||||
|
||||
<form method="post" enctype=#{enctype}>
|
||||
|
|
|
@ -1,31 +1,26 @@
|
|||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .subheader .item>
|
||||
<h1>
|
||||
Results for: #{query}
|
||||
|
||||
$if allEmpty
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .subheader .item>
|
||||
<h2>
|
||||
Sorry, no results
|
||||
$else
|
||||
$if not $ null userList
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .subheader .item>
|
||||
<h2>
|
||||
Results in Users:
|
||||
$forall (Entity uId user) <- userList
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .item>
|
||||
<a href=@{ProfileR uId}>
|
||||
#{userSlug user}
|
||||
$if not $ null albumList
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .subheader .item>
|
||||
<h2>
|
||||
Results in Albums:
|
||||
$forall (Entity aId album) <- albumList
|
||||
<article .item data-width="#{albumSampleWidth album}">
|
||||
<div .item data-width="#{albumSampleWidth album}">
|
||||
<a href=@{AlbumR aId}>
|
||||
<figure>
|
||||
$if (albumSamplePic album) == Nothing
|
||||
|
@ -34,23 +29,20 @@ $else
|
|||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ fromJust $ albumSamplePic album) []} title=#{albumTitle album}>
|
||||
<figcaption>#{albumTitle album}
|
||||
$if not $ null mediumList
|
||||
<article #header .item data-width="400">
|
||||
<div .inner>
|
||||
<article .subheader .item>
|
||||
<h2>
|
||||
Results in Media:
|
||||
$forall (Entity mId medium) <- mediumList
|
||||
<article .item data-width="#{mediumThumbWidth medium}">
|
||||
<div .item>
|
||||
<a href=@{MediumR mId}>
|
||||
<figure>
|
||||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb medium) []} title=#{mediumTitle medium}>
|
||||
<figcaption>#{mediumTitle medium}
|
||||
$if not $ null commentList
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .subheader .item>
|
||||
<h2>
|
||||
Results in Comments:
|
||||
$forall (Entity _ comment) <- commentList
|
||||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .item>
|
||||
<a href=@{MediumR $ commentOrigin comment}>
|
||||
#{commentContent comment}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<div #header .item data-width="400">
|
||||
<div .inner>
|
||||
<div .item>
|
||||
<form method=GET action=@{SearchR}>
|
||||
^{widget}
|
||||
<input type="submit" value="Search">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="300">
|
||||
<div .medium>
|
||||
<noscript>You need to have Javscript enabled
|
||||
<h3>Signup
|
||||
<form role="form" class="inner" method="POST" action=@{SignupR}>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
$newline always
|
||||
<div id="header" class="item" data-width="400">
|
||||
<div class="inner">
|
||||
<div .subheader .item>
|
||||
<h1>Tag #{tag}
|
||||
$if null media
|
||||
<p>
|
||||
There are no media tagged with #{tag}
|
||||
|
||||
$forall Just (Entity mId m) <- media
|
||||
<article class="item" data-width=#{mediumThumbWidth m}>
|
||||
<div .item>
|
||||
<a href=@{MediumR mId}>
|
||||
<figure>
|
||||
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []} title=#{mediumTitle m}>
|
||||
|
|
Loading…
Reference in a new issue