Added possibility to generate labels for storelocations.

This commit is contained in:
Jan Böhmer 2020-05-08 13:49:44 +02:00
parent 9a9cd8e887
commit bd6a0de0a2
12 changed files with 126 additions and 4 deletions

View file

@ -1,10 +1,18 @@
{% extends "AdminPages/EntityAdminBase.html.twig" %}
{% import "LabelSystem/dropdown_macro.html.twig" as dropdown %}
{% block card_title %}
<i class="fas fa-cube fa-fw"></i> {% trans %}storelocation.labelp{% endtrans %}
{% endblock %}
{% block additional_controls %}
{% if entity.id %}
<div class="row form-group">
<div class="offset-sm-3 col-sm-9">
{{ dropdown.profile_dropdown('storelocation', entity.id) }}
</div>
</div>
{% endif %}
{% endblock %}
{% block additional_pills %}

View file

@ -1,5 +1,5 @@
{% macro profile_dropdown(type, id = null, include_text = true, btn_type = 'btn-secondary') %}
<div class="btn-group">
<div class="dropdown">
<button type="button" class="btn {{ btn_type }} dropdown-toggle" title="{% trans %}label_generator.label_btn{% endtrans %}"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" {% if not is_granted("@labels.create_labels") %}disabled{% endif %}>
<i class="fas fa-fw fa-qrcode"></i> {% if include_text %}{% trans %}label_generator.label_btn{% endtrans %}{% endif %}

View file

@ -1,4 +1,5 @@
{% import "helper.twig" as helper %}
{% import "LabelSystem/dropdown_macro.html.twig" as dropdown %}
{{ helper.breadcrumb_entity_link(entity) }}
@ -77,6 +78,11 @@
<i class="fas fa-calendar-plus fa-fw"></i> {{ entity.addedDate | format_datetime("short") }}
</span>
</div>
{% if entity is instanceof("App\\Entity\\Parts\\Storelocation") %}
{{ dropdown.profile_dropdown('storelocation', entity.id, true, 'btn-secondary btn-block mt-2') }}
{% endif %}
</div>
</div>
</div>