mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed error, when creation of new elements is disabled in collectionTypes.
This for example happens if the user does not have the permission to create new elements.
This commit is contained in:
parent
7dfbb4c536
commit
b51aa0951e
2 changed files with 17 additions and 4 deletions
|
@ -1,8 +1,14 @@
|
|||
{% macro controller(form, deleteMessage) %}
|
||||
{{ stimulus_controller('elements/collection_type', {
|
||||
'deleteMessage': deleteMessage|trans,
|
||||
'prototype': form_widget(form.vars.prototype)|e('html_attr')
|
||||
}) }}
|
||||
{% if form.vars.prototype is defined %}
|
||||
{{ stimulus_controller('elements/collection_type', {
|
||||
'deleteMessage': deleteMessage|trans,
|
||||
'prototype': form_widget(form.vars.prototype)|e('html_attr')
|
||||
}) }}
|
||||
{% else %} {# If add_element is disabled/forbidden, prototype is not available #}
|
||||
{{ stimulus_controller('elements/collection_type', {
|
||||
'deleteMessage': deleteMessage|trans,
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro target() %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue