Many fixes

This commit is contained in:
root
2026-01-16 21:58:12 +03:00
parent b810a17649
commit 77f76c8c28
45 changed files with 3392 additions and 1243 deletions
-4
View File
@@ -29,10 +29,6 @@
<form method="POST" action="{{ actionUrl }}">
{{ csrf_field()|raw }}
{% if contact is defined %}
<input type="hidden" name="_method" value="PUT">
{% endif %}
<div class="mb-3">
<label for="name" class="form-label fw-bold">Имя *</label>
<input type="text"
+42 -65
View File
@@ -2,10 +2,14 @@
{% block title %}{{ title }}{% endblock %}
{% block styles %}
<link rel="stylesheet" href="/assets/css/modules/data-table.css">
{% endblock %}
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 mb-0">{{ title }}</h1>
<h1 class="h3 mb-0"><i class="fa-solid fa-users text-info me-2"></i> {{ title }}</h1>
</div>
<a href="{{ site_url('/crm/contacts/create') }}" class="btn btn-primary">
<i class="fa-solid fa-plus me-2"></i>Добавить контакт
@@ -13,77 +17,50 @@
</div>
{# Сообщения #}
{% if success is defined %}
{% if session.success %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ success }}
{{ session.success }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
{% if session.error %}
<div class="alert alert-danger alert-dismissible fade show" role="alert">
{{ session.error }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endif %}
<div class="card shadow-sm">
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="bg-light">
<tr>
<th>Имя</th>
<th>Email</th>
<th>Телефон</th>
<th>Должность</th>
<th>Клиент</th>
<th class="text-end" style="width: 120px;">Действия</th>
</tr>
</thead>
<tbody>
{% for contact in contacts %}
<tr>
<td>
<div class="d-flex align-items-center gap-2">
<div class="bg-primary rounded-circle d-flex align-items-center justify-content-center"
style="width: 32px; height: 32px; min-width: 32px;">
<span class="text-white small">{{ contact.name|slice(0, 2)|upper }}</span>
</div>
<span class="fw-medium">{{ contact.name }}</span>
{% if contact.is_primary %}
<span class="badge bg-success" style="font-size: 0.7rem;">Основной</span>
{% endif %}
</div>
</td>
<td>{{ contact.email ?: '—' }}</td>
<td>{{ contact.phone ?: '—' }}</td>
<td>{{ contact.position ?: '—' }}</td>
<td>
{% if contact.customer_id %}
<span class="text-muted">{{ contact.customer_id }}</span>
{% else %}
<span class="text-muted">—</span>
{% endif %}
</td>
<td class="text-end">
<a href="{{ site_url('/crm/contacts/' ~ contact.id ~ '/edit') }}"
class="btn btn-outline-primary btn-sm" title="Редактировать">
<i class="fa-solid fa-pen"></i>
</a>
<form action="{{ site_url('/crm/contacts/' ~ contact.id) }}" method="POST" class="d-inline">
{{ csrf_field()|raw }}
<input type="hidden" name="_method" value="DELETE">
<button type="submit" class="btn btn-outline-danger btn-sm"
onclick="return confirm('Удалить контакт?')" title="Удалить">
<i class="fa-solid fa-trash"></i>
</button>
</form>
</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center py-4 text-muted">
Контактов пока нет
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{{ tableHtml|raw }}
{# CSRF токен для AJAX запросов #}
{{ csrf_field()|raw }}
</div>
</div>
{% endblock %}
{% block scripts %}
<script src="{{ site_url('/assets/js/modules/DataTable.js') }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.data-table').forEach(function(container) {
const id = container.id;
const url = container.dataset.url;
const perPage = parseInt(container.dataset.perPage) || 10;
if (window.dataTables && window.dataTables[id]) {
return;
}
const table = new DataTable(id, {
url: url,
perPage: perPage
});
window.dataTables = window.dataTables || {};
window.dataTables[id] = table;
});
});
</script>
{% endblock %}
+2 -2
View File
@@ -5,7 +5,7 @@
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 mb-0">CRM</h1>
<h1 class="h3 mb-0"><i class="fa-solid fa-chart-line text-primary me-2"></i>CRM</h1>
<p class="text-muted mb-0">Управление продажами и клиентами</p>
</div>
</div>
@@ -66,7 +66,7 @@
</a>
</div>
<div class="col-md-3">
<a href="{{ site_url('/crm/clients') }}" class="card shadow-sm text-decoration-none h-100">
<a href="{{ site_url('/clients') }}" class="card shadow-sm text-decoration-none h-100">
<div class="card-body">
<div class="d-flex align-items-center gap-3">
<div class="bg-success bg-opacity-10 rounded p-3">
+1 -19
View File
@@ -45,31 +45,13 @@
showNavigation: true,
showLegend: true,
legend: calendarLegend,
eventComponent: '@Deals/calendar_event.twig'
eventComponent: '@CRM/deals/calendar_event.twig'
}) }}
{% endblock %}
{% block stylesheets %}
{{ parent() }}
<style>
.calendar-event {
display: block;
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
background-color: #f3f4f6;
border-left: 3px solid #6b7280;
border-radius: 0.25rem;
text-decoration: none;
color: #374151;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.calendar-event:hover {
background-color: #e5e7eb;
}
.calendar-events-more {
padding: 0.125rem 0.5rem;
}
-4
View File
@@ -29,10 +29,6 @@
<form method="POST" action="{{ actionUrl }}">
{{ csrf_field()|raw }}
{% if deal is defined %}
<input type="hidden" name="_method" value="PUT">
{% endif %}
<div class="mb-3">
<label for="title" class="form-label fw-bold">Название сделки *</label>
<input type="text"
+1 -1
View File
@@ -5,7 +5,7 @@
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 mb-0">{{ title }}</h1>
<h1 class="h3 mb-0"><i class="fa-solid fa-file-contract text-primary me-2"></i>{{ title }}</h1>
<p class="text-muted mb-0">
Всего: {{ items|length }} |
Открыто: {{ stats.open_count }} на {{ stats.open_total|number_format(0, ',', ' ') }} ₽
+1 -1
View File
@@ -34,7 +34,7 @@
</a>
</li>
</ul>
{{ csrf_field()|raw }}
{# Канбан доска #}
{{ include('@components/kanban/kanban.twig', {
columns: kanbanColumns,
+1 -2
View File
@@ -5,7 +5,7 @@
{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
<div>
<h1 class="h3 mb-0">{{ title }}</h1>
<h1 class="h3 mb-0"><i class="fa-solid fa-list-check text-warning me-2"></i> {{ title }}</h1>
<p class="text-muted mb-0">Настройка воронки продаж</p>
</div>
<a href="{{ site_url('/crm/deals') }}" class="btn btn-outline-secondary">
@@ -137,7 +137,6 @@
<div class="modal-content">
<form id="editForm" method="POST">
{{ csrf_field()|raw }}
<input type="hidden" name="_method" value="PUT">
<div class="modal-header">
<h5 class="modal-title">Редактировать этап</h5>