mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-03 07:55:36 +00:00
add ENABLE_SEAFILE_DOCS (#3290)
This commit is contained in:
@@ -6,7 +6,7 @@ import { gettext, siteRoot, enableWiki, canAddRepo, canGenerateShareLink, canGen
|
|||||||
import { seafileAPI } from '../utils/seafile-api';
|
import { seafileAPI } from '../utils/seafile-api';
|
||||||
import { Badge } from 'reactstrap';
|
import { Badge } from 'reactstrap';
|
||||||
|
|
||||||
import { canViewOrg, isDocs } from '../utils/constants';
|
import { canViewOrg, isDocs, isPro } from '../utils/constants';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
currentTab: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
currentTab: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
||||||
@@ -144,6 +144,7 @@ class MainSideNav extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
let showActivity = isDocs || isPro;
|
||||||
return (
|
return (
|
||||||
<div className="side-nav">
|
<div className="side-nav">
|
||||||
<div className="side-nav-con">
|
<div className="side-nav-con">
|
||||||
@@ -189,7 +190,7 @@ class MainSideNav extends React.Component {
|
|||||||
<span className="nav-text">{gettext('Favorites')}</span>
|
<span className="nav-text">{gettext('Favorites')}</span>
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
{isDocs &&
|
{showActivity &&
|
||||||
<li className="nav-item">
|
<li className="nav-item">
|
||||||
<Link className={`nav-link ellipsis ${this.getActiveClass('dashboard')}`} to={siteRoot + 'dashboard/'} title={gettext('Activities')} onClick={() => this.tabItemClick('dashboard')}>
|
<Link className={`nav-link ellipsis ${this.getActiveClass('dashboard')}`} to={siteRoot + 'dashboard/'} title={gettext('Activities')} onClick={() => this.tabItemClick('dashboard')}>
|
||||||
<span className="sf2-icon-clock" aria-hidden="true"></span>
|
<span className="sf2-icon-clock" aria-hidden="true"></span>
|
||||||
|
@@ -19,7 +19,8 @@ from seahub.settings import SEAFILE_VERSION, SITE_TITLE, SITE_NAME, \
|
|||||||
MAX_FILE_NAME, LOGO_PATH, BRANDING_CSS, LOGO_WIDTH, LOGO_HEIGHT,\
|
MAX_FILE_NAME, LOGO_PATH, BRANDING_CSS, LOGO_WIDTH, LOGO_HEIGHT,\
|
||||||
SHOW_REPO_DOWNLOAD_BUTTON, SITE_ROOT, ENABLE_GUEST_INVITATION, \
|
SHOW_REPO_DOWNLOAD_BUTTON, SITE_ROOT, ENABLE_GUEST_INVITATION, \
|
||||||
FAVICON_PATH, ENABLE_THUMBNAIL, THUMBNAIL_SIZE_FOR_ORIGINAL, \
|
FAVICON_PATH, ENABLE_THUMBNAIL, THUMBNAIL_SIZE_FOR_ORIGINAL, \
|
||||||
MEDIA_ROOT, SHOW_LOGOUT_ICON, CUSTOM_LOGO_PATH, CUSTOM_FAVICON_PATH
|
MEDIA_ROOT, SHOW_LOGOUT_ICON, CUSTOM_LOGO_PATH, CUSTOM_FAVICON_PATH, \
|
||||||
|
ENABLE_SEAFILE_DOCS
|
||||||
|
|
||||||
from seahub.constants import DEFAULT_ADMIN
|
from seahub.constants import DEFAULT_ADMIN
|
||||||
from seahub.utils import get_site_name, get_service_url
|
from seahub.utils import get_site_name, get_service_url
|
||||||
@@ -29,7 +30,7 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
SEACLOUD_MODE = False
|
SEACLOUD_MODE = False
|
||||||
|
|
||||||
from seahub.utils import HAS_FILE_SEARCH, EVENTS_ENABLED, is_pro_version, is_docs_version
|
from seahub.utils import HAS_FILE_SEARCH, EVENTS_ENABLED, is_pro_version
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from seahub.settings import ENABLE_PUBFILE
|
from seahub.settings import ENABLE_PUBFILE
|
||||||
@@ -121,7 +122,7 @@ def base(request):
|
|||||||
'enable_terms_and_conditions': config.ENABLE_TERMS_AND_CONDITIONS,
|
'enable_terms_and_conditions': config.ENABLE_TERMS_AND_CONDITIONS,
|
||||||
'show_logout_icon': SHOW_LOGOUT_ICON,
|
'show_logout_icon': SHOW_LOGOUT_ICON,
|
||||||
'is_pro': True if is_pro_version() else False,
|
'is_pro': True if is_pro_version() else False,
|
||||||
'is_docs': True if is_docs_version() else False,
|
'is_docs': ENABLE_SEAFILE_DOCS,
|
||||||
'enable_repo_wiki_mode': dj_settings.ENABLE_REPO_WIKI_MODE,
|
'enable_repo_wiki_mode': dj_settings.ENABLE_REPO_WIKI_MODE,
|
||||||
'enable_upload_folder': dj_settings.ENABLE_UPLOAD_FOLDER,
|
'enable_upload_folder': dj_settings.ENABLE_UPLOAD_FOLDER,
|
||||||
'enable_resumable_fileupload': dj_settings.ENABLE_RESUMABLE_FILEUPLOAD,
|
'enable_resumable_fileupload': dj_settings.ENABLE_RESUMABLE_FILEUPLOAD,
|
||||||
|
@@ -423,6 +423,9 @@ ENABLE_GROUP_DISCUSSION = True
|
|||||||
# Enable file comments
|
# Enable file comments
|
||||||
ENABLE_FILE_COMMENT = True
|
ENABLE_FILE_COMMENT = True
|
||||||
|
|
||||||
|
# Enable seafile docs
|
||||||
|
ENABLE_SEAFILE_DOCS = False
|
||||||
|
|
||||||
# File preview
|
# File preview
|
||||||
FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024
|
FILE_PREVIEW_MAX_SIZE = 30 * 1024 * 1024
|
||||||
FILE_ENCODING_LIST = ['auto', 'utf-8', 'gbk', 'ISO-8859-1', 'ISO-8859-5']
|
FILE_ENCODING_LIST = ['auto', 'utf-8', 'gbk', 'ISO-8859-1', 'ISO-8859-5']
|
||||||
|
@@ -83,15 +83,6 @@ def is_pro_version():
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def is_docs_version():
|
|
||||||
is_docs_version = True
|
|
||||||
try:
|
|
||||||
import seafevents
|
|
||||||
except ImportError:
|
|
||||||
is_docs_version = False
|
|
||||||
|
|
||||||
return is_docs_version
|
|
||||||
|
|
||||||
def is_cluster_mode():
|
def is_cluster_mode():
|
||||||
cfg = ConfigParser.ConfigParser()
|
cfg = ConfigParser.ConfigParser()
|
||||||
if 'SEAFILE_CENTRAL_CONF_DIR' in os.environ:
|
if 'SEAFILE_CENTRAL_CONF_DIR' in os.environ:
|
||||||
|
Reference in New Issue
Block a user