<commit_before>@using BTCPayServer.Services
@model BTCPayServer.Services.PoliciesSettings
@{
    ViewData.SetActivePageAndTitle(ServerNavPages.Policies);
}


<partial name="_StatusMessage"/>
@if (!this.ViewContext.ModelState.IsValid)
{
    <div asp-validation-summary="All" class="text-danger"></div>
}

<form method="post">
    <div class="form-group">
        <div class="form-check">
            <input asp-for="RequiresConfirmedEmail" type="checkbox" class="form-check-input"/>
            <label asp-for="RequiresConfirmedEmail" class="form-check-label"></label>
            <span asp-validation-for="RequiresConfirmedEmail" class="text-danger"></span>
        </div>
        <div class="form-check">
            <input asp-for="LockSubscription" type="checkbox" class="form-check-input"/>
            <label asp-for="LockSubscription" class="form-check-label"></label>
            <span asp-validation-for="LockSubscription" class="text-danger"></span>
        </div>
        <div class="form-check">
            <input asp-for="DiscourageSearchEngines" type="checkbox" class="form-check-input"/>
            <label asp-for="DiscourageSearchEngines" class="form-check-label"></label>
            <span asp-validation-for="DiscourageSearchEngines" class="text-danger"></span>
        </div><commit_msg>Add warning to configure e-mail server (#2024)<commit_after>@using BTCPayServer.Services
@using BTCPayServer.Services.Mails;
@model BTCPayServer.Services.PoliciesSettings
@inject BTCPayServer.Services.SettingsRepository _SettingsRepository
@{
    ViewData.SetActivePageAndTitle(ServerNavPages.Policies);
}


<partial name="_StatusMessage"/>
@if (!this.ViewContext.ModelState.IsValid)
{
    <div asp-validation-summary="All" class="text-danger"></div>
}

<form method="post">
    <div class="form-group">
        <div class="form-check">
            @{
                var emailSettings = (await _SettingsRepository.GetSettingAsync<EmailSettings>()) ?? new EmailSettings();
                /**
                 * The "|| Model.RequiresConfirmedEmail" check is for the case when a user had checked
                 * the checkbox without first configuring the e-mail settings so that they can uncheck it.
                 **/
                var isEmailConfigured = emailSettings.IsComplete() || Model.RequiresConfirmedEmail;
            }
            <input asp-for="RequiresConfirmedEmail" type="checkbox" class="form-check-input" disabled="@(isEmailConfigured ? null : "disabled")" />
            <label asp-for="RequiresConfirmedEmail" class="form-check-label"></label>
            <span asp-validation-for="RequiresConfirmedEmail" class="text-danger"></span>
            @if (!isEmailConfigured) {
                <div>
                    <span class="text-secondary">Your email server has not been configured. <a asp-controller="Server" asp-action="Emails">Please configure it first.</a></span>
                </div>
            }
        </div>
        <div class="form-check">
            <input asp-for="LockSubscription" type="checkbox" class="form-check-input"/>
            <label asp-for="LockSubscription" class="form-check-label"></label>
            <span asp-validation-for="LockSubscription" class="text-danger"></span>
        </div>
        <div class="form-check">
            <input asp-for="DiscourageSearchEngines" type="checkbox" class="form-check-input"/>
            <label asp-for="DiscourageSearchEngines" class="form-check-label"></label>
            <span asp-validation-for="DiscourageSearchEngines" class="text-danger"></span>
        </div>
{'fraction_non_alphanumeric': 0.1449315833566043, 'fraction_numerical': 0.001117006422786931, 'mean_word_length': 3.093714285714286, 'pattern_counts': {'":': 0, '<': 62, '<?xml version=': 0, '>': 62, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '514163', 'n_tokens_mistral': 1009, 'n_tokens_neox': 986, 'n_words': 177}