cleanup
This commit is contained in:
parent
96a7a28a42
commit
a9bd79caf9
4 changed files with 11 additions and 15 deletions
|
@ -19,7 +19,6 @@ import Text.Jasmine (minifym)
|
||||||
import Text.Hamlet (hamletFile)
|
import Text.Hamlet (hamletFile)
|
||||||
import Yesod.Core.Types (Logger)
|
import Yesod.Core.Types (Logger)
|
||||||
-- costom imports
|
-- costom imports
|
||||||
import Data.Maybe
|
|
||||||
import Data.Text
|
import Data.Text
|
||||||
import Helper
|
import Helper
|
||||||
|
|
||||||
|
@ -73,7 +72,7 @@ instance Yesod App where
|
||||||
uId <- return $ getUserIdFromText a
|
uId <- return $ getUserIdFromText a
|
||||||
user <- runDB $ getJust uId
|
user <- runDB $ getJust uId
|
||||||
return $ userName user
|
return $ userName user
|
||||||
otherwise -> do
|
Nothing -> do
|
||||||
return ("" :: Text)
|
return ("" :: Text)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,3 @@ getHomeR = do
|
||||||
recentMedia <- runDB $ selectList [] [Desc MediumTime]
|
recentMedia <- runDB $ selectList [] [Desc MediumTime]
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
$(widgetFile "home")
|
$(widgetFile "home")
|
||||||
|
|
||||||
postHomeR :: Handler Html
|
|
||||||
postHomeR = do
|
|
||||||
error "not yet implemented"
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import Import as I
|
||||||
import Data.Time
|
import Data.Time
|
||||||
import Data.Text
|
import Data.Text
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
import Database.Persist.Types
|
|
||||||
|
|
||||||
data TempMedium = TempMedium
|
data TempMedium = TempMedium
|
||||||
{ tempMediumTitle :: Text
|
{ tempMediumTitle :: Text
|
||||||
|
@ -84,6 +83,7 @@ tagField = Field
|
||||||
{ fieldParse = \rawVals _ -> do
|
{ fieldParse = \rawVals _ -> do
|
||||||
case rawVals of
|
case rawVals of
|
||||||
[x] -> return $ Right $ Just $ splitOn " " x
|
[x] -> return $ Right $ Just $ splitOn " " x
|
||||||
|
_ -> return $ Left $ error "unexpected tag list"
|
||||||
, fieldView = \idAttr nameAttr _ eResult isReq ->
|
, fieldView = \idAttr nameAttr _ eResult isReq ->
|
||||||
[whamlet|<input id=#{idAttr} type="text" name=#{nameAttr}>|]
|
[whamlet|<input id=#{idAttr} type="text" name=#{nameAttr}>|]
|
||||||
, fieldEnctype = UrlEncoded
|
, fieldEnctype = UrlEncoded
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/favicon.ico FaviconR GET
|
/favicon.ico FaviconR GET
|
||||||
/robots.txt RobotsR GET
|
/robots.txt RobotsR GET
|
||||||
|
|
||||||
/ HomeR GET POST
|
/ HomeR GET
|
||||||
/signup SignupR GET POST
|
/signup SignupR GET POST
|
||||||
/login LoginR GET POST
|
/login LoginR GET POST
|
||||||
/logout LogoutR GET
|
/logout LogoutR GET
|
||||||
|
@ -11,3 +11,4 @@
|
||||||
/user/#UserId ProfileR GET
|
/user/#UserId ProfileR GET
|
||||||
/upload UploadR GET POST
|
/upload UploadR GET POST
|
||||||
/newalbum NewAlbumR GET POST
|
/newalbum NewAlbumR GET POST
|
||||||
|
/user/#UserId/album/#AlbumId AlbumR GET
|
||||||
|
|
Loading…
Reference in a new issue