diff --git a/public/js/app/views/servers/list_item.js b/public/js/app/views/servers/list_item.js index 4f50147..3930932 100644 --- a/public/js/app/views/servers/list_item.js +++ b/public/js/app/views/servers/list_item.js @@ -16,13 +16,21 @@ define(function (require) { template: template, events: { - "click .delete": "delete" + "click .clone": "clone", + "click .delete": "delete", }, modelEvents: { "change": "serverUpdated", }, + clone: function (e) { + var title = this.model.get('title') + ' Clone'; + var clone = this.model.clone(); + clone.set({id: null, title: title}); + clone.save(); + }, + delete: function (event) { var self = this; sweetAlert({ diff --git a/public/js/app/views/servers/parameters/list_item.js b/public/js/app/views/servers/parameters/list_item.js index 8dad8c6..6494f7d 100644 --- a/public/js/app/views/servers/parameters/list_item.js +++ b/public/js/app/views/servers/parameters/list_item.js @@ -17,6 +17,7 @@ define(function (require) { events: { "click button.delete": "delete", "change input#parameter": "changed", + "click button.clone": "clone", }, changed: function (e) { diff --git a/public/js/tpl/servers/list.html b/public/js/tpl/servers/list.html index a0300ab..b9fb836 100644 --- a/public/js/tpl/servers/list.html +++ b/public/js/tpl/servers/list.html @@ -5,6 +5,7 @@ Port Title + diff --git a/public/js/tpl/servers/list_item.html b/public/js/tpl/servers/list_item.html index ae66439..1d462f4 100644 --- a/public/js/tpl/servers/list_item.html +++ b/public/js/tpl/servers/list_item.html @@ -13,6 +13,11 @@ <%-title%> + + +