looks ready. time to get critique.

This commit is contained in:
nek0 2016-09-02 15:55:50 +02:00
parent 6b62e83099
commit d41bea427b
30 changed files with 164 additions and 225 deletions

View file

@ -19,6 +19,7 @@ module Handler.AlbumSettings where
import Import import Import
import Handler.Commons import Handler.Commons
import qualified Data.Text as T import qualified Data.Text as T
import Data.Maybe
import System.Directory import System.Directory
import System.FilePath import System.FilePath
import qualified Data.List as L import qualified Data.List as L
@ -107,7 +108,9 @@ postAlbumSettingsR albumId = do
else do else do
return [()] return [()]
-- nothing to do here -- 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 _ <- runDB $ update albumId
[ AlbumTitle =. albumTitle temp [ AlbumTitle =. albumTitle temp
, AlbumShares =. newShares , AlbumShares =. newShares

View file

@ -53,7 +53,7 @@ a:hover, .item a:hover, .medium a:hover, a:hover figcaption {
list-style: none; list-style: none;
display: block; display: block;
margin: 80px 80px 0; margin: 80px 80px 0;
padding: 0; padding: 4em 0 4em;
text-align: center; text-align: center;
} }
@ -192,7 +192,7 @@ footer {
} }
.middle { .middle {
margin-top: 50px; /*margin-top: 50px;*/
} }
@media (max-width: 755px) { @media (max-width: 755px) {

View file

@ -1,7 +1,7 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<noscript>You need to have Javascript enabled <noscript>You need to have Javascript enabled
<form class="inner login"> <form .login>
<h3>Activate your account <h3>Activate your account
<p> <p>
<label for="password1">Password: <label for="password1">Password:

View file

@ -1,12 +1,11 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Media from #{albumTitle album} <h1>Media from #{albumTitle album}
$if null media $if null media
<p>#{albumTitle album} has no media yet <p>#{albumTitle album} has no media yet
$forall (Entity mId m) <- media $forall (Entity mId m) <- media
<article class="item" data-width=#{mediumThumbWidth m}> <div .item>
<a href=@{AdminMediumSettingsR mId}> <a href=@{AdminMediumSettingsR mId}>
<figure> <figure>
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>

View file

@ -1,12 +1,12 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .medium>
<form class="inner" method="post" enctype=#{enctype}> <form class="inner" method="post" enctype=#{enctype}>
<h1>Album settings <h1>Album settings
^{adminAlbumSettingsWidget} ^{adminAlbumSettingsWidget}
<a href=@{AdminAlbumDeleteR albumId}>Delete this album <a href=@{AdminAlbumDeleteR albumId}>Delete this album
<div id="header" class="item" data-width="200"> <div .item>
<div class="inner"> <div class="inner">
<p> <p>
<a href=@{AdminAlbumMediaR albumId}>Media in this album <a href=@{AdminAlbumMediaR albumId}>Media in this album

View file

@ -1,12 +1,11 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Albums <h1>Albums
$if null albums $if null albums
<p>There are no albums yet <p>There are no albums yet
$forall (Entity aId a) <- albums $forall (Entity aId a) <- albums
<article class="item" data-width=#{albumSampleWidth a}> <div .item>
<a href=@{AdminAlbumSettingsR aId}> <a href=@{AdminAlbumSettingsR aId}>
<figure> <figure>
$if (albumSamplePic a) == Nothing $if (albumSamplePic a) == Nothing

View file

@ -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

View file

@ -1,21 +1,19 @@
$newline never $newline never
<div id="header" class="item"> <div .column>
<div class="inner"> <div .subheader .medium>
<h1>Comments by medium <h1>Comments by medium
$if null comments $if null comments
<div id="header" class="item"> <div .subheader .medium>
<div class="inner">
<p>There are no comments yet <p>There are no comments yet
$else $else
$forall (Entity mediumId medium) <- media $forall (Entity mediumId medium) <- media
<div id="header" class="item"> <div .subheader .medium>
<div class="inner">
<h3>#{mediumTitle medium} <h3>#{mediumTitle medium}
$forall (Entity commentId comment) <- comments $forall (Entity commentId comment) <- comments
$if commentOrigin comment == mediumId $if commentOrigin comment == mediumId
<article class="comment"> <div .medium .comment>
#{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}: #{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
<hr> <hr>
#{commentContent comment} #{commentContent comment}
@ -23,7 +21,7 @@ $else
$forall (Entity replyId reply) <- replies $forall (Entity replyId reply) <- replies
$if commentParent reply == Just commentId $if commentParent reply == Just commentId
$if commentOrigin reply == mediumId $if commentOrigin reply == mediumId
<article class="comment reply"> <div .medium .comment .reply>
#{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}: #{commentAuthorSlug comment} wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
<hr> <hr>
#{commentContent reply} #{commentContent reply}

View file

@ -1,12 +1,11 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Media <h1>Media
$if null media $if null media
<p>There are no media yet <p>There are no media yet
$forall (Entity mId m) <- media $forall (Entity mId m) <- media
<article class="item" data-width=#{mediumThumbWidth m}> <div .item>
<a href=@{AdminMediumSettingsR mId}> <a href=@{AdminMediumSettingsR mId}>
<figure> <figure>
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>

View file

@ -1,6 +1,6 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .medium>
<form class="inner" method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>
<h1>Medium settings <h1>Medium settings
^{adminMediumSetWidget} ^{adminMediumSetWidget}

View file

@ -1,12 +1,12 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .medium>
<form class="inner" method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>
<h1>Profile Settings <h1>Profile Settings
^{adminProfileSetWidget} ^{adminProfileSetWidget}
<a href=@{AdminProfileDeleteR userId}>Delete user <a href=@{AdminProfileDeleteR userId}>Delete user
<div id="header" class="item" data-width="200"> <div .item>
<div class="inner"> <div class="inner">
<ul> <ul>
<li> <li>

View file

@ -1,12 +1,10 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>User profiles <h1>User profiles
$if null profiles $if null profiles
<p> <p>
There are no profiles yet (How can you even see this?) There are no profiles yet (How can you even see this?)
$forall (Entity uId u) <- profiles $forall (Entity uId u) <- profiles
<div id="header" class="item" data-width="200"> <div .item>
<div class="inner">
<a href=@{AdminProfileSettingsR uId}>#{userSlug u} <a href=@{AdminProfileSettingsR uId}>#{userSlug u}

View file

@ -1,14 +1,13 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Albums of #{userSlug owner} <h1>Albums of #{userSlug owner}
<p>
$if null albums $if null albums
<p>
#{userSlug owner} has no albums yet #{userSlug owner} has no albums yet
$forall (Entity aId a) <- albums $forall (Entity aId a) <- albums
<article class="item" data-width=#{albumSampleWidth a}> <div .item>
<a href=@{AdminAlbumSettingsR aId}>#{albumTitle a} <a href=@{AdminAlbumSettingsR aId}>
<figure> <figure>
$if (albumSamplePic a) == Nothing $if (albumSamplePic a) == Nothing
<img src="/static/img/album.jpg"> <img src="/static/img/album.jpg">

View file

@ -1,14 +1,13 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Media of #{userSlug owner} <h1>Media of #{userSlug owner}
$if null media $if null media
<p> <p>
#{userSlug owner} has no media yet #{userSlug owner} has no media yet
$forall (Entity mId m) <- media $forall (Entity mId m) <- media
<article class="item" data-width=#{mediumThumbWidth m}> <div .item>
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m} <a href=@{AdminMediumSettingsR mId}>
<figure> <figure>
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []}>
<figcaption>#{mediumTitle m} <figcaption>#{mediumTitle m}

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<div class="inner">
<h3>Delete Album #{albumTitle album} <h3>Delete Album #{albumTitle album}
<p> <p>

View file

@ -1,6 +1,6 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<form class="inner" method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>
<h3>Album settings <h3>Album settings
^{albumSettingsWidget} ^{albumSettingsWidget}
$if ownerPresence == True $if ownerPresence == True

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<div class="inner">
<h3>Delete comment <h3>Delete comment
<p> <p>

View file

@ -1,5 +1,4 @@
<div id="header" class="item" data-width="600"> <div .item>
<div class="inner">
<h4>Reply to comment <h4>Reply to comment
<strong>#{commentAuthorSlug comment}</strong> posted on #{formatTime defaultTimeLocale "%A %F %H:%M" (commentTime comment)}: <strong>#{commentAuthorSlug comment}</strong> posted on #{formatTime defaultTimeLocale "%A %F %H:%M" (commentTime comment)}:
<hr> <hr>

View file

@ -1,4 +1,4 @@
<div .medium .middle> <div .medium>
<form method=post enctype=#{enctype}> <form method=post enctype=#{enctype}>
Image upload to album #{albumTitle album} Image upload to album #{albumTitle album}
^{dUploadWidget} ^{dUploadWidget}

View file

@ -1,5 +1,5 @@
$newline always $newline always
<div .medium .middle> <div .medium>
<noscript>Please enable Javascript <noscript>Please enable Javascript
<h3>Login <h3>Login
<form> <form>

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<div class="inner">
<h3>Delete Medium #{mediumTitle medium} <h3>Delete Medium #{mediumTitle medium}
<p> <p>

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<div class="inner">
<h3>Medium settings <h3>Medium settings
<form method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>

View file

@ -1,4 +1,4 @@
<div .medium .middle> <div .medium>
<h3>Create new Album <h3>Create new Album
<form class="inner r" method=post enctype=#{enctype}> <form class="inner r" method=post enctype=#{enctype}>
^{albumWidget} ^{albumWidget}

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<div class="inner">
<h1>Delete User #{userSlug user} <h1>Delete User #{userSlug user}
<p> <p>

View file

@ -1,6 +1,6 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .item>
<form class="inner" method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>
<h3>Profile settings <h3>Profile settings
^{profileSettingsWidget} ^{profileSettingsWidget}

View file

@ -1,6 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .item>
<div class="inner">
<h3>Reset Password <h3>Reset Password
<form method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>

View file

@ -1,31 +1,26 @@
<div #header .item data-width="400"> <div .subheader .item>
<div .inner>
<h1> <h1>
Results for: #{query} Results for: #{query}
$if allEmpty $if allEmpty
<div #header .item data-width="400"> <div .subheader .item>
<div .inner>
<h2> <h2>
Sorry, no results Sorry, no results
$else $else
$if not $ null userList $if not $ null userList
<div #header .item data-width="400"> <div .subheader .item>
<div .inner>
<h2> <h2>
Results in Users: Results in Users:
$forall (Entity uId user) <- userList $forall (Entity uId user) <- userList
<div #header .item data-width="400"> <div .item>
<div .inner>
<a href=@{ProfileR uId}> <a href=@{ProfileR uId}>
#{userSlug user} #{userSlug user}
$if not $ null albumList $if not $ null albumList
<div #header .item data-width="400"> <div .subheader .item>
<div .inner>
<h2> <h2>
Results in Albums: Results in Albums:
$forall (Entity aId album) <- albumList $forall (Entity aId album) <- albumList
<article .item data-width="#{albumSampleWidth album}"> <div .item data-width="#{albumSampleWidth album}">
<a href=@{AlbumR aId}> <a href=@{AlbumR aId}>
<figure> <figure>
$if (albumSamplePic album) == Nothing $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}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ fromJust $ albumSamplePic album) []} title=#{albumTitle album}>
<figcaption>#{albumTitle album} <figcaption>#{albumTitle album}
$if not $ null mediumList $if not $ null mediumList
<article #header .item data-width="400"> <article .subheader .item>
<div .inner>
<h2> <h2>
Results in Media: Results in Media:
$forall (Entity mId medium) <- mediumList $forall (Entity mId medium) <- mediumList
<article .item data-width="#{mediumThumbWidth medium}"> <div .item>
<a href=@{MediumR mId}> <a href=@{MediumR mId}>
<figure> <figure>
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb medium) []} title=#{mediumTitle medium}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb medium) []} title=#{mediumTitle medium}>
<figcaption>#{mediumTitle medium} <figcaption>#{mediumTitle medium}
$if not $ null commentList $if not $ null commentList
<div #header .item data-width="400"> <div .subheader .item>
<div .inner>
<h2> <h2>
Results in Comments: Results in Comments:
$forall (Entity _ comment) <- commentList $forall (Entity _ comment) <- commentList
<div #header .item data-width="400"> <div .item>
<div .inner>
<a href=@{MediumR $ commentOrigin comment}> <a href=@{MediumR $ commentOrigin comment}>
#{commentContent comment} #{commentContent comment}

View file

@ -1,5 +1,4 @@
<div #header .item data-width="400"> <div .item>
<div .inner>
<form method=GET action=@{SearchR}> <form method=GET action=@{SearchR}>
^{widget} ^{widget}
<input type="submit" value="Search"> <input type="submit" value="Search">

View file

@ -1,5 +1,5 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div .medium>
<noscript>You need to have Javscript enabled <noscript>You need to have Javscript enabled
<h3>Signup <h3>Signup
<form role="form" class="inner" method="POST" action=@{SignupR}> <form role="form" class="inner" method="POST" action=@{SignupR}>

View file

@ -1,12 +1,12 @@
$newline always $newline always
<div id="header" class="item" data-width="400"> <div .subheader .item>
<div class="inner">
<h1>Tag #{tag} <h1>Tag #{tag}
$if null media $if null media
<p>
There are no media tagged with #{tag} There are no media tagged with #{tag}
$forall Just (Entity mId m) <- media $forall Just (Entity mId m) <- media
<article class="item" data-width=#{mediumThumbWidth m}> <div .item>
<a href=@{MediumR mId}> <a href=@{MediumR mId}>
<figure> <figure>
<img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []} title=#{mediumTitle m}> <img src=@{StaticR $ StaticRoute (drop 2 $ map T.pack $ splitDirectories $ mediumThumb m) []} title=#{mediumTitle m}>