diff --git a/media/css/seahub.css b/media/css/seahub.css index 1f667ddd0f..4c9540a37b 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -119,6 +119,7 @@ .icon-plus-square:before { content: "\f0fe"; } .icon-envelope:before { content: "\f0e0"; } .icon-ellipsis-vertical:before { content: "\f142"; } +.icon-building:before { content: "\f0f7"; } .fa-1x { font-size: 1.3em; } @@ -3922,6 +3923,9 @@ img.thumbnail { display:flex; justify-content:space-between; } +.address-book-group-icon { + color:#888; +} .group-toolbar-2 { position:relative; flex:none; diff --git a/seahub/api2/endpoints/admin/address_book/groups.py b/seahub/api2/endpoints/admin/address_book/groups.py index 48d5732281..99a1b8f846 100644 --- a/seahub/api2/endpoints/admin/address_book/groups.py +++ b/seahub/api2/endpoints/admin/address_book/groups.py @@ -62,17 +62,17 @@ class AdminAddressBookGroups(APIView): """ group_name = request.data.get('group_name', '').strip() if not group_name: - error_msg = 'group_name %s invalid.' % group_name + error_msg = 'name %s invalid.' % group_name return api_error(status.HTTP_400_BAD_REQUEST, error_msg) # Check whether group name is validate. if not validate_group_name(group_name): - error_msg = _(u'Group name can only contain letters, numbers, blank, hyphen or underscore') + error_msg = _(u'Name can only contain letters, numbers, blank, hyphen or underscore') return api_error(status.HTTP_400_BAD_REQUEST, error_msg) # Check whether group name is duplicated. if check_group_name_conflict(request, group_name): - error_msg = _(u'There is already a group with that name.') + error_msg = _(u'The name already exists.') return api_error(status.HTTP_400_BAD_REQUEST, error_msg) # Group owner is 'system admin' @@ -177,7 +177,7 @@ class AdminAddressBookGroup(APIView): try: ret_code = ccnet_api.remove_group(group_id) if ret_code == -1: - error_msg = 'Failed to remove: this group has child groups.' + error_msg = 'Failed to remove: this department has sub-departments.' return api_error(status.HTTP_400_BAD_REQUEST, error_msg) diff --git a/seahub/api2/endpoints/group_owned_libraries.py b/seahub/api2/endpoints/group_owned_libraries.py index 41d15e0fff..a54c5d7a9c 100644 --- a/seahub/api2/endpoints/group_owned_libraries.py +++ b/seahub/api2/endpoints/group_owned_libraries.py @@ -34,15 +34,15 @@ def get_group_owned_repo_info(request, repo_id): repo = seafile_api.get_repo(repo_id) repo_info = {} - repo_info['repo_id'] = repo_id - repo_info['repo_name'] = repo.name + repo_info['id'] = repo_id + repo_info['name'] = repo.name repo_info['mtime'] = timestamp_to_isoformat_timestr(repo.last_modified) repo_info['size'] = repo.size repo_info['encrypted'] = repo.encrypted repo_owner = get_repo_owner(request, repo_id) - repo_info['owner_email'] = repo_owner + repo_info['owner'] = repo_owner return repo_info @@ -61,13 +61,13 @@ class GroupOwnedLibraries(APIView): """ # argument check - repo_name = request.data.get("repo_name", None) + repo_name = request.data.get("name", None) if not repo_name or \ not is_valid_dirent_name(repo_name): - error_msg = "repo_name invalid." + error_msg = "name invalid." return api_error(status.HTTP_400_BAD_REQUEST, error_msg) - password = request.data.get("password", None) + password = request.data.get("passwd", None) if password and not config.ENABLE_ENCRYPTED_LIBRARY: error_msg = 'NOT allow to create encrypted library.' return api_error(status.HTTP_403_FORBIDDEN, error_msg) diff --git a/seahub/api2/endpoints/groups.py b/seahub/api2/endpoints/groups.py index 9b6a555de8..b0b22f4814 100644 --- a/seahub/api2/endpoints/groups.py +++ b/seahub/api2/endpoints/groups.py @@ -56,6 +56,7 @@ def get_group_info(request, group_id, avatar_size=GROUP_AVATAR_DEFAULT_SIZE): isoformat_timestr = timestamp_to_isoformat_timestr(group.timestamp) group_info = { "id": group.id, + "parent_group_id": group.parent_group_id, "name": group.group_name, "owner": group.creator_name, "created_at": isoformat_timestr, diff --git a/seahub/templates/js/sysadmin-templates.html b/seahub/templates/js/sysadmin-templates.html index ae575b231e..aecdc53fc0 100644 --- a/seahub/templates/js/sysadmin-templates.html +++ b/seahub/templates/js/sysadmin-templates.html @@ -1044,7 +1044,7 @@

{% trans "Departments" context "address book" %}

- +
@@ -1061,7 +1061,7 @@
-

{% trans "No groups" %}

+

{% trans "No departments" %}

@@ -1069,14 +1069,14 @@

- +
-

{% trans "Groups" %}

+

{% trans "Sub-departments" %}

@@ -1089,7 +1089,7 @@
-

{% trans "No groups" %}

+

{% trans "No sub-departments" %}

{% trans "Members" %}

@@ -1148,7 +1148,7 @@ +