47 lines
2.5 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Авторизация приложения — {{ SITE_NAME|default:"CORP" }}</title>
<style>
:root { color-scheme: dark; font-family: Inter, system-ui, sans-serif; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #09111b; color: #f8fafc; }
main { width: min(100%, 520px); padding: 30px; border: 1px solid #263445; border-radius: 24px; background: #111a25; box-shadow: 0 24px 80px rgba(0,0,0,.32); }
.eyebrow { margin: 0 0 10px; color: #67c7ff; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; }
.muted { color: #9fb0c3; line-height: 1.55; }
ul { margin: 20px 0; padding: 0; list-style: none; display: grid; gap: 10px; }
li { padding: 12px 14px; border: 1px solid #2a394b; border-radius: 12px; background: #182331; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
button { min-height: 44px; border-radius: 12px; border: 1px solid #304154; padding: 10px 16px; color: inherit; background: #172231; font: inherit; font-weight: 700; cursor: pointer; }
button[name="allow"] { border-color: #169ddd; background: #087eb7; }
.errors { color: #ff9e9e; }
</style>
</head>
<body>
<main>
{% if not error %}
<p class="eyebrow">Корпоративный доступ</p>
<h1>Разрешить доступ приложению «{{ application.name }}»?</h1>
<p class="muted">Приложение получит только перечисленные данные. Пароль портала ему не передаётся.</p>
<form method="post">
{% csrf_token %}
{% for field in form %}{% if field.is_hidden %}{{ field }}{% endif %}{% endfor %}
<ul>{% for scope in scopes_descriptions %}<li>{{ scope }}</li>{% endfor %}</ul>
<div class="errors">{{ form.errors }}{{ form.non_field_errors }}</div>
<div class="actions">
<button type="submit">Отмена</button>
<button type="submit" name="allow" value="Authorize">Разрешить</button>
</div>
</form>
{% else %}
<p class="eyebrow">Ошибка авторизации</p>
<h1>{{ error.error }}</h1>
<p class="muted">{{ error.description }}</p>
{% endif %}
</main>
</body>
</html>