Files
specs/app/templates/systems/detail.html
2026-10-10 11:30:27 +00:00

120 lines
4.0 KiB
HTML
Raw Permalink 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 %}{{ 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('project_detail', project_id=system.project_id) }}" class="btn btn-secondary">
К проекту
</a>
</div>
{% endblock %}