-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow admins to delete a site and all its data
This doesn't have to be the final shape of this feature, but it should be enough to enable us to think about where to go next. Allows admins to delete a site via the interface. In the next iteration we will use a custom permission, but Joe might already be working as part of his story, so we should coordinate this. I've opted for a two-step, JavaScript-free process, for simplicity. I've also opted for a GitHub-style confirmation prompt, where rather than a yes/no question, the user has to input some text (the site slug AKA abbreviation in our case) to confirm a destructive action.
- Loading branch information
1 parent
afc5018
commit ded06da
Showing
8 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<% content_for(:page_title, @site.default_host.hostname) %> | ||
|
||
<div class="page-title-with-border"> | ||
<h1> | ||
<small><%= @site.default_host.hostname %></small> | ||
<br /> | ||
Delete this site and all its associated data | ||
</h1> | ||
</div> | ||
|
||
<div class="callout callout-danger"> | ||
<div class="callout-title"> | ||
WAIT! | ||
</div> | ||
<div class="callout-body"> | ||
This will delete all data that is associated with this site. | ||
</div> | ||
</div> | ||
|
||
<%= form_for @site, method: :delete, html: { role: 'form' } do |f| %> | ||
<div class="form-group row add-top-margin"> | ||
<div class="col-md-8"> | ||
<div class="input-group"> | ||
<dl> | ||
<dt> | ||
<%= label_tag :confirm_destroy, 'Please enter the site slug to confirm that you want to delete this site and all its data.' %> | ||
</dt> | ||
<dd> | ||
<%= text_field_tag(:confirm_destroy, {}, { class: 'form-control input' }) %> | ||
</dd> | ||
</dl> | ||
</div> | ||
<%= f.submit 'Delete', class: 'add-top-margin btn btn-danger' %> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters