block user in django admin
This commit is contained in:
1 parent
089db0afa4
commit
fe7a10cb61
19 files changed
+574
-11
No files matched your search
@@ -4,7 +4,7 @@
|
||||
{% block content %}
|
||||
<div class="auth-shell">
|
||||
{% if site_branding.login_intro_enabled %}<section class="auth-intro"><div class="auth-intro-icon">{{ site_branding.login_intro_icon }}</div><p class="eyebrow">{{ site_branding.login_intro_eyebrow }}</p><h2>{{ site_branding.login_intro_heading|linebreaksbr }}</h2><p>{{ site_branding.login_intro_body|linebreaksbr }}</p></section>{% endif %}
|
||||
<div class="auth-panel"><section class="auth card">{% include 'includes/auth_brand.html' with hide_copy=True %}<p class="eyebrow">ورود مشتریان</p><h1>خوش آمدید</h1><p class="muted">شماره موبایل خود را وارد کنید؛ نیازی به ثبتنام یا رمز عبور نیست.</p><form method="post" data-disable-on-submit>{% csrf_token %}{{ form.as_p }}<button type="submit">دریافت کد یکبارمصرف <span aria-hidden="true">←</span></button></form><div class="auth-links"><a href="{% url 'accounts:password_login' %}">ورود با رمز عبور</a><a href="{% url 'accounts:staff_login' %}">ورود کارشناسان</a></div></section>{% include 'includes/auth_footer.html' %}</div>
|
||||
<div class="auth-panel"><section class="auth card">{% include 'includes/auth_brand.html' with hide_copy=True %}<p class="eyebrow">ورود مشتریان</p><h1>خوش آمدید</h1><p class="muted">شماره موبایل خود را وارد کنید؛ نیازی به ثبتنام یا رمز عبور نیست.</p>{% include 'includes/customer_login_block.html' %}<form method="post" data-disable-on-submit>{% csrf_token %}{{ form.as_p }}<button type="submit">دریافت کد یکبارمصرف <span aria-hidden="true">←</span></button></form><div class="auth-links"><a href="{% url 'accounts:password_login' %}">ورود با رمز عبور</a><a href="{% url 'accounts:staff_login' %}">ورود کارشناسان</a></div></section>{% include 'includes/auth_footer.html' %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block footer %}{% endblock %}
|
||||
@@ -4,7 +4,7 @@
|
||||
{% block content %}
|
||||
<div class="auth-shell">
|
||||
<section class="auth-intro"><div class="auth-intro-icon">●</div><p class="eyebrow">ورود سریع</p><h2>دوباره خوش آمدید.</h2><p>اگر قبلاً در پروفایل خود رمز تعیین کردهاید، بدون انتظار برای پیامک وارد شوید.</p></section>
|
||||
<div class="auth-panel"><section class="auth card">{% include 'includes/auth_brand.html' %}<p class="eyebrow">حساب مشتری</p><h1>ورود با رمز عبور</h1><p class="muted">شماره موبایل و رمز انتخابی خود را وارد کنید.</p><form method="post" data-disable-on-submit>{% csrf_token %}{{ form.as_p }}<button type="submit">ورود به حساب</button></form><div class="auth-links"><a href="{% url 'accounts:login' %}">ورود با کد یکبارمصرف</a></div></section>{% include 'includes/auth_footer.html' %}</div>
|
||||
<div class="auth-panel"><section class="auth card">{% include 'includes/auth_brand.html' %}<p class="eyebrow">حساب مشتری</p><h1>ورود با رمز عبور</h1><p class="muted">شماره موبایل و رمز انتخابی خود را وارد کنید.</p>{% include 'includes/customer_login_block.html' %}<form method="post" data-disable-on-submit>{% csrf_token %}{{ form.as_p }}<button type="submit">ورود به حساب</button></form><div class="auth-links"><a href="{% url 'accounts:login' %}">ورود با کد یکبارمصرف</a></div></section>{% include 'includes/auth_footer.html' %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block footer %}{% endblock %}
|
||||
@@ -12,6 +12,7 @@
|
||||
<link rel="stylesheet" href="{% static 'css/tailwind.css' %}?v={{ static_asset_version }}">
|
||||
<link rel="stylesheet" href="{% static 'css/operations.css' %}?v={{ static_asset_version }}">
|
||||
<link rel="stylesheet" href="{% static 'css/dispatches.css' %}?v={{ static_asset_version }}">
|
||||
{% if request.resolver_match.namespace == 'accounts' %}<link rel="stylesheet" href="{% static 'css/customer-login-access.css' %}?v={{ static_asset_version }}">{% endif %}
|
||||
{% if request.resolver_match.namespace == 'accounts' and request.resolver_match.url_name == 'profile' or financial_page or request.resolver_match.namespace == 'tickets' and request.resolver_match.url_name == 'list' or request.resolver_match.namespace == 'tickets' and request.resolver_match.url_name == 'new' %}<link rel="stylesheet" href="{% static 'css/customer-dock.css' %}?v={{ static_asset_version }}">{% endif %}
|
||||
<script defer src="{% static 'vendor/htmx-2.0.3.min.js' %}?v={{ static_asset_version }}"></script><script defer src="{% static 'vendor/alpine-3.14.8.min.js' %}?v={{ static_asset_version }}"></script>
|
||||
{% block extra_head %}{% endblock %}
|
||||
@@ -73,6 +74,7 @@
|
||||
{% if user.is_authenticated %}<script defer src="{% static 'js/pwa.js' %}?v={{ static_asset_version }}"></script>{% endif %}
|
||||
{% if user.is_authenticated and user.account_type == 'STAFF' %}<link rel="stylesheet" href="{% static 'css/staff-sharing.css' %}?v={{ static_asset_version }}"><script defer src="{% static 'js/staff-sharing.js' %}?v={{ static_asset_version }}"></script>{% endif %}
|
||||
{% block extra_scripts %}{% endblock %}
|
||||
{% if user.is_authenticated and user.account_type == 'CUSTOMER' and not user.is_staff and not user.is_superuser %}<script defer src="{% static 'js/customer-login-access.js' %}?v={{ static_asset_version }}" data-customer-login-access="{% url 'accounts:login_access' %}"></script>{% endif %}
|
||||
{% block otp_script %}{% endblock %}
|
||||
{% endblock %}
|
||||
</body></html>
|
||||
@@ -0,0 +1,7 @@
|
||||
{% if block_reason %}
|
||||
<div class="customer-login-block" role="alert" aria-labelledby="login-block-title" tabindex="-1">
|
||||
<strong id="login-block-title">ورود به حساب شما مسدود است</strong>
|
||||
<p class="customer-login-block-label">دلیل مسدودی:</p>
|
||||
<p class="customer-login-block-reason">{{ block_reason }}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in new issue
Block a user