merge two repository screens into one

This commit is contained in:
Joey Hess 2012-08-05 19:55:06 -04:00
parent 46feae36b6
commit aab3a01a71
7 changed files with 33 additions and 44 deletions

View file

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

View file

@ -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

View file

@ -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.

View file

@ -1,9 +0,0 @@
<div .span9>
<table .table .table-striped .table-condensed>
<tbody>
$forall (num, name) <- repolist
<tr>
<td>
#{num}
<td>
#{name}

View file

@ -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.

View file

@ -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>.

View file

@ -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>