working on medium site

This commit is contained in:
nek0 2015-01-12 15:15:52 +01:00
parent 4a4815bbe3
commit bba4db7795
11 changed files with 68 additions and 72 deletions

View file

@ -83,8 +83,9 @@ renderLayout widget = do
, js_init_js , js_init_js
]) ])
$(combineStylesheets 'StaticR $(combineStylesheets 'StaticR
[ css_normalize_css [
, css_bootstrap_css -- css_normalize_css
css_bootstrap_css
]) ])
$(widgetFile "default-layout") $(widgetFile "default-layout")
withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet") withUrlRenderer $(hamletFile "templates/default-layout-wrapper.hamlet")

View file

@ -28,7 +28,7 @@ getAdminMediumSettingsR mediumId = do
case tempMedium of case tempMedium of
Just medium -> do Just medium -> do
(adminMediumSetWidget, enctype) <- generateFormPost $ adminMediumSetForm medium (adminMediumSetWidget, enctype) <- generateFormPost $ adminMediumSetForm medium
defaultLayout $ do formLayout $ do
setTitle "Administration: Medium Settings" setTitle "Administration: Medium Settings"
$(widgetFile "adminMediumSet") $(widgetFile "adminMediumSet")
Nothing -> do Nothing -> do

View file

@ -33,7 +33,7 @@ getMediumR mediumId = do
(commentWidget, enctype) <- generateFormPost $ commentForm userId userSl mediumId Nothing (commentWidget, enctype) <- generateFormPost $ commentForm userId userSl mediumId Nothing
comments <- runDB $ selectList [CommentOrigin ==. mediumId, CommentParent ==. Nothing] [Desc CommentTime] comments <- runDB $ selectList [CommentOrigin ==. mediumId, CommentParent ==. Nothing] [Desc CommentTime]
replies <- runDB $ selectList [CommentOrigin ==. mediumId, CommentParent !=. Nothing] [Desc CommentTime] replies <- runDB $ selectList [CommentOrigin ==. mediumId, CommentParent !=. Nothing] [Desc CommentTime]
defaultLayout $ do formLayout $ do
setTitle $ toHtml ("Eidolon :: Medium " `T.append` (mediumTitle medium)) setTitle $ toHtml ("Eidolon :: Medium " `T.append` (mediumTitle medium))
$(widgetFile "medium") $(widgetFile "medium")
Nothing -> do Nothing -> do

View file

@ -499,7 +499,7 @@ console.log(itemsWidth,itemHeight)
overlayColor: _.settings.popupOverlayColor, overlayColor: _.settings.popupOverlayColor,
overlayOpacity: _.settings.popupOverlayOpacity, overlayOpacity: _.settings.popupOverlayOpacity,
popupCloserText: '', popupCloserText: '',
popupLoaderText: '', popupLoaderText: 'loading',
selector: '.thumb a', selector: '.thumb a',
usePopupCaption: true, usePopupCaption: true,
usePopupCloser: false, usePopupCloser: false,

View file

@ -6,8 +6,8 @@ $newline always
<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="200"> <article class="item" data-width=#{mediumThumbWidth m}>
<a href=@{AdminMediumSettingsR mId}>#{mediumTitle m} <a href=@{AdminMediumSettingsR mId}>
<figure class="thumbnail"> <figure class="thumbnail">
<img src=#{mediumThumb m}> <img src=#{mediumThumb m}>
<figcaption>#{mediumTitle m} <figcaption>#{mediumTitle m}

View file

@ -1,8 +1,7 @@
$newline always $newline always
<h3>Medium settings <div id="header" class="item" data-width="300">
<form class="inner" method="post" enctype=#{enctype}>
<div class="left"> <h1>Medium settings
<form method="post" enctype=#{enctype}>
^{adminMediumSetWidget} ^{adminMediumSetWidget}
<div> <div>
<input type=submit value="Change settings"> <input type=submit value="Change settings">

View file

@ -1,10 +0,0 @@
.right
float:right
width:50%
.left
float:left
width:50%
footer
clear:both

View file

@ -1,7 +1,7 @@
$newline always $newline always
<div id="header" class="item" data-width="300"> <div id="header" class="item" data-width="300">
<form class="inner" method="post" enctype=#{enctype}> <form class="inner" method="post" enctype=#{enctype}>
<h3>Album settings <h1>Album settings
^{albumSettingsWidget} ^{albumSettingsWidget}
<div> <div>
<input type=submit value="Change settings"> <input type=submit value="Change settings">

View file

@ -4,6 +4,10 @@
color: #d64760 color: #d64760
font-size: 1.5em font-size: 1.5em
.item
background: #1a1f2c;
background: rgba(255,255,255,0.25);
nav li nav li
display: inline-block display: inline-block

View file

@ -1,4 +1,5 @@
img img
position: relative !important
width: 100% width: 100%
.reply .reply

View file

@ -1,58 +1,59 @@
<h3>#{mediumTitle medium} <div id="header" class="item" data-width="800">
<div class="inner">
by <a href=@{UserR ownerName}>#{ownerName}</a> from album <a href=@{AlbumR albumId}>#{albumTitle album}</a> <h1>#{mediumTitle medium}
by <a href=@{UserR ownerName}>#{ownerName}</a> from album <a href=@{AlbumR albumId}>#{albumTitle album}</a>
<div class="image"> <img src=#{mediumPath medium}>
<img src=#{mediumPath medium}>
<div class="desc"> <div 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> Description:<br>
#{mediumDescription medium} #{mediumDescription medium}
<br>
<div class="tags"> <div class="tags">
Tags: Tags:
<ul> <ul>
$if null (mediumTags medium) $if null (mediumTags medium)
none none
$else
$forall tag <- mediumTags medium
<li>
<a href=@{TagR tag}>#{tag}
$if presence == True
<a href=@{MediumSettingsR mediumId}>Change medium settings
$if null comments
<p>There are no Comments yet
$else $else
$forall tag <- mediumTags medium $forall (Entity commentId comment) <- comments
<li> <div #comment>
<a href=@{TagR tag}>#{tag} <a href=@{ProfileR $ fromJust $ commentAuthor comment}>#{fromJust $ commentAuthorSlug comment}</a> wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
$if presence == True
<a href=@{MediumSettingsR mediumId}>Change medium settings
$if null comments
<p>There are no Comments yet
$else
$forall (Entity commentId comment) <- comments
<div #comment>
<a href=@{ProfileR $ fromJust $ commentAuthor comment}>#{fromJust $ commentAuthorSlug comment}</a> wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime comment}:
<hr>
#{commentContent comment}
$if userId /= Nothing
<hr>
<a href=@{CommentReplyR commentId}>Reply to this comment
$if userId == (commentAuthor comment)
<a href=@{CommentDeleteR commentId}>Delete this comment
$forall (Entity _ reply) <- replies
$if commentParent reply == Just commentId
<div #comment class="reply">
<a href=@{ProfileR $ fromJust $ commentAuthor reply}>#{fromJust $ commentAuthorSlug reply}</a> wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime reply}:
<hr> <hr>
#{commentContent reply} #{commentContent comment}
$if userId == (commentAuthor comment) $if userId /= Nothing
<a href=@{CommentDeleteR commentId}>Delete this comment <hr>
<a href=@{CommentReplyR commentId}>Reply to this comment
$if userId == (commentAuthor comment)
<a href=@{CommentDeleteR commentId}>Delete this comment
$forall (Entity _ reply) <- replies
$if commentParent reply == Just commentId
<div #comment class="reply">
<a href=@{ProfileR $ fromJust $ commentAuthor reply}>#{fromJust $ commentAuthorSlug reply}</a> wrote on #{formatTime defaultTimeLocale "%A %F %H:%M" $ commentTime reply}:
<hr>
#{commentContent reply}
$if userId == (commentAuthor comment)
<a href=@{CommentDeleteR commentId}>Delete this comment
$if userId /= Nothing $if userId /= Nothing
<form method=post enctype=#{enctype}> <form method=post enctype=#{enctype}>
^{commentWidget} ^{commentWidget}
<div> <div>
<input type=submit value="Post comment"> <input type=submit value="Post comment">
get a feed from this: get a feed from this:
<a href=@{CommentFeedAtomR mediumId}>Atom <a href=@{CommentFeedAtomR mediumId}>Atom
<a href=@{CommentFeedRssR mediumId}>RSS <a href=@{CommentFeedRssR mediumId}>RSS