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();
|
||||
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
|
||||
{
|
||||
Price = 10,
|
||||
Currency = settings.Currency,
|
||||
ButtonSize = 2,
|
||||
UrlRoot = "http://127.0.0.1:14142"
|
||||
UrlRoot = "http://127.0.0.1:14142",
|
||||
CurrencyDropdown = currencyDropdown
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ namespace BTCPayServer.Controllers
|
||||
UserManager<ApplicationUser> _UserManager;
|
||||
CurrencyNameTable _Currencies;
|
||||
InvoiceController _InvoiceController;
|
||||
BTCPayNetworkProvider _NetworkProvider;
|
||||
|
||||
[TempData]
|
||||
public string StatusMessage { get; set; }
|
||||
@ -32,12 +33,14 @@ namespace BTCPayServer.Controllers
|
||||
UserManager<ApplicationUser> userManager,
|
||||
ApplicationDbContextFactory contextFactory,
|
||||
CurrencyNameTable currencies,
|
||||
InvoiceController invoiceController)
|
||||
InvoiceController invoiceController,
|
||||
BTCPayNetworkProvider networkProvider)
|
||||
{
|
||||
_InvoiceController = invoiceController;
|
||||
_UserManager = userManager;
|
||||
_ContextFactory = contextFactory;
|
||||
_Currencies = currencies;
|
||||
_NetworkProvider = networkProvider;
|
||||
}
|
||||
public async Task<IActionResult> ListApps()
|
||||
{
|
||||
|
@ -18,5 +18,6 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
|
||||
//
|
||||
public string UrlRoot { get; set; }
|
||||
public List<string> CurrencyDropdown { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,12 @@
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label> </label>
|
||||
<input type="text" class="form-control"
|
||||
v-model="srvModel.currency" v-on:change="inputChanges">
|
||||
<select class="form-control" v-model="srvModel.currency" v-on:change="inputChanges">
|
||||
@foreach(var item in Model.CurrencyDropdown)
|
||||
{
|
||||
<option>@item</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
Loading…
Reference in New Issue
Block a user