Fix "Configure Email Settings warning link not working" (Fix https://github.com/btcpayserver/btcpayserver/issues/906)

This commit is contained in:
nicolas.dorier 2019-07-14 22:54:27 +09:00
parent 010ba4d5b6
commit 8d3cdd39ca
No known key found for this signature in database
GPG key ID: 6618763EF09186FE
7 changed files with 9 additions and 3 deletions

View file

@ -36,6 +36,7 @@ namespace BTCPayServer.Controllers
{
NotificationEmailWarning = !await IsEmailConfigured(app.StoreDataId),
Title = settings.Title,
StoreId = app.StoreDataId,
Enabled = settings.Enabled,
EnforceTargetAmount = settings.EnforceTargetAmount,
StartDate = settings.StartDate,

View file

@ -96,6 +96,7 @@ namespace BTCPayServer.Controllers
{
NotificationEmailWarning = !await IsEmailConfigured(app.StoreDataId),
Id = appId,
StoreId = app.StoreDataId,
Title = settings.Title,
EnableShoppingCart = settings.EnableShoppingCart,
ShowCustomAmount = settings.ShowCustomAmount,

View file

@ -9,6 +9,7 @@ namespace BTCPayServer.Models.AppViewModels
{
public class UpdateCrowdfundViewModel
{
public string StoreId { get; set; }
[Required] [MaxLength(30)] public string Title { get; set; }
[MaxLength(50)] public string Tagline { get; set; }

View file

@ -7,6 +7,7 @@ namespace BTCPayServer.Models.AppViewModels
{
public class UpdatePointOfSaleViewModel
{
public string StoreId { get; set; }
[Required]
[MaxLength(30)]
public string Title { get; set; }

View file

@ -41,6 +41,7 @@
<div class="row">
<div class="col-lg-12">
<form method="post">
<input type="hidden" asp-for="StoreId" />
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Title" class="control-label"></label>*
@ -146,7 +147,7 @@
<label asp-for="NotificationEmail" class="control-label"></label>
@if (Model.NotificationEmailWarning)
{
<partial name="NotificationEmailWarning"></partial>
<partial name="NotificationEmailWarning" model="@Model.StoreId"></partial>
}
<input type="email" asp-for="NotificationEmail" class="form-control" />
<span asp-validation-for="NotificationEmail" class="text-danger"></span>

View file

@ -40,6 +40,7 @@
<div class="row">
<div class="col-lg-12">
<form method="post">
<input type="hidden" asp-for="StoreId" />
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Title" class="control-label"></label>*
@ -119,7 +120,7 @@
<label asp-for="NotificationEmail" class="control-label"></label>
@if (Model.NotificationEmailWarning)
{
<partial name="NotificationEmailWarning"></partial>
<partial name="NotificationEmailWarning" model="@Model.StoreId"></partial>
}
<input type="email" asp-for="NotificationEmail" class="form-control" />
<span asp-validation-for="NotificationEmail" class="text-danger"></span>

View file

@ -1,5 +1,5 @@
<div class="alert alert-warning alert-dismissible">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>The Email settings have not been configured on this server or store yet. Setting this field will not send emails until then. <a asp-action="Emails" asp-controller="Stores">Configure store email settings</a>
</button>The Email settings have not been configured on this server or store yet. Setting this field will not send emails until then. <a asp-action="Emails" asp-controller="Stores" asp-route-storeId="@Model">Configure store email settings</a>
</div>