1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

[user perm] improvement

This commit is contained in:
llj
2015-04-30 13:54:57 +08:00
parent 92ec6f94d4
commit 3934bb18ab
5 changed files with 87 additions and 99 deletions

View File

@@ -19,11 +19,7 @@ define([
this.repo_id = options.repo_id;
this.obj_name = options.obj_name;
this.dir_path = options.dir_path;
if (this.dir_path === '/') {
this.path = this.dir_path + this.obj_name;
} else {
this.path = this.dir_path + '/' + this.obj_name;
}
this.path = Common.pathJoin([this.dir_path, this.obj_name])
this.render();
@@ -94,6 +90,7 @@ define([
// use select2 to 'user' input in 'add user perm'
$('[name="email"]', $add_user_perm).select2({
placeholder: gettext("Enter emails or select contacts"),
tags: function () {
var contacts = app.pageOptions.contacts || [];
var contact_list = [];
@@ -128,6 +125,7 @@ define([
g_opts += '<option value="' + groups[i].id + '" data-index="' + i + '">' + groups[i].name + '</option>';
}
$('[name="group"]', $add_group_perm).html(g_opts).select2({
placeholder: gettext("Select groups"),
escapeMarkup: function(m) { return m; }
});
},

View File

@@ -410,7 +410,7 @@ define([
loading_tip.show();
$('[name="emails"]', form).select2({
placeholder: gettext("Select contacts or input"),
placeholder: gettext("Enter emails or select contacts"),
width: '400px',
// with 'tags', the user can directly enter, not just select
// tags need `<input type="hidden" />`, not `<select>`