mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-04 10:14:44 +02:00
Improved project info page
This commit is contained in:
parent
ef6d30e04b
commit
742b2d3d48
8 changed files with 195 additions and 20 deletions
71
templates/Projects/info/_info.html.twig
Normal file
71
templates/Projects/info/_info.html.twig
Normal file
|
@ -0,0 +1,71 @@
|
|||
{% import "helper.twig" as helper %}
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-lg-4 col-4 mt-auto mb-auto">
|
||||
<img src="{{ asset('img/part_placeholder.svg') }}" class="img-fluid img-thumbnail bg-light mb-2" alt="Part main image" height="300" width="300">
|
||||
</div>
|
||||
<div class="col-md-9 col-lg-8 col-7">
|
||||
<h3 class="w-fit" title="{% trans %}name.label{% endtrans %}">{{ project.name }}
|
||||
{# You need edit permission to use the edit button #}
|
||||
{% if is_granted('edit', project) %}
|
||||
<a href="{{ entity_url(project, 'edit') }}"><i class="fas fa-fw fa-sm fa-edit"></i></a>
|
||||
{% endif %}
|
||||
</h3>
|
||||
<h6 class="text-muted w-fit" title="{% trans %}description.label{% endtrans %}"><span>{{ project.description|format_markdown(true) }}</span></h6>
|
||||
{% if project.buildPart %}
|
||||
<h6>{% trans %}project.edit.associated_build_part{% endtrans %}:</h6>
|
||||
<a href="{{ entity_url(project.buildPart) }}">{{ project.buildPart.name }}</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-4"> {# Sidebar panel with infos about last creation date, etc. #}
|
||||
<div class="mb-3">
|
||||
<span class="text-muted" title="{% trans %}lastModified{% endtrans %}">
|
||||
<i class="fas fa-history fa-fw"></i> {{ helper.date_user_combination(project, true) }}
|
||||
</span>
|
||||
<br>
|
||||
<span class="text-muted mt-1" title="{% trans %}createdAt{% endtrans %}">
|
||||
<i class="fas fa-calendar-plus fa-fw"></i> {{ helper.date_user_combination(project, false) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="mt-1">
|
||||
<h6>
|
||||
{{ helper.project_status_to_badge(project.status) }}
|
||||
</h6>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
<h6>
|
||||
<span class="badge badge-primary bg-primary">
|
||||
<i class="fa-solid fa-list-check fa-fw"></i>
|
||||
{{ project.bomEntries | length }}
|
||||
{% trans %}project.info.bom_entries_count{% endtrans %}
|
||||
</span>
|
||||
</h6>
|
||||
</div>
|
||||
{% if project.children is not empty %}
|
||||
<div class="mt-1">
|
||||
<h6>
|
||||
<span class="badge badge-primary bg-secondary">
|
||||
<i class="fa-solid fa-folder-tree fa-fw"></i>
|
||||
{{ project.children | length }}
|
||||
{% trans %}project.info.sub_projects_count{% endtrans %}
|
||||
</span>
|
||||
</h6>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if project.comment is not empty %}
|
||||
<p>
|
||||
<h5>{% trans %}comment.label{% endtrans %}:</h5>
|
||||
{{ project.comment|format_markdown }}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue