From aab3a01a7123854dd782597decf84b67d2bc2102 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 5 Aug 2012 19:55:06 -0400 Subject: [PATCH] merge two repository screens into one --- Assistant/WebApp/Configurators.hs | 19 +++++--------- Assistant/WebApp/routes | 3 +-- templates/configurators/intro.hamlet | 4 +-- .../configurators/listrepositories.hamlet | 9 ------- templates/configurators/main.hamlet | 14 +++------- ...drepository.hamlet => repositories.hamlet} | 26 ++++++++++++++----- templates/page.hamlet | 2 +- 7 files changed, 33 insertions(+), 44 deletions(-) delete mode 100644 templates/configurators/listrepositories.hamlet rename templates/configurators/{addrepository.hamlet => repositories.hamlet} (66%) diff --git a/Assistant/WebApp/Configurators.hs b/Assistant/WebApp/Configurators.hs index 66b8d386e1..14da2ddbf0 100644 --- a/Assistant/WebApp/Configurators.hs +++ b/Assistant/WebApp/Configurators.hs @@ -49,20 +49,13 @@ getConfigR = ifM (inFirstRun) $(widgetFile "configurators/main") ) -{- Lists different types of repositories that can be added. -} -getAddRepositoryR :: Handler RepHtml -getAddRepositoryR = bootstrap (Just Config) $ do +{- Lists known repositories, followed by options to add more. -} +getRepositoriesR :: Handler RepHtml +getRepositoriesR = bootstrap (Just Config) $ do sideBarDisplay - setTitle "Add repository" - $(widgetFile "configurators/addrepository") - -{- Lists known repositories. -} -getListRepositoriesR :: Handler RepHtml -getListRepositoriesR = bootstrap (Just Config) $ do - sideBarDisplay - setTitle "Repository list" + setTitle "Repositories" repolist <- lift repoList - $(widgetFile "configurators/listrepositories") + $(widgetFile "configurators/repositories") {- A numbered list of known repositories, including the current one. -} repoList :: Handler [(String, String)] @@ -217,7 +210,7 @@ getAddDriveR = bootstrap (Just Config) $ do FormSuccess (RemovableDrive { mountPoint = d }) -> lift $ do go $ T.unpack d setMessage $ toHtml $ T.unwords ["Added", d] - redirect ListRepositoriesR + redirect RepositoriesR _ -> do let authtoken = webAppFormAuthToken $(widgetFile "configurators/adddrive") diff --git a/Assistant/WebApp/routes b/Assistant/WebApp/routes index a53caf5efc..60f56cf142 100644 --- a/Assistant/WebApp/routes +++ b/Assistant/WebApp/routes @@ -4,10 +4,9 @@ /about AboutR GET /config ConfigR GET -/config/repository/add AddRepositoryR GET +/config/repository RepositoriesR GET /config/repository/add/drive AddDriveR GET /config/repository/first FirstRepositoryR GET -/config/repository/list ListRepositoriesR GET /transfers/#NotificationId TransfersR GET /sidebar/#NotificationId SideBarR GET diff --git a/templates/configurators/intro.hamlet b/templates/configurators/intro.hamlet index 0784b2743e..4a1f228c80 100644 --- a/templates/configurators/intro.hamlet +++ b/templates/configurators/intro.hamlet @@ -8,7 +8,7 @@ repositories on your devices ...

But no other repositories are set up yet. - Add another repository + Add another repository $else $if barelyenough #{numrepos} @@ -23,6 +23,6 @@ #{num} #{name} - Add another repository + Add another repository

Or just sit back, watch the magic, and get on with using your files. diff --git a/templates/configurators/listrepositories.hamlet b/templates/configurators/listrepositories.hamlet deleted file mode 100644 index 22a6910de5..0000000000 --- a/templates/configurators/listrepositories.hamlet +++ /dev/null @@ -1,9 +0,0 @@ -

- - - $forall (num, name) <- repolist - -
- #{num} - - #{name} diff --git a/templates/configurators/main.hamlet b/templates/configurators/main.hamlet index c974eeb5dd..1482a904b4 100644 --- a/templates/configurators/main.hamlet +++ b/templates/configurators/main.hamlet @@ -2,14 +2,8 @@

- - Add repositories + + Manage repositories

- Distribute the files in this repository to other devices; - make backups; and more by adding repositories. -

-

- - Repository list -

- An overview of your repositories. + Distribute the files in this repository to other devices, + make backups, and more, by adding repositories. diff --git a/templates/configurators/addrepository.hamlet b/templates/configurators/repositories.hamlet similarity index 66% rename from templates/configurators/addrepository.hamlet rename to templates/configurators/repositories.hamlet index 81f78828b8..8013e64ec2 100644 --- a/templates/configurators/addrepository.hamlet +++ b/templates/configurators/repositories.hamlet @@ -1,9 +1,21 @@

+

+ Your repositories + + + $forall (num, name) <- repolist + +
+ #{num} + + #{name} +

+ Add more repositories

- Add a removable drive + Removable drive

Clone this repository to a USB drive, memory stick, or other # removable media. @@ -13,15 +25,15 @@ between computers.

- Pair with a local computer + Local computer

- Automatically keep files in sync between computers on your # - local network. + Pair with a local computer to automatically keep files in sync # + between computers on your local network.

For easy sharing with family and friends, or between your devices.