mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Renaming Notice to Notification
Longer, but what can we do...
This commit is contained in:
@@ -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
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||||
|
public class NotificationController : Controller
|
||||||
{
|
{
|
||||||
|
private readonly EventAggregator _eventAggregator;
|
||||||
|
|
||||||
|
public NotificationController(EventAggregator eventAggregator)
|
||||||
|
{
|
||||||
|
_eventAggregator = eventAggregator;
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("notices")]
|
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
|
||||||
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
{
|
{
|
||||||
@@ -1 +0,0 @@
|
|||||||
@using BTCPayServer.Models.NoticeViewModels
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@model BTCPayServer.Models.NoticeViewModels.IndexViewModel
|
@model BTCPayServer.Models.NotificationViewModels.IndexViewModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Notices";
|
ViewData["Title"] = "Notices";
|
||||||
}
|
}
|
||||||
1
BTCPayServer/Views/Notification/_ViewImports.cshtml
Normal file
1
BTCPayServer/Views/Notification/_ViewImports.cshtml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user