diff --git a/config/routes b/config/routes index b3ba83d..6cddd51 100644 --- a/config/routes +++ b/config/routes @@ -145,7 +145,7 @@ /s/#ShrIdent/p/#PrjIdent/t/#Int/d/#MessageKeyHashid/reply TicketReplyR GET /s/#ShrIdent/p/#PrjIdent/t/#Int/deps TicketDepsR GET POST /s/#ShrIdent/p/#PrjIdent/t/#Int/deps/!new TicketDepNewR GET -/s/#ShrIdent/p/#PrjIdent/t/#Int/deps/#Int TicketDepR POST DELETE +/s/#ShrIdent/p/#PrjIdent/t/#Int/deps/#Int TicketDepOldR POST DELETE /s/#ShrIdent/p/#PrjIdent/t/#Int/rdeps TicketReverseDepsR GET /s/#ShrIdent/p/#PrjIdent/t/#Int/participants TicketParticipantsR GET /s/#ShrIdent/p/#PrjIdent/t/#Int/team TicketTeamR GET diff --git a/src/Vervis/Foundation.hs b/src/Vervis/Foundation.hs index c1964e3..4b73c31 100644 --- a/src/Vervis/Foundation.hs +++ b/src/Vervis/Foundation.hs @@ -356,7 +356,7 @@ instance Yesod App where (TicketReplyR _ _ _ _ , _ ) -> personAny (TicketDepsR s j _ , True) -> projOp ProjOpAddTicketDep s j (TicketDepNewR s j _ , _ ) -> projOp ProjOpAddTicketDep s j - (TicketDepR s j _ _ , True) -> projOp ProjOpRemoveTicketDep s j + (TicketDepOldR s j _ _ , True) -> projOp ProjOpRemoveTicketDep s j _ -> return Authorized where nobody :: Handler AuthResult @@ -913,7 +913,7 @@ instance YesodBreadcrumbs App where TicketDepNewR shr prj num -> ( "New dependency" , Just $ TicketDepsR shr prj num ) - TicketDepR shr prj pnum cnum -> ( T.pack $ '#' : show cnum + TicketDepOldR shr prj pnum cnum -> ( T.pack $ '#' : show cnum , Just $ TicketDepsR shr prj pnum ) TicketReverseDepsR shr prj num -> ( "Dependants" diff --git a/src/Vervis/Handler/Ticket.hs b/src/Vervis/Handler/Ticket.hs index 9b7f757..f1d0b50 100644 --- a/src/Vervis/Handler/Ticket.hs +++ b/src/Vervis/Handler/Ticket.hs @@ -45,8 +45,8 @@ module Vervis.Handler.Ticket , getTicketDepsR , postTicketDepsR , getTicketDepNewR - , postTicketDepR - , deleteTicketDepR + , postTicketDepOldR + , deleteTicketDepOldR , getTicketReverseDepsR , getTicketParticipantsR , getTicketTeamR @@ -915,15 +915,15 @@ getTicketDepNewR shr prj num = do ((_result, widget), enctype) <- runFormPost $ ticketDepForm jid tid defaultLayout $(widgetFile "ticket/dep/new") -postTicketDepR :: ShrIdent -> PrjIdent -> Int -> Int -> Handler Html -postTicketDepR shr prj pnum cnum = do +postTicketDepOldR :: ShrIdent -> PrjIdent -> Int -> Int -> Handler Html +postTicketDepOldR shr prj pnum cnum = do mmethod <- lookupPostParam "_method" case mmethod of - Just "DELETE" -> deleteTicketDepR shr prj pnum cnum + Just "DELETE" -> deleteTicketDepOldR shr prj pnum cnum _ -> notFound -deleteTicketDepR :: ShrIdent -> PrjIdent -> Int -> Int -> Handler Html -deleteTicketDepR shr prj pnum cnum = do +deleteTicketDepOldR :: ShrIdent -> PrjIdent -> Int -> Int -> Handler Html +deleteTicketDepOldR shr prj pnum cnum = do runDB $ do Entity sid _ <- getBy404 $ UniqueSharer shr Entity jid _ <- getBy404 $ UniqueProject prj sid diff --git a/templates/ticket/dep/list.hamlet b/templates/ticket/dep/list.hamlet index f007199..f6d213d 100644 --- a/templates/ticket/dep/list.hamlet +++ b/templates/ticket/dep/list.hamlet @@ -32,7 +32,7 @@ $# . #{show status} $if forward - ^{buttonW DELETE "Remove" (TicketDepR shr prj num number)} + ^{buttonW DELETE "Remove" (TicketDepOldR shr prj num number)} $if forward