2017-09-13 23:50:36 +09:00
|
|
|
@model BTCPayServer.Models.StoreViewModels.CreateStoreViewModel
|
|
|
|
@{
|
2021-12-16 11:17:02 +01:00
|
|
|
ViewData.SetActivePage(StoreNavPages.Create, "Create a new store");
|
2017-09-13 23:50:36 +09:00
|
|
|
}
|
2021-03-29 22:27:42 -07:00
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
@section PageFootContent {
|
|
|
|
<partial name="_ValidationScriptsPartial"/>
|
2022-12-14 13:33:27 +09:00
|
|
|
<script>
|
|
|
|
const exchanges = @Safe.Json(StoreBlob.RecommendedExchanges);
|
|
|
|
const recommended = document.querySelector("#PreferredExchange option[value='']")
|
|
|
|
const updateRecommended = currency => {
|
|
|
|
const source = exchanges[currency] || 'coingecko'
|
|
|
|
const name = source.charAt(0).toUpperCase() + source.slice(1)
|
|
|
|
recommended.innerText = `Recommended (${name})`
|
|
|
|
}
|
|
|
|
updateRecommended(@Safe.Json(Model.DefaultCurrency))
|
|
|
|
delegate('change', '#DefaultCurrency', e => updateRecommended(e.target.value))
|
|
|
|
</script>
|
2021-05-19 04:39:27 +02:00
|
|
|
}
|
|
|
|
|
2021-12-11 04:32:23 +01:00
|
|
|
<partial name="_StatusMessage" />
|
2021-04-08 15:32:42 +02:00
|
|
|
|
2022-01-24 18:07:52 -08:00
|
|
|
<h2 class="mt-1 mb-4">@ViewData["Title"]</h2>
|
2021-12-11 04:32:23 +01:00
|
|
|
<div class="row">
|
2022-01-27 03:56:46 +01:00
|
|
|
<div class="col-xl-8 col-xxl-constrain">
|
2021-12-11 04:32:23 +01:00
|
|
|
<form asp-action="CreateStore">
|
|
|
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Name" class="form-label" data-required></label>
|
2022-11-19 11:29:34 +01:00
|
|
|
<input asp-for="Name" class="form-control w-300px" required />
|
2021-12-11 04:32:23 +01:00
|
|
|
<span asp-validation-for="Name" class="text-danger"></span>
|
2017-10-27 17:53:04 +09:00
|
|
|
</div>
|
2022-01-20 17:35:25 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="DefaultCurrency" class="form-label" data-required></label>
|
2022-11-19 11:29:34 +01:00
|
|
|
<input asp-for="DefaultCurrency" class="form-control w-300px" currency-selection />
|
2022-01-20 17:35:25 +01:00
|
|
|
<span asp-validation-for="DefaultCurrency" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="PreferredExchange" class="form-label" data-required></label>
|
2022-11-19 11:29:34 +01:00
|
|
|
<select asp-for="PreferredExchange" asp-items="Model.Exchanges" class="form-select w-300px"></select>
|
2022-12-14 13:33:27 +09:00
|
|
|
<div class="form-text mt-2 only-for-js">The recommended price source gets chosen based on the default currency.</div>
|
2022-01-20 17:35:25 +01:00
|
|
|
<span asp-validation-for="PreferredExchange" class="text-danger"></span>
|
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
<div class="form-group mt-4">
|
|
|
|
<input type="submit" value="Create" class="btn btn-primary" id="Create" />
|
|
|
|
</div>
|
|
|
|
</form>
|
2017-10-27 17:53:04 +09:00
|
|
|
</div>
|
2021-12-11 04:32:23 +01:00
|
|
|
</div>
|