mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 10:22:46 +00:00
add seadoc create btn (#5477)
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { Fragment } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { enableSeadoc, gettext } from '../../utils/constants';
|
||||
import ModalPortal from '../modal-portal';
|
||||
import CreateFolder from '../../components/dialog/create-folder-dialog';
|
||||
import CreateFile from '../../components/dialog/create-file-dialog';
|
||||
@@ -142,6 +142,13 @@ class DirOperationToolbar extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
onCreateSeaDocToggle = () => {
|
||||
this.setState({
|
||||
isCreateFileDialogShow: !this.state.isCreateFileDialogShow,
|
||||
fileType: '.sdoc'
|
||||
});
|
||||
}
|
||||
|
||||
onAddFile = (filePath, isDraft) => {
|
||||
this.setState({isCreateFileDialogShow: false});
|
||||
this.props.onAddFile(filePath, isDraft);
|
||||
@@ -208,6 +215,7 @@ class DirOperationToolbar extends React.Component {
|
||||
<button className="dropdown-item" onClick={this.onCreateExcelToggle} role="menuitem">{gettext('New Excel File')}</button>
|
||||
<button className="dropdown-item" onClick={this.onCreatePPTToggle} role="menuitem">{gettext('New PowerPoint File')}</button>
|
||||
<button className="dropdown-item" onClick={this.onCreateWordToggle} role="menuitem">{gettext('New Word File')}</button>
|
||||
{enableSeadoc && <button className="dropdown-item" onClick={this.onCreateSeaDocToggle} role="menuitem">{gettext('New SeaDoc File')}</button>}
|
||||
</div>
|
||||
)}
|
||||
</Fragment>
|
||||
|
@@ -82,6 +82,7 @@ export const enableOCM = window.app.pageOptions.enableOCM;
|
||||
export const ocmRemoteServers = window.app.pageOptions.ocmRemoteServers;
|
||||
export const enableOCMViaWebdav = window.app.pageOptions.enableOCMViaWebdav;
|
||||
export const enableSSOToThirdpartWebsite = window.app.pageOptions.enableSSOToThirdpartWebsite;
|
||||
export const enableSeadoc = window.app.pageOptions.enableSeadoc;
|
||||
|
||||
export const curNoteMsg = window.app.pageOptions.curNoteMsg;
|
||||
export const curNoteID = window.app.pageOptions.curNoteID;
|
||||
|
@@ -24,7 +24,7 @@ from seahub.settings import SEAFILE_VERSION, SITE_DESCRIPTION, \
|
||||
MEDIA_ROOT, SHOW_LOGOUT_ICON, CUSTOM_LOGO_PATH, CUSTOM_FAVICON_PATH, \
|
||||
ENABLE_SEAFILE_DOCS, LOGIN_BG_IMAGE_PATH, \
|
||||
CUSTOM_LOGIN_BG_PATH, ENABLE_SHARE_LINK_REPORT_ABUSE, \
|
||||
PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK
|
||||
PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK, ENABLE_SEADOC
|
||||
|
||||
from seahub.organizations.models import OrgAdminSettings
|
||||
from seahub.organizations.settings import ORG_ENABLE_ADMIN_CUSTOM_LOGO
|
||||
@@ -162,6 +162,7 @@ def base(request):
|
||||
'side_nav_footer_custom_html': SIDE_NAV_FOOTER_CUSTOM_HTML,
|
||||
'about_dialog_custom_html': ABOUT_DIALOG_CUSTOM_HTML,
|
||||
'enable_repo_auto_del': ENABLE_REPO_AUTO_DEL,
|
||||
'enable_seadoc': ENABLE_SEADOC
|
||||
}
|
||||
|
||||
if request.user.is_staff:
|
||||
|
@@ -142,7 +142,8 @@
|
||||
additionalAppBottomLinks: {% if additional_app_bottom_links %} {{ additional_app_bottom_links|safe }} {% else %} null {% endif %},
|
||||
additionalAboutDialogLinks: {% if additional_about_dialog_links %} {{ additional_about_dialog_links|safe }} {% else %} null {% endif %},
|
||||
enableOnlyoffice: {% if enableOnlyoffice %} true {% else %} false {% endif %},
|
||||
onlyofficeConverterExtensions: {% if onlyofficeConverterExtensions %} {{onlyofficeConverterExtensions|safe}} {% else %} null {% endif %}
|
||||
onlyofficeConverterExtensions: {% if onlyofficeConverterExtensions %} {{onlyofficeConverterExtensions|safe}} {% else %} null {% endif %},
|
||||
enableSeadoc: {% if enable_seadoc %} true {% else %} false {% endif %},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user