mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-07 12:09:08 +00:00
This reverts commit d137c49184
.
This commit is contained in:
parent
bacd350667
commit
4d5d8ac143
@ -2,7 +2,7 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Link } from '@reach/router';
|
import { Link } from '@reach/router';
|
||||||
import { Badge } from 'reactstrap';
|
import { Badge } from 'reactstrap';
|
||||||
import { gettext, siteRoot, canPublishRepo, canAddRepo, canGenerateShareLink, canGenerateUploadLink, canInvitePeople, dtableWebServer, lang } from '../utils/constants';
|
import { gettext, siteRoot, canPublishRepo, canAddRepo, canGenerateShareLink, canGenerateUploadLink, canInvitePeople, dtableWebServer } from '../utils/constants';
|
||||||
import { seafileAPI } from '../utils/seafile-api';
|
import { seafileAPI } from '../utils/seafile-api';
|
||||||
import { Utils } from '../utils/utils';
|
import { Utils } from '../utils/utils';
|
||||||
import toaster from './toast';
|
import toaster from './toast';
|
||||||
@ -167,33 +167,14 @@ class MainSideNav extends React.Component {
|
|||||||
renderCustomNavItems() {
|
renderCustomNavItems() {
|
||||||
return (
|
return (
|
||||||
customNavItems.map((item, idx) => {
|
customNavItems.map((item, idx) => {
|
||||||
// if no item.lang, show
|
return (
|
||||||
// if has item.lang && system.lang in item.lang, show
|
<li key={idx} className="nav-item">
|
||||||
// other case hide
|
<a href={item.link} className="nav-link ellipsis" title={item.desc}>
|
||||||
if (item.hasOwnProperty('lang') && item.lang.indexOf(lang) == -1) return null;
|
<span className={item.icon} aria-hidden="true"></span>
|
||||||
if (item.type === 'heading') {
|
<span className="nav-text">{item.desc}</span>
|
||||||
return (
|
</a>
|
||||||
<h3 key={idx} className="sf-heading">{item.desc}</h3>
|
</li>
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<ul className="nav nav-pills flex-column nav-container">
|
|
||||||
{
|
|
||||||
item.map((nav, idx) => {
|
|
||||||
if (nav.hasOwnProperty('lang') && nav.lang.indexOf(lang) == -1) return null;
|
|
||||||
return (
|
|
||||||
<li key={idx} className="nav-item">
|
|
||||||
<a href={nav.link} className="nav-link ellipsis" title={nav.desc}>
|
|
||||||
<span className={nav.icon} aria-hidden="true"></span>
|
|
||||||
<span className="nav-text">{nav.desc}</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</ul>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -295,8 +276,8 @@ class MainSideNav extends React.Component {
|
|||||||
</a>
|
</a>
|
||||||
{this.renderSharedAdmin()}
|
{this.renderSharedAdmin()}
|
||||||
</li>
|
</li>
|
||||||
|
{customNavItems && this.renderCustomNavItems()}
|
||||||
</ul>
|
</ul>
|
||||||
{customNavItems && this.renderCustomNavItems()}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{dtableWebServer &&
|
{dtableWebServer &&
|
||||||
|
@ -858,23 +858,10 @@ if ENABLE_OAUTH or ENABLE_WORK_WEIXIN:
|
|||||||
#####################
|
#####################
|
||||||
# Custom Nav Items #
|
# Custom Nav Items #
|
||||||
#####################
|
#####################
|
||||||
# if lang is given and system's lang code not in lang, item will hide
|
|
||||||
# an example:
|
# an example:
|
||||||
#
|
|
||||||
# CUSTOM_NAV_ITEMS = [
|
# CUSTOM_NAV_ITEMS = [
|
||||||
# {'type': 'heading',
|
# {'icon': 'sf2-icon-star',
|
||||||
# 'desc': 'my_custom_navs',
|
# 'desc': 'test custom name',
|
||||||
# 'lang': ['en', 'zh-cn', 'de'],
|
# 'link': 'http://127.0.0.1:8000/shared-libs/',
|
||||||
# },
|
# },
|
||||||
# [
|
|
||||||
# {'icon': 'sf2-icon-star',
|
|
||||||
# 'desc': 'only show in english, chinese or german',
|
|
||||||
# 'link': 'http://127.0.0.1:8000/shared-libs/',
|
|
||||||
# 'lang': ['en', 'zh-cn', 'de'],
|
|
||||||
# },
|
|
||||||
# {'icon': 'sf2-icon-star',
|
|
||||||
# 'desc': 'show in all languages',
|
|
||||||
# 'link': 'http://127.0.0.1:8000/shared-libs/',
|
|
||||||
# },
|
|
||||||
# ],
|
|
||||||
# ]
|
# ]
|
||||||
|
Loading…
Reference in New Issue
Block a user