This commit is contained in:
nek0 2014-08-17 22:59:55 +02:00
parent 96a7a28a42
commit a9bd79caf9
4 changed files with 11 additions and 15 deletions

View file

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

View file

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

View file

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

View file

@ -3,11 +3,12 @@
/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
/activate/#Text ActivateR GET /activate/#Text ActivateR GET
/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