summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-05 19:55:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-05 19:55:06 -0400
commitaab3a01a7123854dd782597decf84b67d2bc2102 (patch)
treeef1fb775f6481747ce651cfc65443e16abb334f5
parent46feae36b6ddcb361414cd76fc17e63a392f9257 (diff)
merge two repository screens into one
-rw-r--r--Assistant/WebApp/Configurators.hs19
-rw-r--r--Assistant/WebApp/routes3
-rw-r--r--templates/configurators/intro.hamlet4
-rw-r--r--templates/configurators/listrepositories.hamlet9
-rw-r--r--templates/configurators/main.hamlet14
-rw-r--r--templates/configurators/repositories.hamlet (renamed from templates/configurators/addrepository.hamlet)26
-rw-r--r--templates/page.hamlet2
7 files changed, 33 insertions, 44 deletions
diff --git a/Assistant/WebApp/Configurators.hs b/Assistant/WebApp/Configurators.hs
index 66b8d386e..14da2ddbf 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 a53caf5ef..60f56cf14 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 0784b2743..4a1f228c8 100644
--- a/templates/configurators/intro.hamlet
+++ b/templates/configurators/intro.hamlet
@@ -8,7 +8,7 @@
repositories on your devices ...
<h2>
But no other repositories are set up yet.
- <a .btn .btn-primary .btn-large href="@{AddRepositoryR}">Add another repository</a>
+ <a .btn .btn-primary .btn-large href="@{RepositoriesR}">Add another repository</a>
$else
$if barelyenough
<span .badge .badge-warning>#{numrepos}</span>
@@ -23,6 +23,6 @@
#{num}
<td>
#{name}
- <a .btn .btn-primary .btn-large href="@{AddRepositoryR}">Add another repository</a>
+ <a .btn .btn-primary .btn-large href="@{RepositoriesR}">Add another repository</a>
<p>
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 22a6910de..000000000
--- a/templates/configurators/listrepositories.hamlet
+++ /dev/null
@@ -1,9 +0,0 @@
-<div .span9>
- <table .table .table-striped .table-condensed>
- <tbody>
- $forall (num, name) <- repolist
- <tr>
- <td>
- #{num}
- <td>
- #{name}
diff --git a/templates/configurators/main.hamlet b/templates/configurators/main.hamlet
index c974eeb5d..1482a904b 100644
--- a/templates/configurators/main.hamlet
+++ b/templates/configurators/main.hamlet
@@ -2,14 +2,8 @@
<div .row-fluid>
<div .span4>
<h3>
- <a href="@{AddRepositoryR}">
- Add repositories
+ <a href="@{RepositoriesR}">
+ Manage repositories
<p>
- Distribute the files in this repository to other devices;
- make backups; and more by adding repositories.
- <div .span4>
- <h3>
- <a href="@{ListRepositoriesR}">
- Repository list
- <p>
- 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
index 81f78828b..8013e64ec 100644
--- a/templates/configurators/addrepository.hamlet
+++ b/templates/configurators/repositories.hamlet
@@ -1,9 +1,21 @@
<div .span9>
+ <h2>
+ Your repositories
+ <table .table .table-condensed>
+ <tbody>
+ $forall (num, name) <- repolist
+ <tr>
+ <td>
+ #{num}
+ <td>
+ #{name}
+ <h2>
+ Add more repositories
<div .row-fluid>
<div .span4>
<h3>
<a href="@{AddDriveR}">
- Add a removable drive
+ <i .icon-plus></i> Removable drive
<p>
Clone this repository to a USB drive, memory stick, or other #
removable media.
@@ -13,15 +25,15 @@
between computers.
<div .span4>
<h3>
- Pair with a local computer
+ <i .icon-plus></i> Local computer
<p>
- 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.
<p>
For easy sharing with family and friends, or between your devices.
<div .span4>
<h3>
- Connect to your phone
+ <i .icon-plus></i> Phone
<p>
Save photos and recordings from your phone.
<p>
@@ -29,7 +41,7 @@
<div .row-fluid>
<div .span4>
<h3>
- Store data in the cloud
+ <i .icon-plus></i> The cloud
<p>
Store your data on a third-party cloud platform, #
including Amazon S3, Box.com, and Rsync.net.
@@ -38,7 +50,7 @@
With strong encryption to protect your privacy.
<div .span4>
<h3>
- Clone to a remote server
+ <i .icon-plus></i> Remote server
<p>
Set up a repository on a remote server using #
<tt>ssh</tt> or <tt>rsync</tt>.
diff --git a/templates/page.hamlet b/templates/page.hamlet
index 5544221da..2d33e9561 100644
--- a/templates/page.hamlet
+++ b/templates/page.hamlet
@@ -17,7 +17,7 @@
Current Repository: #{reldir}
<b .caret></b>
<ul .dropdown-menu>
- <li><a href="@{AddRepositoryR}">Add another repository</a></li>
+ <li><a href="@{RepositoriesR}">Add another repository</a></li>
$nothing
<div .container-fluid>
<div .row-fluid>