1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2025-03-20 04:46:22 +09:00

Ticket list page

This commit is contained in:
fr33domlover 2016-04-30 23:02:44 +00:00
parent 09b767a037
commit eaadbc050c
3 changed files with 49 additions and 4 deletions
src/Vervis/Handler

View file

@ -17,13 +17,14 @@ module Vervis.Handler.Ticket
( getTicketsR
, postTicketsR
, getTicketNewR
, getTicketR
)
where
import Prelude
import Data.Text (Text)
import Database.Persist.Types (Entity (..))
import Database.Persist
import Text.Blaze.Html (Html, toHtml)
import Yesod.Core (defaultLayout)
import Yesod.Core.Handler (notFound)
@ -39,7 +40,14 @@ import Vervis.Model
import Vervis.Settings (widgetFile)
getTicketsR :: Text -> Text -> Handler Html
getTicketsR shar proj = notFound
getTicketsR shar proj = do
tickets <- runDB $ do
Entity sid _sharer <- getBy404 $ UniqueSharerIdent shar
Entity pid _project <- getBy404 $ UniqueProject proj sid
selectList [TicketProject ==. pid] [Asc TicketNumber]
defaultLayout $ do
setTitle $ toHtml $ T.intercalate " :: " [shar, proj, "Tickes"]
$(widgetFile "ticket/list")
postTicketsR :: Text -> Text -> Handler Html
postTicketsR shar proj = notFound
@ -54,3 +62,6 @@ getTicketNewR shar proj = do
defaultLayout $ do
setTitle $ toHtml $ T.intercalate " :: " [shar, proj, "New ticket"]
$(widgetFile "ticket/new")
getTicketR :: Text -> Text -> Int -> Handler Html
getTicketR shar proj num = notFound