1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-20 01:49:50 +00:00

Merge pull request #1735 from haiwen/new-lib-icons

[lib icons] use new lib icons
This commit is contained in:
Daniel Pan 2017-08-26 11:44:55 +08:00 committed by GitHub
commit b912c69c5a
30 changed files with 35 additions and 38 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 918 B

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
media/img/lib/256/lib.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
media/img/lib/48/lib.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 B

View File

@ -72,9 +72,9 @@
{% for repo in owned_repos %} {% for repo in owned_repos %}
<tr> <tr>
{% if repo.encrypted %} {% if repo.encrypted %}
<td><img src="{{MEDIA_URL}}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td>
{% else %} {% else %}
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib.png" width="24" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td>
{% endif %} {% endif %}
{% if not repo.name %} {% if not repo.name %}

View File

@ -1512,9 +1512,9 @@
</td> </td>
<td> <td>
<% if (encrypted) { %> <% if (encrypted) { %>
<img src="{{ MEDIA_URL }}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted" %}" alt="{% trans "Encrypted" %}" /> <img src="{{ MEDIA_URL }}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted" %}" alt="{% trans "Encrypted" %}" />
<% } else { %> <% } else { %>
<img src="{{ MEDIA_URL }}img/sync-folder-20.png" title="{% trans "Read-Write" %}" alt="{% trans "Read-Write" %}" /> <img src="{{ MEDIA_URL }}img/lib/48/lib.png" width="24" title="{% trans "Read-Write" %}" alt="{% trans "Read-Write" %}" />
<% } %> <% } %>
</td> </td>
<td><a href="#my-libs/lib/<%= id %>" target="_blank"><%- name %></a></td> <td><a href="#my-libs/lib/<%= id %>" target="_blank"><%- name %></a></td>

View File

@ -24,9 +24,9 @@
{% for repo in org_repos %} {% for repo in org_repos %}
<tr> <tr>
{% if repo.encrypted %} {% if repo.encrypted %}
<td><img src="{{MEDIA_URL}}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted"%}" alt="{% trans "directory icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td>
{% else %} {% else %}
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write"%}" alt="{% trans "directory icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib.png" width="24" title="{% trans "Read-Write"%}" alt="{% trans "library icon" %}" /></td>
{% endif %} {% endif %}
<td>{{ repo.name }}</td> <td>{{ repo.name }}</td>
<td style="font-size:11px;">{{ repo.id }}</td> <td style="font-size:11px;">{{ repo.id }}</td>

View File

@ -156,9 +156,9 @@
{% for repo in owned_repos %} {% for repo in owned_repos %}
<tr> <tr>
{% if repo.encrypted %} {% if repo.encrypted %}
<td><img src="{{MEDIA_URL}}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td>
{% else %} {% else %}
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib.png" width="24" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td>
{% endif %} {% endif %}
{% if not repo.name %} {% if not repo.name %}
@ -205,11 +205,11 @@
{% for repo in in_repos %} {% for repo in in_repos %}
<tr> <tr>
{% if repo.encrypted %} {% if repo.encrypted %}
<td><img src="{{MEDIA_URL}}img/sync-folder-encrypt-20.png" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib-encrypted.png" width="24" title="{% trans "Encrypted"%}" alt="{% trans "library icon" %}" /></td>
{% elif repo.permission == 'r' %} {% elif repo.permission == 'r' %}
<td><img src="{{MEDIA_URL}}img/folder-no-write-20.png" title="{% trans "Read-Only"%}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib-readonly.png" width="24" title="{% trans "Read-Only"%}" alt="{% trans "library icon" %}" /></td>
{% else %} {% else %}
<td><img src="{{MEDIA_URL}}img/sync-folder-20.png?t=1387267140" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td> <td><img src="{{MEDIA_URL}}img/lib/48/lib.png" width="24" title="{% trans "Read-Write" %}" alt="{% trans "library icon" %}" /></td>
{% endif %} {% endif %}
{% if enable_sys_admin_view_repo %} {% if enable_sys_admin_view_repo %}
<td><a href="{% url 'sys_admin_repo' repo.id %}">{{ repo.name }}</a></td> <td><a href="{% url 'sys_admin_repo' repo.id %}">{{ repo.name }}</a></td>

View File

@ -24,7 +24,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size); var icon_url = this.model.getIconUrl(icon_size);
var m = Moment(this.model.get('del_time')); var m = Moment(this.model.get('del_time'));
var tmpl; var tmpl;

View File

@ -33,7 +33,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size); var icon_url = this.model.getIconUrl(icon_size);
var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate; var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate;
$.extend(obj, { $.extend(obj, {

View File

@ -19,7 +19,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size); var icon_url = this.model.getIconUrl(icon_size);
var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate; var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate;
_.extend(obj, { _.extend(obj, {

View File

@ -49,7 +49,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size); var icon_url = this.model.getIconUrl(icon_size);
var tmpl, dropdownOptions = {}; var tmpl, dropdownOptions = {};
if ($(window).width() >= 768) { if ($(window).width() >= 768) {
@ -331,10 +331,10 @@ define([
viewDetails: function() { viewDetails: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var data = $.extend({}, obj, { var data = $.extend({}, obj, {
icon_url: this.model.getIconUrl(icon_size), icon_url: this.model.getIconUrl(icon_size),
big_icon_url: this.model.getIconUrl(96) big_icon_url: this.model.getIconUrl()
}); });
var detailsView = this.myReposView.repoDetailsView; var detailsView = this.myReposView.repoDetailsView;
detailsView.show(data); detailsView.show(data);

View File

@ -104,7 +104,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(), var obj = this.model.toJSON(),
icon_size = Common.isHiDPI() ? 96 : 24, icon_size = Common.isHiDPI() ? 48 : 24,
icon_url = this.model.getIconUrl(icon_size); icon_url = this.model.getIconUrl(icon_size);
_.extend(obj, { _.extend(obj, {

View File

@ -47,7 +47,7 @@ define([
render: function() { render: function() {
var obj = this.model.toJSON(); var obj = this.model.toJSON();
var icon_size = Common.isHiDPI() ? 96 : 24; var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size); var icon_url = this.model.getIconUrl(icon_size);
var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate; var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate;
_.extend(obj, { _.extend(obj, {

View File

@ -295,23 +295,20 @@ define([
}, },
getLibIconUrl: function(is_encrypted, is_readonly, size) { getLibIconUrl: function(is_encrypted, is_readonly, size) {
if (size > 24) {
// icon name
var icon_name = 'lib.png';
if (is_encrypted) { if (is_encrypted) {
return app.config.mediaUrl + "img/lib/96/lib-encrypted.png"; icon_name = 'lib-encrypted.png';
} else if (is_readonly) {
return app.config.mediaUrl + "img/lib/96/lib-readonly.png";
} else {
return app.config.mediaUrl + "img/lib/96/lib.png";
}
} else {
if (is_encrypted) {
return app.config.mediaUrl + "img/lib/24/lib-encrypted.png";
} else if (is_readonly) {
return app.config.mediaUrl + "img/lib/24/lib-readonly.png";
} else {
return app.config.mediaUrl + "img/lib/24/lib.png";
} }
if (is_readonly) {
icon_name = 'lib-readonly.png';
} }
// icon size
var icon_size = size || 256; // 'size' can be 24, 48, or undefined. (2017.7.31)
return app.config.mediaUrl + 'img/lib/' + icon_size + '/' + icon_name;
}, },
getLibIconTitle: function(is_encrypted, is_readonly) { getLibIconTitle: function(is_encrypted, is_readonly) {

View File

@ -56,7 +56,7 @@ define([
render: function() { render: function() {
var data = this.model.toJSON(), var data = this.model.toJSON(),
icon_size = Common.isHiDPI() ? 96 : 24, icon_size = Common.isHiDPI() ? 48 : 24,
icon_url = this.model.getIconUrl(icon_size); icon_url = this.model.getIconUrl(icon_size);
data['icon_url'] = icon_url; data['icon_url'] = icon_url;

View File

@ -153,7 +153,7 @@ define([
render: function() { render: function() {
var data = this.model.toJSON(), var data = this.model.toJSON(),
icon_size = Common.isHiDPI() ? 96 : 24, icon_size = Common.isHiDPI() ? 48 : 24,
icon_url = this.model.getIconUrl(icon_size), icon_url = this.model.getIconUrl(icon_size),
last_accessed = Moment(data['last_accessed']); last_accessed = Moment(data['last_accessed']);

View File

@ -84,7 +84,7 @@ define([
render: function() { render: function() {
var data = this.model.toJSON(), var data = this.model.toJSON(),
icon_size = Common.isHiDPI() ? 96 : 24, icon_size = Common.isHiDPI() ? 48 : 24,
icon_url = this.model.getIconUrl(icon_size), icon_url = this.model.getIconUrl(icon_size),
delete_time = Moment(data['delete_time']); delete_time = Moment(data['delete_time']);