missing files.
This commit is contained in:
12
src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs
Normal file
12
src/Umbraco.Web/Models/ContentEditing/INotificationModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
public interface INotificationModel
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes.
|
||||
/// </summary>
|
||||
List<Notification> Notifications { get; }
|
||||
}
|
||||
}
|
||||
57
src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs
Normal file
57
src/Umbraco.Web/Models/ContentEditing/MessagesExtensions.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Umbraco.Web.UI;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
public static class MessagesExtensions
|
||||
{
|
||||
public static void AddNotification(this INotificationModel model, string header, string msg, SpeechBubbleIcon type)
|
||||
{
|
||||
model.Notifications.Add(new Notification()
|
||||
{
|
||||
Header = header,
|
||||
Message = msg,
|
||||
NotificationType = type
|
||||
});
|
||||
}
|
||||
|
||||
public static void AddSuccessNotification(this INotificationModel model, string header, string msg)
|
||||
{
|
||||
model.Notifications.Add(new Notification()
|
||||
{
|
||||
Header = header,
|
||||
Message = msg,
|
||||
NotificationType = SpeechBubbleIcon.Success
|
||||
});
|
||||
}
|
||||
|
||||
public static void AddErrorNotification(this INotificationModel model, string header, string msg)
|
||||
{
|
||||
model.Notifications.Add(new Notification()
|
||||
{
|
||||
Header = header,
|
||||
Message = msg,
|
||||
NotificationType = SpeechBubbleIcon.Error
|
||||
});
|
||||
}
|
||||
|
||||
public static void AddWarningNotification(this INotificationModel model, string header, string msg)
|
||||
{
|
||||
model.Notifications.Add(new Notification()
|
||||
{
|
||||
Header = header,
|
||||
Message = msg,
|
||||
NotificationType = SpeechBubbleIcon.Warning
|
||||
});
|
||||
}
|
||||
|
||||
public static void AddInfoNotification(this INotificationModel model, string header, string msg)
|
||||
{
|
||||
model.Notifications.Add(new Notification()
|
||||
{
|
||||
Header = header,
|
||||
Message = msg,
|
||||
NotificationType = SpeechBubbleIcon.Info
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/Umbraco.Web/Models/ContentEditing/Notification.cs
Normal file
16
src/Umbraco.Web/Models/ContentEditing/Notification.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Web.UI;
|
||||
|
||||
namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
[DataContract(Name = "notification", Namespace = "")]
|
||||
public class Notification
|
||||
{
|
||||
[DataMember(Name = "header")]
|
||||
public string Header { get; set; }
|
||||
[DataMember(Name = "message")]
|
||||
public string Message { get; set; }
|
||||
[DataMember(Name = "type")]
|
||||
public SpeechBubbleIcon NotificationType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,10 @@
|
||||
<Compile Include="Models\ContentEditing\ContentSaveAction.cs" />
|
||||
<Compile Include="Models\ContentEditing\ContentTypeBasic.cs" />
|
||||
<Compile Include="Models\ContentEditing\IHaveUploadedFiles.cs" />
|
||||
<Compile Include="Models\ContentEditing\INotificationModel.cs" />
|
||||
<Compile Include="Models\ContentEditing\MediaItemDisplay.cs" />
|
||||
<Compile Include="Models\ContentEditing\MessagesExtensions.cs" />
|
||||
<Compile Include="Models\ContentEditing\Notification.cs" />
|
||||
<Compile Include="Models\ContentEditing\Section.cs" />
|
||||
<Compile Include="Models\ContentEditing\Tab.cs" />
|
||||
<Compile Include="Models\ContentEditing\TabbedContentItem.cs" />
|
||||
|
||||
Reference in New Issue
Block a user