diff --git a/UI/Settings/Notifications/AddItemTemplate.html b/UI/Settings/Notifications/AddItemTemplate.html
new file mode 100644
index 000000000..2097e9a9b
--- /dev/null
+++ b/UI/Settings/Notifications/AddItemTemplate.html
@@ -0,0 +1 @@
+{{name}}
\ No newline at end of file
diff --git a/UI/Settings/Notifications/AddTemplate.html b/UI/Settings/Notifications/AddTemplate.html
new file mode 100644
index 000000000..058598b78
--- /dev/null
+++ b/UI/Settings/Notifications/AddTemplate.html
@@ -0,0 +1,12 @@
+
+
+
\ No newline at end of file
diff --git a/UI/Settings/Notifications/AddView.js b/UI/Settings/Notifications/AddView.js
new file mode 100644
index 000000000..eae3dd787
--- /dev/null
+++ b/UI/Settings/Notifications/AddView.js
@@ -0,0 +1,30 @@
+"use strict";
+
+define([
+ 'app',
+ 'Settings/Notifications/Model'
+
+], function () {
+
+ NzbDrone.Settings.Notifications.AddItemView = Backbone.Marionette.ItemView.extend({
+ template : 'Settings/Notifications/AddItemTemplate',
+ tagName : 'button',
+ className: 'btn',
+
+ events: {
+ 'click': 'add'
+ },
+
+ add: function () {
+ this.model.set('id', undefined);
+ var view = new NzbDrone.Settings.Notifications.EditView({ model: this.model});
+ NzbDrone.modalRegion.show(view);
+ }
+ });
+
+ NzbDrone.Settings.Notifications.AddView = Backbone.Marionette.CompositeView.extend({
+ itemView : NzbDrone.Settings.Notifications.AddItemView,
+ itemViewContainer : '#notifications-to-add',
+ template : 'Settings/Notifications/AddTemplate'
+ });
+});
diff --git a/UI/Settings/Notifications/CollectionTemplate.html b/UI/Settings/Notifications/CollectionTemplate.html
index eb08fe772..6d3606041 100644
--- a/UI/Settings/Notifications/CollectionTemplate.html
+++ b/UI/Settings/Notifications/CollectionTemplate.html
@@ -9,4 +9,6 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/UI/Settings/Notifications/CollectionView.js b/UI/Settings/Notifications/CollectionView.js
index 6c8b53a19..c83b4c756 100644
--- a/UI/Settings/Notifications/CollectionView.js
+++ b/UI/Settings/Notifications/CollectionView.js
@@ -1,8 +1,19 @@
'use strict';
-define(['app', 'Settings/Notifications/ItemView'], function () {
+define(['app', 'Settings/Notifications/ItemView', 'Settings/Notifications/AddView'], function () {
NzbDrone.Settings.Notifications.CollectionView = Backbone.Marionette.CompositeView.extend({
itemView : NzbDrone.Settings.Notifications.ItemView,
itemViewContainer : 'tbody',
- template : 'Settings/Notifications/CollectionTemplate'
+ template : 'Settings/Notifications/CollectionTemplate',
+
+ events: {
+ 'click .x-add': function () {
+ var schema = new NzbDrone.Settings.Notifications.Collection();
+ schema.url = '/api/notification/schema';
+ schema.fetch();
+
+ var view = new NzbDrone.Settings.Notifications.AddView({ collection: schema});
+ NzbDrone.modalRegion.show(view);
+ }
+ }
});
});