Corp/backend/templates/auth/password_reset.html
Игорь Надеин 8159c6f472 feat: Replace Bootstrap buttons with custom button system
### Custom Button System Implementation

Created modern button system to replace Bootstrap buttons:

- ✅ Created core/_buttons-custom.scss (550+ lines)
- ✅ CSS Custom Properties for easy customization
- ✅ 8 color variants (primary, secondary, success, danger, warning, info, light, dark)
- ✅ Outline and Ghost variants
- ✅ 4 sizes (sm, md, lg, xl)
- ✅ Special variants (block, icon, circle, link)
- ✅ Loading state with spinner animation
- ✅ Button groups support
- ✅ Modern animations (hover, active, focus)

### Template Migration

Migrated 65 HTML templates using automated Python script:
- Replaced .btn → .button
- Replaced .btn-primary → .button--primary
- Replaced .btn-outline-* → .button--outline button--*
- Replaced size classes .btn-sm → .button--sm
- Total changes: 354 → 347 button usages

### Results

- app.css: 137 KB → 148 KB (+11 KB for custom buttons)
- Templates changed: 65 files
- Remaining .btn classes: 133 (mostly btn-close for modals)
- New .button classes: 347

### Backward Compatibility

Kept @extend rules in _buttons-custom.scss for gradual migration.
Can be removed after complete migration.

Next step: Remove Bootstrap button imports from custom-bootstrap.scss
2026-01-15 14:23:44 +03:00

72 lines
2.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends 'base.html' %}
{% load static %}
{% block title %}Сброс пароля{% endblock %}
{# Раннее применение темы, синхронно с переключателем в base.html #}
{% block extra_css %}
<script src="{% static 'js/utils/themeInitializer.js' %}"></script>
{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card shadow">
<div class="card-header bg-primary text-white">
<h3 class="mb-0">Сброс пароля</h3>
</div>
<div class="card-body">
{# Общие ошибки формы #}
{% if form.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show mb-4" role="alert">
{% for error in form.non_field_errors %}
<i class="bi bi-exclamation-triangle me-2"></i>{{ error }}
{% if not forloop.last %}<br>{% endif %}
{% endfor %}
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
</div>
{% endif %}
<form method="post" novalidate>
{% csrf_token %}
<div class="mb-4 form-floating">
<input
type="email"
name="{{ form.email.html_name }}"
id="{{ form.email.auto_id|default:'id_email' }}"
class="form-control {% if form.email.errors %}is-invalid{% endif %}"
placeholder="Email"
value="{{ form.email.value|default:'' }}"
inputmode="email"
autocomplete="email"
required
>
<label for="{{ form.email.auto_id|default:'id_email' }}">Email</label>
{% if form.email.errors %}
<div class="invalid-feedback">
{{ form.email.errors|striptags }}
</div>
{% else %}
<div class="form-text">Мы отправим инструкции по сбросу на этот адрес.</div>
{% endif %}
</div>
<button type="submit" class="button button--primary button--lg w-100">
<i class="bi bi-envelope-arrow-up me-2"></i>Отправить инструкции
</button>
</form>
</div>
</div>
</div>
</div>
{% endblock %}
{% block extra_js %}
<script type="module">
import { focusField } from "{% static 'js/utils/focusFieldHandler.js' %}";
focusField('{{ form.email.auto_id|default:"id_email" }}');
</script>
{% endblock %}