diff --git a/templates/web/admin/collection/collection.html.twig b/templates/web/admin/collection/collection.html.twig index ff5b7fc993..0a33c6495e 100644 --- a/templates/web/admin/collection/collection.html.twig +++ b/templates/web/admin/collection/collection.html.twig @@ -154,7 +154,11 @@ {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
- + + + {% trans %}Select files{% endtrans %}... + +
{% endif %} @@ -175,7 +179,11 @@ {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
- + + + {% trans %}Select files{% endtrans %}... + +
{% endif %} @@ -196,7 +204,11 @@ {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
- + + + {% trans %}Select files{% endtrans %}... + +
{% endif %} @@ -217,7 +229,11 @@ {% elseif app['authentication'].getUser().ACL.has_right_on_base(bas_id, 'manage') %} {% trans 'admin::base:collection: aucun fichier (minilogo, watermark ...)' %}
- + + + {% trans %}Select files{% endtrans %}... + +
{% endif %} @@ -295,7 +311,7 @@ if(datas.success) { alert(datas.msg); if(submitLink.hasClass('reload')) { - reloadTree('base:{{ databox.get_sbas_id() }}', true); + reloadTree('base:{{ collection.get_sbas_id() }}', true); } else if(submitLink.hasClass('reload-tree')) { reloadTree('bases:bases', true); } @@ -313,11 +329,13 @@ $(this).fileupload({ dataType: 'html', add: function(e, data) { - if( ! /(\.|\/)(png|jpeg|jpg|pjpg|gif)$/i.test(data.files[0].type)) { - {% set supported_file_types = ['jpg', 'jpeg', 'pjpg', 'gif', 'png']|join(' | ') %} - alert("{% trans %} Invalid file type, only ({{ supported_file_types }}) file formats are supported {% endtrans %}"); + if (typeof data.files[0].type !== "undefined") { + if( ! /(\.|\/)(png|jpeg|jpg|pjpg|gif)$/i.test(data.files[0].type)) { + {% set supported_file_types = ['jpg', 'jpeg', 'pjpg', 'gif', 'png']|join(' | ') %} + alert("{% trans %} Invalid file type, only ({{ supported_file_types }}) file formats are supported {% endtrans %}"); - return false; + return false; + } } data.submit();