mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
204 lines
No EOL
11 KiB
Twig
204 lines
No EOL
11 KiB
Twig
{% import "components/tree_macros.html.twig" as tree %}
|
|
{% import "helper.twig" as helper %}
|
|
|
|
{# @var entity \App\Entity\Base\AbstractStructuralDBElement #}
|
|
|
|
{% extends "main_card.html.twig" %}
|
|
|
|
{% block title %}
|
|
{% if entity.id is null %}
|
|
{{ block("new_title") }}
|
|
{% else %}
|
|
{{ block("edit_title")|striptags }}
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block card_type %}
|
|
{% if timeTravel is defined and timeTravel is not null %}
|
|
bg-primary-striped text-white
|
|
{% else %}
|
|
bg-primary text-white
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% form_theme form.log_comment 'bootstrap_5_layout.html.twig' %}
|
|
|
|
{% block card_content %}
|
|
<div class="row">
|
|
|
|
<div class="col-sm-4">
|
|
<turbo-frame id="admin-tree-frame" target="admin-content-frame" data-turbo-action="advance">
|
|
{{ tree.treeview(entity) }}
|
|
</turbo-frame>
|
|
</div>
|
|
|
|
<div class="col-sm-8">
|
|
<turbo-frame id="admin-content-frame" data-turbo-action="advance" target="content">
|
|
<fieldset>
|
|
<legend>
|
|
{% if entity.ID %}
|
|
<strong>{% block edit_title %}{% trans with {'%name': entity.name|escape } %}edit.caption{% endtrans %}{% endblock %}</strong>
|
|
{% if timeTravel is defined and timeTravel is not null %}
|
|
({{ timeTravel|format_datetime('short') }})
|
|
{% endif %}
|
|
<div class="float-end">
|
|
{% block quick_links %}{% endblock %}
|
|
{% block preview_picture %}
|
|
{{ helper.entity_preview_sm(entity) }}
|
|
{% endblock %}
|
|
</div>
|
|
{% else %}
|
|
<strong>{% block new_title %}{% trans %}new.caption{% endtrans %}{% endblock %}</strong>
|
|
{% endif %}
|
|
</legend>
|
|
{% if timeTravel is defined and timeTravel is not null %}
|
|
<b>{% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %}</b>
|
|
{% endif %}
|
|
|
|
{{ form_errors(form) }}
|
|
|
|
<ul class="nav nav-tabs mt-2">
|
|
<li class="nav-item"><a class="link-anchor active nav-link" data-bs-toggle="tab" href="#home">{% trans %}standard.label{% endtrans %}</a></li>
|
|
<li class="nav-item"><a data-bs-toggle="tab" class="link-anchor nav-link" href="#info">{% trans %}infos.label{% endtrans %}</a></li>
|
|
{% if datatable is defined %}
|
|
<li class="nav-item {% if datatable is null %}not-allowed{% endif %}"><a data-bs-toggle="tab" class="link-anchor nav-link {% if datatable is null %}disabled{% endif %}" href="#history">{% trans %}history.label{% endtrans %}</a></li>
|
|
{% endif %}
|
|
{% if entity.id %}
|
|
<li class="nav-item"><a data-bs-toggle="tab" class="link-anchor nav-link" href="#export">{% trans %}export.label{% endtrans %}</a> </li>
|
|
{% else %}
|
|
<li class="nav-item"><a data-bs-toggle="tab" class="link-anchor nav-link" href="#import_export">{% trans %}import_export.label{% endtrans %}</a> </li>
|
|
<li class="nav-item"><a data-bs-toggle="tab" class="link-anchor nav-link" href="#mass_creation">{% trans %}mass_creation.label{% endtrans %}</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
|
|
<div class="tab-content mb-3 mt-3">
|
|
|
|
<div id="home" class="tab-pane fade show active">
|
|
|
|
{{ form_start(form) }}
|
|
|
|
{% block nav_pills_container %}
|
|
<ul class="nav nav-pills mb-2">
|
|
<li class="nav-item">
|
|
<a data-bs-toggle="tab" class="nav-link link-anchor active" href="#common">{% trans %}admin.common{% endtrans %}</a>
|
|
</li>
|
|
{% block additional_pills %}{% endblock %}
|
|
<li class="nav-item">
|
|
<a data-bs-toggle="tab" class="nav-link link-anchor" href="#attachments">{% trans %}admin.attachments{% endtrans %}</a>
|
|
</li>
|
|
{% if entity.parameters is defined %}
|
|
<li class="nav-item">
|
|
<a data-bs-toggle="tab" class="nav-link link-anchor" href="#parameters">{% trans %}admin.parameters{% endtrans %}</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endblock %}
|
|
|
|
<!-- Tab panes -->
|
|
<div class="tab-content">
|
|
<div class="tab-pane active" id="common">
|
|
{{ form_row(form.name) }}
|
|
{% if form.parent%}
|
|
{{ form_row(form.parent) }}
|
|
{% endif %}
|
|
{% if form.not_selectable is defined %}
|
|
{{ form_row(form.not_selectable) }}
|
|
{% endif %}
|
|
|
|
{% block additional_controls %}{% endblock %}
|
|
|
|
{% block comment %}
|
|
{{ form_row(form.comment) }}
|
|
{% endblock %}
|
|
|
|
</div>
|
|
{% block additional_panes %}{% endblock %}
|
|
|
|
<div class="tab-pane" id="attachments">
|
|
{% include "admin/_attachments.html.twig" %}
|
|
{% block master_picture_block %}
|
|
{{ form_row(form.master_picture_attachment) }}
|
|
{% endblock %}
|
|
</div>
|
|
|
|
{% if entity.parameters is defined %}
|
|
<div id="parameters" class="tab-pane fade">
|
|
{% include "admin/_parameters.html.twig" %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-9 offset-sm-3">
|
|
<div class="btn-group">
|
|
{{ form_widget(form.save) }}
|
|
<button type="button" class="btn {% if entity.id is not null %}btn-primary{% else %}btn-success{% endif %} dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
|
<span class="visually-hidden">Toggle Dropdown</span>
|
|
</button>
|
|
<div class="dropdown-menu p-2">
|
|
{{ form_row(form.log_comment)}}
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
{{ form_row(form.reset) }}
|
|
{{ form_end(form) }}
|
|
|
|
|
|
{# Only include on existing parts #}
|
|
{% if entity.id %}
|
|
{{ include('admin/_duplicate.html.twig') }}
|
|
{{ include('admin/_delete_form.html.twig') }}
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
<div id="info" class="tab-pane fade">
|
|
{% include "admin/_info.html.twig" %}
|
|
</div>
|
|
|
|
{% if datatable is defined and datatable is not null %}
|
|
<div id="history" class="tab-pane fade">
|
|
{% import "components/history_log_macros.html.twig" as log %}
|
|
{{ log.element_history_component(datatable) }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if entity.id %}
|
|
<div id="export" class="tab-pane fade">
|
|
{% include 'admin/_export_form.html.twig' with {'path' : path(route_base ~ '_export', {'id': entity.id})} %}
|
|
</div>
|
|
{% else %} {# For new element we have a combined import/export tab #}
|
|
<div id="import_export" class="tab-pane fade">
|
|
|
|
{{ form_start(import_form) }}
|
|
|
|
{{ form_end(import_form) }}
|
|
|
|
<hr>
|
|
<fieldset>
|
|
<legend>{% trans %}export_all.label{% endtrans %}</legend>
|
|
{% include 'admin/_export_form.html.twig' with {'path' : path(route_base ~ '_export_all')} %}
|
|
</fieldset>
|
|
</div>
|
|
|
|
<div id="mass_creation" class="tab-pane fade">
|
|
<div class="row">
|
|
<p class="text-muted offset-sm-3 col-sm-9">{% trans %}mass_creation.help{% endtrans %}</p>
|
|
</div>
|
|
{{ form(mass_creation_form) }}
|
|
</div>
|
|
|
|
|
|
{% endif %}
|
|
</div>
|
|
</fieldset>
|
|
|
|
{# Include turbo control things, so we can still control page title and reloading #}
|
|
{% include "_turbo_control.html.twig" %}
|
|
</turbo-frame>
|
|
</div>
|
|
</div>
|
|
{% endblock %} |