@using PantheonRA.BackOffice

@{
    var notificationManager = new NotificationManager();
    if (notificationManager.AnyNotifications)
    {
        <script>
            $(function () {
                toastr.options.closeButton = '@notificationManager.ShowCloseButton';
                toastr.options.newestOnTop = '@notificationManager.ShowNewestOnTop';

                @foreach (var notification in notificationManager.FlushNotifications())
                {
                    string toastTypeValue = notification.Type.ToString("F").ToLower();
                    @: var optionsOverride = { /* Add message specific options here */ };
                    if (notification.IsSticky)
                    {
                        @:optionsOverride.timeOut = 0; 
                        @:optionsOverride.extendedTimeout = 0;
                    }
                    @: toastr['@toastTypeValue']('@notification.Message', '@notification.Title', optionsOverride);
                }
            })
        </script>
    }
}