Files
octopus/myproject/customers/templates/customers/customer_detail.html
Andrey Smakotin 0973121b39 Удалена устаревшая логика адресов клиентов
Исправлена ошибка AttributeError при создании нового клиента.
Адреса теперь привязаны к заказам, а не к клиентам.

- Удалено обращение к customer.addresses в customer_detail view
- Убрана секция "Адреса доставки" из шаблона customer_detail.html
- Исправлена команда create_demo_orders для работы с новой структурой

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 17:04:20 +03:00

87 lines
3.9 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" %}
{% block title %}{{ customer.full_name }}{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center mb-3">
<h1>Клиент: {{ customer.full_name }}</h1>
<div>
<a href="{% url 'customers:customer-update' customer.pk %}" class="btn btn-primary">Редактировать</a>
<a href="{% url 'customers:customer-delete' customer.pk %}" class="btn btn-danger">Удалить</a>
<a href="{% url 'customers:customer-list' %}" class="btn btn-secondary">Назад к списку</a>
</div>
</div>
</div>
</div>
<div class="row">
<!-- Customer Info -->
<div class="col-md-12">
<div class="card mb-4">
<div class="card-header">
<h5>Информация о клиенте</h5>
</div>
<div class="card-body">
<table class="table table-borderless">
<tr>
<th>Имя:</th>
<td>{{ customer.full_name }}</td>
</tr>
<tr>
<th>Email:</th>
<td>{{ customer.email }}</td>
</tr>
<tr>
<th>Телефон:</th>
<td>{{ customer.phone }}</td>
</tr>
<tr>
<th>Уровень лояльности:</th>
<td>
<span>({{ customer.get_loyalty_discount }}% скидка)</span>
<span class="badge ms-2
{% if customer.loyalty_tier == 'bronze' %}bg-secondary text-dark
{% elif customer.loyalty_tier == 'silver' %}bg-light text-dark
{% elif customer.loyalty_tier == 'gold' %}bg-warning text-dark
{% elif customer.loyalty_tier == 'platinum' %}bg-primary text-white
{% endif %}">
{{ customer.get_loyalty_tier_display }}
</span>
</td>
</tr>
<tr>
<th>Сумма покупок:</th>
<td>{{ customer.total_spent|floatformat:2 }} руб.</td>
</tr>
<tr>
<th>VIP:</th>
<td>
{% if customer.is_vip %}
<span class="badge bg-success">Да</span>
{% else %}
<span class="badge bg-secondary">Нет</span>
{% endif %}
</td>
</tr>
<tr>
<th>Заметки:</th>
<td>{{ customer.notes|default:"Нет" }}</td>
</tr>
<tr>
<th>Дата создания:</th>
<td>{{ customer.created_at|date:"d.m.Y H:i" }}</td>
</tr>
<tr>
<th>Дата обновления:</th>
<td>{{ customer.updated_at|date:"d.m.Y H:i" }}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}