#6410 Added NotifyType.Success and replaced most usages of NotifyType.Information with it. Added appropriate styles in css files.

Some minor fixes - wrong notification types.

Conflicts:
	src/Orchard.Web/Modules/Orchard.ImportExport/Controllers/AdminController.cs
	src/Orchard.Web/Modules/Orchard.Taxonomies/Controllers/TermAdminController.cs
	src/Orchard.Web/Modules/Orchard.Themes/Controllers/AdminController.cs

Contained in branches: dev#gitext://gotobranch/dev
Contained in no tag
This commit is contained in:
Szymon Seliga 2016-03-22 21:19:50 +01:00
parent 4cda6672f9
commit 694aeb5062
71 changed files with 214 additions and 186 deletions

View File

@ -14,11 +14,13 @@ namespace Orchard.Tests.UI.Notify {
notifier.Warning(T("Hello world")); notifier.Warning(T("Hello world"));
notifier.Information(T("More Info")); notifier.Information(T("More Info"));
notifier.Error(T("Boom")); notifier.Error(T("Boom"));
notifier.Success(T("Success"));
Assert.That(notifier.List(), Has.Count.EqualTo(3)); Assert.That(notifier.List(), Has.Count.EqualTo(4));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Hello world"))); Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Hello world")));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("More Info"))); Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("More Info")));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Boom"))); Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Boom")));
Assert.That(notifier.List(), Has.Some.Property("Message").EqualTo(T("Success")));
} }
} }
} }

View File

@ -193,7 +193,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Publish(item); _contentManager.Publish(item);
} }
Services.Notifier.Information(T("Content successfully published.")); Services.Notifier.Success(T("Content successfully published."));
break; break;
case ContentsBulkAction.Unpublish: case ContentsBulkAction.Unpublish:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -204,7 +204,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Unpublish(item); _contentManager.Unpublish(item);
} }
Services.Notifier.Information(T("Content successfully unpublished.")); Services.Notifier.Success(T("Content successfully unpublished."));
break; break;
case ContentsBulkAction.Remove: case ContentsBulkAction.Remove:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -215,7 +215,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Remove(item); _contentManager.Remove(item);
} }
Services.Notifier.Information(T("Content successfully removed.")); Services.Notifier.Success(T("Content successfully removed."));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
@ -296,7 +296,7 @@ namespace Orchard.Core.Contents.Controllers {
conditionallyPublish(contentItem); conditionallyPublish(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("Your content has been created.") ? T("Your content has been created.")
: T("Your {0} has been created.", contentItem.TypeDefinition.DisplayName)); : T("Your {0} has been created.", contentItem.TypeDefinition.DisplayName));
if (!string.IsNullOrEmpty(returnUrl)) { if (!string.IsNullOrEmpty(returnUrl)) {
@ -375,7 +375,7 @@ namespace Orchard.Core.Contents.Controllers {
returnUrl = Url.ItemDisplayUrl(contentItem); returnUrl = Url.ItemDisplayUrl(contentItem);
} }
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("Your content has been saved.") ? T("Your content has been saved.")
: T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)); : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName));
@ -400,7 +400,7 @@ namespace Orchard.Core.Contents.Controllers {
return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
} }
Services.Notifier.Information(T("Successfully cloned. The clone was saved as a draft.")); Services.Notifier.Success(T("Successfully cloned. The clone was saved as a draft."));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
} }
@ -414,7 +414,7 @@ namespace Orchard.Core.Contents.Controllers {
if (contentItem != null) { if (contentItem != null) {
_contentManager.Remove(contentItem); _contentManager.Remove(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName)
? T("That content has been removed.") ? T("That content has been removed.")
: T("That {0} has been removed.", contentItem.TypeDefinition.DisplayName)); : T("That {0} has been removed.", contentItem.TypeDefinition.DisplayName));
} }
@ -433,7 +433,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Publish(contentItem); _contentManager.Publish(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been published.") : T("That {0} has been published.", contentItem.TypeDefinition.DisplayName)); Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been published.") : T("That {0} has been published.", contentItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
} }
@ -449,7 +449,7 @@ namespace Orchard.Core.Contents.Controllers {
_contentManager.Unpublish(contentItem); _contentManager.Unpublish(contentItem);
Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been unpublished.") : T("That {0} has been unpublished.", contentItem.TypeDefinition.DisplayName)); Services.Notifier.Success(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) ? T("That content has been unpublished.") : T("That {0} has been unpublished.", contentItem.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("List")); return this.RedirectLocal(returnUrl, () => RedirectToAction("List"));
} }

View File

@ -227,7 +227,7 @@ namespace Orchard.Core.Navigation.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
} }

View File

@ -82,7 +82,7 @@ namespace Orchard.Core.Settings.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("Settings updated")); Services.Notifier.Success(T("Settings updated"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }

View File

@ -181,7 +181,7 @@ namespace Orchard.Alias.Controllers {
return View(); return View();
} }
Services.Notifier.Information(T("Alias {0} created", aliasPath)); Services.Notifier.Success(T("Alias {0} created", aliasPath));
return RedirectToAction("IndexUnmanaged"); return RedirectToAction("IndexUnmanaged");
} }
@ -251,7 +251,7 @@ namespace Orchard.Alias.Controllers {
_aliasService.Delete(path == "/" ? String.Empty : path); _aliasService.Delete(path == "/" ? String.Empty : path);
} }
Services.Notifier.Information(T("Alias {0} updated", path)); Services.Notifier.Success(T("Alias {0} updated", path));
return RedirectToAction("IndexUnmanaged"); return RedirectToAction("IndexUnmanaged");
} }
@ -267,7 +267,7 @@ namespace Orchard.Alias.Controllers {
_aliasService.Delete(path); _aliasService.Delete(path);
Services.Notifier.Information(T("Alias {0} deleted", path)); Services.Notifier.Success(T("Alias {0} deleted", path));
return this.RedirectLocal(returnUrl, Url.Action("IndexUnmanaged")); return this.RedirectLocal(returnUrl, Url.Action("IndexUnmanaged"));
} }

View File

@ -54,7 +54,7 @@ namespace Orchard.AuditTrail.Controllers {
var restoredContentItem = _contentManager.Restore(contentItem, VersionOptions.Restore(version, publish: !draftable)); var restoredContentItem = _contentManager.Restore(contentItem, VersionOptions.Restore(version, publish: !draftable));
var restoredContentItemTitle = _contentManager.GetItemMetadata(restoredContentItem).DisplayText; var restoredContentItemTitle = _contentManager.GetItemMetadata(restoredContentItem).DisplayText;
_notifier.Information(T(""{0}" has been restored.", restoredContentItemTitle)); _notifier.Success(T(""{0}" has been restored.", restoredContentItemTitle));
return this.RedirectReturn(returnUrl, () => Url.Action("Index", "Admin")); return this.RedirectReturn(returnUrl, () => Url.Action("Index", "Admin"));
} }

View File

@ -56,7 +56,7 @@ namespace Orchard.AuditTrail.Controllers {
var restoredContentItem = _recycleBin.Restore(contentItem); var restoredContentItem = _recycleBin.Restore(contentItem);
var restoredContentItemTitle = _contentManager.GetItemMetadata(restoredContentItem).DisplayText; var restoredContentItemTitle = _contentManager.GetItemMetadata(restoredContentItem).DisplayText;
_notifier.Information(T(""{0}" has been restored.", restoredContentItemTitle)); _notifier.Success(T(""{0}" has been restored.", restoredContentItemTitle));
return this.RedirectReturn(returnUrl, () => Url.Action("Index", "RecycleBin")); return this.RedirectReturn(returnUrl, () => Url.Action("Index", "RecycleBin"));
} }
@ -115,7 +115,7 @@ namespace Orchard.AuditTrail.Controllers {
} }
_recycleBin.Restore(contentItem); _recycleBin.Restore(contentItem);
_notifier.Information(T(""{0}" has been restored.", contentItemTitle)); _notifier.Success(T(""{0}" has been restored.", contentItemTitle));
} }
} }
@ -131,7 +131,7 @@ namespace Orchard.AuditTrail.Controllers {
try { try {
_contentManager.Destroy(contentItem); _contentManager.Destroy(contentItem);
_notifier.Information(T(""{0}" has been permanently deleted.", contentItemTitle)); _notifier.Success(T(""{0}" has been permanently deleted.", contentItemTitle));
} }
catch (Exception ex) { catch (Exception ex) {
Logger.Error(ex, "An exception occurred while trying to permanently delete content with ID {0}.", contentItem.Id); Logger.Error(ex, "An exception occurred while trying to permanently delete content with ID {0}.", contentItem.Id);

View File

@ -108,7 +108,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
return View(viewModel); return View(viewModel);
} }
_notifier.Information(T("The Asset has been saved.")); _notifier.Success(T("The Asset has been saved."));
return RedirectToAction("Edit", new { id = id }); return RedirectToAction("Edit", new { id = id });
}); });
} }
@ -141,7 +141,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
_assetManager.DeleteAsset(asset); _assetManager.DeleteAsset(asset);
Logger.Information("Asset with ID {0} was deleted.", id); Logger.Information("Asset with ID {0} was deleted.", id);
_notifier.Information(T("The asset '{0}' was successfully deleted.", asset.Name)); _notifier.Success(T("The asset '{0}' was successfully deleted.", asset.Name));
} }
catch (Exception ex) { catch (Exception ex) {
_transactionManager.Cancel(); _transactionManager.Cancel();

View File

@ -156,7 +156,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
}); });
Logger.Information("Job was created with task of type {0} on cloud video item with ID {1}.", task, id); Logger.Information("Job was created with task of type {0} on cloud video item with ID {1}.", task, id);
_notifier.Information(T("The job '{0}' was successfully created.", job.Name)); _notifier.Success(T("The job '{0}' was successfully created.", job.Name));
return Redirect(Url.ItemEditUrl(cloudVideoPart)); return Redirect(Url.ItemEditUrl(cloudVideoPart));
} }
@ -187,7 +187,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
job.Status = JobStatus.Archived; job.Status = JobStatus.Archived;
Logger.Information("Job with ID {0} was archived.", id); Logger.Information("Job with ID {0} was archived.", id);
_notifier.Information(T("The job '{0}' was successfully archived.", job.Name)); _notifier.Success(T("The job '{0}' was successfully archived.", job.Name));
return RedirectToReturnUrl(returnUrl, Url.ItemEditUrl(job.CloudVideoPart)); return RedirectToReturnUrl(returnUrl, Url.ItemEditUrl(job.CloudVideoPart));
} }
@ -212,7 +212,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
wamsJob.Cancel(); wamsJob.Cancel();
Logger.Information("Job with ID {0} was canceled.", id); Logger.Information("Job with ID {0} was canceled.", id);
_notifier.Information(T("The job '{0}' was successfully canceled.", job.Name)); _notifier.Success(T("The job '{0}' was successfully canceled.", job.Name));
} }
catch (Exception ex) { catch (Exception ex) {
_transactionManager.Cancel(); _transactionManager.Cancel();

View File

@ -148,7 +148,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
_contentManager.Publish(mediaPart.ContentItem); _contentManager.Publish(mediaPart.ContentItem);
Logger.Information("Cloud video item with ID {0} was saved.", part.Id); Logger.Information("Cloud video item with ID {0} was saved.", part.Id);
_notifier.Information(notification); _notifier.Success(notification);
} }
catch (Exception ex) { catch (Exception ex) {
_transactionManager.Cancel(); _transactionManager.Cancel();

View File

@ -94,7 +94,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
return View("Index", viewModel); return View("Index", viewModel);
} }
else { else {
_services.Notifier.Information(T("The new account credentials were successfully verified.")); _services.Notifier.Success(T("The new account credentials were successfully verified."));
} }
} }
} }
@ -132,7 +132,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
if (addedOrigins.Any()) { if (addedOrigins.Any()) {
Logger.Information("CORS rules were added to the configured storage account for the following URLs: {0}.", String.Join("; ", addedOrigins)); Logger.Information("CORS rules were added to the configured storage account for the following URLs: {0}.", String.Join("; ", addedOrigins));
_services.Notifier.Information(T("CORS rules have been configured on your storage account for the following URLs: {0}.", String.Join("; ", addedOrigins))); _services.Notifier.Success(T("CORS rules have been configured on your storage account for the following URLs: {0}.", String.Join("; ", addedOrigins)));
} }
} }
catch (Exception ex) { catch (Exception ex) {
@ -143,7 +143,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
} }
Logger.Information("Module settings were saved."); Logger.Information("Module settings were saved.");
_services.Notifier.Information(T("The settings were saved successfully.")); _services.Notifier.Success(T("The settings were saved successfully."));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -156,7 +156,7 @@ namespace Orchard.Azure.MediaServices.Controllers {
Logger.Debug("User requested to verify WAMS account credentials."); Logger.Debug("User requested to verify WAMS account credentials.");
if (TestCredentialsInternal(viewModel.General.WamsAccountName, viewModel.General.WamsAccountKey, viewModel.General.StorageAccountKey)) { if (TestCredentialsInternal(viewModel.General.WamsAccountName, viewModel.General.WamsAccountKey, viewModel.General.StorageAccountKey)) {
_services.Notifier.Information(T("The account credentials were successfully verified.")); _services.Notifier.Success(T("The account credentials were successfully verified."));
} }
else { else {
_services.Notifier.Error(T("The account credentials verification failed.")); _services.Notifier.Error(T("The account credentials verification failed."));

View File

@ -96,7 +96,7 @@ namespace Orchard.Azure.MediaServices.Drivers {
var unpublish = httpContext.Request.Form["submit.Save"] == "submit.Unpublish"; var unpublish = httpContext.Request.Form["submit.Save"] == "submit.Unpublish";
if (unpublish) { if (unpublish) {
_services.ContentManager.Unpublish(part.ContentItem); _services.ContentManager.Unpublish(part.ContentItem);
_services.Notifier.Information(T("Your {0} has been unpublished.", part.ContentItem.TypeDefinition.DisplayName)); _services.Notifier.Success(T("Your {0} has been unpublished.", part.ContentItem.TypeDefinition.DisplayName));
} }
if (part.IsPublished()) if (part.IsPublished())

View File

@ -101,7 +101,7 @@ namespace Orchard.Blogs.Controllers {
return HttpNotFound(); return HttpNotFound();
_blogService.Delete(blog); _blogService.Delete(blog);
Services.Notifier.Information(T("Blog deleted")); Services.Notifier.Success(T("Blog deleted"));
return Redirect(Url.BlogsForAdmin()); return Redirect(Url.BlogsForAdmin());
} }
@ -125,7 +125,7 @@ namespace Orchard.Blogs.Controllers {
} }
_contentManager.Publish(blog); _contentManager.Publish(blog);
Services.Notifier.Information(T("Blog information updated")); Services.Notifier.Success(T("Blog information updated"));
return Redirect(Url.BlogsForAdmin()); return Redirect(Url.BlogsForAdmin());
} }
@ -142,7 +142,7 @@ namespace Orchard.Blogs.Controllers {
_blogService.Delete(blog); _blogService.Delete(blog);
Services.Notifier.Information(T("Blog was successfully deleted")); Services.Notifier.Success(T("Blog was successfully deleted"));
return Redirect(Url.BlogsForAdmin()); return Redirect(Url.BlogsForAdmin());
} }

View File

@ -94,7 +94,7 @@ namespace Orchard.Blogs.Controllers {
Services.ContentManager.Publish(blogPost.ContentItem); Services.ContentManager.Publish(blogPost.ContentItem);
} }
Services.Notifier.Information(T("Your {0} has been created.", blogPost.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been created.", blogPost.TypeDefinition.DisplayName));
return Redirect(Url.BlogPostEdit(blogPost)); return Redirect(Url.BlogPostEdit(blogPost));
} }
@ -165,7 +165,7 @@ namespace Orchard.Blogs.Controllers {
conditionallyPublish(blogPost.ContentItem); conditionallyPublish(blogPost.ContentItem);
Services.Notifier.Information(T("Your {0} has been saved.", blogPost.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been saved.", blogPost.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, Url.BlogPostEdit(blogPost)); return this.RedirectLocal(returnUrl, Url.BlogPostEdit(blogPost));
} }
@ -175,7 +175,7 @@ namespace Orchard.Blogs.Controllers {
// get the current draft version // get the current draft version
var draft = Services.ContentManager.Get(id, VersionOptions.Draft); var draft = Services.ContentManager.Get(id, VersionOptions.Draft);
if (draft == null) { if (draft == null) {
Services.Notifier.Information(T("There is no draft to discard.")); Services.Notifier.Warning(T("There is no draft to discard."));
return RedirectToEdit(id); return RedirectToEdit(id);
} }
@ -186,7 +186,7 @@ namespace Orchard.Blogs.Controllers {
// locate the published revision to revert onto // locate the published revision to revert onto
var published = Services.ContentManager.Get(id, VersionOptions.Published); var published = Services.ContentManager.Get(id, VersionOptions.Published);
if (published == null) { if (published == null) {
Services.Notifier.Information(T("Can not discard draft on unpublished blog post.")); Services.Notifier.Error(T("Can not discard draft on unpublished blog post."));
return RedirectToEdit(draft); return RedirectToEdit(draft);
} }
@ -195,7 +195,7 @@ namespace Orchard.Blogs.Controllers {
draft.VersionRecord.Latest = false; draft.VersionRecord.Latest = false;
published.VersionRecord.Latest = true; published.VersionRecord.Latest = true;
Services.Notifier.Information(T("Blog post draft version discarded")); Services.Notifier.Success(T("Blog post draft version discarded"));
return RedirectToEdit(published); return RedirectToEdit(published);
} }
@ -225,7 +225,7 @@ namespace Orchard.Blogs.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_blogPostService.Delete(post); _blogPostService.Delete(post);
Services.Notifier.Information(T("Blog post was successfully deleted")); Services.Notifier.Success(T("Blog post was successfully deleted"));
return Redirect(Url.BlogForAdmin(blog.As<BlogPart>())); return Redirect(Url.BlogForAdmin(blog.As<BlogPart>()));
} }
@ -244,7 +244,7 @@ namespace Orchard.Blogs.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_blogPostService.Publish(post); _blogPostService.Publish(post);
Services.Notifier.Information(T("Blog post successfully published.")); Services.Notifier.Success(T("Blog post successfully published."));
return Redirect(Url.BlogForAdmin(blog.As<BlogPart>())); return Redirect(Url.BlogForAdmin(blog.As<BlogPart>()));
} }
@ -263,7 +263,7 @@ namespace Orchard.Blogs.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_blogPostService.Unpublish(post); _blogPostService.Unpublish(post);
Services.Notifier.Information(T("Blog post successfully unpublished.")); Services.Notifier.Success(T("Blog post successfully unpublished."));
return Redirect(Url.BlogForAdmin(blog.As<BlogPart>())); return Redirect(Url.BlogForAdmin(blog.As<BlogPart>()));
} }

View File

@ -105,14 +105,14 @@ namespace Orchard.Comments.Controllers {
// if the user who submitted the comment has the right to moderate, don't make this comment moderated // if the user who submitted the comment has the right to moderate, don't make this comment moderated
if (Services.Authorizer.Authorize(Permissions.ManageComments)) { if (Services.Authorizer.Authorize(Permissions.ManageComments)) {
commentPart.Status = CommentStatus.Approved; commentPart.Status = CommentStatus.Approved;
Services.Notifier.Information(T("Your comment has been posted.")); Services.Notifier.Success(T("Your comment has been posted."));
} }
else { else {
Services.Notifier.Information(T("Your comment will appear after the site administrator approves it.")); Services.Notifier.Information(T("Your comment will appear after the site administrator approves it."));
} }
} }
else { else {
Services.Notifier.Information(T("Your comment has been posted.")); Services.Notifier.Success(T("Your comment has been posted."));
} }
// send email notification // send email notification
@ -141,7 +141,7 @@ namespace Orchard.Comments.Controllers {
_commentService.ApproveComment(id); _commentService.ApproveComment(id);
} }
Services.Notifier.Information(T("Comment approved successfully")); Services.Notifier.Success(T("Comment approved successfully"));
return Redirect("~/"); return Redirect("~/");
} }
@ -151,7 +151,7 @@ namespace Orchard.Comments.Controllers {
_commentService.DeleteComment(id); _commentService.DeleteComment(id);
} }
Services.Notifier.Information(T("Comment deleted successfully")); Services.Notifier.Success(T("Comment deleted successfully"));
return Redirect("~/"); return Redirect("~/");
} }
@ -161,7 +161,7 @@ namespace Orchard.Comments.Controllers {
_commentService.UnapproveComment(id); _commentService.UnapproveComment(id);
} }
Services.Notifier.Information(T("Comment moderated successfully")); Services.Notifier.Success(T("Comment moderated successfully"));
return Redirect("~/"); return Redirect("~/");
} }

View File

@ -68,7 +68,7 @@ namespace Orchard.Comments.Drivers {
if (!string.IsNullOrEmpty(name) && String.Equals(name, "moderate", StringComparison.OrdinalIgnoreCase)) { if (!string.IsNullOrEmpty(name) && String.Equals(name, "moderate", StringComparison.OrdinalIgnoreCase)) {
if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't moderate comment"))) { if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't moderate comment"))) {
_commentService.UnapproveComment(part.Id); _commentService.UnapproveComment(part.Id);
_orchardServices.Notifier.Information(T("Comment successfully moderated.")); _orchardServices.Notifier.Success(T("Comment successfully moderated."));
return Editor(part, shapeHelper); return Editor(part, shapeHelper);
} }
} }
@ -76,7 +76,7 @@ namespace Orchard.Comments.Drivers {
if (!string.IsNullOrEmpty(name) && String.Equals(name, "approve", StringComparison.OrdinalIgnoreCase)) { if (!string.IsNullOrEmpty(name) && String.Equals(name, "approve", StringComparison.OrdinalIgnoreCase)) {
if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't approve comment"))) { if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't approve comment"))) {
_commentService.ApproveComment(part.Id); _commentService.ApproveComment(part.Id);
_orchardServices.Notifier.Information(T("Comment approved.")); _orchardServices.Notifier.Success(T("Comment approved."));
return Editor(part, shapeHelper); return Editor(part, shapeHelper);
} }
} }
@ -84,14 +84,14 @@ namespace Orchard.Comments.Drivers {
if (!string.IsNullOrEmpty(name) && String.Equals(name, "delete", StringComparison.OrdinalIgnoreCase)) { if (!string.IsNullOrEmpty(name) && String.Equals(name, "delete", StringComparison.OrdinalIgnoreCase)) {
if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't delete comment"))) { if (_orchardServices.Authorizer.Authorize(Permissions.ManageComments, T("Couldn't delete comment"))) {
_commentService.DeleteComment(part.Id); _commentService.DeleteComment(part.Id);
_orchardServices.Notifier.Information(T("Comment successfully deleted.")); _orchardServices.Notifier.Success(T("Comment successfully deleted."));
return Editor(part, shapeHelper); return Editor(part, shapeHelper);
} }
} }
// if editing from the admin, don't update the owner or the status // if editing from the admin, don't update the owner or the status
if (!string.IsNullOrEmpty(name) && String.Equals(name, "save", StringComparison.OrdinalIgnoreCase)) { if (!string.IsNullOrEmpty(name) && String.Equals(name, "save", StringComparison.OrdinalIgnoreCase)) {
_orchardServices.Notifier.Information(T("Comment saved.")); _orchardServices.Notifier.Success(T("Comment saved."));
return Editor(part, shapeHelper); return Editor(part, shapeHelper);
} }

View File

@ -108,7 +108,7 @@ namespace Orchard.ContentTypes.Controllers {
var typeViewModel = new EditTypeViewModel(contentTypeDefinition); var typeViewModel = new EditTypeViewModel(contentTypeDefinition);
Services.Notifier.Information(T("The \"{0}\" content type has been created.", typeViewModel.DisplayName)); Services.Notifier.Success(T("The \"{0}\" content type has been created.", typeViewModel.DisplayName));
return RedirectToAction("AddPartsTo", new { id = typeViewModel.Name }); return RedirectToAction("AddPartsTo", new { id = typeViewModel.Name });
} }
@ -252,7 +252,7 @@ namespace Orchard.ContentTypes.Controllers {
return View(typeViewModel); return View(typeViewModel);
} }
Services.Notifier.Information(T("\"{0}\" settings have been saved.", typeViewModel.DisplayName)); Services.Notifier.Success(T("\"{0}\" settings have been saved.", typeViewModel.DisplayName));
return RedirectToAction("Edit", new { id }); return RedirectToAction("Edit", new { id });
} }
@ -270,7 +270,7 @@ namespace Orchard.ContentTypes.Controllers {
_contentDefinitionService.RemoveType(id, true); _contentDefinitionService.RemoveType(id, true);
Services.Notifier.Information(T("\"{0}\" has been removed.", typeViewModel.DisplayName)); Services.Notifier.Success(T("\"{0}\" has been removed.", typeViewModel.DisplayName));
return RedirectToAction("List"); return RedirectToAction("List");
} }
@ -314,7 +314,7 @@ namespace Orchard.ContentTypes.Controllers {
var partsToAdd = viewModel.PartSelections.Where(ps => ps.IsSelected).Select(ps => ps.PartName); var partsToAdd = viewModel.PartSelections.Where(ps => ps.IsSelected).Select(ps => ps.PartName);
foreach (var partToAdd in partsToAdd) { foreach (var partToAdd in partsToAdd) {
_contentDefinitionService.AddPartToType(partToAdd, typeViewModel.Name); _contentDefinitionService.AddPartToType(partToAdd, typeViewModel.Name);
Services.Notifier.Information(T("The \"{0}\" part has been added.", partToAdd)); Services.Notifier.Success(T("The \"{0}\" part has been added.", partToAdd));
} }
if (!ModelState.IsValid) { if (!ModelState.IsValid) {
@ -362,7 +362,7 @@ namespace Orchard.ContentTypes.Controllers {
return View(viewModel); return View(viewModel);
} }
Services.Notifier.Information(T("The \"{0}\" part has been removed.", viewModel.Name)); Services.Notifier.Success(T("The \"{0}\" part has been removed.", viewModel.Name));
return RedirectToAction("Edit", new {id}); return RedirectToAction("Edit", new {id});
} }
@ -399,11 +399,11 @@ namespace Orchard.ContentTypes.Controllers {
var partViewModel = _contentDefinitionService.AddPart(viewModel); var partViewModel = _contentDefinitionService.AddPart(viewModel);
if (partViewModel == null) { if (partViewModel == null) {
Services.Notifier.Information(T("The content part could not be created.")); Services.Notifier.Error(T("The content part could not be created."));
return View(viewModel); return View(viewModel);
} }
Services.Notifier.Information(T("The \"{0}\" content part has been created.", partViewModel.Name)); Services.Notifier.Success(T("The \"{0}\" content part has been created.", partViewModel.Name));
return RedirectToAction("EditPart", new { id = partViewModel.Name }); return RedirectToAction("EditPart", new { id = partViewModel.Name });
} }
@ -440,7 +440,7 @@ namespace Orchard.ContentTypes.Controllers {
return View(partViewModel); return View(partViewModel);
} }
Services.Notifier.Information(T("\"{0}\" settings have been saved.", partViewModel.Name)); Services.Notifier.Success(T("\"{0}\" settings have been saved.", partViewModel.Name));
return RedirectToAction("ListParts"); return RedirectToAction("ListParts");
} }
@ -458,8 +458,8 @@ namespace Orchard.ContentTypes.Controllers {
return HttpNotFound(); return HttpNotFound();
_contentDefinitionService.RemovePart(id); _contentDefinitionService.RemovePart(id);
Services.Notifier.Information(T("\"{0}\" has been removed.", partViewModel.DisplayName)); Services.Notifier.Success(T("\"{0}\" has been removed.", partViewModel.DisplayName));
return RedirectToAction("ListParts"); return RedirectToAction("ListParts");
} }
@ -547,12 +547,12 @@ namespace Orchard.ContentTypes.Controllers {
_contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partViewModel.Name); _contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partViewModel.Name);
} }
catch (Exception ex) { catch (Exception ex) {
Services.Notifier.Information(T("The \"{0}\" field was not added. {1}", viewModel.DisplayName, ex.Message)); Services.Notifier.Error(T("The \"{0}\" field was not added. {1}", viewModel.DisplayName, ex.Message));
Services.TransactionManager.Cancel(); Services.TransactionManager.Cancel();
return AddFieldTo(id); return AddFieldTo(id);
} }
Services.Notifier.Information(T("The \"{0}\" field has been added.", viewModel.DisplayName)); Services.Notifier.Success(T("The \"{0}\" field has been added.", viewModel.DisplayName));
if (typeViewModel != null) { if (typeViewModel != null) {
return RedirectToAction("Edit", new {id}); return RedirectToAction("Edit", new {id});
@ -626,7 +626,7 @@ namespace Orchard.ContentTypes.Controllers {
_contentDefinitionService.AlterField(partViewModel, viewModel); _contentDefinitionService.AlterField(partViewModel, viewModel);
Services.Notifier.Information(T("Display name changed to {0}.", viewModel.DisplayName)); Services.Notifier.Success(T("Display name changed to {0}.", viewModel.DisplayName));
// redirect to the type editor if a type exists with this name // redirect to the type editor if a type exists with this name
var typeViewModel = _contentDefinitionService.GetType(id); var typeViewModel = _contentDefinitionService.GetType(id);
@ -674,7 +674,7 @@ namespace Orchard.ContentTypes.Controllers {
return View(viewModel); return View(viewModel);
} }
Services.Notifier.Information(T("The \"{0}\" field has been removed.", viewModel.Name)); Services.Notifier.Success(T("The \"{0}\" field has been removed.", viewModel.Name));
if (_contentDefinitionService.GetType(id) != null) if (_contentDefinitionService.GetType(id) != null)
return RedirectToAction("Edit", new { id }); return RedirectToAction("Edit", new { id });

View File

@ -170,7 +170,7 @@ namespace Orchard.CustomForms.Controllers {
// writes a confirmation message // writes a confirmation message
if (customForm.CustomMessage) { if (customForm.CustomMessage) {
if (!String.IsNullOrWhiteSpace(customForm.Message)) { if (!String.IsNullOrWhiteSpace(customForm.Message)) {
Services.Notifier.Information(T(customForm.Message)); Services.Notifier.Success(T(customForm.Message));
} }
} }

View File

@ -48,7 +48,7 @@ namespace Orchard.Dashboards.Controllers {
return UpdateDashboard(dashboard => { return UpdateDashboard(dashboard => {
if (!dashboard.Has<IPublishingControlAspect>() && !dashboard.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable) if (!dashboard.Has<IPublishingControlAspect>() && !dashboard.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
_services.ContentManager.Publish(dashboard); _services.ContentManager.Publish(dashboard);
_services.Notifier.Information(T("Your dashboard has been saved.")); _services.Notifier.Success(T("Your dashboard has been saved."));
}); });
} }
@ -61,7 +61,7 @@ namespace Orchard.Dashboards.Controllers {
return UpdateDashboard(dashboard => { return UpdateDashboard(dashboard => {
_services.ContentManager.Publish(dashboard); _services.ContentManager.Publish(dashboard);
_services.Notifier.Information(T("Your dashboard has been published.")); _services.Notifier.Success(T("Your dashboard has been published."));
}); });
} }
@ -79,7 +79,7 @@ namespace Orchard.Dashboards.Controllers {
if (contentItem != null) if (contentItem != null)
conditonallyPublish(contentItem); conditonallyPublish(contentItem);
else else
_services.Notifier.Information(T("Your dashboard has been saved.")); _services.Notifier.Success(T("Your dashboard has been saved."));
return RedirectToAction("Edit"); return RedirectToAction("Edit");
} }

View File

@ -56,7 +56,7 @@ namespace Orchard.DynamicForms.Controllers {
return HttpNotFound(); return HttpNotFound();
_formService.DeleteSubmission(submission); _formService.DeleteSubmission(submission);
_services.Notifier.Information(T("That submission has been deleted.")); _services.Notifier.Success(T("That submission has been deleted."));
return Redirect(Request.UrlReferrer.ToString()); return Redirect(Request.UrlReferrer.ToString());
} }
@ -69,7 +69,7 @@ namespace Orchard.DynamicForms.Controllers {
} }
else { else {
var numDeletedSubmissions = _formService.DeleteSubmissions(submissionIds); var numDeletedSubmissions = _formService.DeleteSubmissions(submissionIds);
_services.Notifier.Information(T("{0} submissions have been deleted.", numDeletedSubmissions)); _services.Notifier.Success(T("{0} submissions have been deleted.", numDeletedSubmissions));
} }
return Redirect(Request.UrlReferrer.ToString()); return Redirect(Request.UrlReferrer.ToString());

View File

@ -54,7 +54,7 @@ namespace Orchard.DynamicForms.Handlers {
// Notifiy. // Notifiy.
if (!String.IsNullOrWhiteSpace(form.Notification)) if (!String.IsNullOrWhiteSpace(form.Notification))
_notifier.Information(T(_tokenizer.Replace(T(form.Notification).Text, tokenData))); _notifier.Success(T(_tokenizer.Replace(T(form.Notification).Text, tokenData)));
// Trigger workflow event. // Trigger workflow event.
_workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => tokenData); _workflowManager.TriggerEvent(DynamicFormSubmittedActivity.EventName, contentItem, () => tokenData);

View File

@ -80,7 +80,7 @@ namespace Orchard.Indexing.Controllers {
try { try {
provider.CreateIndex(id); provider.CreateIndex(id);
Services.Notifier.Information(T("Index named {0} created successfully", id)); Services.Notifier.Success(T("Index named {0} created successfully", id));
} }
catch(Exception e) { catch(Exception e) {
Services.Notifier.Error(T("An error occured while creating the index: {0}", id)); Services.Notifier.Error(T("An error occured while creating the index: {0}", id));

View File

@ -36,7 +36,7 @@ namespace Orchard.Indexing.Services {
} }
if(_indexingTaskExecutor.RebuildIndex(indexName)) { if(_indexingTaskExecutor.RebuildIndex(indexName)) {
Services.Notifier.Information(T("The index {0} has been rebuilt.", indexName)); Services.Notifier.Success(T("The index {0} has been rebuilt.", indexName));
UpdateIndex(indexName); UpdateIndex(indexName);
} }
else { else {
@ -53,7 +53,7 @@ namespace Orchard.Indexing.Services {
} }
if (_indexingTaskExecutor.DeleteIndex(indexName)) { if (_indexingTaskExecutor.DeleteIndex(indexName)) {
Services.Notifier.Information(T("The index {0} has been deleted.", indexName)); Services.Notifier.Success(T("The index {0} has been deleted.", indexName));
} }
else { else {
Services.Notifier.Warning(T("The index {0} could not be deleted. It might already be in use, please try again later.", indexName)); Services.Notifier.Warning(T("The index {0} could not be deleted. It might already be in use, please try again later.", indexName));
@ -67,7 +67,7 @@ namespace Orchard.Indexing.Services {
handler.UpdateIndex(indexName); handler.UpdateIndex(indexName);
} }
Services.Notifier.Information(T("The index {0} has been updated.", indexName)); Services.Notifier.Success(T("The index {0} has been updated.", indexName));
} }
IndexEntry IIndexingService.GetIndexEntry(string indexName) { IndexEntry IIndexingService.GetIndexEntry(string indexName) {

View File

@ -177,7 +177,7 @@ namespace Orchard.Layouts.Controllers {
blueprint.BaseElementState = data.Serialize(); blueprint.BaseElementState = data.Serialize();
_signals.Trigger(Signals.ElementDescriptors); _signals.Trigger(Signals.ElementDescriptors);
_notifier.Information(T("That blueprint has been saved.")); _notifier.Success(T("That blueprint has been saved."));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -223,7 +223,7 @@ namespace Orchard.Layouts.Controllers {
blueprint.ElementDescription = model.ElementDescription.TrimSafe(); blueprint.ElementDescription = model.ElementDescription.TrimSafe();
blueprint.ElementCategory = model.ElementCategory.TrimSafe(); blueprint.ElementCategory = model.ElementCategory.TrimSafe();
_notifier.Information(T("That blueprint's properties have been saved.")); _notifier.Success(T("That blueprint's properties have been saved."));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -239,7 +239,7 @@ namespace Orchard.Layouts.Controllers {
return HttpNotFound(); return HttpNotFound();
_elementBlueprintService.DeleteBlueprint(blueprint); _elementBlueprintService.DeleteBlueprint(blueprint);
_notifier.Information(T("That blueprint has been deleted.")); _notifier.Success(T("That blueprint has been deleted."));
return Redirect(Request.UrlReferrer.ToString()); return Redirect(Request.UrlReferrer.ToString());
} }
@ -256,7 +256,7 @@ namespace Orchard.Layouts.Controllers {
} }
else { else {
var numDeletedBlueprints = _elementBlueprintService.DeleteBlueprints(blueprintIds); var numDeletedBlueprints = _elementBlueprintService.DeleteBlueprints(blueprintIds);
_notifier.Information(T("{0} blueprints have been deleted.", numDeletedBlueprints)); _notifier.Success(T("{0} blueprints have been deleted.", numDeletedBlueprints));
} }
return Redirect(Request.UrlReferrer.ToString()); return Redirect(Request.UrlReferrer.ToString());

View File

@ -537,11 +537,16 @@ span.message {
border:1px solid #e5cece; /* red */ border:1px solid #e5cece; /* red */
padding-left:26px; padding-left:26px;
} }
.message-Information, .notifications { .message-Success, .notifications {
background:#e6f1c9; /* green */ background:#e6f1c9; /* green */
border:1px solid #cfe493; border:1px solid #cfe493;
color:#062232; color:#062232;
} }
.message-Information {
background:#d9edf7; /* blue */
border:1px solid #bce8f1;
color:#31708f;
}
.message-Warning { .message-Warning {
background:#fdf5bc; /* yellow */ background:#fdf5bc; /* yellow */
border:1px solid #ffea9b; border:1px solid #ffea9b;

View File

@ -135,7 +135,7 @@ namespace Orchard.Lists.Controllers {
} }
_contentManager.Publish(item); _contentManager.Publish(item);
} }
_services.Notifier.Information(T("Lists successfully published.")); _services.Notifier.Success(T("Lists successfully published."));
break; break;
case ContentsBulkAction.Unpublish: case ContentsBulkAction.Unpublish:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -145,7 +145,7 @@ namespace Orchard.Lists.Controllers {
} }
_contentManager.Unpublish(item); _contentManager.Unpublish(item);
} }
_services.Notifier.Information(T("Lists successfully unpublished.")); _services.Notifier.Success(T("Lists successfully unpublished."));
break; break;
case ContentsBulkAction.Remove: case ContentsBulkAction.Remove:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -155,7 +155,7 @@ namespace Orchard.Lists.Controllers {
} }
_contentManager.Remove(item); _contentManager.Remove(item);
} }
_services.Notifier.Information(T("Lists successfully removed.")); _services.Notifier.Success(T("Lists successfully removed."));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
@ -359,15 +359,15 @@ namespace Orchard.Lists.Controllers {
switch (operation) { switch (operation) {
case ViewModels.ListOperation.Reverse: case ViewModels.ListOperation.Reverse:
_containerService.Reverse(items); _containerService.Reverse(items);
_services.Notifier.Information(T("The list has been reversed.")); _services.Notifier.Success(T("The list has been reversed."));
break; break;
case ViewModels.ListOperation.Shuffle: case ViewModels.ListOperation.Shuffle:
_containerService.Shuffle(items); _containerService.Shuffle(items);
_services.Notifier.Information(T("The list has been shuffled.")); _services.Notifier.Success(T("The list has been shuffled."));
break; break;
case ViewModels.ListOperation.Sort: case ViewModels.ListOperation.Sort:
_containerService.Sort(items, sortBy.GetValueOrDefault(), sortByDirection.GetValueOrDefault()); _containerService.Sort(items, sortBy.GetValueOrDefault(), sortByDirection.GetValueOrDefault());
_services.Notifier.Information(T("The list has been sorted.")); _services.Notifier.Success(T("The list has been sorted."));
break; break;
default: default:
_services.Notifier.Error(T("Please select an operation to perform on the list.")); _services.Notifier.Error(T("Please select an operation to perform on the list."));
@ -449,7 +449,7 @@ namespace Orchard.Lists.Controllers {
_containerService.MoveItem(item, targetContainer); _containerService.MoveItem(item, targetContainer);
} }
_services.Notifier.Information(T("Content successfully moved to <a href=\"{0}\">{1}</a>.", Url.Action("List", new { containerId = targetContainerId }), containerDisplayText)); _services.Notifier.Success(T("Content successfully moved to <a href=\"{0}\">{1}</a>.", Url.Action("List", new { containerId = targetContainerId }), containerDisplayText));
return true; return true;
} }
@ -463,7 +463,7 @@ namespace Orchard.Lists.Controllers {
item.As<CommonPart>().Record.Container = null; item.As<CommonPart>().Record.Container = null;
_containerService.UpdateItemPath(item.ContentItem); _containerService.UpdateItemPath(item.ContentItem);
} }
_services.Notifier.Information(T("Content successfully removed from the list.")); _services.Notifier.Success(T("Content successfully removed from the list."));
return true; return true;
} }
@ -476,7 +476,7 @@ namespace Orchard.Lists.Controllers {
_contentManager.Remove(item); _contentManager.Remove(item);
} }
_services.Notifier.Information(T("Content successfully removed.")); _services.Notifier.Success(T("Content successfully removed."));
return true; return true;
} }
@ -489,7 +489,7 @@ namespace Orchard.Lists.Controllers {
_contentManager.Unpublish(item); _contentManager.Unpublish(item);
} }
_services.Notifier.Information(T("Content successfully unpublished.")); _services.Notifier.Success(T("Content successfully unpublished."));
return true; return true;
} }
@ -502,7 +502,7 @@ namespace Orchard.Lists.Controllers {
_contentManager.Publish(item); _contentManager.Publish(item);
} }
_services.Notifier.Information(T("Content successfully published.")); _services.Notifier.Success(T("Content successfully published."));
return true; return true;
} }
} }

View File

@ -108,7 +108,7 @@ namespace Orchard.Localization.Controllers {
conditionallyPublish(contentItemTranslation.ContentItem); conditionallyPublish(contentItemTranslation.ContentItem);
Services.Notifier.Information(T("Created content item translation.")); Services.Notifier.Success(T("Created content item translation."));
var metadata = _contentManager.GetItemMetadata(contentItemTranslation); var metadata = _contentManager.GetItemMetadata(contentItemTranslation);
return RedirectToAction(Convert.ToString(metadata.EditorRouteValues["action"]), metadata.EditorRouteValues); return RedirectToAction(Convert.ToString(metadata.EditorRouteValues["action"]), metadata.EditorRouteValues);

View File

@ -68,7 +68,7 @@ namespace Orchard.Media.Controllers {
try { try {
_mediaService.CreateFolder(viewModel.MediaPath, viewModel.Name); _mediaService.CreateFolder(viewModel.MediaPath, viewModel.Name);
Services.Notifier.Information(T("Media folder created")); Services.Notifier.Success(T("Media folder created"));
} }
catch(ArgumentException argumentException) { catch(ArgumentException argumentException) {
Services.Notifier.Error(T("Creating Folder failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Creating Folder failed: {0}", argumentException.Message));
@ -102,7 +102,7 @@ namespace Orchard.Media.Controllers {
try { try {
_mediaService.DeleteFile(folderName, fileName); _mediaService.DeleteFile(folderName, fileName);
Services.Notifier.Information(T("Media file deleted")); Services.Notifier.Success(T("Media file deleted"));
} }
catch (ArgumentException argumentException) { catch (ArgumentException argumentException) {
Services.Notifier.Error(T("Deleting failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Deleting failed: {0}", argumentException.Message));
@ -116,7 +116,7 @@ namespace Orchard.Media.Controllers {
try { try {
_mediaService.DeleteFolder(folderPath); _mediaService.DeleteFolder(folderPath);
Services.Notifier.Information(T("Media folder deleted")); Services.Notifier.Success(T("Media folder deleted"));
} }
catch(ArgumentException argumentException) { catch(ArgumentException argumentException) {
Services.Notifier.Error(T("Deleting failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Deleting failed: {0}", argumentException.Message));
@ -142,7 +142,7 @@ namespace Orchard.Media.Controllers {
UpdateModel(viewModel); UpdateModel(viewModel);
try { try {
_mediaService.DeleteFolder(viewModel.MediaPath); _mediaService.DeleteFolder(viewModel.MediaPath);
Services.Notifier.Information(T("Media folder deleted")); Services.Notifier.Success(T("Media folder deleted"));
} }
catch(ArgumentException argumentException) { catch(ArgumentException argumentException) {
Services.Notifier.Error(T("Deleting media folder failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Deleting media folder failed: {0}", argumentException.Message));
@ -162,7 +162,7 @@ namespace Orchard.Media.Controllers {
UpdateModel(viewModel); UpdateModel(viewModel);
try { try {
_mediaService.RenameFolder(viewModel.MediaPath, viewModel.Name); _mediaService.RenameFolder(viewModel.MediaPath, viewModel.Name);
Services.Notifier.Information(T("Media folder properties modified")); Services.Notifier.Success(T("Media folder properties modified"));
} }
catch(ArgumentException argumentException) { catch(ArgumentException argumentException) {
Services.Notifier.Error(T("Modifying media folder properties failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Modifying media folder properties failed: {0}", argumentException.Message));
@ -217,7 +217,7 @@ namespace Orchard.Media.Controllers {
} }
} }
Services.Notifier.Information(T("Media file(s) uploaded")); Services.Notifier.Success(T("Media file(s) uploaded"));
return RedirectToAction("Edit", new { name = viewModel.FolderName, mediaPath = viewModel.MediaPath }); return RedirectToAction("Edit", new { name = viewModel.FolderName, mediaPath = viewModel.MediaPath });
} }
@ -266,7 +266,7 @@ namespace Orchard.Media.Controllers {
UpdateModel(viewModel); UpdateModel(viewModel);
try { try {
_mediaService.DeleteFile(viewModel.Name, viewModel.MediaPath); _mediaService.DeleteFile(viewModel.Name, viewModel.MediaPath);
Services.Notifier.Information(T("Media deleted")); Services.Notifier.Success(T("Media deleted"));
} }
catch (ArgumentException argumentException) { catch (ArgumentException argumentException) {
Services.Notifier.Error(T("Removing media file failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Removing media file failed: {0}", argumentException.Message));
@ -298,7 +298,7 @@ namespace Orchard.Media.Controllers {
viewModelName = input["NewName"]; viewModelName = input["NewName"];
} }
Services.Notifier.Information(T("Media information updated")); Services.Notifier.Success(T("Media information updated"));
return RedirectToAction("EditMedia", new { name = viewModelName, return RedirectToAction("EditMedia", new { name = viewModelName,
caption = viewModel.Caption, caption = viewModel.Caption,
lastUpdated = viewModel.LastUpdated, lastUpdated = viewModel.LastUpdated,

View File

@ -63,7 +63,7 @@ namespace Orchard.MediaLibrary.Controllers {
try { try {
_mediaLibraryService.CreateFolder(viewModel.FolderPath, viewModel.Name); _mediaLibraryService.CreateFolder(viewModel.FolderPath, viewModel.Name);
Services.Notifier.Information(T("Media folder created")); Services.Notifier.Success(T("Media folder created"));
} }
catch (ArgumentException argumentException) { catch (ArgumentException argumentException) {
Services.Notifier.Error(T("Creating Folder failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Creating Folder failed: {0}", argumentException.Message));
@ -117,7 +117,7 @@ namespace Orchard.MediaLibrary.Controllers {
try { try {
_mediaLibraryService.RenameFolder(viewModel.FolderPath, viewModel.Name); _mediaLibraryService.RenameFolder(viewModel.FolderPath, viewModel.Name);
Services.Notifier.Information(T("Media folder renamed")); Services.Notifier.Success(T("Media folder renamed"));
} }
catch (Exception exception) { catch (Exception exception) {
Services.Notifier.Error(T("Editing Folder failed: {0}", exception.Message)); Services.Notifier.Error(T("Editing Folder failed: {0}", exception.Message));
@ -142,7 +142,7 @@ namespace Orchard.MediaLibrary.Controllers {
} }
try { try {
_mediaLibraryService.DeleteFolder(viewModel.FolderPath); _mediaLibraryService.DeleteFolder(viewModel.FolderPath);
Services.Notifier.Information(T("Media folder deleted")); Services.Notifier.Success(T("Media folder deleted"));
} }
catch (ArgumentException argumentException) { catch (ArgumentException argumentException) {
Services.Notifier.Error(T("Deleting Folder failed: {0}", argumentException.Message)); Services.Notifier.Error(T("Deleting Folder failed: {0}", argumentException.Message));

View File

@ -62,7 +62,7 @@ namespace Orchard.MediaLibrary.MediaFileName
_mediaLibraryService.RenameFile(part.FolderPath, priorFileName, model.FileName); _mediaLibraryService.RenameFile(part.FolderPath, priorFileName, model.FileName);
part.FileName = model.FileName; part.FileName = model.FileName;
_notifier.Add(NotifyType.Information, T("File '{0}' was renamed to '{1}'", priorFileName, model.FileName)); _notifier.Add(NotifyType.Success, T("File '{0}' was renamed to '{1}'", priorFileName, model.FileName));
} }
catch (Exception) { catch (Exception) {
updater.AddModelError("MediaFileNameEditorSettings.FileName", T("Unable to rename file")); updater.AddModelError("MediaFileNameEditorSettings.FileName", T("Unable to rename file"));
@ -70,6 +70,7 @@ namespace Orchard.MediaLibrary.MediaFileName
} }
} }
} }
return model; return model;
}); });
} }

View File

@ -155,7 +155,7 @@ namespace Orchard.MediaProcessing.Controllers {
} }
Services.ContentManager.Remove(profile.ContentItem); Services.ContentManager.Remove(profile.ContentItem);
Services.Notifier.Information(T("Image Profile {0} deleted", profile.Name)); Services.Notifier.Success(T("Image Profile {0} deleted", profile.Name));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }

View File

@ -67,7 +67,7 @@ namespace Orchard.MediaProcessing.Controllers {
_signals.Trigger("MediaProcessing_Saved_" + filter.ImageProfilePartRecord.Name); _signals.Trigger("MediaProcessing_Saved_" + filter.ImageProfilePartRecord.Name);
Services.Notifier.Information(T("Filter deleted")); Services.Notifier.Success(T("Filter deleted"));
return RedirectToAction("Edit", "Admin", new {id}); return RedirectToAction("Edit", "Admin", new {id});
} }

View File

@ -163,7 +163,7 @@ namespace Orchard.Modules.Controllers {
Services.Notifier.Error(T("Recipes {0} contains unsupported module installation steps.", recipe.Name)); Services.Notifier.Error(T("Recipes {0} contains unsupported module installation steps.", recipe.Name));
} }
Services.Notifier.Information(T("The recipe {0} was executed successfully.", recipe.Name)); Services.Notifier.Success(T("The recipe {0} was executed successfully.", recipe.Name));
return RedirectToAction("Recipes"); return RedirectToAction("Recipes");
@ -229,7 +229,7 @@ namespace Orchard.Modules.Controllers {
var id = feature.Descriptor.Id; var id = feature.Descriptor.Id;
try { try {
_dataMigrationManager.Update(id); _dataMigrationManager.Update(id);
Services.Notifier.Information(T("The feature {0} was updated successfully", id)); Services.Notifier.Success(T("The feature {0} was updated successfully", id));
} }
catch (Exception exception) { catch (Exception exception) {
Services.Notifier.Error(T("An error occured while updating the feature {0}: {1}", id, exception.Message)); Services.Notifier.Error(T("An error occured while updating the feature {0}: {1}", id, exception.Message));

View File

@ -73,7 +73,7 @@ namespace Orchard.Modules.Services {
public void EnableFeatures(IEnumerable<string> featureIds, bool force) { public void EnableFeatures(IEnumerable<string> featureIds, bool force) {
foreach (string featureId in _featureManager.EnableFeatures(featureIds, force)) { foreach (string featureId in _featureManager.EnableFeatures(featureIds, force)) {
var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name; var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name;
Services.Notifier.Information(T("{0} was enabled", featureName)); Services.Notifier.Success(T("{0} was enabled", featureName));
} }
} }
@ -93,7 +93,7 @@ namespace Orchard.Modules.Services {
public void DisableFeatures(IEnumerable<string> featureIds, bool force) { public void DisableFeatures(IEnumerable<string> featureIds, bool force) {
foreach (string featureId in _featureManager.DisableFeatures(featureIds, force)) { foreach (string featureId in _featureManager.DisableFeatures(featureIds, force)) {
var featureName = _featureManager.GetAvailableFeatures().Single(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name; var featureName = _featureManager.GetAvailableFeatures().Single(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name;
Services.Notifier.Information(T("{0} was disabled", featureName)); Services.Notifier.Success(T("{0} was disabled", featureName));
} }
} }

View File

@ -88,7 +88,7 @@ namespace Orchard.MultiTenancy.Controllers {
Modules = viewModel.Modules.Where(x => x.Checked).Select(x => x.ModuleId).ToArray() Modules = viewModel.Modules.Where(x => x.Checked).Select(x => x.ModuleId).ToArray()
}); });
Services.Notifier.Information(T("Tenant '{0}' was created successfully.", viewModel.Name)); Services.Notifier.Success(T("Tenant '{0}' was created successfully.", viewModel.Name));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
catch (ArgumentException ex) { catch (ArgumentException ex) {

View File

@ -127,7 +127,7 @@ namespace Orchard.OutputCache.Controllers {
_signals.Trigger(CacheSettings.CacheKey); _signals.Trigger(CacheSettings.CacheKey);
_cacheService.SaveRouteConfigs(model.RouteConfigs); _cacheService.SaveRouteConfigs(model.RouteConfigs);
Services.Notifier.Information(T("Output cache settings saved successfully.")); Services.Notifier.Success(T("Output cache settings saved successfully."));
} }
else { else {
Services.Notifier.Error(T("Could not save output cache settings.")); Services.Notifier.Error(T("Could not save output cache settings."));

View File

@ -69,7 +69,7 @@ namespace Orchard.Packaging.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_packagingSourceManager.RemoveSource(id); _packagingSourceManager.RemoveSource(id);
Services.Notifier.Information(T("The feed has been removed successfully.")); Services.Notifier.Success(T("The feed has been removed successfully."));
return RedirectToAction("Sources"); return RedirectToAction("Sources");
} }
@ -115,7 +115,7 @@ namespace Orchard.Packaging.Controllers {
return View(new PackagingAddSourceViewModel { Url = url }); return View(new PackagingAddSourceViewModel { Url = url });
_packagingSourceManager.AddSource(title, url); _packagingSourceManager.AddSource(title, url);
Services.Notifier.Information(T("The feed has been added successfully.")); Services.Notifier.Success(T("The feed has been added successfully."));
return RedirectToAction("Sources"); return RedirectToAction("Sources");
} }

View File

@ -131,10 +131,10 @@ namespace Orchard.Packaging.Controllers {
PackageInfo packageInfo = _packageManager.Install(packageId, version, source.FeedUrl, MapAppRoot()); PackageInfo packageInfo = _packageManager.Install(packageId, version, source.FeedUrl, MapAppRoot());
if (DefaultExtensionTypes.IsTheme(packageInfo.ExtensionType)) { if (DefaultExtensionTypes.IsTheme(packageInfo.ExtensionType)) {
Services.Notifier.Information(T("The theme has been successfully installed. It can be enabled in the \"Themes\" page accessible from the menu.")); Services.Notifier.Success(T("The theme has been successfully installed. It can be enabled in the \"Themes\" page accessible from the menu."));
} }
else if (DefaultExtensionTypes.IsModule(packageInfo.ExtensionType)) { else if (DefaultExtensionTypes.IsModule(packageInfo.ExtensionType)) {
Services.Notifier.Information(T("The module has been successfully installed.")); Services.Notifier.Success(T("The module has been successfully installed."));
IPackageRepository packageRepository = PackageRepositoryFactory.Default.CreateRepository(new PackageSource(source.FeedUrl, "Default")); IPackageRepository packageRepository = PackageRepositoryFactory.Default.CreateRepository(new PackageSource(source.FeedUrl, "Default"));
IPackage package = packageRepository.FindPackage(packageId); IPackage package = packageRepository.FindPackage(packageId);
@ -175,10 +175,10 @@ namespace Orchard.Packaging.Controllers {
System.IO.File.Delete(fullFileName); System.IO.File.Delete(fullFileName);
if (DefaultExtensionTypes.IsTheme(extensionDescriptor.ExtensionType)) { if (DefaultExtensionTypes.IsTheme(extensionDescriptor.ExtensionType)) {
Services.Notifier.Information(T("The theme has been successfully installed. It can be enabled in the \"Themes\" page accessible from the menu.")); Services.Notifier.Success(T("The theme has been successfully installed. It can be enabled in the \"Themes\" page accessible from the menu."));
} }
else if (DefaultExtensionTypes.IsModule(extensionDescriptor.ExtensionType)) { else if (DefaultExtensionTypes.IsModule(extensionDescriptor.ExtensionType)) {
Services.Notifier.Information(T("The module has been successfully installed.")); Services.Notifier.Success(T("The module has been successfully installed."));
return InstallPackageDetails(extensionDescriptor, redirectUrl); return InstallPackageDetails(extensionDescriptor, redirectUrl);
} }
@ -281,7 +281,7 @@ namespace Orchard.Packaging.Controllers {
return Redirect(!String.IsNullOrEmpty(retryUrl) ? retryUrl : returnUrl); return Redirect(!String.IsNullOrEmpty(retryUrl) ? retryUrl : returnUrl);
} }
Services.Notifier.Information(T("Uninstalled package \"{0}\"", id)); Services.Notifier.Success(T("Uninstalled package \"{0}\"", id));
return this.RedirectLocal(returnUrl, "~/"); return this.RedirectLocal(returnUrl, "~/");
} }

View File

@ -270,7 +270,7 @@ namespace Orchard.Packaging.Services {
var backupFolder = new DirectoryInfo(localTempPath); var backupFolder = new DirectoryInfo(localTempPath);
_folderUpdater.Restore(backupFolder, source); _folderUpdater.Restore(backupFolder, source);
_notifier.Information(T("Successfully restored local package to local folder \"{0}\"", source)); _notifier.Success(T("Successfully restored local package to local folder \"{0}\"", source));
return true; return true;
} }
@ -299,7 +299,7 @@ namespace Orchard.Packaging.Services {
var backupFolder = new DirectoryInfo(localTempPath); var backupFolder = new DirectoryInfo(localTempPath);
_folderUpdater.Backup(source, backupFolder); _folderUpdater.Backup(source, backupFolder);
_notifier.Information(T("Successfully backed up local package to local folder \"{0}\"", backupFolder)); _notifier.Success(T("Successfully backed up local package to local folder \"{0}\"", backupFolder));
return true; return true;
} }
@ -312,7 +312,7 @@ namespace Orchard.Packaging.Services {
// package is the same version or an older version // package is the same version or an older version
try { try {
Uninstall(package.Id, _virtualPathProvider.MapPath("~\\")); Uninstall(package.Id, _virtualPathProvider.MapPath("~\\"));
_notifier.Information(T("Successfully un-installed local package {0}", package.ExtensionId())); _notifier.Success(T("Successfully un-installed local package {0}", package.ExtensionId()));
} }
catch {} catch {}
} }

View File

@ -233,7 +233,7 @@ namespace Orchard.Projections.Controllers {
} }
Services.ContentManager.Remove(query.ContentItem); Services.ContentManager.Remove(query.ContentItem);
Services.Notifier.Information(T("Query {0} deleted", query.Name)); Services.Notifier.Success(T("Query {0} deleted", query.Name));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }

View File

@ -151,7 +151,7 @@ namespace Orchard.Projections.Controllers {
Description = model.Description Description = model.Description
}); });
Services.Notifier.Information(T("Binding created successfully")); Services.Notifier.Success(T("Binding created successfully"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -174,14 +174,14 @@ namespace Orchard.Projections.Controllers {
var record = recordBluePrints.FirstOrDefault(r => String.Equals(r.Type.FullName, binding.Type, StringComparison.OrdinalIgnoreCase)); var record = recordBluePrints.FirstOrDefault(r => String.Equals(r.Type.FullName, binding.Type, StringComparison.OrdinalIgnoreCase));
if (record == null) { if (record == null) {
Services.Notifier.Information(T("The record for this binding is no longer available, please remove it.")); Services.Notifier.Warning(T("The record for this binding is no longer available, please remove it."));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
var property = record.Type.GetProperty(binding.Member, BindingFlags.Instance | BindingFlags.Public); var property = record.Type.GetProperty(binding.Member, BindingFlags.Instance | BindingFlags.Public);
if (property == null) { if (property == null) {
Services.Notifier.Information(T("The member for this binding is no longer available, please remove it.")); Services.Notifier.Warning(T("The member for this binding is no longer available, please remove it."));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -212,7 +212,7 @@ namespace Orchard.Projections.Controllers {
binding.DisplayName = model.Display; binding.DisplayName = model.Display;
binding.Description = model.Description; binding.Description = model.Description;
Services.Notifier.Information(T("Binding updated successfully")); Services.Notifier.Success(T("Binding updated successfully"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -232,7 +232,7 @@ namespace Orchard.Projections.Controllers {
} }
_repository.Delete(binding); _repository.Delete(binding);
Services.Notifier.Information(T("Binding deleted")); Services.Notifier.Success(T("Binding deleted"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }

View File

@ -96,7 +96,7 @@ namespace Orchard.Projections.Controllers {
filter.FilterGroupRecord.Filters.Remove(filter); filter.FilterGroupRecord.Filters.Remove(filter);
_repository.Delete(filter); _repository.Delete(filter);
Services.Notifier.Information(T("Filter deleted")); Services.Notifier.Success(T("Filter deleted"));
return RedirectToAction("Edit", "Admin", new { id }); return RedirectToAction("Edit", "Admin", new { id });
} }

View File

@ -63,7 +63,7 @@ namespace Orchard.Projections.Controllers {
layout.QueryPartRecord.Layouts.Remove(layout); layout.QueryPartRecord.Layouts.Remove(layout);
_repository.Delete(layout); _repository.Delete(layout);
Services.Notifier.Information(T("Layout deleted")); Services.Notifier.Success(T("Layout deleted"));
return RedirectToAction("Edit", "Admin", new { id = queryId }); return RedirectToAction("Edit", "Admin", new { id = queryId });
} }
@ -117,7 +117,7 @@ namespace Orchard.Projections.Controllers {
layoutRecord.Display = model.Display; layoutRecord.Display = model.Display;
layoutRecord.DisplayType = model.DisplayType; layoutRecord.DisplayType = model.DisplayType;
Services.Notifier.Information(T("Layout Created")); Services.Notifier.Success(T("Layout Created"));
_repository.Create(layoutRecord); _repository.Create(layoutRecord);
return RedirectToAction("Edit", new { id = layoutRecord.Id }); return RedirectToAction("Edit", new { id = layoutRecord.Id });
@ -212,7 +212,7 @@ namespace Orchard.Projections.Controllers {
layoutRecord.DisplayType = model.DisplayType; layoutRecord.DisplayType = model.DisplayType;
layoutRecord.GroupProperty = layoutRecord.Properties.FirstOrDefault(x => x.Id == model.GroupPropertyId); layoutRecord.GroupProperty = layoutRecord.Properties.FirstOrDefault(x => x.Id == model.GroupPropertyId);
Services.Notifier.Information(T("Layout Saved")); Services.Notifier.Success(T("Layout Saved"));
return RedirectToAction("Edit", new { id = layoutRecord.Id }); return RedirectToAction("Edit", new { id = layoutRecord.Id });
} }

View File

@ -66,7 +66,7 @@ namespace Orchard.Projections.Controllers {
property.LayoutRecord.Properties.Remove(property); property.LayoutRecord.Properties.Remove(property);
_repository.Delete(property); _repository.Delete(property);
Services.Notifier.Information(T("Property deleted")); Services.Notifier.Success(T("Property deleted"));
return RedirectToAction("Edit", "Layout", new { id }); return RedirectToAction("Edit", "Layout", new { id });
} }

View File

@ -64,7 +64,7 @@ namespace Orchard.Projections.Controllers {
sortCriterion.QueryPartRecord.SortCriteria.Remove(sortCriterion); sortCriterion.QueryPartRecord.SortCriteria.Remove(sortCriterion);
_repository.Delete(sortCriterion); _repository.Delete(sortCriterion);
Services.Notifier.Information(T("Sort criteria deleted")); Services.Notifier.Success(T("Sort criteria deleted"));
return RedirectToAction("Edit", "Admin", new { id }); return RedirectToAction("Edit", "Admin", new { id });
} }

View File

@ -155,7 +155,7 @@ namespace Orchard.Roles.Controllers {
} }
_roleService.UpdateRole(viewModel.Id, viewModel.Name, rolePermissions); _roleService.UpdateRole(viewModel.Id, viewModel.Name, rolePermissions);
Services.Notifier.Information(T("Your Role has been saved.")); Services.Notifier.Success(T("Your Role has been saved."));
return RedirectToAction("Edit", new { id }); return RedirectToAction("Edit", new { id });
} }
@ -171,7 +171,7 @@ namespace Orchard.Roles.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_roleService.DeleteRole(id); _roleService.DeleteRole(id);
Services.Notifier.Information(T("Role was successfully deleted.")); Services.Notifier.Success(T("Role was successfully deleted."));
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
} }

View File

@ -49,7 +49,7 @@ namespace Orchard.Rules.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_rulesServices.DeleteAction(actionId); _rulesServices.DeleteAction(actionId);
Services.Notifier.Information(T("Action Deleted")); Services.Notifier.Success(T("Action Deleted"));
return RedirectToAction("Edit", "Admin", new { id }); return RedirectToAction("Edit", "Admin", new { id });
} }

View File

@ -252,7 +252,7 @@ namespace Orchard.Rules.Controllers {
rule.Name = viewModel.Name; rule.Name = viewModel.Name;
rule.Enabled = viewModel.Enabled; rule.Enabled = viewModel.Enabled;
Services.Notifier.Information(T("Rule Saved")); Services.Notifier.Success(T("Rule Saved"));
return RedirectToAction("Edit", new { id = rule.Id }); return RedirectToAction("Edit", new { id = rule.Id });
} }
@ -275,7 +275,7 @@ namespace Orchard.Rules.Controllers {
if (rule != null) { if (rule != null) {
_rulesServices.DeleteRule(id); _rulesServices.DeleteRule(id);
Services.Notifier.Information(T("Rule {0} deleted", rule.Name)); Services.Notifier.Success(T("Rule {0} deleted", rule.Name));
} }
return RedirectToAction("Index"); return RedirectToAction("Index");
@ -289,7 +289,7 @@ namespace Orchard.Rules.Controllers {
if (rule != null) { if (rule != null) {
rule.Enabled = true; rule.Enabled = true;
Services.Notifier.Information(T("Rule enabled")); Services.Notifier.Success(T("Rule enabled"));
} }
return RedirectToAction("Index"); return RedirectToAction("Index");
@ -303,7 +303,7 @@ namespace Orchard.Rules.Controllers {
if (rule != null) { if (rule != null) {
rule.Enabled = false; rule.Enabled = false;
Services.Notifier.Information(T("Rule disabled")); Services.Notifier.Success(T("Rule disabled"));
} }
return RedirectToAction("Index"); return RedirectToAction("Index");

View File

@ -48,7 +48,7 @@ namespace Orchard.Rules.Controllers {
return new HttpUnauthorizedResult(); return new HttpUnauthorizedResult();
_rulesServices.DeleteEvent(eventId); _rulesServices.DeleteEvent(eventId);
Services.Notifier.Information(T("Event Deleted")); Services.Notifier.Success(T("Event Deleted"));
return RedirectToAction("Edit", "Admin", new { id }); return RedirectToAction("Edit", "Admin", new { id });
} }

View File

@ -201,7 +201,7 @@ namespace Orchard.Taxonomies.Controllers {
} }
} }
Services.Notifier.Information(T("The terms have been imported successfully.")); Services.Notifier.Success(T("The terms have been imported successfully."));
return RedirectToAction("Index", "TermAdmin", new { taxonomyId = id }); return RedirectToAction("Index", "TermAdmin", new { taxonomyId = id });
} }

View File

@ -100,7 +100,7 @@ namespace Orchard.Taxonomies.Controllers {
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
Services.Notifier.Information(T("{0} term have been removed.", checkedEntries.Count)); Services.Notifier.Success(T("{0} term have been removed.", checkedEntries.Count));
return RedirectToAction("Index", new { taxonomyId = viewModel.TaxonomyId }); return RedirectToAction("Index", new { taxonomyId = viewModel.TaxonomyId });
} }
@ -200,7 +200,7 @@ namespace Orchard.Taxonomies.Controllers {
} }
Services.ContentManager.Publish(term.ContentItem); Services.ContentManager.Publish(term.ContentItem);
Services.Notifier.Information(T("The {0} term has been created.", term.Name)); Services.Notifier.Success(T("The {0} term has been created.", term.Name));
return RedirectToAction("Index", "TermAdmin", new { taxonomyId }); return RedirectToAction("Index", "TermAdmin", new { taxonomyId });
} }
@ -238,7 +238,7 @@ namespace Orchard.Taxonomies.Controllers {
Services.ContentManager.Publish(contentItem); Services.ContentManager.Publish(contentItem);
_taxonomyService.ProcessPath(term); _taxonomyService.ProcessPath(term);
Services.Notifier.Information(T("Term information updated")); Services.Notifier.Success(T("Term information updated"));
return RedirectToAction("Index", "TermAdmin", new { taxonomyId = term.TaxonomyId }); return RedirectToAction("Index", "TermAdmin", new { taxonomyId = term.TaxonomyId });
} }

View File

@ -165,7 +165,7 @@ namespace Orchard.Taxonomies.Drivers {
term.Selectable = true; term.Selectable = true;
Services.ContentManager.Create(term, VersionOptions.Published); Services.ContentManager.Create(term, VersionOptions.Published);
Services.Notifier.Information(T("The {0} term has been created.", term.Name)); Services.Notifier.Success(T("The {0} term has been created.", term.Name));
} }
return term; return term;

View File

@ -136,7 +136,7 @@ namespace Orchard.Templates.Controllers {
_contentManager.Publish(item); _contentManager.Publish(item);
} }
Services.Notifier.Information(T("Content successfully published.")); Services.Notifier.Success(T("Content successfully published."));
break; break;
case ContentsBulkAction.Unpublish: case ContentsBulkAction.Unpublish:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -147,7 +147,7 @@ namespace Orchard.Templates.Controllers {
_contentManager.Unpublish(item); _contentManager.Unpublish(item);
} }
Services.Notifier.Information(T("Content successfully unpublished.")); Services.Notifier.Success(T("Content successfully unpublished."));
break; break;
case ContentsBulkAction.Remove: case ContentsBulkAction.Remove:
foreach (var item in checkedContentItems) { foreach (var item in checkedContentItems) {
@ -158,7 +158,7 @@ namespace Orchard.Templates.Controllers {
_contentManager.Remove(item); _contentManager.Remove(item);
} }
Services.Notifier.Information(T("Content successfully removed.")); Services.Notifier.Success(T("Content successfully removed."));
break; break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();

View File

@ -246,7 +246,7 @@ namespace Orchard.Themes.Controllers {
try { try {
_dataMigrationManager.Update(themeId); _dataMigrationManager.Update(themeId);
Services.Notifier.Information(T("The theme {0} was updated successfully.", themeId)); Services.Notifier.Success(T("The theme {0} was updated successfully", themeId));
Logger.Information("The theme {0} was updated successfully.", themeId); Logger.Information("The theme {0} was updated successfully.", themeId);
} catch (Exception exception) { } catch (Exception exception) {
Logger.Error(T("An error occured while updating the theme {0}: {1}", themeId, exception.Message).Text); Logger.Error(T("An error occured while updating the theme {0}: {1}", themeId, exception.Message).Text);

View File

@ -95,7 +95,7 @@ namespace Orchard.Themes.Services {
foreach (var featureId in _featureManager.EnableFeatures(new[] { themeId }, true)) { foreach (var featureId in _featureManager.EnableFeatures(new[] { themeId }, true)) {
if (themeId != featureId) { if (themeId != featureId) {
var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name; var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name;
Services.Notifier.Information(T("{0} was enabled", featureName)); Services.Notifier.Success(T("{0} was enabled", featureName));
} }
} }
} }
@ -194,7 +194,7 @@ namespace Orchard.Themes.Services {
public void DisablePreviewFeatures(IEnumerable<string> features) { public void DisablePreviewFeatures(IEnumerable<string> features) {
foreach (var featureId in _featureManager.DisableFeatures(features,true)) { foreach (var featureId in _featureManager.DisableFeatures(features,true)) {
var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name; var featureName = _featureManager.GetAvailableFeatures().First(f => f.Id.Equals(featureId, StringComparison.OrdinalIgnoreCase)).Name;
Services.Notifier.Information(T("{0} was disabled", featureName)); Services.Notifier.Success(T("{0} was disabled", featureName));
} }
} }
} }

View File

@ -210,7 +210,7 @@ namespace Orchard.Users.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("User created")); Services.Notifier.Success(T("User created"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -268,7 +268,7 @@ namespace Orchard.Users.Controllers {
Services.ContentManager.Publish(user.ContentItem); Services.ContentManager.Publish(user.ContentItem);
Services.Notifier.Information(T("User information updated")); Services.Notifier.Success(T("User information updated"));
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -288,7 +288,7 @@ namespace Orchard.Users.Controllers {
} }
else{ else{
Services.ContentManager.Remove(user.ContentItem); Services.ContentManager.Remove(user.ContentItem);
Services.Notifier.Information(T("User {0} deleted", user.UserName)); Services.Notifier.Success(T("User {0} deleted", user.UserName));
} }
} }
@ -309,10 +309,9 @@ namespace Orchard.Users.Controllers {
} }
_userService.SendChallengeEmail(user.As<UserPart>(), nonce => Url.MakeAbsolute(Url.Action("ChallengeEmail", "Account", new { Area = "Orchard.Users", nonce = nonce }), siteUrl)); _userService.SendChallengeEmail(user.As<UserPart>(), nonce => Url.MakeAbsolute(Url.Action("ChallengeEmail", "Account", new { Area = "Orchard.Users", nonce = nonce }), siteUrl));
Services.Notifier.Information(T("Challenge email sent to {0}", user.UserName)); Services.Notifier.Success(T("Challenge email sent to {0}", user.UserName));
} }
return RedirectToAction("Index"); return RedirectToAction("Index");
} }
@ -325,7 +324,7 @@ namespace Orchard.Users.Controllers {
if ( user != null ) { if ( user != null ) {
user.As<UserPart>().RegistrationStatus = UserStatus.Approved; user.As<UserPart>().RegistrationStatus = UserStatus.Approved;
Services.Notifier.Information(T("User {0} approved", user.UserName)); Services.Notifier.Success(T("User {0} approved", user.UserName));
_userEventHandlers.Approved(user); _userEventHandlers.Approved(user);
} }
@ -345,7 +344,7 @@ namespace Orchard.Users.Controllers {
} }
else { else {
user.As<UserPart>().RegistrationStatus = UserStatus.Pending; user.As<UserPart>().RegistrationStatus = UserStatus.Pending;
Services.Notifier.Information(T("User {0} disabled", user.UserName)); Services.Notifier.Success(T("User {0} disabled", user.UserName));
} }
} }

View File

@ -80,7 +80,7 @@ namespace Orchard.Warmup.Controllers {
if (ModelState.IsValid) { if (ModelState.IsValid) {
_warmupUpdater.Generate(); _warmupUpdater.Generate();
Services.Notifier.Information(T("Warmup updated successfully.")); Services.Notifier.Success(T("Warmup updated successfully."));
} }
else { else {
Services.TransactionManager.Cancel(); Services.TransactionManager.Cancel();

View File

@ -227,7 +227,7 @@ namespace Orchard.Widgets.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("Your {0} has been added.", widgetPart.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been added.", widgetPart.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
} }
@ -269,7 +269,7 @@ namespace Orchard.Widgets.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("Your {0} has been created.", layerPart.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been created.", layerPart.TypeDefinition.DisplayName));
return RedirectToAction("Index", "Admin", new { layerId = layerPart.Id }); return RedirectToAction("Index", "Admin", new { layerId = layerPart.Id });
} }
@ -302,7 +302,7 @@ namespace Orchard.Widgets.Controllers {
return View(model); return View(model);
} }
Services.Notifier.Information(T("Your {0} has been saved.", layerPart.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been saved.", layerPart.TypeDefinition.DisplayName));
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
} }
@ -315,7 +315,7 @@ namespace Orchard.Widgets.Controllers {
try { try {
_widgetsService.DeleteLayer(id); _widgetsService.DeleteLayer(id);
Services.Notifier.Information(T("Layer was successfully deleted")); Services.Notifier.Success(T("Layer was successfully deleted"));
} }
catch (Exception exception) { catch (Exception exception) {
Logger.Error(T("Removing Layer failed: {0}", exception.Message).Text); Logger.Error(T("Removing Layer failed: {0}", exception.Message).Text);
@ -387,7 +387,7 @@ namespace Orchard.Widgets.Controllers {
conditionallyPublish(widgetPart.ContentItem); conditionallyPublish(widgetPart.ContentItem);
Services.Notifier.Information(T("Your {0} has been saved.", widgetPart.TypeDefinition.DisplayName)); Services.Notifier.Success(T("Your {0} has been saved.", widgetPart.TypeDefinition.DisplayName));
} }
catch (Exception exception) { catch (Exception exception) {
Logger.Error(T("Editing widget failed: {0}", exception.Message).Text); Logger.Error(T("Editing widget failed: {0}", exception.Message).Text);
@ -412,7 +412,7 @@ namespace Orchard.Widgets.Controllers {
return HttpNotFound(); return HttpNotFound();
try { try {
_widgetsService.DeleteWidget(widgetPart.Id); _widgetsService.DeleteWidget(widgetPart.Id);
Services.Notifier.Information(T("Widget was successfully deleted")); Services.Notifier.Success(T("Widget was successfully deleted"));
} }
catch (Exception exception) { catch (Exception exception) {
Logger.Error(T("Removing Widget failed: {0}", exception.Message).Text); Logger.Error(T("Removing Widget failed: {0}", exception.Message).Text);

View File

@ -145,7 +145,7 @@ namespace Orchard.Workflows.Controllers {
if (workflowDefinition != null) { if (workflowDefinition != null) {
_workflowDefinitionRecords.Delete(workflowDefinition); _workflowDefinitionRecords.Delete(workflowDefinition);
Services.Notifier.Information(T("Workflow {0} deleted", workflowDefinition.Name)); Services.Notifier.Success(T("Workflow {0} deleted", workflowDefinition.Name));
} }
} }
break; break;
@ -263,7 +263,7 @@ namespace Orchard.Workflows.Controllers {
if (workflowDefinition != null) { if (workflowDefinition != null) {
_workflowDefinitionRecords.Delete(workflowDefinition); _workflowDefinitionRecords.Delete(workflowDefinition);
Services.Notifier.Information(T("Workflow {0} deleted", workflowDefinition.Name)); Services.Notifier.Success(T("Workflow {0} deleted", workflowDefinition.Name));
} }
return RedirectToAction("Index"); return RedirectToAction("Index");
@ -278,7 +278,7 @@ namespace Orchard.Workflows.Controllers {
if (workflow != null) { if (workflow != null) {
_workflowRecords.Delete(workflow); _workflowRecords.Delete(workflow);
Services.Notifier.Information(T("Workflow deleted")); Services.Notifier.Success(T("Workflow deleted"));
} }
return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index"));
@ -389,7 +389,7 @@ namespace Orchard.Workflows.Controllers {
} }
} }
Services.Notifier.Information(T("Workflow saved successfully")); Services.Notifier.Success(T("Workflow saved successfully"));
// Don't pass the localId to force the activites to refresh and use the deterministic clientId. // Don't pass the localId to force the activites to refresh and use the deterministic clientId.
return RedirectToAction("Edit", new { id }); return RedirectToAction("Edit", new { id });

View File

@ -45,8 +45,8 @@ namespace Upgrade.Controllers {
try { try {
_upgradeService.ExecuteReader("DELETE FROM " + _upgradeService.GetPrefixedTableName("Orchard_ContentPicker_ContentMenuItemPartRecord"), null); _upgradeService.ExecuteReader("DELETE FROM " + _upgradeService.GetPrefixedTableName("Orchard_ContentPicker_ContentMenuItemPartRecord"), null);
_upgradeService.CopyTable("Navigation_ContentMenuItemPartRecord", "Orchard_ContentPicker_ContentMenuItemPartRecord", new string[0]); _upgradeService.CopyTable("Navigation_ContentMenuItemPartRecord", "Orchard_ContentPicker_ContentMenuItemPartRecord", new string[0]);
_orchardServices.Notifier.Information(T("Content Picker menu items were migrated successfully.")); _orchardServices.Notifier.Success(T("Content Picker menu items were migrated successfully."));
} }
catch(Exception e) { catch(Exception e) {
Logger.Error(e, "Unexpected error while migrating to Orchard.ContentPicker. Please check the log."); Logger.Error(e, "Unexpected error while migrating to Orchard.ContentPicker. Please check the log.");

View File

@ -89,8 +89,8 @@ namespace Upgrade.Controllers {
_orchardServices.ContentManager.Clear(); _orchardServices.ContentManager.Clear();
} while (contents.Any()); } while (contents.Any());
_orchardServices.Notifier.Information(T("{0} fields were migrated successfully", contentType)); _orchardServices.Notifier.Success(T("{0} fields were migrated successfully", contentType));
} }
} }

View File

@ -278,8 +278,8 @@ namespace Upgrade.Controllers {
_upgradeService.ExecuteReader("DROP TABLE " + blogTable, null); _upgradeService.ExecuteReader("DROP TABLE " + blogTable, null);
} }
#endregion #endregion
_orchardServices.Notifier.Information(T("Site Settings migrated successfully")); _orchardServices.Notifier.Success(T("Site Settings migrated successfully"));
return View(); return View();
} }

View File

@ -52,7 +52,7 @@ namespace Upgrade.Controllers {
// create a Main Menu // create a Main Menu
var mainMenu = _menuService.Create("Main Menu"); var mainMenu = _menuService.Create("Main Menu");
_orchardServices.Notifier.Information(T("Main menu created")); _orchardServices.Notifier.Success(T("Main menu created"));
// assign the Main Menu to all current menu items // assign the Main Menu to all current menu items
foreach (var menuItem in _menuService.Get()) { foreach (var menuItem in _menuService.Get()) {
@ -62,7 +62,7 @@ namespace Upgrade.Controllers {
} }
menuItem.Menu = mainMenu.ContentItem; menuItem.Menu = mainMenu.ContentItem;
} }
_orchardServices.Notifier.Information(T("Menu items moved to Main menu")); _orchardServices.Notifier.Success(T("Menu items moved to Main menu"));
// a widget should is created to display the navigation // a widget should is created to display the navigation
var layer = _widgetsService.GetLayers().FirstOrDefault(x => x.Name == "Default"); var layer = _widgetsService.GetLayers().FirstOrDefault(x => x.Name == "Default");

View File

@ -97,7 +97,7 @@ namespace Upgrade.Controllers {
record.State = JsonConvert.SerializeObject(newState); record.State = JsonConvert.SerializeObject(newState);
}); });
_orchardServices.Notifier.Information(T("Email activities updated successfully")); _orchardServices.Notifier.Success(T("Email activities updated successfully"));
} }
else { else {
_orchardServices.Notifier.Warning(T("No email activities were updated.")); _orchardServices.Notifier.Warning(T("No email activities were updated."));

View File

@ -160,7 +160,7 @@ namespace Upgrade.Controllers {
_orchardServices.Notifier.Warning(T("Some content items could not be imported. Please refer to the corresponding Report.")); _orchardServices.Notifier.Warning(T("Some content items could not be imported. Please refer to the corresponding Report."));
} }
else { else {
_orchardServices.Notifier.Information(T("{0} was migrated successfully", contentType)); _orchardServices.Notifier.Success(T("{0} was migrated successfully", contentType));
} }
} }
} }

View File

@ -61,7 +61,7 @@ namespace Upgrade.Controllers {
_upgradeService.CopyTable("Contrib_Taxonomies_TermPartRecord", "Orchard_Taxonomies_TermPartRecord", new string[0]); _upgradeService.CopyTable("Contrib_Taxonomies_TermPartRecord", "Orchard_Taxonomies_TermPartRecord", new string[0]);
_upgradeService.CopyTable("Contrib_Taxonomies_TermsPartRecord", "Orchard_Taxonomies_TermsPartRecord", new string[0]); _upgradeService.CopyTable("Contrib_Taxonomies_TermsPartRecord", "Orchard_Taxonomies_TermsPartRecord", new string[0]);
_orchardServices.Notifier.Information(T("Taxonomies were migrated successfully.")); _orchardServices.Notifier.Success(T("Taxonomies were migrated successfully."));
} }
catch(Exception e) { catch(Exception e) {
Logger.Error(e, "Unexpected error while migrating to Orchard.Taxonomies. Please check the log."); Logger.Error(e, "Unexpected error while migrating to Orchard.Taxonomies. Please check the log.");

View File

@ -315,11 +315,16 @@ span.message {
background:#e68585; /* red */ background:#e68585; /* red */
color:#fff; color:#fff;
} }
.message-Information { .message-Success {
background:#e6f1c9; /* green */ background:#e6f1c9; /* green */
border:1px solid #cfe493; border:1px solid #cfe493;
color:#062232; color:#062232;
} }
.message-Information {
background:#d9edf7; /* blue */
border:1px solid #bce8f1;
color:#31708f;
}
.message-Warning { .message-Warning {
background:#fdf5bc; /* yellow */ background:#fdf5bc; /* yellow */
border:1px solid #ffea9b; border:1px solid #ffea9b;

View File

@ -559,11 +559,16 @@ span.message {
border:1px solid #e5cece; /* red */ border:1px solid #e5cece; /* red */
padding-left:4px 4px 4px 26px; padding-left:4px 4px 4px 26px;
} }
.message-Information, .notifications { .message-Success, .notifications {
background:#e6f1c9; /* green */ background:#e6f1c9; /* green */
border:1px solid #cfe493; border:1px solid #cfe493;
color:#062232; color:#062232;
} }
.message-Information {
background:#d9edf7; /* blue */
border:1px solid #bce8f1;
color:#31708f;
}
.message-Warning { .message-Warning {
background:#fdf5bc; /* yellow */ background:#fdf5bc; /* yellow */
border:1px solid #ffea9b; border:1px solid #ffea9b;

View File

@ -494,7 +494,8 @@ nav ul.breadcrumb
/* Confirmations */ /* Confirmations */
.message, .validation-summary-errors { margin:10px 0 4px 0; padding:4px; } .message, .validation-summary-errors { margin:10px 0 4px 0; padding:4px; }
.messages a { font-weight:bold; } .messages a { font-weight:bold; }
.message-Information { background:#e6f1c9; /* green */ border:1px solid #cfe493; color:#062232; } .message-Success { background:#e6f1c9; /* green */ border:1px solid #cfe493; color:#062232; }
.message-Information { background:#d9edf7; /* blue */ border:1px solid #bce8f1; color:#31708f; }
.message-Warning { background:#fdf5bc; /* yellow */ border:1px solid #ffea9b; } .message-Warning { background:#fdf5bc; /* yellow */ border:1px solid #ffea9b; }
.critical.message, .validation-summary-errors, .message-Error { background:#e68585; /* red */ border:1px solid #990808; color:#fff; } .critical.message, .validation-summary-errors, .message-Error { background:#e68585; /* red */ border:1px solid #990808; color:#fff; }

View File

@ -28,5 +28,14 @@ namespace Orchard.UI.Notify {
public static void Error(this INotifier notifier, LocalizedString message) { public static void Error(this INotifier notifier, LocalizedString message) {
notifier.Add(NotifyType.Error, message); notifier.Add(NotifyType.Error, message);
} }
/// <summary>
/// Adds a new UI notification of type Success
/// </summary>
/// <seealso cref="Orchard.UI.Notify.INotifier.Add()"/>
/// <param name="message">A localized message to display</param>
public static void Success(this INotifier notifier, LocalizedString message) {
notifier.Add(NotifyType.Success, message);
}
} }
} }

View File

@ -4,7 +4,8 @@ namespace Orchard.UI.Notify {
public enum NotifyType { public enum NotifyType {
Information, Information,
Warning, Warning,
Error Error,
Success
} }
public class NotifyEntry { public class NotifyEntry {