From 30a049e4fb9b2d19c7591d24b47eaa3f27268e5a Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Mon, 28 Jan 2013 19:01:46 -0800 Subject: [PATCH] added success notification when new series is added. --- NzbDrone.Web/Views/V2/Index.cshtml | 2 +- .../AddSeries/AddNewSeries/SearchResultView.js | 16 +++++++++++++--- NzbDrone.Web/_backboneApp/Content/base.css | 4 ++-- .../_backboneApp/Shared/NotificationView.js | 2 +- NzbDrone.Web/_backboneApp/app.js | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/NzbDrone.Web/Views/V2/Index.cshtml b/NzbDrone.Web/Views/V2/Index.cshtml index 57e0b76ec..235a73a4c 100644 --- a/NzbDrone.Web/Views/V2/Index.cshtml +++ b/NzbDrone.Web/Views/V2/Index.cshtml @@ -50,7 +50,7 @@
-
+
diff --git a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultView.js b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultView.js index 957c504d5..7c1f738f7 100644 --- a/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultView.js +++ b/NzbDrone.Web/_backboneApp/AddSeries/AddNewSeries/SearchResultView.js @@ -38,7 +38,17 @@ NzbDrone.AddSeries.SearchItemView = Backbone.Marionette.ItemView.extend({ path: path }); - model.save(); + model.save(undefined, { + success: function () { + var notificationModel = new NzbDrone.Shared.NotificationModel({ + title: 'Added', + message: title, + level: 'success' + }); + + NzbDrone.Shared.NotificationCollectionView.Instance.collection.add(notificationModel); + } + }); } @@ -53,7 +63,7 @@ NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.CollectionView.extend( initialize: function () { this.listenTo(this.collection, 'reset', this.render); }, - - + + }); diff --git a/NzbDrone.Web/_backboneApp/Content/base.css b/NzbDrone.Web/_backboneApp/Content/base.css index bae5d5793..664c05460 100644 --- a/NzbDrone.Web/_backboneApp/Content/base.css +++ b/NzbDrone.Web/_backboneApp/Content/base.css @@ -60,10 +60,10 @@ body { } -#error-region .alert { +#notification-region .alert { margin: 10px; } -#error-region .alert .icon-warning-sign { +#notification-region i { padding-right: 10px; } diff --git a/NzbDrone.Web/_backboneApp/Shared/NotificationView.js b/NzbDrone.Web/_backboneApp/Shared/NotificationView.js index 564f4ff97..ba248a67b 100644 --- a/NzbDrone.Web/_backboneApp/Shared/NotificationView.js +++ b/NzbDrone.Web/_backboneApp/Shared/NotificationView.js @@ -32,7 +32,7 @@ NzbDrone.Shared.NotificationCollectionView = Backbone.Marionette.CollectionView. }); NzbDrone.addInitializer(function (options) { - NzbDrone.errorRegion.show(NzbDrone.Shared.NotificationCollectionView.Instance); + NzbDrone.notificationRegion.show(NzbDrone.Shared.NotificationCollectionView.Instance); }); diff --git a/NzbDrone.Web/_backboneApp/app.js b/NzbDrone.Web/_backboneApp/app.js index 120f4a4e7..8c0404f20 100644 --- a/NzbDrone.Web/_backboneApp/app.js +++ b/NzbDrone.Web/_backboneApp/app.js @@ -74,7 +74,7 @@ NzbDrone.addInitializer(function (options) { NzbDrone.addRegions({ mainRegion: "#main-region", - errorRegion: "#error-region" + notificationRegion: "#notification-region" }); NzbDrone.Router = new NzbDrone.Router();