work around yesod bug that causes a warning

I think this is fixed in newer versions of yesod, so this commit can be
reverted when dropping support for Debian wheezy.
This commit is contained in:
Joey Hess 2013-02-27 18:30:11 -04:00
parent 54cbbe460c
commit 95a244d9c4
4 changed files with 13 additions and 4 deletions

View file

@ -164,8 +164,8 @@ getNewRepositoryR = page "Add another repository" (Just Configuration) $ do
mainrepo <- fromJust . relDir <$> lift getYesod
$(widgetFile "configurators/newrepository/combine")
getCombineRepositoryR :: FilePath -> UUID -> Handler RepHtml
getCombineRepositoryR newrepopath newrepouuid = do
getCombineRepositoryR :: FilePathAndUUID -> Handler RepHtml
getCombineRepositoryR (FilePathAndUUID newrepopath newrepouuid) = do
r <- combineRepos newrepopath remotename
syncRemote r
redirect $ EditRepositoryR newrepouuid

View file

@ -88,6 +88,15 @@ data RepoSelector = RepoSelector
data RepoListNotificationId = RepoListNotificationId NotificationId RepoSelector
deriving (Read, Show, Eq)
{- Only needed to work around old-yesod bug that emits a warning message
- when a route has two parameters. -}
data FilePathAndUUID = FilePathAndUUID FilePath UUID
deriving (Read, Show, Eq)
instance PathPiece FilePathAndUUID where
toPathPiece = pack . show
fromPathPiece = readish . unpack
instance PathPiece SshData where
toPathPiece = pack . show
fromPathPiece = readish . unpack

View file

@ -20,7 +20,7 @@
/config/repository/new NewRepositoryR GET
/config/repository/switcher RepositorySwitcherR GET
/config/repository/switchto/#FilePath SwitchToRepositoryR GET
/config/repository/combine/#FilePath/#UUID CombineRepositoryR GET
/config/repository/combine/#FilePathAndUUID CombineRepositoryR GET
/config/repository/edit/#UUID EditRepositoryR GET
/config/repository/edit/new/#UUID EditNewRepositoryR GET
/config/repository/edit/new/cloud/#UUID EditNewCloudRepositoryR GET

View file

@ -6,7 +6,7 @@
<br>
Do you want to combine it with your existing repository at #{mainrepo}?
<p>
<a .btn href="@{CombineRepositoryR newrepopath newrepouuid}">
<a .btn href="@{CombineRepositoryR $ FilePathAndUUID newrepopath newrepouuid}">
<i .icon-resize-small></i> Combine the repositories #
The combined repositories will sync and share their files.
<p>