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

[address book] group: show repo owner and etc.

This commit is contained in:
llj
2018-06-12 18:34:49 +08:00
parent ce23a58edf
commit 040348e6f4
5 changed files with 28 additions and 24 deletions

View File

@@ -157,7 +157,7 @@ define([
});
data = {
'group_id': item_data.group_id,
'p': this.path // TODO: 'p'?
'path': this.path
};
}
} else {

View File

@@ -221,14 +221,23 @@ define([
var icon_size = Common.isHiDPI() ? 48 : 24;
var icon_url = this.model.getIconUrl(icon_size);
var tmpl = $(window).width() >= 768 ? this.template : this.mobileTemplate;
var owner_name;
if (obj.owner.indexOf('@seafile_group') == -1) {
// 'owner_nickname' for '#group/id/'
// 'owner_name' for '#groups'
owner_name = this.model.get('owner_nickname') || this.model.get('owner_name');
} else {
// owner: "18@seafile_group"
// It's a group owned repo
owner_name = obj.group_name;
}
$.extend(obj, {
group_id: this.group_id,
parent_group_id: this.parent_group_id,
is_staff: this.is_staff,
// for '#groups' (no 'share_from_me')
is_repo_owner: app.pageOptions.username == this.model.get('owner'),
//'owner_nickname' for '#group/id/', 'owner_name' for '#groups'
owner_name: this.model.get('owner_nickname') || this.model.get('owner_name'),
owner_name: owner_name,
show_repo_owner: this.show_repo_owner,
icon_url: icon_url,
icon_title: this.model.getIconTitle()

View File

@@ -25,7 +25,6 @@ define([
toolbar2Template: _.template($('#group-toolbar2-tmpl').html()),
pathTemplate: _.template($('#group-path-tmpl').html()),
theadTemplate: _.template($('#shared-repos-hd-tmpl').html()),
ownedReposTheadTemplate: _.template($('#group-owned-repos-hd-tmpl').html()),
theadMobileTemplate: _.template($('#shared-repos-hd-mobile-tmpl').html()),
events: {
@@ -69,7 +68,7 @@ define([
model: repo,
group_id: this.group_id,
parent_group_id: this.group.parent_group_id,
show_repo_owner: this.group.is_address_book_group ? false : true,
show_repo_owner: true,
repoDetailsView: this.repoDetailsView,
is_staff: this.repos.is_staff
});
@@ -86,11 +85,7 @@ define([
if ($(window).width() < 768) {
tmpl = this.theadMobileTemplate;
} else {
if (this.group.parent_group_id == 0) {
tmpl = this.theadTemplate;
} else {
tmpl = this.ownedReposTheadTemplate;
}
tmpl = this.theadTemplate;
}
this.$tableHead.html(tmpl());
},
@@ -175,6 +170,11 @@ define([
'id': data.id,
'wiki_enabled': data.wiki_enabled
});
// for common member in a group, there is only 'leave group' option in the 'settings' popup
// in an address book group, a common member can't 'leave group'
if (data.parent_group_id != 0 && !user_is_admin) {
$('#group-settings-icon').hide();
}
_this.showRepoList();
if (options) {
if (options.showDiscussions) {