Initial commit
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Ресурсы - Pool{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<h1>Общий пул ресурсов</h1>
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{{ url_for('home') }}">Главная</a></li>
|
||||
<li class="breadcrumb-item active">Ресурсы</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
{% if project_id %}
|
||||
<div class="alert alert-info">
|
||||
Фильтр: Проект #{{ project_id }}
|
||||
<a href="{{ url_for('resources_list') }}" class="btn btn-sm btn-link">Показать все</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="section-title">Сводка ресурсов</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Module</th>
|
||||
<th>Получено</th>
|
||||
<th>Распределено</th>
|
||||
<th>Свободно</th>
|
||||
<th>Invoice</th>
|
||||
<th>Specification</th>
|
||||
<th>Действие</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for resource in resources %}
|
||||
<tr>
|
||||
<td><a href="{{ url_for('resource_detail', resource_id=resource.id) }}">{{ resource.id }}</a></td>
|
||||
<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) %}
|
||||
{{ allocated }}
|
||||
</td>
|
||||
<td>
|
||||
{% set allocated = resource.resource_allocations|sum(attribute='quantity', default=0) %}
|
||||
{% set remaining = resource.quantity - allocated %}
|
||||
<span class="badge {% if remaining <= 0 %}bg-danger{% elif remaining < 100 %}bg-warning{% else %}bg-success{% endif %}">
|
||||
{{ remaining }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ resource.invoice_number if resource.invoice_number else 'N/A' }}</td>
|
||||
<td>{{ resource.specification_number if resource.specification_number else 'N/A' }}</td>
|
||||
<td>
|
||||
<a href="{{ url_for('resource_detail', resource_id=resource.id) }}" class="btn btn-sm btn-primary">
|
||||
Открыть
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">Нет ресурсов</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="{{ url_for('projects_list') }}" class="btn btn-secondary">
|
||||
К проектам
|
||||
</a>
|
||||
{% if not project_id %}
|
||||
<a href="{{ url_for('seed_demo_data') }}" class="btn btn-success">
|
||||
Seed demo data
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user