Merge pull request #77 from btcpayserver/cleanup_email
Make verify email a partial class for re-use
This commit is contained in:
commit
5a80b8d1df
@ -37,7 +37,7 @@ public class AccountController(
|
||||
|
||||
var action = nameof(HomeController.VerifyEmail);
|
||||
var ctrl = nameof(HomeController).Replace("Controller", "");
|
||||
return RedirectToAction(action, ctrl);
|
||||
return RedirectToAction(action, ctrl, new { email = user.Email! });
|
||||
}
|
||||
|
||||
return RedirectToAction(nameof(AccountDetails));
|
||||
|
||||
@ -135,7 +135,10 @@ public class HomeController(
|
||||
new { uid = user.Id, token }, Request.Scheme, Request.Host.ToString())!;
|
||||
var email = user.Email!;
|
||||
await emailService.SendVerifyEmail(email, link);
|
||||
return RedirectToAction(nameof(VerifyEmail), new { email, sent = true });
|
||||
ViewData["VerifyEmailTitle"] = "Email confirmation required to sign in";
|
||||
ViewData["VerifyEmailDescription"] =
|
||||
"After you confirm your email, please sign in again to continue.";
|
||||
return View(nameof(VerifyEmail), model: email);
|
||||
}
|
||||
|
||||
await signInManager.SignInAsync(user, isPersistent: model.RememberMe);
|
||||
|
||||
@ -4,11 +4,15 @@
|
||||
Layout = "_LayoutPublicModal";
|
||||
}
|
||||
|
||||
|
||||
|
||||
<partial name="_PublicHeader" />
|
||||
|
||||
<div class="container">
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 text-center">
|
||||
<h3 class="display-5 fw-bold">BTCPay Server Plugin Directory</h3>
|
||||
<p class="text-muted">Extend and customize your BTCPay Server with community and official plugins.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4">
|
||||
<form method="get" asp-action="AllPlugins">
|
||||
<div class="input-group">
|
||||
@ -17,28 +21,31 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="row">
|
||||
@foreach (var plugin in Model)
|
||||
@if (Model != null && Model.Any())
|
||||
{
|
||||
var owner = @plugin.GetGithubRepository()?.Owner;
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100 plugin-card" data-type="community">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div style="display: flex; align-items: flex-start; margin-bottom: 20px;">
|
||||
<div style="margin-right: 15px;">
|
||||
<partial name="_PluginLogo" model="plugin" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin-top: 0; margin-bottom: 5px;">
|
||||
<a asp-action="GetPluginDetails" asp-route-pluginSlug="@plugin.ProjectSlug">@plugin.ManifestInfo["Name"]?.ToString()</a>
|
||||
</h3>
|
||||
<p style="margin-bottom: 5px;">@plugin.ManifestInfo["Description"]?.ToString()</p>
|
||||
<div style="font-size: 0.875em; color: #6c757d;">
|
||||
<div style="margin-bottom: 3px;">
|
||||
<span>by <a href="https://github.com/@owner" rel="noreferrer noopener" target="_blank">@owner</a></span>
|
||||
</div>
|
||||
<div>
|
||||
Latest Version: @plugin.Version
|
||||
@foreach (var plugin in Model)
|
||||
{
|
||||
var owner = @plugin.GetGithubRepository()?.Owner;
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card h-100 plugin-card" data-type="community">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div style="display: flex; align-items: flex-start; margin-bottom: 20px;">
|
||||
<div style="margin-right: 15px;">
|
||||
<partial name="_PluginLogo" model="plugin" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 style="margin-top: 0; margin-bottom: 5px;">
|
||||
<a asp-action="GetPluginDetails" asp-route-pluginSlug="@plugin.ProjectSlug">@plugin.ManifestInfo["Name"]?.ToString()</a>
|
||||
</h3>
|
||||
<p style="margin-bottom: 5px;">@plugin.ManifestInfo["Description"]?.ToString()</p>
|
||||
<div style="font-size: 0.875em; color: #6c757d;">
|
||||
<div style="margin-bottom: 3px;">
|
||||
<span>by <a href="https://github.com/@owner" rel="noreferrer noopener" target="_blank">@owner</a></span>
|
||||
</div>
|
||||
<div>
|
||||
Latest Version: @plugin.Version
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -46,8 +53,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-12 text-center py-5">
|
||||
<h4>No plugins available yet</h4>
|
||||
<p class="text-muted">Check back later, or login to upload one.</p>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,19 +1,7 @@
|
||||
@model string
|
||||
@{
|
||||
ViewData["Title"] = "Verify Email Address";
|
||||
Layout = "_LayoutHomeModal";
|
||||
Layout = "_LayoutHomeModal";
|
||||
ViewData["VerifyEmailLayout"] = Layout;
|
||||
}
|
||||
<div class="row justify-content-center mb-2">
|
||||
<div class="col text-center">
|
||||
<a tabindex="-1" href="/">
|
||||
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="mb-4" height="70" />
|
||||
</a>
|
||||
<h1 class="h2 mb-3">@ViewData["Title"]</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="account-form">
|
||||
<p class="text-center mt-2 mb-0">
|
||||
Please check <b>@Model</b> email address for verification email from us!<br />
|
||||
If you find it in spam, please mark it as not spam to receive future emails from us.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<partial name="_VerifyEmailTemplate" model="Model" />
|
||||
|
||||
26
PluginBuilder/Views/Shared/_VerifyEmailTemplate.cshtml
Normal file
26
PluginBuilder/Views/Shared/_VerifyEmailTemplate.cshtml
Normal file
@ -0,0 +1,26 @@
|
||||
@model string
|
||||
@{
|
||||
Layout = ViewData["VerifyEmailLayout"] as string ?? "_Layout";
|
||||
var title = ViewData["VerifyEmailTitle"] as string ?? "Verify Email to use Plugin Builder";
|
||||
var description = ViewData["VerifyEmailDescription"] as string;
|
||||
}
|
||||
<div class="row justify-content-center mb-2">
|
||||
<div class="col text-center">
|
||||
<a tabindex="-1" href="/">
|
||||
<img src="~/img/btcpay-logo.svg" alt="BTCPay Server" class="mb-4" height="70" />
|
||||
</a>
|
||||
<h1 class="h2 mb-3">@title</h1>
|
||||
</div>
|
||||
</div>
|
||||
<div class="account-form">
|
||||
<p class="text-center mt-2 mb-0">
|
||||
Please check your email: <b>@Model</b> for verification email from us!<br />
|
||||
If you find it in spam, please mark it as not spam to receive future emails from us.
|
||||
</p>
|
||||
@if (!string.IsNullOrEmpty(description))
|
||||
{
|
||||
<p class="text-center mt-2 mb-0">
|
||||
@description
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user