1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

[address book] modified group quota shown and etc.

This commit is contained in:
llj
2018-05-10 12:13:47 +08:00
parent 243aa2f5c9
commit 97b0e98c7d
2 changed files with 12 additions and 5 deletions

View File

@@ -694,7 +694,7 @@
<script type="text/template" id="group-item-tmpl">
<td><a href="{{ SITE_ROOT }}sysadmin/#groups/<%= id %>/libs/"><%- name %></a></td>
<td>
<% if (owner && owner.indexOf('system admin') == -1) { %>
<% if (owner != 'system admin') { %>
<a href="{{ SITE_ROOT }}useradmin/info/<% print(encodeURIComponent(owner)); %>/"><%- owner %></a>
<% } else { %>
--
@@ -702,7 +702,7 @@
</td>
<td><time title="<%= time %>"><%= time_from_now %></time></td>
<td>
<% if (owner && owner.indexOf('system admin') == -1) { %>
<% if (owner != 'system admin') { %>
<a href="#" class="sf2-icon-delete sf2-x group-delete-btn op-icon vh" title="{% trans "Delete" %}" aria-label="{% trans "Delete" %}"></a>
<a href="#" class="sf2-icon-move sf2-x group-transfer-btn op-icon vh" title="{% trans "Transfer" %}" aria-label="{% trans "Transfer" %}"></a>
<% } %>
@@ -1155,7 +1155,7 @@
<td><a href="{{ SITE_ROOT }}sysadmin/#address-book/groups/<%= id %>/"><%- name %></a></td>
<td><time title="<%= time %>"><%= time_from_now %></time></td>
<td>
<span><%= quota_shown %></span>
<span <% if (quota_error) { %>class="error"<% } %>><%= quota_shown %></span>
<span title="{% trans "Edit Quota" %}" class="quota-edit-icon sf2-icon-edit op-icon vh"></span>
</td>
<td>

View File

@@ -118,15 +118,22 @@ define([
data['time'] = created_at.format('LLLL');
data['time_from_now'] = Common.getRelativeTimeStr(created_at);
data['quota_error'] = false;
switch(data['quota']) {
case -2: // no limit
data['quota_shown'] = '--';
break;
case -1: // not set or error
data['quota_shown'] = 0;
data['quota_shown'] = gettext("Error");
data['quota_error'] = true;
break;
default:
if (data['quota'] > 0) {
data['quota_shown'] = Common.quotaSizeFormat(data['quota']);
} else {
data['quota_shown'] = gettext("Error");
data['quota_error'] = true;
}
}
this.$el.html(this.template(data));