mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-07 17:04:30 +02:00
Added possibillity to delete attachments in admin page.
This commit is contained in:
parent
72cd9a3722
commit
7c43feefbe
10 changed files with 133 additions and 19 deletions
|
@ -8,16 +8,16 @@
|
|||
<div class="col-8">
|
||||
<input id="tree-search" type="search" class="form-control" placeholder="{% trans %}search.placeholder{% endtrans %}">
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm col-4" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary" id="tree-expand"
|
||||
title="{% trans %}expandAll{% endtrans %}">
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" id="tree-reduce"
|
||||
title="{% trans %}reduceAll{% endtrans %}">
|
||||
<i class="fas fa-minus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group btn-group-sm col-4" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary" id="tree-expand"
|
||||
title="{% trans %}expandAll{% endtrans %}">
|
||||
<i class="fas fa-plus fa-fw"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary" id="tree-reduce"
|
||||
title="{% trans %}reduceAll{% endtrans %}">
|
||||
<i class="fas fa-minus fa-fw"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="treeview-sm mt-2" id="tree" data-tree-data="{{ generateTreeData(entity) }}"
|
||||
|
@ -93,10 +93,14 @@
|
|||
{{ form_row(form.reset) }}
|
||||
|
||||
|
||||
|
||||
</fieldset>
|
||||
|
||||
{{ form_end(form) }}
|
||||
|
||||
{# Only include on existing parts #}
|
||||
{% if entity.id %}
|
||||
{{ include('AdminPages/_delete_form.html.twig') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
12
templates/AdminPages/_delete_form.html.twig
Normal file
12
templates/AdminPages/_delete_form.html.twig
Normal file
|
@ -0,0 +1,12 @@
|
|||
<form method="post" class="" action="{{ entity|entityURL('delete') }}"
|
||||
data-delete-form data-title="{% trans with {'%name%': entity.name }%}entity.delete.confirm_title{% endtrans %}"
|
||||
data-message="{% trans %}entity.delete{% endtrans %}">
|
||||
<input type="hidden" name="_method" value="DELETE">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ entity.id) }}">
|
||||
<div class="form-group">
|
||||
<div class=""></div>
|
||||
<div class="col-3 offset-2 pl-1">
|
||||
<button class="btn btn-danger">{% trans %}entity.delete{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
Loading…
Add table
Add a link
Reference in a new issue