]> git.agnieray.net Git - galette.git/commitdiff
Fix dynamic file field display
authorGuillaume AGNIERAY <dev@agnieray.net>
Mon, 25 Sep 2023 16:54:56 +0000 (18:54 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 25 Sep 2023 17:05:01 +0000 (19:05 +0200)
galette/templates/default/components/dynamic_fields.html.twig

index 40e45a7b4c7f5aa6d9295b16e220cc904a382351..72df9f0dd7ac22906a848b2f35a9d9d9d5a2d966 100644 (file)
                         />
                         <label for="info_field_{{ field.getId() }}_{{ loop }}_new" class="ui button">
                             <i class="blue upload icon"></i>
-                            {% if object.id %}{{ _T("Choose another file") }}{% else %}{{ _T("Choose a file") }}{% endif %}
+                            {% if object.id and valuedata %}{{ _T("Choose another file") }}{% else %}{{ _T("Choose a file") }}{% endif %}
                         </label>
                     </div>
                 </div>
+                {% if object.id and valuedata %}
                 <div class="extra ui basic fitted segment">
-                    {% if object.id %}
                     <div class="ui toggle checkbox">
                         <input
                             type="checkbox"
                             {{ _T("delete") }}
                         </label>
                     </div>
-                    {% endif %}
                 </div>
+                {% endif %}
             {% endif %}
         {% endmacro %}