uff. br0ken stuff.

This commit is contained in:
nek0 2016-09-05 17:17:57 +02:00
parent 2db1b5a8af
commit aab8e5661d
5 changed files with 17 additions and 18 deletions

View file

@ -150,15 +150,15 @@ getAdminProfileDeleteR ownerId = do
case tempOwner of case tempOwner of
Just owner -> do Just owner -> do
let albumList = userAlbums owner let albumList = userAlbums owner
_ <- mapM (\albumId -> do mapM_ (\albumId -> do
album <- runDB $ getJust albumId album <- runDB $ getJust albumId
let mediaList = albumContent album let mediaList = albumContent album
_ <- mapM (\med -> do mapM_ (\med -> do
-- delete comments -- delete comments
commEnts <- runDB $ selectList [CommentOrigin ==. med] [] commEnts <- runDB $ selectList [CommentOrigin ==. med] []
_ <- mapM (\ent -> do mapM_ (\ent -> do
children <- runDB $ selectList [CommentParent ==. (Just $ entityKey ent)] [] children <- runDB $ selectList [CommentParent ==. (Just $ entityKey ent)] []
_ <- mapM (\child -> do mapM_ (\child -> do
-- delete comment children -- delete comment children
runDB $ delete $ entityKey child runDB $ delete $ entityKey child
) children ) children
@ -169,7 +169,6 @@ getAdminProfileDeleteR ownerId = do
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium) liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium) liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
-- delete medium database entry and search -- delete medium database entry and search
ium <- runDB $ getJust med
runDB $ delete med runDB $ delete med
) mediaList ) mediaList
runDB $ delete albumId runDB $ delete albumId

View file

@ -22,14 +22,14 @@ import Data.Text.Encoding
getReactivateR :: Handler Html getReactivateR :: Handler Html
getReactivateR = do getReactivateR = do
(reactivateWidget, enctype) <- generateFormPost reactivateForm (reactivateWidget, enctype) <- generateFormPost $ renderBootstrap3 BootstrapBasicForm $ reactivateForm
formLayout $ do formLayout $ do
setTitle "Eidolon :: Reactivate account" setTitle "Eidolon :: Reactivate account"
$(widgetFile "reactivate") $(widgetFile "reactivate")
postReactivateR :: Handler Html postReactivateR :: Handler Html
postReactivateR = do postReactivateR = do
((result, _), _) <- runFormPost reactivateForm ((result, _), _) <- runFormPost $ renderBootstrap3 BootstrapBasicForm $ reactivateForm
case result of case result of
FormSuccess temp -> do FormSuccess temp -> do
users <- runDB $ selectList [UserEmail ==. temp] [] users <- runDB $ selectList [UserEmail ==. temp] []
@ -66,6 +66,7 @@ postReactivateR = do
setMessage "There is something wrong with your email" setMessage "There is something wrong with your email"
redirect $ ReactivateR redirect $ ReactivateR
reactivateForm :: Form Text reactivateForm :: AForm Handler Text
reactivateForm = renderDivs $ (\a -> a) reactivateForm = id
<$> areq emailField "Email" Nothing <$> areq emailField (bfs ("Email" :: Text)) Nothing
<* bootstrapSubmit ("Send" :: BootstrapSubmit Text)

View file

@ -1,16 +1,17 @@
$newline always $newline always
<div .item> <div .medium>
<noscript>You need to have Javascript enabled <noscript>You need to have Javascript enabled
<form .login>
<h3>Activate your account <h3>Activate your account
<p> <form>
<div .form-group .required>
<label for="password1">Password: <label for="password1">Password:
<input id="password1" type="password" required> <input id="password1" type="password" required>
<p> <div .form-group .required>
<label for="password2">Confirm your password: <label for="password2">Confirm your password:
<input id="password2" type="password" required> <input id="password2" type="password" required>
<p id="progress"> <p id="progress">
<input id="activate" type="submit" value="Activate" data-token="#{token}" data-salt="#{hexSalt}"> <div .form-group .optional>
<input id="activate" type="submit" value="Activate" data-token="#{token}" data-salt="#{hexSalt}">
<script src="/static/js/jquery.min.js" type="text/javascript"> <script src="/static/js/jquery.min.js" type="text/javascript">
<script src="/static/js/jsSHA.js" type="text/javascript"> <script src="/static/js/jsSHA.js" type="text/javascript">

View file

@ -4,5 +4,3 @@ $newline always
<form method="post" enctype=#{enctype}> <form method="post" enctype=#{enctype}>
^{reactivateWidget} ^{reactivateWidget}
<div>
<input type=submit value="Send">

View file

@ -2,7 +2,7 @@ $newline always
<div .medium> <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" method="POST" action=@{SignupR}>
<div .form-group .required> <div .form-group .required>
<label for="username">Username: <label for="username">Username:
<input .form-control #username name="username" type="text" required> <input .form-control #username name="username" type="text" required>