diff --git a/media/css/seahub.css b/media/css/seahub.css index 8e90f13ecf..17b4879043 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -1074,6 +1074,10 @@ textarea:-moz-placeholder {/* for FF */ .details-panel { width:320px; } +.details-panel-item-name { + display:inline-block; + max-width:215px; +} .details-panel-img-container { text-align:center; height:160px; diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index 0d635d49c1..db511d0262 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -777,7 +777,7 @@

- <%- dirent.obj_name %> + <%- dirent.obj_name %>

@@ -791,31 +791,48 @@
+ <% if (dirent.is_file) { %> - - <% if (dirent.is_file) { %> - <% } else { %> + + + + + <% if (dirent.last_modified) { %> + + + + + <% } %> +
{% trans "Size" %} <%= dirent.file_size %>
{% trans "Location" %}<%- path %>
{% trans "Last Update" %}<%= dirent.last_update %>
+ + <% } else { %> +

+

+ + + + + - + - <% } %> @@ -828,8 +845,8 @@ <% } %>
{% trans "Folders" %}
{% trans "Files" %}
{% trans "Size" %}
{% trans "Location" %}
+ <% } %>
- diff --git a/static/scripts/app/views/dirent-details.js b/static/scripts/app/views/dirent-details.js index a197fbbc7d..745dce7a1f 100644 --- a/static/scripts/app/views/dirent-details.js +++ b/static/scripts/app/views/dirent-details.js @@ -45,13 +45,15 @@ define([ }, update: function(part_data) { - if (part_data.error) { - this.$('.dir-folder-counts, .dir-file-counts, .dir-size') - .html('' + gettext("Error") + ''); + var $container = this.$('.details-panel-text-info-container'); + $('.loading-icon', $container).hide(); + if (part_data.error_msg) { + $('.error', $container).html(part_data.error_msg).show(); } else { this.$('.dir-folder-counts').html(part_data.dir_count); this.$('.dir-file-counts').html(part_data.file_count); this.$('.dir-size').html(part_data.size); + $('table', $container).show(); } }, diff --git a/static/scripts/app/views/dirent-grid.js b/static/scripts/app/views/dirent-grid.js index 8335a6b4f5..9b44501987 100644 --- a/static/scripts/app/views/dirent-grid.js +++ b/static/scripts/app/views/dirent-grid.js @@ -323,8 +323,15 @@ define([ 'size': Common.fileSizeFormat(data.size, 1) }); }, - error: function() { - detailsView.update({'error': true}); + error: function(xhr) { + var error_msg; + if (xhr.responseText) { + var parsed_resp = $.parseJSON(xhr.responseText); + error_msg = parsed_resp.error_msg || parsed_resp.detail; + } else { + error_msg = gettext("Failed. Please check the network."); + } + detailsView.update({'error_msg': error_msg}); } }); } diff --git a/static/scripts/app/views/dirent.js b/static/scripts/app/views/dirent.js index ca3a40c30f..b846335deb 100644 --- a/static/scripts/app/views/dirent.js +++ b/static/scripts/app/views/dirent.js @@ -605,8 +605,15 @@ define([ 'size': Common.fileSizeFormat(data.size, 1) }); }, - error: function() { - detailsView.update({'error': true}); + error: function(xhr) { + var error_msg; + if (xhr.responseText) { + var parsed_resp = $.parseJSON(xhr.responseText); + error_msg = parsed_resp.error_msg || parsed_resp.detail; + } else { + error_msg = gettext("Failed. Please check the network."); + } + detailsView.update({'error_msg': error_msg}); } }); }