mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
Currency dropdown as part of page model
This commit is contained in:
parent
4afd55c441
commit
b562094956
@ -290,13 +290,21 @@ namespace BTCPayServer.Controllers
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
var settings = app.GetSettings<PointOfSaleSettings>();
|
var settings = app.GetSettings<PointOfSaleSettings>();
|
||||||
|
|
||||||
|
var store = await GetStore(app);
|
||||||
|
var paymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider)
|
||||||
|
.Select(a=>a.PaymentId.ToString()).ToList();
|
||||||
|
|
||||||
|
var currencyDropdown = new List<string>();
|
||||||
|
currencyDropdown.Add(settings.Currency);
|
||||||
|
currencyDropdown.AddRange(paymentMethods);
|
||||||
|
|
||||||
var model = new PayButtonViewModel
|
var model = new PayButtonViewModel
|
||||||
{
|
{
|
||||||
Price = 10,
|
Price = 10,
|
||||||
Currency = settings.Currency,
|
Currency = settings.Currency,
|
||||||
ButtonSize = 2,
|
ButtonSize = 2,
|
||||||
UrlRoot = "http://127.0.0.1:14142"
|
UrlRoot = "http://127.0.0.1:14142",
|
||||||
|
CurrencyDropdown = currencyDropdown
|
||||||
};
|
};
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace BTCPayServer.Controllers
|
|||||||
UserManager<ApplicationUser> _UserManager;
|
UserManager<ApplicationUser> _UserManager;
|
||||||
CurrencyNameTable _Currencies;
|
CurrencyNameTable _Currencies;
|
||||||
InvoiceController _InvoiceController;
|
InvoiceController _InvoiceController;
|
||||||
|
BTCPayNetworkProvider _NetworkProvider;
|
||||||
|
|
||||||
[TempData]
|
[TempData]
|
||||||
public string StatusMessage { get; set; }
|
public string StatusMessage { get; set; }
|
||||||
@ -32,12 +33,14 @@ namespace BTCPayServer.Controllers
|
|||||||
UserManager<ApplicationUser> userManager,
|
UserManager<ApplicationUser> userManager,
|
||||||
ApplicationDbContextFactory contextFactory,
|
ApplicationDbContextFactory contextFactory,
|
||||||
CurrencyNameTable currencies,
|
CurrencyNameTable currencies,
|
||||||
InvoiceController invoiceController)
|
InvoiceController invoiceController,
|
||||||
|
BTCPayNetworkProvider networkProvider)
|
||||||
{
|
{
|
||||||
_InvoiceController = invoiceController;
|
_InvoiceController = invoiceController;
|
||||||
_UserManager = userManager;
|
_UserManager = userManager;
|
||||||
_ContextFactory = contextFactory;
|
_ContextFactory = contextFactory;
|
||||||
_Currencies = currencies;
|
_Currencies = currencies;
|
||||||
|
_NetworkProvider = networkProvider;
|
||||||
}
|
}
|
||||||
public async Task<IActionResult> ListApps()
|
public async Task<IActionResult> ListApps()
|
||||||
{
|
{
|
||||||
|
@ -18,5 +18,6 @@ namespace BTCPayServer.Models.AppViewModels
|
|||||||
|
|
||||||
//
|
//
|
||||||
public string UrlRoot { get; set; }
|
public string UrlRoot { get; set; }
|
||||||
|
public List<string> CurrencyDropdown { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label> </label>
|
<label> </label>
|
||||||
<input type="text" class="form-control"
|
<select class="form-control" v-model="srvModel.currency" v-on:change="inputChanges">
|
||||||
v-model="srvModel.currency" v-on:change="inputChanges">
|
@foreach(var item in Model.CurrencyDropdown)
|
||||||
|
{
|
||||||
|
<option>@item</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
Loading…
Reference in New Issue
Block a user