mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +00:00
[address book] modification
This commit is contained in:
@@ -49,13 +49,13 @@
|
||||
|
||||
{% if is_pro and user.admin_permissions.can_manage_group %}
|
||||
<li class="tab<% if (cur_tab == 'address-book') { %> tab-cur<% } %>">
|
||||
<a href="{{ SITE_ROOT }}sysadmin/#address-book/"><span class="sf2-icon-organization"></span>{% trans "Organization" %}</a>
|
||||
<a href="{{ SITE_ROOT }}sysadmin/#address-book/"><span class="sf2-icon-organization"></span>{% trans "Departments" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if multi_tenancy and is_default_admin %}
|
||||
<li class="tab">
|
||||
<a href="{{ SITE_ROOT }}sys/orgadmin/"><span class="sf2-icon-organization"></span>{% trans "Multi-Tenancy" %}</a>
|
||||
<a href="{{ SITE_ROOT }}sys/orgadmin/"><span class="sf2-icon-organization"></span>{% trans "Organizations" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
@@ -683,16 +683,6 @@
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="address-book-group-add-form-tmpl">
|
||||
<form id="group-add-form" action="" method="post" class="hide">{% csrf_token %}
|
||||
<h3 id="dialogTitle">{% trans "New Group" %}</h3>
|
||||
<label for="group-name">{% trans "Name" %}</label><br />
|
||||
<input type="text" name="group_name" value="" class="input" id="group-name" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" class="submit" value="{% trans "Submit" %}" />
|
||||
</form>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="group-item-tmpl">
|
||||
<td><a href="{{ SITE_ROOT }}sysadmin/#groups/<%= id %>/libs/"><%- name %></a></td>
|
||||
<td><a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a></td>
|
||||
@@ -1024,7 +1014,7 @@
|
||||
{# address book #}
|
||||
<script type="text/template" id="address-book-tmpl">
|
||||
<div class="hd ovhd">
|
||||
<h3 class="fleft">{% trans "Organization" %}</h3>
|
||||
<h3 class="fleft">{% trans "Departments" %}</h3>
|
||||
<div class="fright">
|
||||
<button class="btn-white js-add-group">{% trans "New Group" %}</button>
|
||||
</div>
|
||||
@@ -1064,8 +1054,8 @@
|
||||
<tr>
|
||||
<th width="40%">{% trans "Name" %}</th>
|
||||
<th width="25%">{% trans "Created At" %}</th>
|
||||
<th width="20%">{% trans "Quota" %}</th>
|
||||
<th width="15%"><!--Operations--></th>
|
||||
<th width="25%">{% trans "Quota" %}</th>
|
||||
<th width="10%"><!--Operations--></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -1097,7 +1087,7 @@
|
||||
<tr>
|
||||
<th width="5%"></th>
|
||||
<th width="55%">{% trans "Name" %}</th>
|
||||
<th width="35%">{% trans "Size" %}</th>
|
||||
<th width="30%">{% trans "Size" %}</th>
|
||||
<th width="10%"><!--Operations--></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -1109,7 +1099,7 @@
|
||||
<p class="error error-tip hide"></p>
|
||||
</script>
|
||||
<script type="text/template" id="address-book-group-path-tmpl">
|
||||
<a href="#address-book/" class="normal">{% trans "Organization" %}</a>
|
||||
<a href="#address-book/" class="normal">{% trans "Departments" %}</a>
|
||||
<span class="path-split">/</span>
|
||||
<% for (var i = 0,len = ancestor_groups.length; i < len; i++) { %>
|
||||
<a href="#address-book/groups/<%= ancestor_groups[i].id %>/" class="normal"><%- ancestor_groups[i].name %></a>
|
||||
@@ -1121,20 +1111,29 @@
|
||||
<td><a href="{{ SITE_ROOT }}sysadmin/#address-book/groups/<%= id %>/"><%- name %></a></td>
|
||||
<td><time title="<%= time %>"><%= time_from_now %></time></td>
|
||||
<td>
|
||||
<span class="group-quota"><%= quota_shown %></span>
|
||||
<span><%= quota_shown %></span>
|
||||
<span title="{% trans "Edit Quota" %}" class="quota-edit-icon sf2-icon-edit op-icon vh"></span>
|
||||
</td>
|
||||
<td>
|
||||
<a href="#" class="sf2-icon-delete sf2-x group-delete-btn op-icon vh" title="{% trans "Delete" %}" aria-label="{% trans "Delete" %}"></a>
|
||||
</td>
|
||||
</script>
|
||||
<script type="text/template" id="address-book-group-add-form-tmpl">
|
||||
<form id="group-add-form" action="" method="post" class="hide">{% csrf_token %}
|
||||
<h3 id="dialogTitle">{% trans "New Group" %}</h3>
|
||||
<label for="group-name">{% trans "Name" %}</label><br />
|
||||
<input type="text" name="group_name" value="" class="input" id="group-name" /><br />
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" class="submit" value="{% trans "Submit" %}" />
|
||||
</form>
|
||||
</script>
|
||||
<script type="text/template" id="address-book-group-quota-set-form-tmpl">
|
||||
<form id="set-quota-form" method="post" action="" class="hide">{% csrf_token %}
|
||||
<h3>{% trans "Set group quota" %}</h3>
|
||||
<input type="text" name="quota" class="input" /> MB
|
||||
<p class="tip">
|
||||
<span>{% trans "An integer that is greater than 0 or equal to -2." %}</span><br />
|
||||
<span>{% trans "Tip: -2 means no limit" %}</span>
|
||||
<span>{% trans "Tip: -2 means no limit." %}</span>
|
||||
</p>
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" value="{% trans "Submit" %}" class="submit" />
|
||||
|
@@ -60,13 +60,13 @@
|
||||
|
||||
{% if is_pro and user.admin_permissions.can_manage_group %}
|
||||
<li class="tab">
|
||||
<a href="{{ SITE_ROOT }}sysadmin/#address-book/"><span class="sf2-icon-organization"></span>{% trans "Organization" %}</a>
|
||||
<a href="{{ SITE_ROOT }}sysadmin/#address-book/"><span class="sf2-icon-organization"></span>{% trans "Departments" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if multi_tenancy and is_default_admin %}
|
||||
<li class="tab {% block cur_org %}{% endblock %}">
|
||||
<a href="{{ SITE_ROOT }}sys/orgadmin/"><span class="sf2-icon-organization"></span>{% trans "Multi-Tenancy" %}</a>
|
||||
<a href="{{ SITE_ROOT }}sys/orgadmin/"><span class="sf2-icon-organization"></span>{% trans "Organizations" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
@@ -149,10 +149,6 @@ define([
|
||||
case 'group_members': return siteRoot + 'api/v2.1/groups/' + options.group_id + '/members/';
|
||||
case 'group_member': return siteRoot + 'api/v2.1/groups/' + options.group_id + '/members/' + options.email + '/';
|
||||
case 'group_member_bulk': return siteRoot + 'api/v2.1/groups/' + options.group_id + '/members/bulk/';
|
||||
|
||||
case 'group_owned_libraries': return siteRoot + 'api/v2.1/groups/' + options.group_id + '/group-owned-libraries/';
|
||||
case 'group_owned_library': return siteRoot + 'api/v2.1/groups/' + options.group_id + '/group-owned-libraries/' + options.repo_id + '/';
|
||||
|
||||
case 'group_import_members': return siteRoot + 'ajax/group/' + options.group_id + '/members/import/';
|
||||
case 'group_repos': return siteRoot + 'api2/groups/' + options.group_id + '/repos/';
|
||||
case 'group_discussions': return siteRoot + 'api2/groups/' + options.group_id + '/discussions/';
|
||||
@@ -193,6 +189,8 @@ define([
|
||||
case 'admin-group': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/';
|
||||
case 'admin-group-libraries': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/libraries/';
|
||||
case 'admin-group-library': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/libraries/' + options.repo_id + '/';
|
||||
case 'admin-group-owned-libraries': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/group-owned-libraries/';
|
||||
case 'admin-group-owned-library': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/group-owned-libraries/' + options.repo_id + '/';
|
||||
case 'admin-group-members': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/members/';
|
||||
case 'admin-group-member': return siteRoot + 'api/v2.1/admin/groups/' + options.group_id + '/members/' + options.email+ '/';
|
||||
case 'admin-system-library': return siteRoot + 'api/v2.1/admin/system-library/';
|
||||
|
@@ -77,7 +77,7 @@ define([
|
||||
Common.disableButton($submitBtn);
|
||||
$.ajax({
|
||||
url: Common.getUrl({
|
||||
'name':'admin-address-book-group',
|
||||
'name':'admin-group',
|
||||
'group_id': model.get('id')
|
||||
}),
|
||||
type: 'PUT',
|
||||
@@ -112,7 +112,16 @@ define([
|
||||
data['time'] = created_at.format('LLLL');
|
||||
data['time_from_now'] = Common.getRelativeTimeStr(created_at);
|
||||
|
||||
data['quota_shown'] = data['quota'] == -2 ? '--' : Common.quotaSizeFormat(data['quota']);
|
||||
switch(data['quota']) {
|
||||
case -2: // no limit
|
||||
data['quota_shown'] = '--';
|
||||
break;
|
||||
case -1: // not set or error
|
||||
data['quota_shown'] = 0;
|
||||
break;
|
||||
default:
|
||||
data['quota_shown'] = Common.quotaSizeFormat(data['quota']);
|
||||
}
|
||||
|
||||
this.$el.html(this.template(data));
|
||||
|
||||
|
@@ -26,13 +26,13 @@ define([
|
||||
|
||||
del: function() {
|
||||
var _this = this;
|
||||
var repo_name = this.model.get('repo_name');
|
||||
var repo_name = this.model.get('repo_name') || this.model.get('name');
|
||||
var popupTitle = gettext("Delete Library");
|
||||
var popupContent = gettext("Are you sure you want to delete %s ?").replace('%s', '<span class="op-target ellipsis ellipsis-op-target" title="' + Common.HTMLescape(repo_name) + '">' + Common.HTMLescape(repo_name) + '</span>');
|
||||
var yesCallback = function() {
|
||||
$.ajax({
|
||||
url: Common.getUrl({
|
||||
'name': 'group_owned_library',
|
||||
'name': 'admin-group-owned-library',
|
||||
'group_id': _this.group_id,
|
||||
'repo_id': _this.model.get('repo_id')
|
||||
}),
|
||||
|
@@ -245,7 +245,7 @@ define([
|
||||
|
||||
$.ajax({
|
||||
url: Common.getUrl({
|
||||
'name': 'group_owned_libraries',
|
||||
'name': 'admin-group-owned-libraries',
|
||||
'group_id': _this.options.group_id
|
||||
}),
|
||||
type: 'POST',
|
||||
|
Reference in New Issue
Block a user