Initial commit

This commit is contained in:
Alex
2026-10-07 19:57:07 +00:00
commit 6e6035c789
131 changed files with 23101 additions and 0 deletions
+122
View File
@@ -0,0 +1,122 @@
{% extends "base.html" %}
{% block title %}{{ system.name }} - Система{% endblock %}
{% block content %}
<div class="page-header">
<h1>Система: {{ system.name }}</h1>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ url_for('home') }}">Главная</a></li>
<li class="breadcrumb-item"><a href="{{ url_for('systems_list') }}">Системы</a></li>
<li class="breadcrumb-item active">{{ system.name }}</li>
</ol>
</nav>
<p class="text-muted">
<strong>Заказчик:</strong> {{ system.customer.name if system.customer else 'N/A' }}<br>
<strong>Проект:</strong> {{ system.project.name if system.project else 'N/A' }}
</p>
</div>
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
<strong>Структура системы:</strong>
<pre class="mb-0" style="background: #e9ecef; padding: 10px;">System {{ system.name }}
├── Common (guardian_id = NULL)
│ └── Modules × N
└── Guardians
├── Core × 1
└── Modules × N</pre>
</div>
</div>
</div>
<div class="section-title">Общая часть (Common)</div>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Модуль</th>
<th>Количество</th>
</tr>
</thead>
<tbody>
{% for module in common_modules %}
<tr>
<td>{{ module.module.name }}</td>
<td><strong>{{ module.quantity }}</strong></td>
</tr>
{% else %}
<tr>
<td colspan="2" class="text-center">В общей части нет модулей</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="section-title">Guardians</div>
<p class="text-muted">Каждый Guardian имеет ровно один Core и дополнительные модули.</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Guardian</th>
<th>Core</th>
<th>Модули</th>
<th>Действие</th>
</tr>
</thead>
<tbody>
{% for data in guardian_data %}
<tr>
<td>
<a href="{{ url_for('guardian_detail', guardian_id=data.guardian.id) }}">
{{ data.guardian.name }}
</a>
</td>
<td>
{% if data.core %}
<span class="badge bg-success">{{ data.core.quantity }}</span>
{% else %}
<span class="badge bg-warning">Отсутствует</span>
{% endif %}
</td>
<td>
{% if data.modules %}
<ul class="list-unstyled mb-0">
{% for m in data.modules %}
<li><strong>{{ m.module.name }}</strong>: {{ m.quantity }}</li>
{% endfor %}
</ul>
{% else %}
<span class="text-muted">Нет дополнительных модулей</span>
{% endif %}
</td>
<td>
<a href="{{ url_for('guardian_detail', guardian_id=data.guardian.id) }}" class="btn btn-sm btn-primary">
Открыть
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4" class="text-center">Нет Guardian</td>
</tr>
{% endfor %}
</tbody>
</table>
</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>
</div>
{% endblock %}