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

Improve library icon

This commit is contained in:
Daniel Pan
2016-03-11 12:10:55 +08:00
parent 565c05ee66
commit 0931bd0103
14 changed files with 66 additions and 22 deletions

View File

@@ -1,7 +1,8 @@
define([
'underscore',
'backbone'
], function(_, Backbone) {
'backbone',
'common'
], function(_, Backbone, Common) {
'use strict';
var Repo = Backbone.Model.extend({
@@ -14,7 +15,8 @@ define([
mtime_relative: "",
encrypted: false,
owner: "-",
owner_nickname: "-"
owner_nickname: "-",
permission: "rw"
},
parse: function(response) {
@@ -37,6 +39,12 @@ define([
}
if (attrs.passwd1 != attrs.passwd2) return gettext("Passwords don't match");
}
},
getIconUrl: function(size) {
var is_encrypted = this.get('encrypted');
var is_readonly = this.get('permission') == "r" ? true : false;
return Common.getLibIconUrl(is_encrypted, is_readonly, size);
}
});