mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-30 21:50:59 +00:00
[lib list] modification about 'icon_title'
This commit is contained in:
parent
0931bd0103
commit
6f0fcd6cb1
@ -30,11 +30,7 @@
|
||||
</script>
|
||||
<script type="text/template" id="repo-tmpl">
|
||||
<td>
|
||||
<% if (encrypted) { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Encrypted" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Write" %}" alt="" width="24" />
|
||||
<% } %>
|
||||
<img src="<%= icon_url %>" title="<%= icon_title %>" alt="" width="24" />
|
||||
</td>
|
||||
<% if (name) { %>
|
||||
<td><span class="repo-name-span"><a href="#my-libs/lib/<%= id %>"><%- name %></a></span></td>
|
||||
@ -67,15 +63,7 @@
|
||||
</script>
|
||||
<script type="text/template" id="group-repo-tmpl">
|
||||
<td>
|
||||
<% if (encrypted) { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Encrypted" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<% if (permission == 'rw') { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Write" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Only" %}" alt="" width="24" />
|
||||
<% } %>
|
||||
<% } %>
|
||||
<img src="<%= icon_url %>" title="<%= icon_title %>" alt="" width="24" />
|
||||
</td>
|
||||
<td><a href="#group/<%= group_id %>/lib/<%= id %>"><%- name %></a></td>
|
||||
<td class="alc">
|
||||
@ -91,15 +79,7 @@
|
||||
</script>
|
||||
<script type="text/template" id="organization-repo-tmpl">
|
||||
<td>
|
||||
<% if (encrypted) { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Encrypted" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<% if (permission == 'rw') { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Write" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Only" %}" alt="" width="24" />
|
||||
<% } %>
|
||||
<% } %>
|
||||
<img src="<%= icon_url %>" title="<%= icon_title %>" alt="" width="24" />
|
||||
</td>
|
||||
<td><a href="#org/lib/<%= id %>"><%- name %></a></td>
|
||||
<td class="alc">
|
||||
@ -603,15 +583,7 @@
|
||||
</script>
|
||||
<script type="text/template" id="shared-repo-tmpl">
|
||||
<td>
|
||||
<% if (encrypted) { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Write" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<% if (permission == 'rw') { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Write" %}" alt="" width="24" />
|
||||
<% } else { %>
|
||||
<img src="<%- icon_url %>" title="{% trans "Read-Only" %}" alt="" width="24" />
|
||||
<% } %>
|
||||
<% } %>
|
||||
<img src="<%= icon_url %>" title="<%= icon_title %>" alt="" width="24" />
|
||||
</td>
|
||||
<td><a href="#shared-libs/lib/<%= id %>"><%- name %></a></td>
|
||||
<td class="alc">
|
||||
|
@ -45,6 +45,19 @@ define([
|
||||
var is_encrypted = this.get('encrypted');
|
||||
var is_readonly = this.get('permission') == "r" ? true : false;
|
||||
return Common.getLibIconUrl(is_encrypted, is_readonly, size);
|
||||
},
|
||||
|
||||
getIconTitle: function() {
|
||||
var icon_title = '';
|
||||
if (this.get('encrypted')) {
|
||||
icon_title = gettext("Encrypted");
|
||||
} else if (this.get('permission') == "rw") {
|
||||
icon_title = gettext("Read-Write");
|
||||
} else {
|
||||
icon_title = gettext("Read-Only");
|
||||
}
|
||||
|
||||
return icon_title;
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -41,7 +41,8 @@ define([
|
||||
// 'owner_name' for '#groups', 'owner_nickname' for '#group/id/'
|
||||
owner_name: this.model.get('owner_nickname') || this.model.get('owner_name'),
|
||||
show_shared_by: this.show_shared_by,
|
||||
icon_url: icon_url
|
||||
icon_url: icon_url,
|
||||
icon_title: this.model.getIconTitle()
|
||||
});
|
||||
this.$el.html(this.template(obj));
|
||||
return this;
|
||||
|
@ -18,7 +18,10 @@ define([
|
||||
var obj = this.model.toJSON();
|
||||
var icon_size = Common.isHiDPI() ? 96 : 24;
|
||||
var icon_url = this.model.getIconUrl(icon_size);
|
||||
_.extend(obj, { 'icon_url': icon_url });
|
||||
_.extend(obj, {
|
||||
'icon_url': icon_url,
|
||||
'icon_title': this.model.getIconTitle()
|
||||
});
|
||||
this.$el.html(this.template(obj));
|
||||
return this;
|
||||
},
|
||||
|
@ -42,7 +42,10 @@ define([
|
||||
var obj = this.model.toJSON();
|
||||
var icon_size = Common.isHiDPI() ? 96 : 24;
|
||||
var icon_url = this.model.getIconUrl(icon_size);
|
||||
_.extend(obj, { 'icon_url': icon_url });
|
||||
_.extend(obj, {
|
||||
'icon_url': icon_url,
|
||||
'icon_title': this.model.getIconTitle()
|
||||
});
|
||||
this.$el.html(this.template(obj));
|
||||
return this;
|
||||
},
|
||||
|
@ -50,7 +50,10 @@ define([
|
||||
var obj = this.model.toJSON();
|
||||
var icon_size = Common.isHiDPI() ? 96 : 24;
|
||||
var icon_url = this.model.getIconUrl(icon_size);
|
||||
_.extend(obj, { 'icon_url': icon_url });
|
||||
_.extend(obj, {
|
||||
'icon_url': icon_url,
|
||||
'icon_title': this.model.getIconTitle()
|
||||
});
|
||||
this.$el.html(this.template(obj));
|
||||
return this;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user