mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-23 12:24:45 +02:00
Allow to add a comment when editing/creating/deleting an element.
This commit is contained in:
parent
c14d6d91ff
commit
b6f95ebe48
19 changed files with 421 additions and 47 deletions
|
@ -1,5 +1,7 @@
|
|||
{% extends "main_card.html.twig" %}
|
||||
|
||||
{% form_theme form.log_comment 'bootstrap_4_layout.html.twig' %}
|
||||
|
||||
{% block card_content %}
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
|
@ -96,7 +98,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_row(form.save) }}
|
||||
<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-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">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) }}
|
||||
|
||||
|
|
|
@ -7,12 +7,22 @@
|
|||
<div class=""></div>
|
||||
<div class="col-sm offset-sm-3 pl-2">
|
||||
{% set delete_disabled = (not is_granted("delete", entity)) or (entity.group is defined and entity.id == 1) %}
|
||||
<button class="btn btn-danger" {% if delete_disabled %}disabled{% endif %}>{% trans %}entity.delete{% endtrans %}</button>
|
||||
{% if entity.parent is defined %}
|
||||
<div class="ml-2 custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="recursive" name="delete_recursive">
|
||||
<label class="custom-control-label" for="recursive">{% trans %}entity.delete.recursive{% endtrans %}</label>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-danger" {% if delete_disabled %}disabled{% endif %}>{% trans %}entity.delete{% endtrans %}</button>
|
||||
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2">
|
||||
<div class="form-group"><label for="delete_log_comment">{% trans %}edit.log_comment{% endtrans %}</label>
|
||||
<input type="text" id="delete_log_comment" name="log_comment" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if entity.parent is defined %}
|
||||
<div class="ml-2 custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" class="custom-control-input" id="recursive" name="delete_recursive">
|
||||
<label class="custom-control-label" for="recursive">{% trans %}entity.delete.recursive{% endtrans %}</label>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -84,11 +84,23 @@
|
|||
<div class="tab-pane fade p-2" id="comment" role="tabpanel">
|
||||
{{ form_widget(form.comment)}}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{{ form_row(form.save) }}
|
||||
|
||||
<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 btn-primary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2">
|
||||
{{ form_row(form.log_comment)}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ form_row(form.reset) }}
|
||||
{{ form_errors(form) }}
|
||||
{{ form_end(form) }}
|
||||
|
|
|
@ -31,9 +31,19 @@
|
|||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ part.id) }}">
|
||||
<div class="form-group">
|
||||
<button class="btn btn-danger" {% if not is_granted("delete", part) %}disabled{% endif %}>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
{% trans %}part.delete{% endtrans %}
|
||||
</button>
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-danger" {% if not is_granted("delete", part) %}disabled{% endif %}>
|
||||
<i class="fa fa-trash fa-fw"></i>
|
||||
{% trans %}part.delete{% endtrans %}
|
||||
</button>
|
||||
<button type="button" class="btn btn-danger dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div class="dropdown-menu p-2">
|
||||
<div class="form-group"><label for="delete_log_comment">{% trans %}edit.log_comment{% endtrans %}</label>
|
||||
<input type="text" id="delete_log_comment" name="log_comment" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue