1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 00:43:53 +00:00

add GROUP_IMPORT_MEMBERS_EXTRA_MSG (#4835)

Co-authored-by: lian <lian@seafile.com>
This commit is contained in:
lian
2021-03-17 16:43:10 +08:00
committed by GitHub
parent b27d7cd11c
commit 2405ba671e
5 changed files with 7 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Alert, Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';
import { gettext, siteRoot } from '../../utils/constants';
import { gettext, siteRoot, groupImportMembersExtraMsg } from '../../utils/constants';
const propTypes = {
toggleImportMembersDialog: PropTypes.func.isRequired,
@@ -50,6 +50,7 @@ class ImportMembersDialog extends React.Component {
<ModalHeader toggle={this.toggle}>{gettext('Import members from a .xlsx file')}</ModalHeader>
<ModalBody>
<p>{groupImportMembersExtraMsg}</p>
<p><a className="text-secondary small" href={`${siteRoot}api/v2.1/group-members-import-example/`}>{gettext('Download an example file')}</a></p>
<button className="btn btn-outline-primary" onClick={this.openFileInput}>{gettext('Upload file')}</button>
<input className="d-none" type="file" onChange={this.uploadFile} ref={this.fileInputRef} />

View File

@@ -30,6 +30,7 @@ export const contactEmail = window.app.pageOptions.contactEmail;
export const username = window.app.pageOptions.username;
export const canAddRepo = window.app.pageOptions.canAddRepo;
export const canAddGroup = window.app.pageOptions.canAddGroup;
export const groupImportMembersExtraMsg = window.app.pageOptions.groupImportMembersExtraMsg;
export const canGenerateShareLink = window.app.pageOptions.canGenerateShareLink;
export const canGenerateUploadLink = window.app.pageOptions.canGenerateUploadLink;
export const canSendShareLinkEmail = window.app.pageOptions.canSendShareLinkEmail;

View File

@@ -2,3 +2,4 @@
from django.conf import settings
GROUP_MEMBERS_DEFAULT_DISPLAY = getattr(settings, 'GROUP_MEMBERS_DEFAULT_DISPLAY', 10)
GROUP_IMPORT_MEMBERS_EXTRA_MSG = getattr(settings, 'GROUP_IMPORT_MEMBERS_EXTRA_MSG', '')

View File

@@ -60,6 +60,7 @@
trashReposExpireDays: {% if trash_repos_expire_days >= 0 %} {{ trash_repos_expire_days }} {% else %} null {% endif %},
canAddRepo: {% if user.permissions.can_add_repo %} true {% else %} false {% endif %},
canAddGroup: {% if user.permissions.can_add_group %} true {% else %} false {% endif %},
groupImportMembersExtraMsg: "{{group_import_members_extra_msg}}",
canGenerateShareLink: {% if user.permissions.can_generate_share_link %} true {% else %} false {% endif %},
canGenerateUploadLink: {% if user.permissions.can_generate_upload_link %} true {% else %} false {% endif %},
canSendShareLinkEmail: {% if user.permissions.can_send_share_link_mail %} true {% else %} false {% endif %},

View File

@@ -63,6 +63,7 @@ from seahub.wopi.settings import ENABLE_OFFICE_WEB_APP
from seahub.onlyoffice.settings import ONLYOFFICE_DESKTOP_EDITORS_PORTAL_LOGIN
from seahub.ocm.settings import ENABLE_OCM, OCM_REMOTE_SERVERS
from seahub.constants import HASH_URLS, PERMISSION_READ
from seahub.group.settings import GROUP_IMPORT_MEMBERS_EXTRA_MSG
from seahub.weixin.settings import ENABLE_WEIXIN
@@ -1213,4 +1214,5 @@ def react_fake_view(request, **kwargs):
'enable_ocm': ENABLE_OCM,
'ocm_remote_servers': OCM_REMOTE_SERVERS,
'enable_share_to_department': settings.ENABLE_SHARE_TO_DEPARTMENT,
'group_import_members_extra_msg': GROUP_IMPORT_MEMBERS_EXTRA_MSG,
})