drop down menu for each repository with edit, disable, delete

This commit is contained in:
Joey Hess 2013-04-03 21:26:38 -04:00
parent 37d7da4de8
commit a886c3b56d
4 changed files with 30 additions and 11 deletions

View file

@ -27,16 +27,20 @@ import System.IO.HVFS (SystemFS(..))
import qualified Data.Text as T
import qualified Data.Map as M
notCurrentRepo :: UUID -> Handler RepHtml -> Handler RepHtml
notCurrentRepo uuid a = go =<< liftAnnex (Remote.remoteFromUUID uuid)
where
go Nothing = redirect DeleteCurrentRepositoryR
go (Just _) = a
getDisableRepositoryR :: UUID -> Handler RepHtml
getDisableRepositoryR uuid = do
getDisableRepositoryR uuid = notCurrentRepo uuid $ do
void $ liftAssistant $ disableRemote uuid
redirect DashboardR
getDeleteRepositoryR :: UUID -> Handler RepHtml
getDeleteRepositoryR uuid = go =<< liftAnnex (Remote.remoteFromUUID uuid)
where
go Nothing = redirect DeleteCurrentRepositoryR
go (Just r) = deletionPage $ do
getDeleteRepositoryR uuid = notCurrentRepo uuid $
deletionPage $ do
reponame <- liftAnnex $ Remote.prettyUUID uuid
$(widgetFile "configurators/delete/start")