Allow to delete domain from admin.

This commit is contained in:
opi 2014-03-02 20:07:02 +01:00
parent 0dbe01e399
commit ba9692e966
2 changed files with 22 additions and 7 deletions

View file

@ -481,6 +481,19 @@ app = Sammy('#main', function (sam) {
}, 'POST', params);
});
sam.get('#/domains/:domain/delete', function (c) {
if (confirm('Are you sure you want to delete '+ c.params['domain'] +' ?')) {
c.api('/domains/'+ c.params['domain'], function(data) { // http://api.yunohost.org/#!/domain/domain_remove_delete_3
store.clear('slide');
c.redirect('#/domains');
}, 'DELETE');
} else {
store.clear('slide');
c.redirect('#/domains');
}
});
/**
* Apps
*

View file

@ -9,11 +9,13 @@
<div class="br"></div>
<div class="list-group">
{{#Domains}}
<a href="#/domains/{{.}}" class="list-group-item slide">
<h4 class="pull-left list-group-item-heading">{{.}}</h4>
<span class="glyphicon glyphicon-chevron-right pull-right"></span>
<div class="clearfix"></div>
</a>
{{/Domains}}
{{#Domains}}
<div class="list-group-item">
<a href="#/domains/{{.}}/delete" class="btn btn-danger slide back pull-right">
<span class="glyphicon glyphicon-trash"></span> Delete
</a>
<h2 class="list-group-item-heading">{{.}}</h2>
<a href="https://{{.}}" target="_blank">https://{{.}}</a>
</div>
{{/Domains}}
</div>