summaryrefslogtreecommitdiffstats
path: root/module/web
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-30 16:38:37 +0100
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-03-30 16:38:37 +0100
commit9b9ba2a20409486e6645e0429220447f84199cc7 (patch)
tree0848626e95da6cb850819ded944ef1220f76f42e /module/web
parentplugin chooser for settings (diff)
downloadpyload-9b9ba2a20409486e6645e0429220447f84199cc7.tar.xz
show active addons
Diffstat (limited to 'module/web')
-rw-r--r--module/web/static/css/default/settings.less20
-rw-r--r--module/web/static/js/views/settings/pluginChooserModal.js5
-rw-r--r--module/web/static/js/views/settings/settingsView.js14
-rw-r--r--module/web/templates/default/settings.html10
4 files changed, 41 insertions, 8 deletions
diff --git a/module/web/static/css/default/settings.less b/module/web/static/css/default/settings.less
index 44eeddc5f..12cc31e06 100644
--- a/module/web/static/css/default/settings.less
+++ b/module/web/static/css/default/settings.less
@@ -22,6 +22,26 @@
margin-top: 0;
}
+ .plugin {
+ a {
+ padding-left: 28px;
+ background-position: 4px 2px;
+ background-repeat: no-repeat;
+ background-size: 20px 20px;
+ }
+
+ i {
+ display: none;
+ }
+
+ &:hover {
+ i {
+ display: block;
+ }
+ }
+
+ }
+
border-top-left-radius: 0;
border-top-right-radius: 0;
diff --git a/module/web/static/js/views/settings/pluginChooserModal.js b/module/web/static/js/views/settings/pluginChooserModal.js
index c7cdce244..65c412d9c 100644
--- a/module/web/static/js/views/settings/pluginChooserModal.js
+++ b/module/web/static/js/views/settings/pluginChooserModal.js
@@ -14,10 +14,9 @@ define(['jquery', 'underscore', 'app', 'views/abstract/modalView', 'text!tpl/def
this.events = _.extend({}, modalView.prototype.events, this.events);
var self = this;
$.ajax(App.apiRequest('getAvailablePlugins', null, {success: function(data) {
- self.plugins = data;
+ self.plugins = _.sortBy(data, function(item){return item.name;});
self.render();
- }
- }));
+ }}));
},
onRender: function() {
diff --git a/module/web/static/js/views/settings/settingsView.js b/module/web/static/js/views/settings/settingsView.js
index 58507f51a..4e83322e5 100644
--- a/module/web/static/js/views/settings/settingsView.js
+++ b/module/web/static/js/views/settings/settingsView.js
@@ -9,7 +9,8 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
events: {
'click .settings-menu li > a': 'change_section',
- 'click .btn-add': 'choosePlugin'
+ 'click .btn-add': 'choosePlugin',
+ 'click .iconf-remove': 'deleteConfig'
},
menu: null,
@@ -110,7 +111,8 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
},
failure: function() {
-
+ // TODO
+ this.config = null;
},
change_section: function(e) {
@@ -134,6 +136,14 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
self.modal.show();
});
+ },
+
+ deleteConfig: function(e){
+ e.stopPropagation();
+ var el = $(e.target).parent().parent();
+ var name = el.data("name");
+
+ console.log("Delete config " + name);
}
});
diff --git a/module/web/templates/default/settings.html b/module/web/templates/default/settings.html
index bee583dbf..d8e3430f5 100644
--- a/module/web/templates/default/settings.html
+++ b/module/web/templates/default/settings.html
@@ -23,10 +23,14 @@
<li class="divider"></li>
<li class="nav-header"><i class="icon-th-large icon-white"></i> {{ _("Addons") }}</li>
<%= each plugin %>
- <li data-name="<% name %>"><a href="#"><% label %></a></li>
+ <li class="plugin" data-name="<% name %>">
+ <a href="#" style="background-image: url(icons/<% name %>);">
+ <% label %>
+ <i class="iconf-remove pull-right"></i>
+ </a></li>
<%/each%>
-{# <li class="divider"></li>#}
-{# <li class="nav-header"><i class="icon-th-list icon-white"></i> {{ _("Other") }}</li>#}
+ {# <li class="divider"></li>#}
+ {# <li class="nav-header"><i class="icon-th-list icon-white"></i> {{ _("Other") }}</li>#}
</script>
<script type="text/template" id="template-config">
<legend>