1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 21:30:39 +00:00

[my libs] repo 'share links': fixed 'icon url'

This commit is contained in:
llj
2017-10-13 14:53:26 +08:00
parent c09c3d0c6b
commit 101872d5c4
3 changed files with 10 additions and 2 deletions

View File

@@ -1988,10 +1988,10 @@
</script>
<script type="text/template" id="repo-shared-link-tmpl">
<% if (share_type == 'd') { %>
<td class="alc"><img src="{{ MEDIA_URL }}img/folder-24.png" alt="{% trans "Directory icon"%}" /></td>
<td class="alc"><img src="<%= icon_url %>" alt="{% trans "Directory icon"%}" width="24" /></td>
<td><a href="#my-libs/lib/<%= repo_id %><%= encoded_path %>"><%- name %></a></td>
<% } else { %>
<td class="alc"><img src="{{ MEDIA_URL }}img/file/file.png" alt="{% trans "File"%}" /></td>
<td class="alc"><img src="<%= icon_url %>" alt="{% trans "File"%}" width="24" /></td>
<td><a href="{{SITE_ROOT}}lib/<%= repo_id %>/file<%= encoded_path %>"><%- name %></a></td>
<% } %>
<td><a href="{{SITE_ROOT}}profile/<% print(encodeURIComponent(create_by)); %>/"><%- creator_name %></a></td>

View File

@@ -37,14 +37,20 @@ define([
'share_type': 'd' // 'd': dir
});
}
var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url;
if (obj.share_type == 'd') {
// path is ended with '/'
_path = path.substring(0, path.length - 1);
icon_url = Common.getDirIconUrl(false, icon_size); // is_readonly: false
} else {
formattedSize = Common.fileSizeFormat(this.model.get('size'), 1);
icon_url = Common.getFileIconUrl(this.model.get('name'), icon_size);
}
$.extend(obj, {
'repo_id': this.data.repo_id,
'icon_url': icon_url,
'formattedSize': formattedSize,
'encoded_path': Common.encodePath(_path)
});

View File

@@ -286,6 +286,8 @@ define([
});
return false;
});
return false;
},
popupHistorySetting: function() {