split repository comfiguration page into several widgets

This commit is contained in:
Joey Hess 2012-11-10 17:08:43 -04:00
parent fd22734392
commit 75048b43e2
5 changed files with 96 additions and 83 deletions

View file

@ -56,12 +56,22 @@ introDisplay ident = do
$(widgetFile "configurators/intro")
lift $ modifyWebAppState $ \s -> s { showIntro = False }
makeMiscRepositories :: Widget
makeMiscRepositories = $(widgetFile "configurators/repositories/misc")
makeCloudRepositories :: Widget
makeCloudRepositories = $(widgetFile "configurators/repositories/cloud")
repoTable :: Widget
repoTable = do
repolist <- lift $ repoList False True
$(widgetFile "configurators/repositories/table")
{- Lists known repositories, followed by options to add more. -}
getRepositoriesR :: Handler RepHtml
getRepositoriesR = bootstrap (Just Config) $ do
sideBarDisplay
setTitle "Repositories"
repolist <- lift $ repoList False True
$(widgetFile "configurators/repositories")
data Actions

View file

@ -1,95 +1,16 @@
<div .span9>
<h2>
Your repositories
<table .table .table-condensed>
<tbody>
$forall (num, name, actions) <- repolist
<tr>
<td>
#{num}
<td>
#{name}
<td>
$if needsEnabled actions
<a href="@{setupRepoLink actions}">
<i .icon-warning-sign></i> not enabled
$else
<a href="@{syncToggleLink actions}">
$if notSyncing actions
<i .icon-pause></i> syncing paused
$else
<i .icon-refresh></i> syncing enabled
<td>
$if needsEnabled actions
<a href="@{setupRepoLink actions}">
enable
$else
<a href="@{setupRepoLink actions}">
configure
^{repoTable}
<div .row-fluid>
<div .span6>
<h2>
Add more repositories
<h3>
<a href="@{AddDriveR}">
<i .icon-plus-sign></i> Removable drive
<p>
Clone this repository to a USB drive, memory stick, or other #
removable media.
<p>
For offline archiving, backups, or to #
<a href="http://en.wikipedia.org/wiki/Sneakernet">SneakerNet</a> #
between computers.
<h3>
<a href="@{StartPairR}">
<i .icon-plus-sign></i> Pair with another computer
<p>
Connect with another computer used by you, or by a friend,
that is also running git-annex.
<h3>
<i .icon-plus-sign></i> Phone
<p>
Save photos and recordings from your phone.
<p>
Send selected files to your phone.
<h3>
<i .icon-plus-sign></i> Network Attached Storage
<p>
Connect to a local storage appliance (NAS).
^{makeMiscRepositories}
<div .span6>
<h2>
Store your data in the cloud
<h3>
<a href="@{AddRsyncNetR}">
<i .icon-plus-sign></i> Rsync.net
<p>
Works very well with git-annex.
<h3>
<a href="@{AddS3R}">
<i .icon-plus-sign></i> Amazon S3
<p>
Good choice for professional storage quality and low prices.
<h3>
<i .icon-plus-sign></i> Amazon Glacier
<p>
Low cost offline data archival.
<h3>
<i .icon-plus-sign></i> Box.com
<p>
Provides free cloud storage for small amounts of data.
<h3>
<a href="@{AddSshR}">
<i .icon-plus-sign></i> Remote server
<p>
Set up a repository on a remote server using #
<tt>ssh</tt>, to build your own personal cloud.
^{makeCloudRepositories}

View file

@ -0,0 +1,28 @@
<h3>
<a href="@{AddRsyncNetR}">
<i .icon-plus-sign></i> Rsync.net
<p>
Works very well with git-annex.
<h3>
<a href="@{AddS3R}">
<i .icon-plus-sign></i> Amazon S3
<p>
Good choice for professional storage quality and low prices.
<h3>
<i .icon-plus-sign></i> Amazon Glacier
<p>
Low cost offline data archival.
<h3>
<i .icon-plus-sign></i> Box.com
<p>
Provides free cloud storage for small amounts of data.
<h3>
<a href="@{AddSshR}">
<i .icon-plus-sign></i> Remote server
<p>
Set up a repository on a remote server using #
<tt>ssh</tt>, to build your own personal cloud.

View file

@ -0,0 +1,29 @@
<h3>
<a href="@{AddDriveR}">
<i .icon-plus-sign></i> Removable drive
<p>
Clone this repository to a USB drive, memory stick, or other #
removable media.
<p>
For offline archiving, backups, or to #
<a href="http://en.wikipedia.org/wiki/Sneakernet">SneakerNet</a> #
between computers.
<h3>
<a href="@{StartPairR}">
<i .icon-plus-sign></i> Pair with another computer
<p>
Connect with another computer used by you, or by a friend,
that is also running git-annex.
<h3>
<i .icon-plus-sign></i> Phone
<p>
Save photos and recordings from your phone.
<p>
Send selected files to your phone.
<h3>
<i .icon-plus-sign></i> Network Attached Storage
<p>
Connect to a local storage appliance (NAS).

View file

@ -0,0 +1,25 @@
<table .table .table-condensed>
<tbody>
$forall (num, name, actions) <- repolist
<tr>
<td>
#{num}
<td>
#{name}
<td>
$if needsEnabled actions
<a href="@{setupRepoLink actions}">
<i .icon-warning-sign></i> not enabled
$else
<a href="@{syncToggleLink actions}">
$if notSyncing actions
<i .icon-pause></i> syncing paused
$else
<i .icon-refresh></i> syncing enabled
<td>
$if needsEnabled actions
<a href="@{setupRepoLink actions}">
enable
$else
<a href="@{setupRepoLink actions}">
configure