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:
@@ -1988,10 +1988,10 @@
|
|||||||
</script>
|
</script>
|
||||||
<script type="text/template" id="repo-shared-link-tmpl">
|
<script type="text/template" id="repo-shared-link-tmpl">
|
||||||
<% if (share_type == 'd') { %>
|
<% 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>
|
<td><a href="#my-libs/lib/<%= repo_id %><%= encoded_path %>"><%- name %></a></td>
|
||||||
<% } else { %>
|
<% } 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}}lib/<%= repo_id %>/file<%= encoded_path %>"><%- name %></a></td>
|
||||||
<% } %>
|
<% } %>
|
||||||
<td><a href="{{SITE_ROOT}}profile/<% print(encodeURIComponent(create_by)); %>/"><%- creator_name %></a></td>
|
<td><a href="{{SITE_ROOT}}profile/<% print(encodeURIComponent(create_by)); %>/"><%- creator_name %></a></td>
|
||||||
|
@@ -37,14 +37,20 @@ define([
|
|||||||
'share_type': 'd' // 'd': dir
|
'share_type': 'd' // 'd': dir
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var icon_size = Common.isHiDPI() ? 48 : 24;
|
||||||
|
var icon_url;
|
||||||
if (obj.share_type == 'd') {
|
if (obj.share_type == 'd') {
|
||||||
// path is ended with '/'
|
// path is ended with '/'
|
||||||
_path = path.substring(0, path.length - 1);
|
_path = path.substring(0, path.length - 1);
|
||||||
|
icon_url = Common.getDirIconUrl(false, icon_size); // is_readonly: false
|
||||||
} else {
|
} else {
|
||||||
formattedSize = Common.fileSizeFormat(this.model.get('size'), 1);
|
formattedSize = Common.fileSizeFormat(this.model.get('size'), 1);
|
||||||
|
icon_url = Common.getFileIconUrl(this.model.get('name'), icon_size);
|
||||||
}
|
}
|
||||||
$.extend(obj, {
|
$.extend(obj, {
|
||||||
'repo_id': this.data.repo_id,
|
'repo_id': this.data.repo_id,
|
||||||
|
'icon_url': icon_url,
|
||||||
'formattedSize': formattedSize,
|
'formattedSize': formattedSize,
|
||||||
'encoded_path': Common.encodePath(_path)
|
'encoded_path': Common.encodePath(_path)
|
||||||
});
|
});
|
||||||
|
@@ -286,6 +286,8 @@ define([
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
popupHistorySetting: function() {
|
popupHistorySetting: function() {
|
||||||
|
Reference in New Issue
Block a user