mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-22 07:24:29 +01:00
* Mark Payouts as Paid This PR allows users to mark payouts as paid manually through the UI and through the API. It also sets up the payout proof system to be able store a manual proof that will in a later PR allow you to specify a proof of payment (link or text) * add docs, test and greenfield client * remove extra docs stuff * Update BTCPayServer.Tests/GreenfieldAPITests.cs Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com> * clean up pull payment/payouts fetch code * Ensure payoutis are retrieved with pull payment Co-authored-by: britttttk <39231115+britttttk@users.noreply.github.com>
198 lines
11 KiB
Plaintext
198 lines
11 KiB
Plaintext
@using NUglify.Helpers
|
|
@model BTCPayServer.Models.ViewPullPaymentModel
|
|
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
|
@inject BTCPayServer.Services.BTCPayServerEnvironment env
|
|
@inject BTCPayServer.HostedServices.CssThemeManager themeManager
|
|
@{
|
|
ViewData["Title"] = Model.Title;
|
|
Layout = null;
|
|
|
|
string StatusTextClass(string status)
|
|
{
|
|
switch (status)
|
|
{
|
|
case "Completed":
|
|
case "In Progress":
|
|
return "text-success";
|
|
case "Cancelled":
|
|
return "text-danger";
|
|
default:
|
|
return "text-warning";
|
|
}
|
|
}
|
|
}
|
|
<!DOCTYPE html>
|
|
<html lang="en" @(env.IsDeveloping ? " data-devenv" : "")>
|
|
<head>
|
|
<title>@ViewData["Title"]</title>
|
|
<meta charset="utf-8" />
|
|
<meta name="robots" content="noindex, nofollow">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<link href="@Context.Request.GetRelativePathOrAbsolute(themeManager.BootstrapUri)" rel="stylesheet" />
|
|
<link href="@Context.Request.GetRelativePathOrAbsolute(themeManager.ThemeUri)" rel="stylesheet" />
|
|
<bundle name="wwwroot/bundles/payment-request-bundle.min.css" asp-append-version="true"></bundle>
|
|
@if (Model.CustomCSSLink != null)
|
|
{
|
|
<link href="@Model.CustomCSSLink" rel="stylesheet" />
|
|
}
|
|
@Safe.Raw(Model.EmbeddedCSS)
|
|
<script src="~/js/copy-to-clipboard.js" asp-append-version="true"></script>
|
|
<noscript>
|
|
<style>
|
|
.hide-when-js, [v-cloak] { display: block !important; }
|
|
.only-for-js { display: none !important; }
|
|
</style>
|
|
</noscript>
|
|
</head>
|
|
<body>
|
|
<div class="min-vh-100 d-flex flex-column">
|
|
@if (Model.IsPending)
|
|
{
|
|
<nav id="mainNav" class="navbar sticky-top py-3 py-lg-4 d-print-none">
|
|
<div class="container">
|
|
<form asp-action="ClaimPullPayment" asp-route-pullPaymentId="@Model.Id" class="w-100">
|
|
<div class="row align-items-center" style="width:calc(100% + 30px)">
|
|
<div class="col-12 mb-3 col-lg-6 mb-lg-0">
|
|
<input class="form-control form-control-lg font-monospace w-100" asp-for="Destination" placeholder="Enter destination address to claim funds …" required style="font-size:.9rem;height:42px;">
|
|
</div>
|
|
<div class="col-12 mb-3 col-sm-6 mb-sm-0 col-lg-3">
|
|
<div class="input-group">
|
|
<input type="number" class="form-control form-control-lg text-end hide-number-spin" asp-for="ClaimedAmount" max="@Model.AmountDue" min="@Model.MinimumClaim" step="any" placeholder="Amount" required>
|
|
<span class="input-group-text px-3">@Model.Currency.ToUpper()</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-12 col-sm-6 col-lg-3">
|
|
<button class="btn btn-lg btn-primary w-100 text-nowrap" type="submit">Claim Funds</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
}
|
|
|
|
<main class="flex-grow-1 py-4">
|
|
<div class="container">
|
|
<partial name="_StatusMessage" model="@(new ViewDataDictionary(ViewData){ { "Margin", "mb-4" } })" />
|
|
@if (!ViewContext.ModelState.IsValid)
|
|
{
|
|
@Html.ValidationSummary(string.Empty, new { @class = "alert alert-danger mb-4 pb-0 text-center" })
|
|
}
|
|
<div class="row">
|
|
<div class="col col-12 col-lg-6 mb-4">
|
|
<div class="bg-tile h-100 m-0 p-3 p-sm-5">
|
|
@if (!Model.Title.IsNullOrWhiteSpace())
|
|
{
|
|
<h2 class="h4 mb-3">@Model.Title</h2>
|
|
}
|
|
<div class="d-flex align-items-center">
|
|
<span class="text-muted text-nowrap">Start Date</span>
|
|
|
|
<span class="text-nowrap">@Model.StartDate.ToString("g")</span>
|
|
</div>
|
|
<div class="d-flex align-items-center">
|
|
<span class="text-muted text-nowrap">Last Updated</span>
|
|
|
|
<span class="text-nowrap">@Model.LastRefreshed.ToString("g")</span>
|
|
<button type="button" class="btn btn-link d-none d-lg-inline-block d-print-none border-0 p-0 ms-4 only-for-js" id="copyLink">
|
|
Copy Link
|
|
</button>
|
|
</div>
|
|
@if (!string.IsNullOrEmpty(Model.ResetIn))
|
|
{
|
|
<p>
|
|
<span class="text-muted text-nowrap">Reset in</span>
|
|
|
|
<span class="text-nowrap">@Model.ResetIn</span>
|
|
</p>
|
|
}
|
|
@if (!string.IsNullOrEmpty(Model.Description) && Model.Description != "<br>")
|
|
{
|
|
<div>@Safe.Raw(Model.Description)</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
<div class="col col-12 col-lg-6 mb-4">
|
|
<div class="bg-tile h-100 m-0 p-3 p-sm-5">
|
|
<h2 class="h4 mb-3">Payment Details</h2>
|
|
<dl class="mb-0 mt-md-4">
|
|
<div class="d-flex d-print-inline-block flex-column mb-4 me-5">
|
|
<dt class="h4 fw-normal text-nowrap text-primary text-print-default order-2 order-sm-1 mb-0">@Model.AmountDueFormatted</dt>
|
|
<dd class="text-muted order-1 order-sm-2 mb-1">Available claim</dd>
|
|
</div>
|
|
<div class="progress bg-light d-none d-sm-flex mb-sm-4 d-print-none" style="height:5px">
|
|
<div class="progress-bar bg-primary" role="progressbar" style="width:@((Model.AmountCollected / Model.Amount) * 100)%"></div>
|
|
</div>
|
|
<div class="d-flex d-print-inline-block flex-column mb-4 me-5 d-sm-inline-flex mb-sm-0">
|
|
<dt class="h4 fw-normal text-nowrap order-2 order-sm-1 mb-0">@Model.AmountCollectedFormatted</dt>
|
|
<dd class="text-muted order-1 order-sm-2 mb-1">Already claimed</dd>
|
|
</div>
|
|
<div class="d-flex d-print-inline-block flex-column mb-0 d-sm-inline-flex float-sm-end">
|
|
<dt class="h4 text-sm-end fw-normal text-nowrap order-2 order-sm-1 mb-0">@Model.AmountFormatted</dt>
|
|
<dd class="text-muted text-sm-end order-1 order-sm-2 mb-1">Claim limit</dd>
|
|
</div>
|
|
</dl>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="bg-tile h-100 m-0 p-3 p-sm-5">
|
|
<h2 class="h4 mb-3">Claims</h2>
|
|
<div class="table-responsive">
|
|
@if (Model.Payouts.Any())
|
|
{
|
|
<table class="table my-0">
|
|
<thead>
|
|
<tr class="table-borderless">
|
|
<th class="fw-normal text-secondary" scope="col">Destination</th>
|
|
<th class="fw-normal text-secondary text-end text-nowrap">Amount requested</th>
|
|
<th class="fw-normal text-secondary text-end">Status</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (var invoice in Model.Payouts)
|
|
{
|
|
<tr>
|
|
<td class="text-break">
|
|
@invoice.Destination
|
|
</td>
|
|
<td class="text-end">@invoice.AmountFormatted</td>
|
|
<td class="text-end text-nowrap">
|
|
@if (!string.IsNullOrEmpty(invoice.Link))
|
|
{
|
|
<a class="transaction-link text-print-default @StatusTextClass(invoice.Status.ToString())" href="@invoice.Link">@invoice.Status.GetStateString()</a>
|
|
}
|
|
else
|
|
{
|
|
<span class="text-print-default @StatusTextClass(invoice.Status.ToString())">@invoice.Status.GetStateString()</span>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
}
|
|
else
|
|
{
|
|
<p class="text-muted">No claim made yet.</p>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<footer class="pt-2 pb-4 d-print-none">
|
|
<div class="container text-center">
|
|
Powered by <a href="https://btcpayserver.org" target="_blank">BTCPay Server</a>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
<script>
|
|
document.getElementById("copyLink").addEventListener("click", window.copyUrlToClipboard);
|
|
</script>
|
|
</body>
|
|
</html>
|