Renaming Notice to Notification

Longer, but what can we do...
This commit is contained in:
rockstardev
2020-05-27 18:35:25 -05:00
parent 1ab016d21e
commit 0cacfa140b
6 changed files with 22 additions and 8 deletions

View File

@@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using BTCPayServer.Events.Notifications;
using BTCPayServer.Filters; using BTCPayServer.Filters;
using BTCPayServer.Models.NoticeViewModels; using BTCPayServer.Models.NotificationViewModels;
using BTCPayServer.Security; using BTCPayServer.Security;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
@@ -12,11 +13,17 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers namespace BTCPayServer.Controllers
{ {
[BitpayAPIConstraint(false)] [BitpayAPIConstraint(false)]
public class NoticeController : Controller
{
[HttpGet]
[Route("notices")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)] [Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
public class NotificationController : Controller
{
private readonly EventAggregator _eventAggregator;
public NotificationController(EventAggregator eventAggregator)
{
_eventAggregator = eventAggregator;
}
[HttpGet]
public async Task<IActionResult> Index(int skip = 0, int count = 50, int timezoneOffset = 0) public async Task<IActionResult> Index(int skip = 0, int count = 50, int timezoneOffset = 0)
{ {
var model = new IndexViewModel() var model = new IndexViewModel()
@@ -70,5 +77,12 @@ namespace BTCPayServer.Controllers
model.Items = model.Items.OrderByDescending(a => a.Created).ToList(); model.Items = model.Items.OrderByDescending(a => a.Created).ToList();
return View(model); return View(model);
} }
[HttpGet]
public async Task<IActionResult> Generate()
{
_eventAggregator.NoticeNewVersion("1.1.1");
return RedirectToAction(nameof(Index));
}
} }
} }

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace BTCPayServer.Models.NoticeViewModels namespace BTCPayServer.Models.NotificationViewModels
{ {
public class IndexViewModel public class IndexViewModel
{ {

View File

@@ -1 +0,0 @@
@using BTCPayServer.Models.NoticeViewModels

View File

@@ -1,4 +1,4 @@
@model BTCPayServer.Models.NoticeViewModels.IndexViewModel @model BTCPayServer.Models.NotificationViewModels.IndexViewModel
@{ @{
ViewData["Title"] = "Notices"; ViewData["Title"] = "Notices";
} }

View File

@@ -0,0 +1 @@


View File

@@ -79,7 +79,7 @@
<a asp-area="" asp-controller="Manage" asp-action="Index" title="My settings" class="nav-link js-scroll-trigger" id="MySettings"><i class="fa fa-user"></i></a> <a asp-area="" asp-controller="Manage" asp-action="Index" title="My settings" class="nav-link js-scroll-trigger" id="MySettings"><i class="fa fa-user"></i></a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a asp-area="" asp-controller="Notices" asp-action="Index" title="Notices" class="nav-link js-scroll-trigger" id="Notices"><i class="fa fa-bell"></i></a> <a asp-area="" asp-controller="Notification" asp-action="Index" title="Notifications" class="nav-link js-scroll-trigger" id="Notifications"><i class="fa fa-bell"></i></a>
<span class="alerts-badge badge badge-pill badge-danger">6</span> <span class="alerts-badge badge badge-pill badge-danger">6</span>
</li> </li>
<li class="nav-item"> <li class="nav-item">