mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 16:31:13 +00:00
[sysadmin] groups: modification
This commit is contained in:
@@ -3291,9 +3291,6 @@ button.sf-dropdown-toggle:focus {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
/* sysadmin */
|
/* sysadmin */
|
||||||
#admin-groups .btn-white {
|
|
||||||
margin-left:3px;
|
|
||||||
}
|
|
||||||
#import-members-btn .icon-upload-alt {
|
#import-members-btn .icon-upload-alt {
|
||||||
color:#777;
|
color:#777;
|
||||||
margin-right:3px;
|
margin-right:3px;
|
||||||
|
@@ -519,8 +519,10 @@
|
|||||||
<script type="text/template" id="groups-tmpl">
|
<script type="text/template" id="groups-tmpl">
|
||||||
<div class="hd ovhd">
|
<div class="hd ovhd">
|
||||||
<h3 class="fleft">{% trans "Groups" %}</h3>
|
<h3 class="fleft">{% trans "Groups" %}</h3>
|
||||||
<a class="sf-btn-link btn-white js-export-excel fright" href="{% url "sys_group_admin_export_excel" %}">{% trans "Export Excel" %}</a>
|
<div class="fright">
|
||||||
<a class="sf-btn-link btn-white js-add-group fright" href="#">{% trans "New Group" %}</a>
|
<button class="btn-white js-add-group">{% trans "New Group" %}</button>
|
||||||
|
<button class="btn-white js-export-excel">{% trans "Export Excel" %}</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="loading-icon loading-tip"></span>
|
<span class="loading-icon loading-tip"></span>
|
||||||
<table>
|
<table>
|
||||||
@@ -543,14 +545,16 @@
|
|||||||
<h2 class="alc">{% trans "No groups" %}</h2>
|
<h2 class="alc">{% trans "No groups" %}</h2>
|
||||||
</div>
|
</div>
|
||||||
<p class="error error-tip hide"></p>
|
<p class="error error-tip hide"></p>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/template" id="group-add-form-tmpl">
|
||||||
<form id="group-add-form" action="" method="post" class="hide">{% csrf_token %}
|
<form id="group-add-form" action="" method="post" class="hide">{% csrf_token %}
|
||||||
<h3 id="dialogTitle">{% trans "New Group" %}</h3>
|
<h3 id="dialogTitle">{% trans "New Group" %}</h3>
|
||||||
<label for="group-name">{% trans "Name" %}</label><br />
|
<label for="group-name">{% trans "Name" %}</label><br />
|
||||||
<input type="text" name="group_name" value="" class="input" id="group-name" /><br />
|
<input type="text" name="group_name" value="" class="input" id="group-name" /><br />
|
||||||
<label for="group-owner">{% trans "Owner" %}</label>
|
<label for="group-owner">{% trans "Owner" %}</label>
|
||||||
<span class="tip">{% trans "(If left blank, owner will be admin)" %}</span><br />
|
<span class="tip">{% trans "(If left blank, owner will be admin)" %}</span><br />
|
||||||
<input type="hidden" name="group_owner" value="" class="input" id="group-owner" /><br />
|
<input type="hidden" name="group_owner" value="" id="group-owner" />
|
||||||
<p class="error hide"></p>
|
<p class="error hide"></p>
|
||||||
<input type="submit" class="submit" value="{% trans "Submit" %}" />
|
<input type="submit" class="submit" value="{% trans "Submit" %}" />
|
||||||
</form>
|
</form>
|
||||||
|
@@ -183,6 +183,7 @@ define([
|
|||||||
case 'admin-trash-libraries': return siteRoot + 'api/v2.1/admin/trash-libraries/';
|
case 'admin-trash-libraries': return siteRoot + 'api/v2.1/admin/trash-libraries/';
|
||||||
case 'admin-trash-library': return siteRoot + 'api/v2.1/admin/trash-libraries/' + options.repo_id + '/';
|
case 'admin-trash-library': return siteRoot + 'api/v2.1/admin/trash-libraries/' + options.repo_id + '/';
|
||||||
case 'admin_shares': return siteRoot + 'api/v2.1/admin/shares/';
|
case 'admin_shares': return siteRoot + 'api/v2.1/admin/shares/';
|
||||||
|
case 'sys_group_admin_export_excel': return siteRoot + 'sys/groupadmin/export-excel/';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@ define([
|
|||||||
id: 'admin-groups',
|
id: 'admin-groups',
|
||||||
|
|
||||||
template: _.template($("#groups-tmpl").html()),
|
template: _.template($("#groups-tmpl").html()),
|
||||||
|
groupAddFormtemplate: _.template($("#group-add-form-tmpl").html()),
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.groupCollection = new GroupCollection();
|
this.groupCollection = new GroupCollection();
|
||||||
@@ -36,6 +37,7 @@ define([
|
|||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .js-add-group': 'addGroup',
|
'click .js-add-group': 'addGroup',
|
||||||
|
'click .js-export-excel': 'exportExcel',
|
||||||
'click #paginator .js-next': 'getNextPage',
|
'click #paginator .js-next': 'getNextPage',
|
||||||
'click #paginator .js-previous': 'getPreviousPage'
|
'click #paginator .js-previous': 'getPreviousPage'
|
||||||
},
|
},
|
||||||
@@ -51,7 +53,7 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
addGroup: function () {
|
addGroup: function () {
|
||||||
var $form = $('#group-add-form'),
|
var $form = $(this.groupAddFormtemplate()),
|
||||||
groups = this.groupCollection,
|
groups = this.groupCollection,
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
||||||
@@ -60,7 +62,8 @@ define([
|
|||||||
|
|
||||||
$('[name="group_owner"]', $form).select2($.extend(
|
$('[name="group_owner"]', $form).select2($.extend(
|
||||||
Common.contactInputOptionsForSelect2(), {
|
Common.contactInputOptionsForSelect2(), {
|
||||||
width: '270px',
|
width: '268px',
|
||||||
|
containerCss: {'margin-bottom': '5px'},
|
||||||
maximumSelectionSize: 1,
|
maximumSelectionSize: 1,
|
||||||
placeholder: gettext("Search user or enter email and press Enter"), // to override 'placeholder' returned by `Common.conta...`
|
placeholder: gettext("Search user or enter email and press Enter"), // to override 'placeholder' returned by `Common.conta...`
|
||||||
formatSelectionTooBig: gettext("You cannot select any more choices")
|
formatSelectionTooBig: gettext("You cannot select any more choices")
|
||||||
@@ -73,7 +76,7 @@ define([
|
|||||||
var $submitBtn = $('[type="submit"]', $form);
|
var $submitBtn = $('[type="submit"]', $form);
|
||||||
|
|
||||||
if (!group_name) {
|
if (!group_name) {
|
||||||
$error.html(gettext("It is required.")).show();
|
$error.html(gettext("Name is required.")).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +108,10 @@ define([
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
exportExcel: function() {
|
||||||
|
location.href = Common.getUrl({'name': 'sys_group_admin_export_excel'});
|
||||||
|
},
|
||||||
|
|
||||||
getNextPage: function() {
|
getNextPage: function() {
|
||||||
this.initPage();
|
this.initPage();
|
||||||
var current_page = this.groupCollection.state.current_page;
|
var current_page = this.groupCollection.state.current_page;
|
||||||
|
Reference in New Issue
Block a user