mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Use common settings for all element history tables
This commit is contained in:
parent
f50959837f
commit
38ff9bae4a
8 changed files with 36 additions and 18 deletions
|
@ -152,7 +152,8 @@
|
||||||
|
|
||||||
{% if datatable is defined and datatable is not null %}
|
{% if datatable is defined and datatable is not null %}
|
||||||
<div id="history" class="tab-pane fade">
|
<div id="history" class="tab-pane fade">
|
||||||
{% include "LogSystem/_log_table.html.twig" %}
|
{% import "components/history_log_macros.html.twig" as log %}
|
||||||
|
{{ log.element_history_component(datatable) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{% import "components/datatables.macro.html.twig" as datatables %}
|
|
||||||
|
|
||||||
<form method="post" action="{{ path("log_undo") }}"
|
|
||||||
{{ stimulus_controller('elements/delete_btn') }} {{ stimulus_action('elements/delete_btn', "submit", "submit") }}
|
|
||||||
data-delete-title="{% trans %}log.undo.confirm_title{% endtrans %}"
|
|
||||||
data-delete-message="{% trans %}log.undo.confirm_message{% endtrans %}">
|
|
||||||
<input type="hidden" name="redirect_back" value="{{ app.request.uri }}">
|
|
||||||
|
|
||||||
{{ datatables.logDataTable(datatable) }}
|
|
||||||
|
|
||||||
</form>
|
|
|
@ -51,5 +51,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include "LogSystem/_log_table.html.twig" %}
|
{% import "components/history_log_macros.html.twig" as log %}
|
||||||
|
{{ log.system_log_component(datatable) }}
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,5 +1,6 @@
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{% if datatable is not null %}
|
{% if datatable is not null %}
|
||||||
{% include "LogSystem/_log_table.html.twig" %}
|
{% import "components/history_log_macros.html.twig" as log %}
|
||||||
|
{{ log.element_history_component(datatable) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
|
@ -75,7 +75,8 @@
|
||||||
|
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{% if datatable is defined and datatable is not null %}
|
{% if datatable is defined and datatable is not null %}
|
||||||
{% include "LogSystem/_log_table.html.twig" %}
|
{% import "components/history_log_macros.html.twig" as log %}
|
||||||
|
{{ log.element_history_component(datatable) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -13,8 +13,8 @@
|
||||||
</div>
|
</div>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro logDataTable(dt) %}
|
{% macro logDataTable(dt, state_save_tag = null) %}
|
||||||
{{ _self.datatable(dt, 'elements/datatables/log') }}
|
{{ _self.datatable(dt, 'elements/datatables/log', state_save_tag) }}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro partsDatatableWithForm(datatable, state_save_tag = 'parts') %}
|
{% macro partsDatatableWithForm(datatable, state_save_tag = 'parts') %}
|
||||||
|
|
24
templates/components/history_log_macros.html.twig
Normal file
24
templates/components/history_log_macros.html.twig
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{% macro last_activity_component(datatable) %}
|
||||||
|
{{ _self.log_component(datatable, 'last_activity') }}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro element_history_component(datatable) %}
|
||||||
|
{{ _self.log_component(datatable, 'element_history') }}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro system_log_component(datatable) %}
|
||||||
|
{{ _self.log_component(datatable, 'system_log') }}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro log_component(datatable, tag = null) %}
|
||||||
|
{% import "components/datatables.macro.html.twig" as datatables %}
|
||||||
|
|
||||||
|
<form method="post" action="{{ path("log_undo") }}"
|
||||||
|
{{ stimulus_controller('elements/delete_btn') }} {{ stimulus_action('elements/delete_btn', "submit", "submit") }}
|
||||||
|
data-delete-title="{% trans %}log.undo.confirm_title{% endtrans %}"
|
||||||
|
data-delete-message="{% trans %}log.undo.confirm_message{% endtrans %}">
|
||||||
|
<input type="hidden" name="redirect_back" value="{{ app.request.uri }}">
|
||||||
|
|
||||||
|
{{ datatables.logDataTable(datatable, tag) }}
|
||||||
|
</form>
|
||||||
|
{% endmacro %}
|
|
@ -44,7 +44,8 @@
|
||||||
<div class="card mt-3">
|
<div class="card mt-3">
|
||||||
<div class="card-header"><i class="fas fa-fw fa-history"></i> {% trans %}homepage.last_activity{% endtrans %}</div>
|
<div class="card-header"><i class="fas fa-fw fa-history"></i> {% trans %}homepage.last_activity{% endtrans %}</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% include "LogSystem/_log_table.html.twig" %}
|
{% import "components/history_log_macros.html.twig" as log %}
|
||||||
|
{{ log.last_activity_component(datatable) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue