This commit is contained in:
NicolasDorier 2017-09-13 16:56:33 +09:00
parent 95b45da25a
commit b17a2fc1db
10 changed files with 18 additions and 18 deletions

View File

@ -12,7 +12,7 @@ namespace BTCPayServer.Controllers
{
public IActionResult Index()
{
return View();
return View("Home");
}
public IActionResult About()

View File

@ -21,7 +21,7 @@ namespace BTCPayServer.Controllers
[HttpGet]
[Route("i/{invoiceId}")]
[AcceptMediaTypeConstraint("application/bitcoin-paymentrequest", false)]
public async Task<IActionResult> Payment(string invoiceId)
public async Task<IActionResult> Checkout(string invoiceId)
{
var invoice = await _InvoiceRepository.GetInvoice(null, invoiceId);
if(invoice == null)
@ -91,7 +91,7 @@ namespace BTCPayServer.Controllers
[HttpGet]
[Route("Invoices")]
[BitpayAPIConstraint(false)]
public async Task<IActionResult> Index(string searchTerm = null, int skip = 0, int count = 20)
public async Task<IActionResult> ListInvoices(string searchTerm = null, int skip = 0, int count = 20)
{
var store = await FindStore(User);
var model = new InvoicesModel();
@ -150,7 +150,7 @@ namespace BTCPayServer.Controllers
}, store);
StatusMessage = $"Invoice {result.Data.Id} just created!";
return RedirectToAction("Index");
return RedirectToAction("ListInvoices");
}
[HttpPost]

View File

@ -382,12 +382,12 @@ namespace BTCPayServer.Controllers
if(pairingCode != null && await _TokenRepository.PairWithAsync(pairingCode, store.Id))
{
StatusMessage = "Pairing is successfull";
return RedirectToAction(nameof(Tokens));
return RedirectToAction(nameof(ListTokens));
}
else
{
StatusMessage = "Pairing failed";
return RedirectToAction(nameof(Tokens));
return RedirectToAction(nameof(ListTokens));
}
}
@ -528,7 +528,7 @@ namespace BTCPayServer.Controllers
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> AddToken(AddTokenViewModel model)
public async Task<IActionResult> CreateToken(CreateTokenViewModel model)
{
if(!ModelState.IsValid)
{
@ -542,7 +542,7 @@ namespace BTCPayServer.Controllers
var link = pairing.CreateLink(url).ToString();
await _TokenRepository.PairWithAsync(pairing.ToString(), storeId);
StatusMessage = "New access token paired to this store";
return RedirectToAction("Tokens");
return RedirectToAction(nameof(ListTokens));
}
private async Task<string> GetStoreId()
@ -556,9 +556,9 @@ namespace BTCPayServer.Controllers
}
[HttpGet]
public IActionResult AddToken()
public IActionResult CreateToken()
{
var model = new AddTokenViewModel();
var model = new CreateTokenViewModel();
model.Facade = "merchant";
if(_Env.IsDevelopment())
{
@ -572,11 +572,11 @@ namespace BTCPayServer.Controllers
{
await _TokenRepository.DeleteToken(sin, name);
StatusMessage = "Token revoked";
return RedirectToAction("Tokens");
return RedirectToAction(nameof(ListTokens));
}
[HttpGet]
public async Task<IActionResult> Tokens()
public async Task<IActionResult> ListTokens()
{
var model = new TokensViewModel();
var tokens = await _TokenRepository.GetTokensByPairedIdAsync(await GetStoreId());

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace BTCPayServer.Models.ManageViewModels
{
public class AddTokenViewModel
public class CreateTokenViewModel
{
[PubKeyValidatorAttribute]
public string PublicKey

View File

@ -50,7 +50,7 @@
<td>@invoice.InvoiceId</td>
<td>@invoice.Status</td>
<td>@invoice.AmountCurrency</td>
<td><a asp-action="Payment" asp-route-invoiceId="@invoice.InvoiceId">Go to payment</a></td>
<td><a asp-action="Checkout" asp-route-invoiceId="@invoice.InvoiceId">Checkout</a></td>
</tr>
}
</tbody>

View File

@ -1,4 +1,4 @@
@model AddTokenViewModel
@model CreateTokenViewModel
@{
ViewData["Title"] = "Create a new token";
ViewData.AddActivePage(ManageNavPages.Tokens);
@ -8,7 +8,7 @@
<div class="row">
<div class="col-md-6">
<form asp-action="AddToken" method="post">
<form asp-action="CreateToken" method="post">
<div class="form-group">
<label asp-for="Label"></label>
<input asp-for="Label" class="form-control" />

View File

@ -9,7 +9,7 @@
@Html.Partial("_StatusMessage", Model.StatusMessage)
<div class="row">
<div class="col-md-9">
<a asp-action="AddToken" class="btn btn-success" role="button"><span class="glyphicon glyphicon-plus"></span>Create a new token</a>
<a asp-action="CreateToken" class="btn btn-success" role="button"><span class="glyphicon glyphicon-plus"></span>Create a new token</a>
<table class="table">
<thead class="thead-inverse">
<tr>

View File

@ -7,7 +7,7 @@
<ul class="nav nav-pills nav-stacked">
<li class="@ManageNavPages.IndexNavClass(ViewContext)"><a asp-action="Index">Profile</a></li>
<li class="@ManageNavPages.ChangePasswordNavClass(ViewContext)"><a asp-action="ChangePassword">Password</a></li>
<li class="@ManageNavPages.TokensNavClass(ViewContext)"><a asp-action="Tokens">Access Tokens</a></li>
<li class="@ManageNavPages.TokensNavClass(ViewContext)"><a asp-action="ListTokens">Access Tokens</a></li>
@if (hasExternalLogins)
{
<li class="@ManageNavPages.ExternalLoginsNavClass(ViewContext)"><a asp-action="ExternalLogins">External logins</a></li>