2020-05-01 20:29:18 +02:00
|
|
|
{% macro profile_dropdown(type, id = null, include_text = true, btn_type = 'btn-secondary') %}
|
|
|
|
<div class="btn-group">
|
|
|
|
<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">
|
|
|
|
<i class="fas fa-fw fa-qrcode"></i> {% if include_text %}{% trans %}label_generator.label_btn{% endtrans %}{% endif %}
|
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu">
|
2020-05-02 19:47:31 +02:00
|
|
|
{% set profiles = label_profile_dropdown_helper.dropdownProfiles(type) %}
|
|
|
|
{% for profile in profiles %}
|
2020-05-01 20:29:18 +02:00
|
|
|
<a class="dropdown-item" href="{{ path('label_dialog_profile', {'profile': profile.id, 'target_type': type, 'target_id': id, 'generate': true}) }}">{{ profile.name }}</a>
|
|
|
|
{% endfor %}
|
2020-05-02 19:47:31 +02:00
|
|
|
{% if profiles is not empty %}
|
|
|
|
<div class="dropdown-divider"></div>
|
|
|
|
{% endif %}
|
2020-05-01 20:29:18 +02:00
|
|
|
<a class="dropdown-item" href="{{ path('label_dialog', {'target_type': type, 'target_id': id}) }}">{% trans %}label_generator.label_empty{% endtrans %}</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endmacro %}
|