diff --git a/htdocs/frontend/javascripts/entity.js b/htdocs/frontend/javascripts/entity.js
index a2dcbd5..38fd039 100644
--- a/htdocs/frontend/javascripts/entity.js
+++ b/htdocs/frontend/javascripts/entity.js
@@ -98,13 +98,32 @@ Entity.prototype.loadData = function() {
* Show and edit entity details
*/
Entity.prototype.showDetails = function() {
+ var entity = this;
+
$('
')
.addClass('details')
.append(this.getDOMDetails())
.dialog({
title: 'Details für ' + this.title,
width: 480,
- resizable: false
+ resizable: false,
+ buttons : {
+ 'Schließen': function() {
+ $(this).dialog('close');
+ },
+ 'Löschen' : function() {
+ vz.load({ // TODO encapsulate in own method
+ controller: 'entity',
+ context: this,
+ identifier: entity.uuid,
+ url: entity.middleware,
+ type: 'DELETE',
+ success: function() {
+ $(this).dialog('close');
+ }
+ });
+ }
+ }
});
};
diff --git a/htdocs/frontend/javascripts/functions.js b/htdocs/frontend/javascripts/functions.js
index 8e9a785..ae502a1 100644
--- a/htdocs/frontend/javascripts/functions.js
+++ b/htdocs/frontend/javascripts/functions.js
@@ -79,6 +79,14 @@ vz.load = function(args) {
args.url += '.json';
+ if (args.data === undefined) {
+ args.data = { };
+ }
+
+ if (args.type) {
+ args.data.operation = args.type.toLowerCase();
+ }
+
return $.ajax(args);
};