108 lines
5.7 KiB
Twig
108 lines
5.7 KiB
Twig
{#
|
||
organizations/invitation_accept.twig - Страница принятия/отклонения приглашения
|
||
#}
|
||
{% extends 'layouts/landing.twig' %}
|
||
|
||
{% block title %}{{ title }}{% endblock %}
|
||
|
||
{% block content %}
|
||
<div class="min-vh-100 d-flex align-items-center justify-content-center py-5" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);">
|
||
<div class="container">
|
||
<div class="row justify-content-center">
|
||
<div class="col-md-6 col-lg-5">
|
||
<div class="card shadow-lg border-0">
|
||
<div class="card-body p-5">
|
||
{# Логотип организации #}
|
||
<div class="text-center mb-4">
|
||
{% if organization.logo %}
|
||
<img src="{{ organization.logo }}" alt="{{ organization.name }}" style="max-height: 60px;">
|
||
{% else %}
|
||
<div class="bg-primary text-white rounded-3 d-inline-flex align-items-center justify-content-center" style="width: 60px; height: 60px;">
|
||
<i class="fa-solid fa-building fs-3"></i>
|
||
</div>
|
||
{% endif %}
|
||
</div>
|
||
|
||
<h2 class="text-center mb-4">Приглашение в организацию</h2>
|
||
|
||
{# Информация об организации #}
|
||
<div class="text-center mb-4">
|
||
<h4 class="mb-1">{{ organization.name }}</h4>
|
||
<span class="badge bg-primary fs-6">{{ role_label }}</span>
|
||
</div>
|
||
|
||
<p class="text-center text-muted mb-4">
|
||
Вас пригласили присоединиться к организации "{{ organization.name }}"
|
||
</p>
|
||
|
||
{% if invited_by %}
|
||
<p class="text-center text-muted small mb-4">
|
||
Приглашение отправил: {{ invited_by.name|default(invited_by.email) }}
|
||
</p>
|
||
{% endif %}
|
||
|
||
{# Если пользователь не авторизован #}
|
||
{% if not is_logged_in %}
|
||
<div class="alert alert-warning">
|
||
<i class="fa-solid fa-triangle-exclamation me-2"></i>
|
||
Для принятия приглашения необходимо войти в аккаунт или зарегистрироваться
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Если авторизован, но email не совпадает #}
|
||
{% if is_logged_in and not email_matches %}
|
||
<div class="alert alert-warning">
|
||
<i class="fa-solid fa-triangle-exclamation me-2"></i>
|
||
Внимание! Вы вошли как <strong>{{ get_session('email') }}</strong>,
|
||
а приглашение отправлено на другой email.
|
||
</div>
|
||
{% endif %}
|
||
|
||
{# Форма принятия/отклонения #}
|
||
<form action="/invitation/accept/{{ token }}" method="POST" data-ajax="true">
|
||
{{ csrf_field()|raw }}
|
||
<input type="hidden" name="action" value="accept">
|
||
|
||
<div class="d-flex gap-3">
|
||
<button type="submit" class="btn btn-primary flex-grow-1">
|
||
<i class="fa-solid fa-check me-2"></i>Принять
|
||
</button>
|
||
<button type="submit"
|
||
name="action"
|
||
value="decline"
|
||
class="btn btn-outline-danger flex-grow-1">
|
||
<i class="fa-solid fa-xmark me-2"></i>Отклонить
|
||
</button>
|
||
</div>
|
||
</form>
|
||
|
||
{# Ссылка на вход/регистрацию #}
|
||
{% if not is_logged_in %}
|
||
<div class="text-center mt-4">
|
||
<a href="/login?redirect={{ url_encode('/invitation/accept/' ~ token) }}" class="text-muted">
|
||
<i class="fa-solid fa-sign-in-alt me-1"></i>Войти в аккаунт
|
||
</a>
|
||
<span class="text-muted mx-2">|</span>
|
||
<a href="/register?redirect={{ url_encode('/invitation/accept/' ~ token) }}" class="text-muted">
|
||
<i class="fa-solid fa-user-plus me-1"></i>Регистрация
|
||
</a>
|
||
</div>
|
||
{% endif %}
|
||
|
||
<div class="text-center mt-4 text-muted small">
|
||
<i class="fa-regular fa-clock me-1"></i>
|
||
Приглашение действительно 48 часов
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
{# Футер #}
|
||
<div class="text-center mt-4 text-white-50 small">
|
||
© {{ "now"|date("Y") }} Бизнес.Точка
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
{% endblock %}
|