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")

View file

@ -1,6 +1,9 @@
<div .span9 .hero-unit>
<h2>
Configuring repository
$if new
Repository created
$else
Editing repository
$if new
<p>
This repository is set up and ready to go!
@ -20,10 +23,8 @@
<div .form-actions>
<button .btn .btn-primary type=submit>
Save Changes #
<a href="@{DashboardR}">
<a .btn href="@{DashboardR}">
Cancel #
<a href="@{DeleteRepositoryR uuid}">
Delete repository
$if new
<p>
In a hurry? Feel free to skip this step! You can always come back #

View file

@ -2,11 +2,15 @@
<li>
<a href="@{NewRepositoryR}">
<i .icon-plus-sign></i> Add another local repository
<li>
<a href="@{RepositorySwitcherR}">
<i .icon-folder-close></i> Switch repository
<li>
<a href="@{RestartR}">
<i .icon-repeat></i> Restart daemon
<li>
<a href="@{ShutdownR}">
<i .icon-off></i> Shutdown daemon
<li>
<a href="@{LogR}">
<i .icon-list></i> View log

View file

@ -32,8 +32,18 @@
<a href="@{setupRepoLink actions}">
enable
$else
<a href="@{setupRepoLink actions}">
configure
<span .dropdown #menu-#{fromUUID uuid}>
<a .dropdown-toggle data-toggle="dropdown" href="#menu-#{fromUUID uuid}">
<i .icon-cog></i> settings
<b .caret></b>
<ul .dropdown-menu>
<li>
<a href="@{setupRepoLink actions}">
<i .icon-pencil></i> Edit
<a href="@{DisableRepositoryR uuid}">
<i .icon-minus></i> Disable
<a href="@{DeleteRepositoryR uuid}">
<i .icon-trash></i> Delete
$if addmore
<tr>
<td colspan="3">