1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-14 06:11:16 +00:00

[starred files] bugfix

This commit is contained in:
llj
2015-07-22 21:01:10 +08:00
parent ebf1d7f8d0
commit 83c0374cd8
4 changed files with 7 additions and 9 deletions

View File

@@ -70,7 +70,7 @@ def prepare_starred_files(files):
array = []
for f in files:
sfile = {'org' : f.org_id,
'repo' : f.repo.id,
'repo_id' : f.repo.id,
'repo_name' : f.repo.name,
'path' : f.path,
'icon_path' : file_icon_filter(f.path),

View File

@@ -12,7 +12,7 @@
</div>
<ul class="side-tabnav-tabs">
<li class="tab {% block cur_my_lib %}{% endblock %}"><a href="{{ SITE_ROOT }}" class="lib">{% trans "Libraries" %}</a></li>
<li class="tab {% block cur_stars %}{% endblock %}"><a href="{% url 'starred' %}" class="star">{% trans "Starred" %}</a></li>
<li class="tab {% block cur_stars %}{% endblock %}"><a href="{{ SITE_ROOT }}#starred/" class="star">{% trans "Starred" %}</a></li>
{% if events_enabled %}
<li class="tab {% block cur_activities %}{% endblock %}"><a href="{% url 'activities' %}" class="activity">{% trans "Activities" %}</a></li>
{% endif %}

View File

@@ -723,14 +723,12 @@
<td class="alc"><img src="{{ MEDIA_URL }}img/file/<%= icon_path %>" alt="{% trans "icon" %}" /></td>
<td>
<% if (is_img) { %>
<a class="normal img-name-link" href="{{ SITE_ROOT }}lib/<%= repo %>/file<%- encoded_path %>" target="_blank" data-mfp-src="{{ SITE_ROOT }}repo/<%= repo %>/raw<%- encoded_path %>"><%- file_name %></a>
<a class="img-name-link" href="{{ SITE_ROOT }}lib/<%= repo_id %>/file<%- encoded_path %>" target="_blank" data-mfp-src="{{ SITE_ROOT }}repo/<%= repo_id %>/raw<%- encoded_path %>"><%- file_name %></a>
<% } else { %>
<a href="{{ SITE_ROOT }}lib/<%= repo %>/file<%- encoded_path %>" target="_blank"><%- file_name %></a>
<a href="{{ SITE_ROOT }}lib/<%= repo_id %>/file<%- encoded_path %>" target="_blank"><%- file_name %></a>
<% } %>
</td>
<td>
<a href="{{ SITE_ROOT }}#my-libs/lib/<%= repo %>"><%- repo_name %></a>
</td>
<td><%- repo_name %></td>
<td><%= mtime_relative %></td>
<td>
<img src="{{MEDIA_URL}}img/rm.png" alt="" class="unstar op-icon vh" title="{% trans "Unstar" %}" />

View File

@@ -32,12 +32,12 @@ define([
removeShare: function() {
var _this = this,
repo_id = this.model.get('repo'),
repo_id = this.model.get('repo_id'),
file_name = this.model.get('file_name'),
path = this.model.get('path');
$.ajax({
url: Common.getUrl({name: 'starred_files'}) + '?p=' + encodeURIComponent(path) + '&repo_id=' + repo_id,
url: Common.getUrl({name: 'starred_files'}) + '?p=' + encodeURIComponent(path) + '&repo_id=' + encodeURIComponent(repo_id),
type: 'DELETE',
beforeSend: Common.prepareCSRFToken,
success: function() {