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:
parent
54cbbe460c
commit
95a244d9c4
4 changed files with 13 additions and 4 deletions
|
@ -164,8 +164,8 @@ getNewRepositoryR = page "Add another repository" (Just Configuration) $ do
|
||||||
mainrepo <- fromJust . relDir <$> lift getYesod
|
mainrepo <- fromJust . relDir <$> lift getYesod
|
||||||
$(widgetFile "configurators/newrepository/combine")
|
$(widgetFile "configurators/newrepository/combine")
|
||||||
|
|
||||||
getCombineRepositoryR :: FilePath -> UUID -> Handler RepHtml
|
getCombineRepositoryR :: FilePathAndUUID -> Handler RepHtml
|
||||||
getCombineRepositoryR newrepopath newrepouuid = do
|
getCombineRepositoryR (FilePathAndUUID newrepopath newrepouuid) = do
|
||||||
r <- combineRepos newrepopath remotename
|
r <- combineRepos newrepopath remotename
|
||||||
syncRemote r
|
syncRemote r
|
||||||
redirect $ EditRepositoryR newrepouuid
|
redirect $ EditRepositoryR newrepouuid
|
||||||
|
|
|
@ -88,6 +88,15 @@ data RepoSelector = RepoSelector
|
||||||
data RepoListNotificationId = RepoListNotificationId NotificationId RepoSelector
|
data RepoListNotificationId = RepoListNotificationId NotificationId RepoSelector
|
||||||
deriving (Read, Show, Eq)
|
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
|
instance PathPiece SshData where
|
||||||
toPathPiece = pack . show
|
toPathPiece = pack . show
|
||||||
fromPathPiece = readish . unpack
|
fromPathPiece = readish . unpack
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
/config/repository/new NewRepositoryR GET
|
/config/repository/new NewRepositoryR GET
|
||||||
/config/repository/switcher RepositorySwitcherR GET
|
/config/repository/switcher RepositorySwitcherR GET
|
||||||
/config/repository/switchto/#FilePath SwitchToRepositoryR 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/#UUID EditRepositoryR GET
|
||||||
/config/repository/edit/new/#UUID EditNewRepositoryR GET
|
/config/repository/edit/new/#UUID EditNewRepositoryR GET
|
||||||
/config/repository/edit/new/cloud/#UUID EditNewCloudRepositoryR GET
|
/config/repository/edit/new/cloud/#UUID EditNewCloudRepositoryR GET
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<br>
|
<br>
|
||||||
Do you want to combine it with your existing repository at #{mainrepo}?
|
Do you want to combine it with your existing repository at #{mainrepo}?
|
||||||
<p>
|
<p>
|
||||||
<a .btn href="@{CombineRepositoryR newrepopath newrepouuid}">
|
<a .btn href="@{CombineRepositoryR $ FilePathAndUUID newrepopath newrepouuid}">
|
||||||
<i .icon-resize-small></i> Combine the repositories #
|
<i .icon-resize-small></i> Combine the repositories #
|
||||||
The combined repositories will sync and share their files.
|
The combined repositories will sync and share their files.
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue