Prepare Specs UI for Windows review

This commit is contained in:
Alex
2026-10-10 11:30:27 +00:00
parent 6e6035c789
commit 25511870ff
68 changed files with 1931 additions and 1070 deletions
+3 -3
View File
@@ -24,10 +24,10 @@
<strong>Структура Guardian:</strong>
<pre class="mb-0" style="background: #e9ecef; padding: 10px;">Guardian {{ guardian.name }}
├── Core: 1
└── Modules: {{ modules|length }}
└── Modules: {{ modules|length }}</pre>
{% for m in modules %}
- {{ m.module.name }} × {{ m.quantity }}
{% endfor %}</pre>
{{ '-' }} {{ m.module.name }} × {{ m.quantity }}
{% endfor %}
</div>
<div class="section-title">Core</div>
+22
View File
@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}Projects - Specs UI{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="page-header">
<h1>Проекты</h1>
</div>
<div class="row">
{% for project in projects %}
<div class="col-md-4">
<div class="stat-card">
<h3>{{ project.name }}</h3>
<p>{{ project.description or "Нет описания" }}</p>
<a href="/ui/projects/{{ project.id }}" class="btn btn-sm btn-primary">Подробнее</a>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}
+1 -1
View File
@@ -90,7 +90,7 @@
<p class="text-muted">Закупки связаны со спецификациями через PurchaseSpecification. Invoice относится к Purchase.</p>
<div class="mt-4">
<a href="{{ url_for('purchases_list', project_id=purchase.project_id) }}" class="btn btn-secondary">
<a href="{{ url_for('project_detail', project_id=purchase.project_id) }}" class="btn btn-secondary">
К списку закупок
</a>
<a href="{{ url_for('project_detail', project_id=purchase.project_id) }}" class="btn btn-secondary">
+3 -3
View File
@@ -107,7 +107,7 @@
<label class="form-label" for="system_id">Система:</label>
<select class="form-select" name="system_id" id="system_id" required>
<option value="">-- Выберите систему --</option>
{% for system in resource.project.systems %}
{% for system in systems %}
<option value="{{ system.id }}">{{ system.name }} ({{ system.customer.name if system.customer else 'N/A' }})</option>
{% else %}
<option disabled>Нет систем в проекте</option>
@@ -119,7 +119,7 @@
<label class="form-label" for="guardian_id">Guardian (опционально):</label>
<select class="form-select" name="guardian_id" id="guardian_id">
<option value="">Общая часть (NULL)</option>
{% for system in resource.project.systems %}
{% for system in systems %}
{% for guardian in system.guardians %}
<option value="{{ guardian.id }}">{{ guardian.name }}</option>
{% endfor %}
@@ -146,7 +146,7 @@
{% endif %}
<div class="mt-4">
<a href="{{ url_for('resources_list', project_id=resource.project_id) }}" class="btn btn-secondary">
<a href="{{ url_for('project_detail', project_id=resource.project_id) }}" class="btn btn-secondary">
К пулу ресурсов
</a>
</div>
+8 -2
View File
@@ -42,11 +42,17 @@
<td>{{ resource.module.name if resource.module else 'N/A' }}</td>
<td>{{ resource.quantity }}</td>
<td>
{% set allocated = resource.resource_allocations|sum(attribute='quantity', default=0) %}
{% set allocated = 0 %}
{% for allocation in resource.resource_allocations %}
{% set allocated = allocated + allocation.quantity %}
{% endfor %}
{{ allocated }}
</td>
<td>
{% set allocated = resource.resource_allocations|sum(attribute='quantity', default=0) %}
{% set allocated = 0 %}
{% for allocation in resource.resource_allocations %}
{% set allocated = allocated + allocation.quantity %}
{% endfor %}
{% set remaining = resource.quantity - allocated %}
<span class="badge {% if remaining <= 0 %}bg-danger{% elif remaining < 100 %}bg-warning{% else %}bg-success{% endif %}">
{{ remaining }}
+1 -1
View File
@@ -78,7 +78,7 @@
</div>
<div class="mt-4">
<a href="{{ url_for('specifications_list', project_id=specification.project_id) }}" class="btn btn-secondary">
<a href="{{ url_for('project_detail', project_id=specification.project_id) }}" class="btn btn-secondary">
К списку спецификаций
</a>
<a href="{{ url_for('project_detail', project_id=specification.project_id) }}" class="btn btn-secondary">
-3
View File
@@ -111,9 +111,6 @@
</div>
<div class="mt-4">
<a href="{{ url_for('resources_list', project_id=system.project_id) }}" class="btn btn-secondary">
Ресурсы проекта
</a>
<a href="{{ url_for('project_detail', project_id=system.project_id) }}" class="btn btn-secondary">
К проекту
</a>
+22
View File
@@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block title %}Systems - Specs UI{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="page-header">
<h1>Системы</h1>
</div>
<div class="row">
{% for system in systems %}
<div class="col-md-4">
<div class="stat-card">
<h3>{{ system.name }}</h3>
<p>{{ system.description or "Нет описания" }}</p>
<a href="/ui/systems/{{ system.id }}" class="btn btn-sm btn-primary">Подробнее</a>
</div>
</div>
{% endfor %}
</div>
</div>
{% endblock %}