diff --git a/Assistant/WebApp/Configurators/Edit.hs b/Assistant/WebApp/Configurators/Edit.hs index 350a0ee14f..d69e9cb51b 100644 --- a/Assistant/WebApp/Configurators/Edit.hs +++ b/Assistant/WebApp/Configurators/Edit.hs @@ -115,7 +115,13 @@ editRepositoryAForm def = RepoConfig _ -> [] getEditRepositoryR :: UUID -> Handler RepHtml -getEditRepositoryR uuid = bootstrap (Just Config) $ do +getEditRepositoryR = editForm False + +getEditNewRepositoryR :: UUID -> Handler RepHtml +getEditNewRepositoryR = editForm True + +editForm :: Bool -> UUID -> Handler RepHtml +editForm new uuid = bootstrap (Just Config) $ do sideBarDisplay setTitle "Configure repository" @@ -129,11 +135,11 @@ getEditRepositoryR uuid = bootstrap (Just Config) $ do maybe noop (changeEnabled r) =<< runAnnex undefined (setRepoConfig r input) redirect RepositoriesR - _ -> showform form enctype + _ -> showform form enctype curr where - showform form enctype = do + showform form enctype curr = do + let istransfer = repoGroup curr == RepoGroupStandard TransferGroup let authtoken = webAppFormAuthToken - description <- lift $ - runAnnex T.empty $ T.pack . concat <$> - Remote.prettyListUUIDs [uuid] $(widgetFile "configurators/editrepository") + + diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index e742b04ec3..67d8b9bc44 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -185,19 +185,19 @@ getAddDriveR = bootstrap (Just Config) $ do ((res, form), enctype) <- lift $ runFormGet $ selectDriveForm (sort writabledrives) Nothing case res of - FormSuccess (RemovableDrive { mountPoint = d }) -> lift $ do - go $ T.unpack d - redirect RepositoriesR + FormSuccess (RemovableDrive { mountPoint = d }) -> lift $ + make (T.unpack d) >>= redirect . EditNewRepositoryR _ -> do let authtoken = webAppFormAuthToken $(widgetFile "configurators/adddrive") where - go mountpoint = do + make mountpoint = do liftIO $ makerepo dir u <- liftIO $ initRepo dir $ Just remotename r <- addremote dir remotename runAnnex () $ setStandardGroup u TransferGroup syncRemote r + return u where dir = mountpoint gitAnnexAssistantDefaultDir remotename = takeFileName mountpoint diff --git a/Assistant/WebApp/Configurators/S3.hs b/Assistant/WebApp/Configurators/S3.hs index 04dffe7509..cd019be0b8 100644 --- a/Assistant/WebApp/Configurators/S3.hs +++ b/Assistant/WebApp/Configurators/S3.hs @@ -125,4 +125,4 @@ makeS3Remote (S3Creds ak sk) name setup config = do return remotename setup r liftIO $ syncNewRemote st (daemonStatus webapp) (scanRemotes webapp) r - redirect RepositoriesR + redirect $ EditNewRepositoryR $ Remote.uuid r diff --git a/Assistant/WebApp/Configurators/Ssh.hs b/Assistant/WebApp/Configurators/Ssh.hs index b440944e37..690fc2183a 100644 --- a/Assistant/WebApp/Configurators/Ssh.hs +++ b/Assistant/WebApp/Configurators/Ssh.hs @@ -291,7 +291,7 @@ makeSshRepo forcersync setup sshdata = do (scanRemotes webapp) forcersync sshdata setup r - redirect RepositoriesR + redirect $ EditRepositoryR $ Remote.uuid r getAddRsyncNetR :: Handler RepHtml getAddRsyncNetR = do diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index 0d8417d32a..4e473e1e99 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -11,6 +11,7 @@ /config/repository/new NewRepositoryR GET /config/repository/switchto/#FilePath SwitchToRepositoryR GET /config/repository/edit/#UUID EditRepositoryR GET +/config/repository/edit/new/#UUID EditNewRepositoryR GET /config/repository/add/drive AddDriveR GET /config/repository/add/ssh AddSshR GET diff --git a/templates/configurators/editrepository.hamlet b/templates/configurators/editrepository.hamlet index b4c2b7e440..6eecc3b08c 100644 --- a/templates/configurators/editrepository.hamlet +++ b/templates/configurators/editrepository.hamlet @@ -1,6 +1,17 @@

- Configuring repository: #{description} + Configuring repository + $if new +

+ This repository is set up and ready to go! +

+ Now you can do a little more configuring of it, if you like. # + Perhaps enter a better description than the automatically generated one. + $if istransfer +

+ This repository is currently in the transfer group. That's the # + right choice if you'll use it to shuttle data back and forth # + between other repositories. Otherwise, pick one of the other groups.

@@ -11,3 +22,7 @@ Save Changes Cancel + $if new +

+ In a hurry? Feel free to skip this step! You can always come back # + and configure this repository later.