fix error message
[qcg-portal.git] / qcg / templates / qcg / gridftp.html
index 5ee519f..e75e621 100644 (file)
@@ -27,7 +27,8 @@
     {% include 'filex/source.js.html' %}
 
     <script>
-        var filex = filex || {};
+        var filex = filex || {},
+            hostArchiveSupport = ['moss.man.poznan.pl', 'ui.plgrid.wcss.wroc.pl'];
 
         $(function () {
             'use strict';
@@ -72,7 +73,7 @@
                 if (filex.files.some(function(item) { return item.get('name') == name })) {
                     $('<div>', {
                         'class': 'alert alert-danger',
-                        html: '<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> Plik o podanej już nazwie istnieje!'
+                        html: '<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> Plik o podanej nazwie już istnieje!'
                     }).prependTo(modal.find('.modal-body'));
 
                     return true;
             }
 
             filex.files.on('change:checked reset', function() {
-                var selected = filex.selectedFiles().length;
+                var selected = filex.selectedFiles().length,
+                    supportsArchive = hostArchiveSupport.indexOf(filex.host) != -1;
 
                 $('#btn-rename').toggleClass('disabled', selected != 1);
                 $('#btn-delete').toggleClass('disabled', selected == 0);
-                $('#btn-compress').toggleClass('disabled', filex.host != 'moss.man.poznan.pl' || selected == 0);
+                $('#btn-compress').toggleClass('disabled', !supportsArchive || selected == 0);
 
-                if (filex.host == 'moss.man.poznan.pl' && selected == 1) {
+                if (supportsArchive && selected == 1) {
                     var filename = filex.selectedFiles()[0].get('name'),
                         is_archive = _.some(['.zip', '.tar.gz', '.tgz', '.tar.bz2', 'tbz'], function(ext) {
                             return filename.endsWith(ext);