ad8730c752
Co-authored-by: Cursor <cursoragent@cursor.com>
54 lines
3.7 KiB
HTML
54 lines
3.7 KiB
HTML
{% load i18n %}
|
|
<div id="email-connect-panel" style="max-width:32rem; background:var(--color-card); border-radius:0.75rem; border:1px solid var(--color-border); padding:1.5rem; box-shadow:0 1px 2px rgb(0 0 0/0.05);">
|
|
{% if adding_mailbox %}
|
|
<h2 style="font-size:1rem; font-weight:500; margin-bottom:0.5rem;">{% trans "Подключить ещё один ящик" %}</h2>
|
|
<p style="font-size:0.8125rem; color:var(--color-muted-foreground); margin-bottom:1rem;">
|
|
{% trans "Добавьте другой почтовый адрес. Текущий ящик не изменится — потом можно переключаться между ними." %}
|
|
</p>
|
|
{% else %}
|
|
<h2 style="font-size:1rem; font-weight:500; margin-bottom:0.5rem;">{% trans "Подключение ящика" %}</h2>
|
|
<p style="font-size:0.8125rem; color:var(--color-muted-foreground); margin-bottom:1rem;">
|
|
{% trans "Подключите свою почту: укажите адрес и пароль. Параметры сервера определяются автоматически (как в Thunderbird);" %}
|
|
{% if mail_defaults %}{% blocktrans with host=mail_defaults.imap_host %}если автоконфиг не найден — попробуем <strong>{{ host }}</strong>.{% endblocktrans %}{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
{% if connect_error %}
|
|
<div style="background:color-mix(in srgb, var(--color-destructive) 8%, transparent); border:1px solid color-mix(in srgb, var(--color-destructive) 30%, transparent); border-radius:0.5rem; padding:0.75rem 1rem; margin-bottom:1rem; font-size:0.8125rem; color:var(--color-destructive); line-height:1.45;">
|
|
{{ connect_error }}
|
|
{% if connect_error_detail %}
|
|
<div style="margin-top:0.35rem; opacity:0.85; font-size:0.75rem;">{{ connect_error_detail }}</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
<form hx-post="/email/connect/" hx-target="#email-connect-panel" hx-swap="outerHTML" hx-indicator="#loader">
|
|
{% csrf_token %}
|
|
<label style="display:block; font-size:0.8125rem; font-weight:500; margin-bottom:0.375rem;">Email</label>
|
|
<input type="email" name="email" required autocomplete="username"
|
|
value="{{ suggested_email|default:'' }}"
|
|
placeholder="name@company.com"
|
|
class="input" style="width:100%; margin-bottom:0.875rem;"
|
|
hx-post="/email/autoconfig/"
|
|
hx-trigger="change delay:300ms, blur{% if suggested_email %}, load once{% endif %}"
|
|
hx-target="#email-autoconfig-fields"
|
|
hx-indicator="#loader"
|
|
hx-include="closest form">
|
|
<label style="display:block; font-size:0.8125rem; font-weight:500; margin-bottom:0.375rem;">{% trans "Пароль ящика" %}</label>
|
|
<input type="password" name="password" required autocomplete="current-password" class="input" style="width:100%; margin-bottom:0.875rem;">
|
|
<div id="email-autoconfig-fields">
|
|
{% include "partials/email-autoconfig-fields.html" %}
|
|
</div>
|
|
<div style="display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap;">
|
|
<button type="submit" class="btn btn-primary">{% trans "Подключить" %}</button>
|
|
{% if adding_mailbox %}
|
|
<a href="/email/"
|
|
hx-get="/email/"
|
|
hx-target="#main-content" hx-push-url="/email/" hx-indicator="#loader"
|
|
class="btn" style="text-decoration:none;">{% trans "Отмена" %}</a>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
{% if connect_success %}
|
|
<div style="margin-top:0.75rem; font-size:0.8125rem; color:hsl(152 55% 35%);">{% trans "Подключено. Перенаправление…" %}</div>
|
|
{% endif %}
|
|
</div>
|