mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Added an export function to attachment_types admin pages.
This commit is contained in:
parent
09eb3c226a
commit
091311cdf1
6 changed files with 199 additions and 20 deletions
|
@ -29,8 +29,6 @@
|
|||
|
||||
<div class="col-8">
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
<fieldset>
|
||||
<legend>
|
||||
{% if entity.ID %}
|
||||
|
@ -43,14 +41,26 @@
|
|||
<ul class="nav nav-tabs mt-2">
|
||||
<li class="nav-item"><a class="link-anchor active nav-link" data-toggle="tab" href="#home">standard.label</a></li>
|
||||
<li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#info">infos.label</a></li>
|
||||
{% if entity.id %}
|
||||
<li class="nav-item"><a data-toggle="tab" class="link-anchor nav-link" href="#export">export.label</a> </li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<div class="tab-content mb-3 mt-3">
|
||||
<div id="home" class="tab-pane fade show active">
|
||||
{{ form_start(form) }}
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.parent) }}
|
||||
{% block additional_controls %}{% endblock %}
|
||||
{{ form_row(form.comment) }}
|
||||
{{ form_row(form.save) }}
|
||||
{{ form_row(form.reset) }}
|
||||
{{ form_end(form) }}
|
||||
|
||||
{# Only include on existing parts #}
|
||||
{% if entity.id %}
|
||||
{{ include('AdminPages/_delete_form.html.twig') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="info" class="tab-pane fade">
|
||||
|
@ -87,20 +97,59 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if entity.id %}
|
||||
<div id="export" class="tab-pane fade">
|
||||
<form class="form-horizontal" data-no-ajax method="post" action="{{ path('attachment_type_export', {'id': entity.id}) }}">
|
||||
|
||||
<div class="form-row">
|
||||
<label class="col-form-label col-md-2">{% trans %}export.format{% endtrans %}</label>
|
||||
<div class="col">
|
||||
<select class="form-control" name="format">
|
||||
<option value="json">JSON</option>
|
||||
<option value="xml">XML</option>
|
||||
<option value="csv">CSV</option>
|
||||
<option value="yaml">YAML</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row mt-2">
|
||||
<label class="col-form-label col-md-2">{% trans %}export.level{% endtrans %}</label>
|
||||
<div class="col">
|
||||
<select class="form-control" name="level">
|
||||
<option value="simple">{% trans %}export.level.simple{% endtrans %}</option>
|
||||
<option value="extended" selected>{% trans %}export.level.extended{% endtrans %}</option>
|
||||
<option value="full">{% trans %}export.level.full{% endtrans %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row mt-2">
|
||||
<div class="offset-2 col">
|
||||
<div class="form-check abc-checkbox">
|
||||
<input class="form-check-input" name="include_children" id="include_children" type="checkbox" checked>
|
||||
<label class="form-check-label" for="include_children">
|
||||
{% trans %}export.include_children{% endtrans %}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row mt-2">
|
||||
<div class="offset-2 col">
|
||||
<button type="submit" class="btn btn-primary">{% trans %}export.btn{% endtrans %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{{ form_row(form.save) }}
|
||||
{{ 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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue