Part-DB.Part-DB-server/templates/AdminPages/EntityAdminBase.html.twig

156 lines
7.7 KiB
Twig
Raw Normal View History

{% extends "main_card.html.twig" %}
{% block card_content %}
<div class="row">
<div class="col-4">
<div class="row">
<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>
<div class="treeview-sm mt-2" id="tree" data-tree-data="{{ generateTreeData(entity) }}"
data-tree-search="#tree-search" data-tree-expand="#tree-expand" data-tree-reduce="#tree-reduce">
</div>
</div>
<div class="col-8">
<fieldset>
<legend>
{% if entity.ID %}
<strong>{% trans with {'%name': entity.name} %}edit.caption{% endtrans %}</strong>
{% else %}
<strong>{% trans %}new.caption{% endtrans %}</strong>
{% endif %}
</legend>
<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">
<div class="form-group row">
<label class="col-form-label col-md-3">{% trans %}id.label{% endtrans %}</label>
<div class="col-md-9">
<p class="form-control-plaintext">{% if entity.iD %}{{ entity.id }}{% else %}-{% endif %}</p>
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3">{% trans %}createdAt{% endtrans %}</label>
<div class="col-md-9">
<p class="form-control-plaintext">
{% if date(entity.addedDate) > date('1900/01/01') %}
{{ entity.addedDate | localizeddate("long") }}
{% else %}
-
{% endif %}
</p>
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-md-3">{% trans %}lastModified{% endtrans %}</label>
<div class="col-md-9">
<p class="form-control-plaintext">
{% if date(entity.lastModified) > date('1900/01/01') %}
{{ entity.lastModified | localizeddate("long") }}
{% else %}
-
{% endif %}
</p>
</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>
</fieldset>
</div>
</div>
{% endblock %}