diff --git a/UI/Settings/Indexers/AddCardTemplate.html b/UI/Settings/Indexers/AddCardTemplate.html
deleted file mode 100644
index 5605cfcc8..000000000
--- a/UI/Settings/Indexers/AddCardTemplate.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/UI/Settings/Indexers/CollectionTemplate.html b/UI/Settings/Indexers/CollectionTemplate.html
index 92f0d9f22..7713572fe 100644
--- a/UI/Settings/Indexers/CollectionTemplate.html
+++ b/UI/Settings/Indexers/CollectionTemplate.html
@@ -2,7 +2,15 @@
\ No newline at end of file
diff --git a/UI/Settings/Indexers/CollectionView.js b/UI/Settings/Indexers/CollectionView.js
index 4d34e4e76..063a78316 100644
--- a/UI/Settings/Indexers/CollectionView.js
+++ b/UI/Settings/Indexers/CollectionView.js
@@ -10,19 +10,19 @@ define(['app',
itemViewContainer: '#x-indexers',
template : 'Settings/Indexers/CollectionTemplate',
+ ui: {
+ 'addCard': '.x-add-card'
+ },
+
events: {
'click .x-add-card': '_openSchemaModal'
},
- onRender: function () {
- this.listenTo(this.collection, 'add', this.render);
-
- this.templateFunction = Marionette.TemplateCache.get('Settings/Indexers/AddCardTemplate');
- var html = this.templateFunction();
-
- this.$itemViewContainer.append(html);
+ appendHtml: function(collectionView, itemView, index){
+ collectionView.ui.addCard.parent('li').before(itemView.el);
},
+
_openSchemaModal: function () {
var self = this;
//TODO: Is there a better way to deal with changing URLs?
diff --git a/UI/Settings/Indexers/indexers.less b/UI/Settings/Indexers/indexers.less
index ea2d5a03a..d037d3b43 100644
--- a/UI/Settings/Indexers/indexers.less
+++ b/UI/Settings/Indexers/indexers.less
@@ -29,20 +29,8 @@
}
&.add-card {
- .clickable;
- color: #adadad;
- font-size: 50px;
- text-align: center;
-
.center {
- display: inline-block;
- padding: 0px 20px;
- padding-top: 5px;
margin-top: 100px;
}
-
- i {
- .clickable;
- }
}
}
\ No newline at end of file
diff --git a/UI/Settings/Notifications/AddCardTemplate.html b/UI/Settings/Notifications/AddCardTemplate.html
deleted file mode 100644
index b32a4ab00..000000000
--- a/UI/Settings/Notifications/AddCardTemplate.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/UI/Settings/Notifications/CollectionTemplate.html b/UI/Settings/Notifications/CollectionTemplate.html
index c4ebae92a..643407ff7 100644
--- a/UI/Settings/Notifications/CollectionTemplate.html
+++ b/UI/Settings/Notifications/CollectionTemplate.html
@@ -1,5 +1,13 @@
\ No newline at end of file
diff --git a/UI/Settings/Notifications/CollectionView.js b/UI/Settings/Notifications/CollectionView.js
index bd4d9a546..b54094f99 100644
--- a/UI/Settings/Notifications/CollectionView.js
+++ b/UI/Settings/Notifications/CollectionView.js
@@ -3,24 +3,24 @@ define([
'app',
'marionette',
'Settings/Notifications/ItemView',
- 'Settings/Notifications/SchemaModal'
-], function (App, Marionette, NotificationItemView, SchemaModal) {
+ 'Settings/Notifications/SchemaModal',
+ 'Settings/Notifications/AddCardView'
+], function (App, Marionette, NotificationItemView, SchemaModal, AddCardView) {
return Marionette.CompositeView.extend({
itemView : NotificationItemView,
itemViewContainer: '.notifications',
template : 'Settings/Notifications/CollectionTemplate',
+ ui: {
+ 'addCard': '.x-add-card'
+ },
+
events: {
'click .x-add-card': '_openSchemaModal'
},
- onRender: function () {
- this.listenTo(this.collection, 'add', this.render);
-
- this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
- var html = this.templateFunction();
-
- this.$itemViewContainer.append(html);
+ appendHtml: function(collectionView, itemView, index){
+ collectionView.ui.addCard.parent('li').before(itemView.el);
},
_openSchemaModal: function () {
diff --git a/UI/Settings/Notifications/notifications.less b/UI/Settings/Notifications/notifications.less
index 59c1726ce..978ba199c 100644
--- a/UI/Settings/Notifications/notifications.less
+++ b/UI/Settings/Notifications/notifications.less
@@ -58,20 +58,8 @@
}
&.add-card {
- .clickable;
- color: #adadad;
- font-size: 50px;
- text-align: center;
-
.center {
- display: inline-block;
- padding: 0px 20px;
- padding-top: 5px;
margin-top: 15px;
}
-
- i {
- .clickable;
- }
}
}
\ No newline at end of file
diff --git a/UI/Settings/Quality/Profile/AddCardTemplate.html b/UI/Settings/Quality/Profile/AddCardTemplate.html
deleted file mode 100644
index 54c8b09be..000000000
--- a/UI/Settings/Quality/Profile/AddCardTemplate.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/UI/Settings/Quality/Profile/QualityProfileCollectionTemplate.html b/UI/Settings/Quality/Profile/QualityProfileCollectionTemplate.html
index c7d6ed762..0c403edcf 100644
--- a/UI/Settings/Quality/Profile/QualityProfileCollectionTemplate.html
+++ b/UI/Settings/Quality/Profile/QualityProfileCollectionTemplate.html
@@ -2,7 +2,15 @@
\ No newline at end of file
diff --git a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js
index 7cb1e1b6b..2e504d1b4 100644
--- a/UI/Settings/Quality/Profile/QualityProfileCollectionView.js
+++ b/UI/Settings/Quality/Profile/QualityProfileCollectionView.js
@@ -12,19 +12,19 @@ define(['app',
itemViewContainer: '.quality-profiles',
template : 'Settings/Quality/Profile/QualityProfileCollectionTemplate',
+ ui: {
+ 'addCard': '.x-add-card'
+ },
+
events: {
'click .x-add-card': '_addProfile'
},
- onRender: function () {
- this.listenTo(this.collection, 'add', this.render);
-
- this.templateFunction = Marionette.TemplateCache.get('Settings/Quality/Profile/AddCardTemplate');
- var html = this.templateFunction();
-
- this.$itemViewContainer.append(html);
+ appendHtml: function(collectionView, itemView, index){
+ collectionView.ui.addCard.parent('li').before(itemView.el);
},
+
_addProfile: function () {
var self = this;
var schemaCollection = new ProfileCollection();
diff --git a/UI/Settings/Quality/quality.less b/UI/Settings/Quality/quality.less
index 7a64fa495..6460b2a15 100644
--- a/UI/Settings/Quality/quality.less
+++ b/UI/Settings/Quality/quality.less
@@ -29,21 +29,9 @@
}
&.add-card {
- .clickable;
- color: #adadad;
- font-size: 50px;
- text-align: center;
-
.center {
- display: inline-block;
- padding: 0px 20px;
- padding-top: 5px;
margin-top: 30px;
}
-
- i {
- .clickable;
- }
}
}
diff --git a/UI/Settings/settings.less b/UI/Settings/settings.less
index 41e5d0fdc..42be8f420 100644
--- a/UI/Settings/settings.less
+++ b/UI/Settings/settings.less
@@ -20,4 +20,23 @@ li.save-and-add:hover {
text-decoration: none;
color: rgb(255, 255, 255);
background-color: rgb(0, 129, 194);
+}
+
+.add-card {
+ .clickable;
+ color: #adadad;
+ font-size: 50px;
+ text-align: center;
+ background-color: #f5f5f5;
+
+ .center {
+ .well;
+ display: inline-block;
+ padding: 5px 20px 0px;
+ background-color: white;
+ }
+
+ i {
+ .clickable;
+ }
}
\ No newline at end of file