]> git.agnieray.net Git - galette.git/blobdiff - galette/templates/default/elements/group.html.twig
Prevent empty parent group dropdown; closes #1648
[galette.git] / galette / templates / default / elements / group.html.twig
index ba117a0e2bf2945440453cc3e5722bdcc461c528..ca29d021cb405311acc84fa4c4a7fd6b6b53d734 100644 (file)
             {% endif %}
             <div class="inline field">
                     <label for="parent_group">{{ _T("Parent group:") }}</label>
-                {% if can_edit %}
+                {% if can_edit and parent_groups|length > 0 %}
                     <select name="parent_group" id="parent_group" class="ui search dropdown nochosen">
                         <option value="">{{ _T("None") }}</option>
-                        {% for g in groups %}
-                            {% if group.canSetParentGroup(g) %}
-                                <option value="{{ g.getId() }}"{% if pgroup is defined and pgroup.getId() == g.getId() %} selected="selected"{% endif %}>{{ g.getIndentName()|raw }}</option>
-                            {% endif %}
+                        {% for g in parent_groups %}
+                            <option value="{{ g.getId() }}"{% if pgroup is defined and pgroup.getId() == g.getId() %} selected="selected"{% endif %}>{{ g.getIndentName()|raw }}</option>
                         {% endfor %}
                     </select>
                 {% else %}