2019-02-24 09:26:37 +01:00
|
|
|
@using BTCPayServer.Services.PaymentRequests
|
2019-05-07 10:01:37 +02:00
|
|
|
@using System.Globalization
|
2019-01-14 22:43:29 +01:00
|
|
|
@model BTCPayServer.Models.PaymentRequestViewModels.UpdatePaymentRequestViewModel
|
2019-03-24 01:10:16 +01:00
|
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
2019-01-14 22:43:29 +01:00
|
|
|
<section>
|
|
|
|
<div class="container">
|
|
|
|
<div class="row">
|
2019-11-01 21:55:05 +01:00
|
|
|
<div class="col-lg-12 section-heading">
|
|
|
|
<h2>@(string.IsNullOrEmpty(Model.Id) ? "Create" : "Edit") Payment Request</h2>
|
2019-01-14 22:43:29 +01:00
|
|
|
<hr class="primary">
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-10-31 04:29:59 +01:00
|
|
|
@if (TempData.HasStatusMessage())
|
2019-06-06 11:47:31 +02:00
|
|
|
{
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 text-center">
|
2019-10-31 04:29:59 +01:00
|
|
|
<partial name="_StatusMessage" />
|
2019-06-06 11:47:31 +02:00
|
|
|
</div>
|
2019-01-14 22:43:29 +01:00
|
|
|
</div>
|
2019-06-06 11:47:31 +02:00
|
|
|
}
|
2019-01-14 22:43:29 +01:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
2019-03-07 06:27:16 +01:00
|
|
|
<form method="post" action="@Url.Action("EditPaymentRequest", "PaymentRequest", new { id = Model.Id}, Context.Request.Scheme)">
|
2019-06-06 11:47:31 +02:00
|
|
|
<input type="hidden" name="Id" value="@Model.Id" />
|
2019-01-14 22:43:29 +01:00
|
|
|
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Title" class="control-label"></label>*
|
2019-06-06 11:47:31 +02:00
|
|
|
<input asp-for="Title" class="form-control" />
|
2019-01-14 22:43:29 +01:00
|
|
|
<span asp-validation-for="Title" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Amount" class="control-label"></label>*
|
2019-06-06 11:47:31 +02:00
|
|
|
<input type="number" step="any" asp-for="Amount" class="form-control" />
|
2019-01-14 22:43:29 +01:00
|
|
|
<span asp-validation-for="Amount" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Currency" class="control-label"></label>*
|
2019-06-06 11:47:31 +02:00
|
|
|
<input asp-for="Currency" class="form-control" />
|
2019-01-14 22:43:29 +01:00
|
|
|
<span asp-validation-for="Currency" class="text-danger"></span>
|
|
|
|
</div>
|
2019-11-09 04:12:14 +01:00
|
|
|
<div class="form-group form-check">
|
|
|
|
<input asp-for="AllowCustomPaymentAmounts" type="checkbox" class="form-check-input" />
|
|
|
|
<label asp-for="AllowCustomPaymentAmounts" class="form-check-label"></label>
|
2019-01-14 22:43:29 +01:00
|
|
|
<span asp-validation-for="AllowCustomPaymentAmounts" class="text-danger"></span>
|
2019-02-22 11:37:45 +01:00
|
|
|
</div>
|
2019-01-14 22:43:29 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="StoreId" class="control-label"></label>
|
|
|
|
@if (string.IsNullOrEmpty(Model.Id))
|
|
|
|
{
|
|
|
|
<select asp-for="StoreId" asp-items="Model.Stores" class="form-control"></select>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-06 11:47:31 +02:00
|
|
|
<input type="hidden" asp-for="StoreId" value="@Model.StoreId" />
|
|
|
|
<input type="text" class="form-control" value="@Model.Stores.Single(item => item.Value == Model.StoreId).Text" readonly />
|
2019-01-14 22:43:29 +01:00
|
|
|
}
|
|
|
|
<span asp-validation-for="StoreId" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Email" class="control-label"></label>
|
|
|
|
<input type="email" asp-for="Email" class="form-control"></input>
|
|
|
|
<span asp-validation-for="Email" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="ExpiryDate" class="control-label"></label>
|
|
|
|
<div class="input-group ">
|
2019-06-06 11:47:31 +02:00
|
|
|
<input asp-for="ExpiryDate"
|
2019-05-07 10:01:37 +02:00
|
|
|
value="@( Model.ExpiryDate?.ToString("u", CultureInfo.InvariantCulture))"
|
2019-06-06 11:47:31 +02:00
|
|
|
class="form-control flatdtpicker" min="today" placeholder="No expiry date has been set for this payment request" />
|
2019-03-07 06:29:29 +01:00
|
|
|
<div class="input-group-append">
|
2019-01-14 22:43:29 +01:00
|
|
|
<button class="btn btn-secondary input-group-clear" type="button" title="Clear">
|
|
|
|
<span class=" fa fa-times"></span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<span asp-validation-for="ExpiryDate" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="Description" class="control-label"></label>
|
|
|
|
<textarea asp-for="Description" class="form-control richtext"></textarea>
|
|
|
|
<span asp-validation-for="Description" class="text-danger"></span>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="CustomCSSLink" class="control-label"></label>
|
2019-02-22 11:37:45 +01:00
|
|
|
<a href="https://docs.btcpayserver.org/development/theme#bootstrap-themes" target="_blank">
|
|
|
|
<span class="fa fa-question-circle-o" title="More information..."></span>
|
|
|
|
</a>
|
2019-06-06 11:47:31 +02:00
|
|
|
<input asp-for="CustomCSSLink" class="form-control" />
|
2019-01-14 22:43:29 +01:00
|
|
|
<span asp-validation-for="CustomCSSLink" class="text-danger"></span>
|
2019-02-22 11:37:45 +01:00
|
|
|
</div>
|
2019-01-14 22:43:29 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label asp-for="EmbeddedCSS" class="control-label"></label>
|
|
|
|
<textarea asp-for="EmbeddedCSS" rows="10" cols="40" class="form-control"></textarea>
|
|
|
|
<span asp-validation-for="EmbeddedCSS" class="text-danger"></span>
|
2019-02-22 11:37:45 +01:00
|
|
|
</div>
|
2019-01-14 22:43:29 +01:00
|
|
|
<div class="form-group">
|
2019-05-12 10:13:26 +02:00
|
|
|
<button type="submit" class="btn btn-primary" id="SaveButton">Save</button>
|
2019-02-22 11:37:45 +01:00
|
|
|
@if (!string.IsNullOrEmpty(Model.Id))
|
|
|
|
{
|
2019-05-12 10:13:26 +02:00
|
|
|
<a class="btn btn-secondary" target="_blank" asp-action="ViewPaymentRequest" id="@Model.Id" name="ViewAppButton">View</a>
|
2019-06-06 11:47:31 +02:00
|
|
|
<a class="btn btn-secondary"
|
2019-02-24 09:26:37 +01:00
|
|
|
target="_blank"
|
|
|
|
asp-action="ListInvoices"
|
2019-06-06 11:47:31 +02:00
|
|
|
asp-controller="Invoice"
|
2019-02-24 09:26:37 +01:00
|
|
|
asp-route-searchterm="@($"orderid:{PaymentRequestRepository.GetOrderIdForPaymentRequest(Model.Id)}")">Invoices</a>
|
2019-06-06 11:47:31 +02:00
|
|
|
<a class="btn btn-secondary" asp-action="ClonePaymentRequest" id="@Model.Id">Clone</a>
|
2019-02-22 11:37:45 +01:00
|
|
|
}
|
2019-01-14 22:43:29 +01:00
|
|
|
<a class="btn btn-secondary" target="_blank" asp-action="GetPaymentRequests">Back to list</a>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
@section Scripts {
|
2019-06-06 11:47:31 +02:00
|
|
|
<script src="~/vendor/moment/moment.js"></script>
|
2019-01-14 22:43:29 +01:00
|
|
|
<bundle name="wwwroot/bundles/payment-request-admin-bundle.min.js"></bundle>
|
|
|
|
<bundle name="wwwroot/bundles/payment-request-admin-bundle.min.css"></bundle>
|
|
|
|
}
|