Add contribution payment options to registries
- Added support for single and amount-specific QR codes. - Updated `RegistrySettings` model and database schema. - Enhanced `RegistryAdmin` to configure payment options. - Introduced `RegistryContributionAmount` for partial fulfillment. - Updated `RegistryPublic` to display contribution progress. - Added new models for payment methods and QR code handling. - Improved privacy by limiting contributor visibility.
This commit is contained in:
@@ -247,6 +247,50 @@ else
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<h3>Contribution Payment Options</h3>
|
||||
<div class="row g-3 mt-2">
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Single QR code URL</label>
|
||||
<InputText class="form-control" @bind-Value="SettingsModel.ContributionQrCodeUrl" />
|
||||
<small class="form-text text-muted">Optional: one QR code that donors can scan for any amount.</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h4 class="mb-0">Amount-specific QR codes</h4>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" @onclick="AddContributionAmountQrCode">Add QR amount</button>
|
||||
</div>
|
||||
|
||||
@if (SettingsModel.ContributionAmountQrCodes.Count == 0)
|
||||
{
|
||||
<p class="text-muted mt-2 mb-0">No amount-specific QR codes configured.</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="mt-2 d-flex flex-column gap-2">
|
||||
@foreach (var amountQr in SettingsModel.ContributionAmountQrCodes)
|
||||
{
|
||||
<div class="row g-2 align-items-end">
|
||||
<div class="col-md-3">
|
||||
<label class="form-label">Amount</label>
|
||||
<InputNumber class="form-control" @bind-Value="amountQr.Amount" />
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-label">QR code URL</label>
|
||||
<InputText class="form-control" @bind-Value="amountQr.QrCodeUrl" />
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="btn btn-outline-danger w-100" @onclick="() => RemoveContributionAmountQrCode(amountQr)">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary mt-4" type="submit">Save settings</button>
|
||||
</EditForm>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user