webapp: Added UI to delete repositories. Closes: #689847
This commit is contained in:
parent
e683df9536
commit
c57baaaa30
12 changed files with 245 additions and 6 deletions
21
templates/configurators/delete/choose.hamlet
Normal file
21
templates/configurators/delete/choose.hamlet
Normal file
|
@ -0,0 +1,21 @@
|
|||
<div .span9 .hero-unit>
|
||||
<h2>
|
||||
Delete repository #
|
||||
<small>
|
||||
#{reponame}
|
||||
<p>
|
||||
There are two ways you can choose to delete the repository:
|
||||
<p>
|
||||
The repository can be removed from the list of repositories, #
|
||||
but its contents left as-is. This prevents further syncing #
|
||||
to the repository. You can add the repository back at any time.
|
||||
<br>
|
||||
<a .btn .btn-default href="@{DeleteRepositoryFromListR uuid}">
|
||||
<i .icon-minus></i> Remove repository from list
|
||||
<p style="text-align: center">
|
||||
-or-
|
||||
<p>
|
||||
All data in the repository can be deleted. This is dangerous!
|
||||
<br>
|
||||
<a .btn .btn-danger href="@{DeleteRepositoryContentsR uuid}">
|
||||
<i .icon-warning-sign></i> Remove repository and all its contents
|
34
templates/configurators/delete/currentrepository.hamlet
Normal file
34
templates/configurators/delete/currentrepository.hamlet
Normal file
|
@ -0,0 +1,34 @@
|
|||
<div .span9 .hero-unit>
|
||||
<h2>
|
||||
Deleting #{reldir}
|
||||
<p>
|
||||
Deleting this repository will remove <tt>#{reldir}</tt> and all its #
|
||||
^{actionButton FileBrowserR (Just "files") (Just "Click to open a file browser") "" "icon-folder-open"}.
|
||||
$if havegitremotes
|
||||
$if havedataremotes
|
||||
<div .alert>
|
||||
Since this repository is currently configured to sync to other #
|
||||
repositories, you may be able to remove this repository without #
|
||||
losing any data, if all files have been synced to them. #
|
||||
No guarantees -- It's up to you to make sure before you continue.
|
||||
$else
|
||||
<div .alert .alert-error>
|
||||
This repository is not uploading its files to other repositories,
|
||||
so you will lose data if you delete it!
|
||||
$else
|
||||
<div .alert .alert-error>
|
||||
This repository is not syncing to other git repositories, #
|
||||
so you will lose data if you delete it!
|
||||
<p>
|
||||
If you choose to delete this repository, and potentially lose #
|
||||
data, enter "#{magicphrase}" into the box.
|
||||
<p>
|
||||
<form method="post" .form-horizontal enctype=#{enctype}>
|
||||
<fieldset>
|
||||
^{form}
|
||||
^{webAppFormAuthToken}
|
||||
<div .form-actions>
|
||||
<button .btn .btn-danger type=submit>
|
||||
<i .icon-warning-sign></i> Delete this repository #
|
||||
<a .btn .btn-primary href="@{DashboardR}">
|
||||
Cancel
|
20
templates/configurators/delete/repositorycontents.hamlet
Normal file
20
templates/configurators/delete/repositorycontents.hamlet
Normal file
|
@ -0,0 +1,20 @@
|
|||
<div .span9 .hero-unit>
|
||||
<h2>
|
||||
Delete repository contents?
|
||||
<p>
|
||||
Deleting the contents of the repository "#{reponame}" could cause #
|
||||
you to lose data. Some files might <em>only</em> be stored in #
|
||||
that repository.
|
||||
<p>
|
||||
If you choose to delete the repository, and potentially lose #
|
||||
data, enter "#{magicphrase}" into the box.
|
||||
<p>
|
||||
<form method="post" .form-horizontal enctype=#{enctype}>
|
||||
<fieldset>
|
||||
^{form}
|
||||
^{webAppFormAuthToken}
|
||||
<div .form-actions>
|
||||
<button .btn .btn-danger type=submit>
|
||||
<i .icon-warning-sign></i> Delete repository #
|
||||
<a .btn .btn-primary href="@{DashboardR}">
|
||||
Cancel
|
|
@ -0,0 +1,23 @@
|
|||
<div .span9 .hero-unit>
|
||||
<h2>
|
||||
Deleting repository contents
|
||||
<p>
|
||||
The repository "#{reponame}" has now been removed from the list, and #
|
||||
marked as a dead repository. But, this program is not currently #
|
||||
able to delete the contents of remote repositories.
|
||||
$maybe path <- Remote.localpath oldremote
|
||||
<p>
|
||||
<i .icon-warning-sign></i> #
|
||||
To delete the repository, remove everything in <tt>#{path}</tt>
|
||||
<p>
|
||||
(If the repository is on a removable drive, make sure it's mounted #
|
||||
first.)
|
||||
$nothing
|
||||
$if Git.repoIsUrl (Remote.repo oldremote)
|
||||
<p>
|
||||
<i .icon-warning-sign></i> #
|
||||
To delete the repository, remove everything in <tt>#{Git.repoLocation (Remote.repo oldremote)}</tt>
|
||||
$else
|
||||
<p>
|
||||
<i .icon-warning-sign></i> #
|
||||
It's up to you to finish deleting the contents of the repository.
|
|
@ -19,9 +19,11 @@
|
|||
^{webAppFormAuthToken}
|
||||
<div .form-actions>
|
||||
<button .btn .btn-primary type=submit>
|
||||
Save Changes
|
||||
<a .btn href="@{DashboardR}">
|
||||
Cancel
|
||||
Save Changes #
|
||||
<a href="@{DashboardR}">
|
||||
Cancel #
|
||||
<a href="@{DeleteRepositoryR uuid}">
|
||||
Delete repository
|
||||
$if new
|
||||
<p>
|
||||
In a hurry? Feel free to skip this step! You can always come back #
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue