mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 00:20:07 +00:00
[address book] group: show repo owner and etc.
This commit is contained in:
@@ -453,10 +453,10 @@
|
|||||||
<td><%= file_count %> / <%= size_formatted %></td>
|
<td><%= file_count %> / <%= size_formatted %></td>
|
||||||
<td style="font-size:11px;"><%= id %></td>
|
<td style="font-size:11px;"><%= id %></td>
|
||||||
<td>
|
<td>
|
||||||
<% if (owner && owner.indexOf('@seafile_group') == -1) { %>
|
<% if (owner.indexOf('@seafile_group') == -1) { %>
|
||||||
<a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a>
|
<a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
--
|
<a href="{{ SITE_ROOT }}sysadmin/#address-book/groups/<% print(owner_name); %>/"><%- group_name %></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -531,7 +531,7 @@
|
|||||||
<% if (owner.indexOf('@seafile_group') == -1) { %>
|
<% if (owner.indexOf('@seafile_group') == -1) { %>
|
||||||
<a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a>
|
<a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
--
|
<%- group_name %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
<td><time title="<%= time %>"><%= time_from_now %></time></td>
|
<td><time title="<%= time %>"><%= time_from_now %></time></td>
|
||||||
|
@@ -259,10 +259,11 @@
|
|||||||
<a href="#" class="sf2-icon-share sf2-x repo-share-btn op-icon vh" title="{% trans "Share" %}" aria-label="{% trans "Share" %}"></a>
|
<a href="#" class="sf2-icon-share sf2-x repo-share-btn op-icon vh" title="{% trans "Share" %}" aria-label="{% trans "Share" %}"></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (is_staff || is_repo_owner || is_admin) { %>
|
<% if (is_staff || is_repo_owner || is_admin) { %>
|
||||||
<a href="#" class="sf2-icon-delete sf2-x cancel-share op-icon vh" title="{% trans "Unshare" %}" aria-label="{% trans "Unshare" %}"></a>
|
<a href="#" class="sf2-icon-x2 sf2-x cancel-share op-icon vh" title="{% trans "Unshare" %}" aria-label="{% trans "Unshare" %}"></a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } else { %>
|
<% } else { %> {# It is an address book group #}
|
||||||
<% if (is_staff) { %>
|
<% if (is_staff) { %>
|
||||||
|
<% if (owner == group_id + '@seafile_group') { %> {# this repo belongs to the current group #}
|
||||||
<a href="#" class="sf2-icon-share sf2-x repo-share-btn op-icon vh" title="{% trans "Share" %}" aria-label="{% trans "Share" %}"></a>
|
<a href="#" class="sf2-icon-share sf2-x repo-share-btn op-icon vh" title="{% trans "Share" %}" aria-label="{% trans "Share" %}"></a>
|
||||||
<a href="#" class="sf2-icon-delete sf2-x delete-repo op-icon vh" title="{% trans "Delete" %}" aria-label="{% trans "Delete" %}"></a>
|
<a href="#" class="sf2-icon-delete sf2-x delete-repo op-icon vh" title="{% trans "Delete" %}" aria-label="{% trans "Delete" %}"></a>
|
||||||
<div class="sf-dropdown sf-dropdown-inline">
|
<div class="sf-dropdown sf-dropdown-inline">
|
||||||
@@ -275,6 +276,9 @@
|
|||||||
<li><a class="op js-repo-details" href="#">{% trans "Details" %}</a></li>
|
<li><a class="op js-repo-details" href="#">{% trans "Details" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<% } else { %>
|
||||||
|
<a href="#" class="sf2-icon-x2 sf2-x cancel-share op-icon vh" title="{% trans "Unshare" %}" aria-label="{% trans "Unshare" %}"></a>
|
||||||
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
@@ -1828,15 +1832,6 @@
|
|||||||
<th width="16%">{% trans "Owner" %}</th>
|
<th width="16%">{% trans "Owner" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/template" id="group-owned-repos-hd-tmpl">
|
|
||||||
<tr>
|
|
||||||
<th width="4%"><span class="sr-only">{% trans "Library Type" %}</span><!--icon--></th>
|
|
||||||
<th width="46%"><a class="table-sort-op by-name" href="#">{% trans "Name" %} <span class="sort-icon icon-caret-down hide"></span></a></th>
|
|
||||||
<th width="10%"><span class="sr-only">{% trans "Actions" %}</span><!--op--></th>
|
|
||||||
<th width="20%">{% trans "Size" %}</th>
|
|
||||||
<th width="20%"><a class="table-sort-op by-time" href="#">{% trans "Last Update" %} <span class="sort-icon icon-caret-up"></span></a></th>
|
|
||||||
</tr>
|
|
||||||
</script>
|
|
||||||
<script type="text/template" id="shared-repos-hd-mobile-tmpl">
|
<script type="text/template" id="shared-repos-hd-mobile-tmpl">
|
||||||
<tr>
|
<tr>
|
||||||
<th width="4%"><span class="sr-only">{% trans "Library Type" %}</span><!--icon--></th>
|
<th width="4%"><span class="sr-only">{% trans "Library Type" %}</span><!--icon--></th>
|
||||||
|
@@ -157,7 +157,7 @@ define([
|
|||||||
});
|
});
|
||||||
data = {
|
data = {
|
||||||
'group_id': item_data.group_id,
|
'group_id': item_data.group_id,
|
||||||
'p': this.path // TODO: 'p'?
|
'path': this.path
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@@ -221,14 +221,23 @@ define([
|
|||||||
var icon_size = Common.isHiDPI() ? 48 : 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;
|
||||||
|
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, {
|
$.extend(obj, {
|
||||||
group_id: this.group_id,
|
group_id: this.group_id,
|
||||||
parent_group_id: this.parent_group_id,
|
parent_group_id: this.parent_group_id,
|
||||||
is_staff: this.is_staff,
|
is_staff: this.is_staff,
|
||||||
// for '#groups' (no 'share_from_me')
|
// for '#groups' (no 'share_from_me')
|
||||||
is_repo_owner: app.pageOptions.username == this.model.get('owner'),
|
is_repo_owner: app.pageOptions.username == this.model.get('owner'),
|
||||||
//'owner_nickname' for '#group/id/', 'owner_name' for '#groups'
|
owner_name: owner_name,
|
||||||
owner_name: this.model.get('owner_nickname') || this.model.get('owner_name'),
|
|
||||||
show_repo_owner: this.show_repo_owner,
|
show_repo_owner: this.show_repo_owner,
|
||||||
icon_url: icon_url,
|
icon_url: icon_url,
|
||||||
icon_title: this.model.getIconTitle()
|
icon_title: this.model.getIconTitle()
|
||||||
|
@@ -25,7 +25,6 @@ define([
|
|||||||
toolbar2Template: _.template($('#group-toolbar2-tmpl').html()),
|
toolbar2Template: _.template($('#group-toolbar2-tmpl').html()),
|
||||||
pathTemplate: _.template($('#group-path-tmpl').html()),
|
pathTemplate: _.template($('#group-path-tmpl').html()),
|
||||||
theadTemplate: _.template($('#shared-repos-hd-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()),
|
theadMobileTemplate: _.template($('#shared-repos-hd-mobile-tmpl').html()),
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
@@ -69,7 +68,7 @@ define([
|
|||||||
model: repo,
|
model: repo,
|
||||||
group_id: this.group_id,
|
group_id: this.group_id,
|
||||||
parent_group_id: this.group.parent_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,
|
repoDetailsView: this.repoDetailsView,
|
||||||
is_staff: this.repos.is_staff
|
is_staff: this.repos.is_staff
|
||||||
});
|
});
|
||||||
@@ -86,11 +85,7 @@ define([
|
|||||||
if ($(window).width() < 768) {
|
if ($(window).width() < 768) {
|
||||||
tmpl = this.theadMobileTemplate;
|
tmpl = this.theadMobileTemplate;
|
||||||
} else {
|
} else {
|
||||||
if (this.group.parent_group_id == 0) {
|
tmpl = this.theadTemplate;
|
||||||
tmpl = this.theadTemplate;
|
|
||||||
} else {
|
|
||||||
tmpl = this.ownedReposTheadTemplate;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.$tableHead.html(tmpl());
|
this.$tableHead.html(tmpl());
|
||||||
},
|
},
|
||||||
@@ -175,6 +170,11 @@ define([
|
|||||||
'id': data.id,
|
'id': data.id,
|
||||||
'wiki_enabled': data.wiki_enabled
|
'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();
|
_this.showRepoList();
|
||||||
if (options) {
|
if (options) {
|
||||||
if (options.showDiscussions) {
|
if (options.showDiscussions) {
|
||||||
|
Reference in New Issue
Block a user