feat: UI/UX cleanup V1 with header, import requisites, and status fixes
This commit is contained in:
@@ -13,28 +13,78 @@
|
||||
.system-progress-table .progress-summary > * { white-space: nowrap; }
|
||||
.money-value { transition: filter 0.15s; }
|
||||
.money-hidden .money-value { filter: blur(6px); user-select: none; pointer-events: none; }
|
||||
/*
|
||||
* Document navigation: one horizontal row, no horizontal scroll.
|
||||
* Buttons never wrap to a second row; long labels wrap inside the button.
|
||||
* Equal height via stretch + flex centering of button content.
|
||||
*/
|
||||
.doc-nav {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
align-items: stretch;
|
||||
gap: .5rem;
|
||||
}
|
||||
.doc-nav .btn {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
white-space: normal;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
line-height: 1.25;
|
||||
padding-left: .5rem;
|
||||
padding-right: .5rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-light money-hidden">
|
||||
<main class="container-fluid container-xxl py-4">
|
||||
<nav class="mb-3"><ol class="breadcrumb"><li class="breadcrumb-item"><a href="/projects/">Проекты</a></li><li class="breadcrumb-item active">{{ project.name }}</li></ol></nav>
|
||||
|
||||
<header class="d-flex flex-wrap justify-content-between align-items-start gap-3 mb-4">
|
||||
<div>
|
||||
<h1 class="h2 mb-2">{{ project.name }}</h1>
|
||||
<div class="d-flex flex-wrap gap-3 text-secondary">
|
||||
<span>Договор: <strong class="text-dark">{{ project.contract_number or 'не указан' }}</strong></span>
|
||||
<span>Заказчик: <strong class="text-dark">{{ project.customer or 'не указан' }}</strong></span>
|
||||
<span>Валюта: <strong class="text-dark">{{ project.currency or 'RUB' }}</strong></span>
|
||||
<span>Период: <strong class="text-dark">{{ project.start_date.strftime('%d.%m.%Y') if project.start_date else '—' }} — {{ project.end_date.strftime('%d.%m.%Y') if project.end_date else '—' }}</strong></span>
|
||||
<span>Статус: <span class="badge text-bg-secondary">{{ project.status or 'не указан' }}</span></span>
|
||||
</div>
|
||||
{% if base_boq_documents|length == 1 %}<div class="small text-muted mt-2">Ведомость проекта: {{ base_boq_documents[0].name.replace('BOQ Import - ', 'Импорт ведомости — ').replace('BOQ Import — ', 'Импорт ведомости — ') }}</div>{% elif base_boq_documents|length > 1 %}<div class="small text-muted mt-2">Ведомостей проекта: {{ base_boq_documents|length }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="d-flex flex-wrap gap-2">
|
||||
<a class="btn btn-primary" href="/projects/{{ project.id }}/daily-reports/new">Создать Daily Report</a>
|
||||
<button type="button" class="btn btn-outline-secondary" id="toggleMoney" title="Показать/скрыть финансовые суммы" aria-label="Показать или скрыть финансовые суммы">👁</button>
|
||||
<header class="mb-4">
|
||||
<!-- Block 1: project title -->
|
||||
<h1 class="h2 mb-2">{{ project.name }}</h1>
|
||||
<!-- Block 2: project actions (under title) -->
|
||||
<div class="d-flex flex-wrap gap-2 mb-3">
|
||||
<a class="btn btn-primary" href="/projects/{{ project.id }}/daily-reports/new">Дневной отчёт</a>
|
||||
<a class="btn btn-outline-secondary" href="/projects/{{ project.id }}/edit">Редактировать</a>
|
||||
</div>
|
||||
<!-- Requisites -->
|
||||
<div class="row g-3 g-md-4 align-items-start mb-2">
|
||||
<div class="col-6 col-sm-4 col-md-auto">
|
||||
<div class="text-muted small mb-1">Договор</div>
|
||||
<div class="fw-semibold text-dark">{{ project.contract_number or 'не указан' }}</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-auto">
|
||||
<div class="text-muted small mb-1">Заказчик</div>
|
||||
<div class="fw-semibold text-dark">{{ project.customer or 'не указан' }}</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-auto">
|
||||
<div class="text-muted small mb-1">Валюта</div>
|
||||
<div class="fw-semibold text-dark">{{ project.currency or 'RUB' }}</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-auto">
|
||||
<div class="text-muted small mb-1">Период</div>
|
||||
<div class="fw-semibold text-dark">{{ project.start_date.strftime('%d.%m.%Y') if project.start_date else '—' }} — {{ project.end_date.strftime('%d.%m.%Y') if project.end_date else '—' }}</div>
|
||||
</div>
|
||||
<div class="col-6 col-sm-4 col-md-auto">
|
||||
<div class="text-muted small mb-1">Статус</div>
|
||||
{% set status = project.status or 'active' %}
|
||||
{% set status_map = {
|
||||
'active': ('Активный', 'success'),
|
||||
'completed': ('Завершён', 'primary'),
|
||||
'on_hold': ('Приостановлен', 'warning'),
|
||||
'archived': ('Архивирован', 'secondary')
|
||||
} %}
|
||||
{% set status_pair = status_map.get(status, (status, 'secondary')) %}
|
||||
<div><span class="badge text-bg-{{ status_pair[1] }}">{{ status_pair[0] }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- BOQ document -->
|
||||
{% if base_boq_documents|length == 1 %}<div class="small text-muted mb-3">Ведомость проекта: {{ base_boq_documents[0].display_name }}</div>{% elif base_boq_documents|length > 1 %}<div class="small text-muted mb-3">Ведомостей проекта: {{ base_boq_documents|length }}</div>{% endif %}
|
||||
<!-- Document navigation: single left-aligned row, no h-scroll -->
|
||||
<nav class="doc-nav mb-3" aria-label="Документы проекта">
|
||||
<a class="btn btn-outline-primary" href="/boq/{{ project.id }}">Ведомости{% if base_boq_documents %} ({{ base_boq_documents|length }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/agreements">Дополнительные соглашения{% if agreements_count %} ({{ agreements_count }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/daily-reports">Daily Reports{% if daily_reports_count %} ({{ daily_reports_count }}){% endif %}</a>
|
||||
@@ -42,7 +92,7 @@
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/ks3">КС-3{% if ks3_count %} ({{ ks3_count }}){% endif %}</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/ks6a">КС-6а</a>
|
||||
<a class="btn btn-outline-primary" href="/projects/{{ project.id }}/payments">Платежи{% if payments_count %} ({{ payments_count }}){% endif %}</a>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
{% if project.status != 'archived' %}
|
||||
@@ -50,8 +100,8 @@
|
||||
<form method="post" action="/projects/{{ project.id }}/archive" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-warning btn-sm" onclick="return confirm('Архивировать проект? Данные будут сохранены.')">Архивировать</button>
|
||||
</form>
|
||||
<form method="post" action="/projects/{{ project.id }}/delete" class="d-inline">
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm" onclick="return confirm('ВНИМАНИЕ: Проект будет физически удалён вместе со связанными данными. Это действие необратимо. Продолжить?')">Удалить проект</button>
|
||||
<form method="post" action="/projects/{{ project.id }}/delete" class="d-inline" id="delete-project-form">
|
||||
<button type="submit" class="btn btn-outline-danger btn-sm">Удалить проект</button>
|
||||
</form>
|
||||
</div>
|
||||
{% else %}
|
||||
@@ -64,6 +114,11 @@
|
||||
{% else %}<div class="text-success small py-2">✓ Проверка плана: превышений нет</div>{% endif %}
|
||||
</section>
|
||||
|
||||
<div class="d-flex justify-content-end align-items-center gap-2 mb-3">
|
||||
<span class="text-muted small">Финансовые суммы</span>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm" id="toggleMoney" title="Показать/скрыть финансовые суммы" aria-label="Показать или скрыть финансовые суммы">👁</button>
|
||||
</div>
|
||||
|
||||
<section class="mb-4" aria-labelledby="kpi-heading">
|
||||
<h2 id="kpi-heading" class="h5 mb-3">План и выполнение</h2>
|
||||
<div class="row g-3">
|
||||
@@ -184,8 +239,8 @@
|
||||
<option value="word">Word</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary w-100">Сформировать комплект</button>
|
||||
<div class="col-md-2 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary text-nowrap w-auto">Сформировать комплект</button>
|
||||
</div>
|
||||
</form>
|
||||
<div id="package-error" class="alert alert-danger mt-3 mb-0" role="alert" hidden></div>
|
||||
@@ -202,13 +257,19 @@
|
||||
</section>
|
||||
|
||||
<section class="card border-0 shadow-sm mt-4">
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center"><h2 class="h5 mb-0">Дерево документов</h2><a href="/boq/{{ project.id }}" class="btn btn-sm btn-outline-primary">Ведомости</a></div>
|
||||
<div class="card-header bg-white d-flex justify-content-between align-items-center">
|
||||
<h2 class="h5 mb-0">Дерево документов</h2>
|
||||
<div class="d-flex gap-2">
|
||||
<a href="/boq/{{ project.id }}" class="btn btn-sm btn-outline-primary">Ведомости</a>
|
||||
<a href="/projects/{{ project.id }}/agreements" class="btn btn-sm btn-outline-primary">Дополнительные соглашения</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-2 fw-semibold">План и ведомости</div>
|
||||
{% for node in doc_tree %}
|
||||
<div class="ms-3 mb-2">
|
||||
<a href="/boq/{{ project.id }}/documents/{{ node.doc.id }}" class="text-decoration-none">
|
||||
📄 {{ node.doc.name.replace('BOQ Import - ', 'Импорт ведомости — ').replace('BOQ Import — ', 'Импорт ведомости — ') }}
|
||||
📄 {{ node.doc.display_name }}
|
||||
</a>
|
||||
{% if node.agreements %}
|
||||
<div class="ms-4 mt-1">
|
||||
@@ -263,6 +324,26 @@
|
||||
</table></div></div>
|
||||
</div></div>
|
||||
</div>
|
||||
<div class="modal fade" id="deleteBlockedModal" tabindex="-1" aria-labelledby="deleteBlockedTitle" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h2 class="modal-title fs-5" id="deleteBlockedTitle">Проект нельзя удалить</h2>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Закрыть"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>В проекте есть связанные данные: ведомости, отчёты или документы. Удаление невозможно, чтобы не нарушить историю проекта.</p>
|
||||
<p class="mb-0"><strong>Рекомендуется архивировать проект.</strong></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Отмена</button>
|
||||
<form method="post" action="/projects/{{ project.id }}/archive" class="d-inline">
|
||||
<button type="submit" class="btn btn-warning">Архивировать проект</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
@@ -346,6 +427,25 @@
|
||||
document.getElementById('toggleMoney').addEventListener('click', () => {
|
||||
document.body.classList.toggle('money-hidden');
|
||||
});
|
||||
const deleteForm = document.getElementById('delete-project-form');
|
||||
if (deleteForm) {
|
||||
deleteForm.addEventListener('submit', async event => {
|
||||
event.preventDefault();
|
||||
if (!window.confirm('ВНИМАНИЕ: Проект будет физически удалён вместе со связанными данными. Это действие необратимо. Продолжить?')) return;
|
||||
try {
|
||||
const response = await fetch(deleteForm.getAttribute('action'), {method: 'POST'});
|
||||
if (response.ok) {
|
||||
window.location.href = '/projects/';
|
||||
return;
|
||||
}
|
||||
const modal = new bootstrap.Modal(document.getElementById('deleteBlockedModal'));
|
||||
modal.show();
|
||||
} catch {
|
||||
const modal = new bootstrap.Modal(document.getElementById('deleteBlockedModal'));
|
||||
modal.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
const packageForm = document.querySelector('form[action*="/export/package"]');
|
||||
const packageError = document.getElementById('package-error');
|
||||
if (packageForm) {
|
||||
|
||||
Reference in New Issue
Block a user