mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 12:59:36 +00:00
205 lines
9.6 KiB
Twig
205 lines
9.6 KiB
Twig
{% extends "main_card.html.twig" %}
|
|
|
|
{# @var StatisticsHelper helper #}
|
|
|
|
{% block title %}{% trans %}statistics.title{% endtrans %}{% endblock %}
|
|
|
|
{% block card_title %}<i class="fas fa-chart-bar fa-fw"></i>
|
|
{% trans %}statistics.title{% endtrans %}{% endblock %}
|
|
|
|
{% block card_body %}
|
|
<ul class="nav nav-tabs ms-3 me-3 mt-2" id="statistics_tabs" role="tablist">
|
|
<li class="nav-item">
|
|
<a class="nav-link active" id="parts-tab" data-bs-toggle="tab" href="#parts" role="tab" aria-controls="home" aria-selected="true">
|
|
{% trans %}statistics.parts{% endtrans %}
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="assemblies-tab" data-bs-toggle="tab" href="#assemblies" role="tab" aria-controls="assemblies" aria-selected="false">
|
|
{% trans %}statistics.assemblies{% endtrans %}
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="projects-tab" data-bs-toggle="tab" href="#projects" role="tab" aria-controls="projects" aria-selected="false">
|
|
{% trans %}statistics.projects{% endtrans %}
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="data_structures-tab" data-bs-toggle="tab" href="#data_structures" role="tab" aria-controls="profile" aria-selected="false">
|
|
{% trans %}statistics.data_structures{% endtrans %}
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" id="attachments-tab" data-bs-toggle="tab" href="#attachments" role="tab" aria-controls="contact" aria-selected="false">
|
|
{% trans %}statistics.attachments{% endtrans %}
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
|
|
<div class="tab-content" id="statistics_content">
|
|
<div class="tab-pane fade show active" id="parts" role="tabpanel" aria-labelledby="parts-tab">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans %}statistics.property{% endtrans %}</th>
|
|
<th>{% trans %}statistics.value{% endtrans %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{% trans %}statistics.distinct_parts_count{% endtrans %}</td>
|
|
<td>{{ helper.distinctPartsCount }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.parts_instock_sum{% endtrans %}</td>
|
|
<td>{{ helper.PartsInstockSum }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.parts_with_price{% endtrans %}</td>
|
|
<td>{{ helper.partsCountWithPrice }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="assemblies" role="tabpanel" aria-labelledby="assemblies-tab"
|
|
{{ stimulus_controller('pages/statistics_assembly', {
|
|
cleanupBomUrl: path('statistics_cleanup_assembly_bom_entries'),
|
|
cleanupPreviewUrl: path('statistics_cleanup_assembly_preview_attachments')
|
|
}) }}
|
|
>
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans %}statistics.property{% endtrans %}</th>
|
|
<th>{% trans %}statistics.value{% endtrans %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{% trans %}statistics.distinct_assemblies_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("assembly") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.invalid_part_bom_entries_count{% endtrans %}</td>
|
|
<td>
|
|
<span {{ stimulus_target('pages/statistics_assembly', 'bomCount') }}>{{ helper.invalidPartBOMEntriesCount }}</span>
|
|
{% if helper.invalidPartBOMEntriesCount > 0 %}
|
|
<button type="button" class="btn btn-sm btn-outline-danger ms-2" {{ stimulus_action('pages/statistics_assembly', 'cleanup', 'click') }} {{ stimulus_target('pages/statistics_assembly', 'bomButton') }}>
|
|
<i class="fas fa-magic"></i> {% trans %}statistics.cleanup_assembly_bom_entries.button{% endtrans %}
|
|
</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.invalid_assembly_preview_attachments_count{% endtrans %}</td>
|
|
<td>
|
|
<span {{ stimulus_target('pages/statistics_assembly', 'previewCount') }}>{{ helper.invalidAssemblyPreviewAttachmentsCount }}</span>
|
|
{% if helper.invalidAssemblyPreviewAttachmentsCount > 0 %}
|
|
<button type="button" class="btn btn-sm btn-outline-danger ms-2" {{ stimulus_action('pages/statistics_assembly', 'cleanupPreview', 'click') }} {{ stimulus_target('pages/statistics_assembly', 'previewButton') }}>
|
|
<i class="fas fa-magic"></i> {% trans %}statistics.cleanup_assembly_preview_attachments.button{% endtrans %}
|
|
</button>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="projects" role="tabpanel" aria-labelledby="projects-tab">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans %}statistics.property{% endtrans %}</th>
|
|
<th>{% trans %}statistics.value{% endtrans %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{% trans %}statistics.distinct_projects_count{% endtrans %}</td>
|
|
<td>{{ helper.distinctProjectsCount }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tab-pane fade" id="data_structures" role="tabpanel" aria-labelledby="data_structures-tab">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans %}statistics.property{% endtrans %}</th>
|
|
<th>{% trans %}statistics.value{% endtrans %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{% trans %}statistics.categories_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("category") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.footprints_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("footprint") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.manufacturers_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("manufacturer") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.storelocations_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("storelocation") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.suppliers_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("supplier") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.currencies_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("currency") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.measurement_units_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("measurement_unit") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.devices_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("device") }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tab-pane fade show" id="attachments" role="tabpanel" aria-labelledby="attachments-tab">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans %}statistics.property{% endtrans %}</th>
|
|
<th>{% trans %}statistics.value{% endtrans %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{% trans %}statistics.attachment_types_count{% endtrans %}</td>
|
|
<td>{{ helper.dataStructuresCount("attachment_type") }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.all_attachments_count{% endtrans %}</td>
|
|
<td>{{ helper.AttachmentsCount }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.user_uploaded_attachments_count{% endtrans %}</td>
|
|
<td>{{ helper.UserUploadedAttachmentsCount }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.private_attachments_count{% endtrans %}</td>
|
|
<td>{{ helper.PrivateAttachmentsCount }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{% trans %}statistics.external_attachments_count{% endtrans %}</td>
|
|
<td>{{ helper.ExternalAttachmentsCount }}</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|