mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 23:48:47 +00:00
Improve hu requirement (#4502)
* optimize code * optimize code * optimize code
This commit is contained in:
@@ -1,18 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { siteRoot, gettext } from '../../utils/constants'
|
import { siteRoot, gettext } from '../../utils/constants';
|
||||||
|
|
||||||
export default function Logout() {
|
export default function Logout() {
|
||||||
const style = {
|
|
||||||
width: '32px',
|
|
||||||
height: '32px',
|
|
||||||
marginLeft: '8px',
|
|
||||||
color: '#bbb',
|
|
||||||
textDecoration: 'none'
|
|
||||||
};
|
|
||||||
const classname = "d-flex align-items-center justify-content-center"
|
|
||||||
return (
|
return (
|
||||||
<a className={classname} style={style} href={`${siteRoot}accounts/logout/`} title={gettext('Logout')}>
|
<a className="logout-icon" href={`${siteRoot}accounts/logout/`} title={gettext('Log out')}>
|
||||||
<i className="sf3-font sf3-font-logout" style={{fontSize: '24px'}}></i>
|
<i className="sf3-font sf3-font-logout" style={{fontSize: '24px'}}></i>
|
||||||
</a>
|
</a>
|
||||||
)
|
);
|
||||||
}
|
}
|
@@ -17,7 +17,7 @@ class AboutDialog extends React.Component {
|
|||||||
if (extraAboutDialogLinks && (typeof extraAboutDialogLinks) === 'object') {
|
if (extraAboutDialogLinks && (typeof extraAboutDialogLinks) === 'object') {
|
||||||
let keys = Object.keys(extraAboutDialogLinks);
|
let keys = Object.keys(extraAboutDialogLinks);
|
||||||
return keys.map((key, index) => {
|
return keys.map((key, index) => {
|
||||||
return <a key={index} className="d-block" href={extraAboutDialogLinks[key]} aria-hidden="true">{key}</a>;
|
return <a key={index} className="d-block" href={extraAboutDialogLinks[key]}>{key}</a>;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@@ -20,7 +20,7 @@ class SideNavFooter extends React.Component {
|
|||||||
if (extraAppBottomLinks && (typeof extraAppBottomLinks) === 'object') {
|
if (extraAppBottomLinks && (typeof extraAppBottomLinks) === 'object') {
|
||||||
let keys = Object.keys(extraAppBottomLinks);
|
let keys = Object.keys(extraAppBottomLinks);
|
||||||
return keys.map((key, index) => {
|
return keys.map((key, index) => {
|
||||||
return <a key={index} className="item" href={extraAppBottomLinks[key]} aria-hidden="true">{key}</a>;
|
return <a key={index} className="item" href={extraAppBottomLinks[key]}>{key}</a>;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { isPro, gettext, showExtraLogoutIcon } from '../../utils/constants';
|
import { isPro, gettext, showLogoutIcon } from '../../utils/constants';
|
||||||
import Search from '../search/search';
|
import Search from '../search/search';
|
||||||
import Notification from '../common/notification';
|
import Notification from '../common/notification';
|
||||||
import Account from '../common/account';
|
import Account from '../common/account';
|
||||||
@@ -26,7 +26,7 @@ class CommonToolbar extends React.Component {
|
|||||||
)}
|
)}
|
||||||
<Notification />
|
<Notification />
|
||||||
<Account />
|
<Account />
|
||||||
{showExtraLogoutIcon && (<Logout />)}
|
{showLogoutIcon && (<Logout />)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -83,6 +83,17 @@
|
|||||||
.common-toolbar > div{
|
.common-toolbar > div{
|
||||||
margin-left: .5rem;
|
margin-left: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.common-toolbar .logout-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
margin-left: 8px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: #ccc;
|
||||||
|
}
|
||||||
/* end common-toolbar */
|
/* end common-toolbar */
|
||||||
|
|
||||||
/* begin path toolbar */
|
/* begin path toolbar */
|
||||||
|
@@ -61,7 +61,7 @@ export const maxNumberOfFilesForFileupload = window.app.pageOptions.maxNumberOfF
|
|||||||
export const curNoteMsg = window.app.pageOptions.curNoteMsg;
|
export const curNoteMsg = window.app.pageOptions.curNoteMsg;
|
||||||
export const curNoteID = window.app.pageOptions.curNoteID;
|
export const curNoteID = window.app.pageOptions.curNoteID;
|
||||||
|
|
||||||
export const showExtraLogoutIcon = window.app.pageOptions.showExtraLogoutIcon;
|
export const showLogoutIcon = window.app.pageOptions.showLogoutIcon;
|
||||||
export const extraShareDialogNote = window.app.pageOptions.extraShareDialogNote;
|
export const extraShareDialogNote = window.app.pageOptions.extraShareDialogNote;
|
||||||
export const extraAppBottomLinks = window.app.pageOptions.extraAppBottomLinks;
|
export const extraAppBottomLinks = window.app.pageOptions.extraAppBottomLinks;
|
||||||
export const extraAboutDialogLinks = window.app.pageOptions.extraAboutDialogLinks;
|
export const extraAboutDialogLinks = window.app.pageOptions.extraAboutDialogLinks;
|
||||||
|
@@ -773,7 +773,6 @@ ENABLE_REPO_WIKI_MODE = True
|
|||||||
############################
|
############################
|
||||||
# HU berlin external#
|
# HU berlin external#
|
||||||
############################
|
############################
|
||||||
SHOW_EXTRA_LOGOUT_ICON = False
|
|
||||||
|
|
||||||
# EXTRA_SHARE_DIALOG_NOTE = {
|
# EXTRA_SHARE_DIALOG_NOTE = {
|
||||||
# 'title': 'Attention! Read before shareing files:',
|
# 'title': 'Attention! Read before shareing files:',
|
||||||
|
@@ -102,7 +102,7 @@
|
|||||||
curNoteMsg: '{{ request.cur_note.message|urlize|escapejs }}',
|
curNoteMsg: '{{ request.cur_note.message|urlize|escapejs }}',
|
||||||
curNoteID: '{{ request.cur_note.id }}',
|
curNoteID: '{{ request.cur_note.id }}',
|
||||||
{% endif %}
|
{% endif %}
|
||||||
showExtraLogoutIcon: {% if show_extra_logout_icon %} true {% else %} false {% endif %},
|
showLogoutIcon: {% if show_logout_icon %} true {% else %} false {% endif %},
|
||||||
extraShareDialogNote: {% if extra_share_dialog_note %} {{ extra_share_dialog_note|safe }} {% else %} null {% endif %},
|
extraShareDialogNote: {% if extra_share_dialog_note %} {{ extra_share_dialog_note|safe }} {% else %} null {% endif %},
|
||||||
extraAppBottomLinks: {% if extra_app_bottom_links %} {{ extra_app_bottom_links|safe }} {% else %} null {% endif %},
|
extraAppBottomLinks: {% if extra_app_bottom_links %} {{ extra_app_bottom_links|safe }} {% else %} null {% endif %},
|
||||||
extraAboutDialogLinks: {% if extra_about_dialog_links %} {{ extra_about_dialog_links|safe }} {% else %} null {% endif %}
|
extraAboutDialogLinks: {% if extra_about_dialog_links %} {{ extra_about_dialog_links|safe }} {% else %} null {% endif %}
|
||||||
|
@@ -57,7 +57,7 @@ from seahub.settings import AVATAR_FILE_STORAGE, \
|
|||||||
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL, SHARE_LINK_EXPIRE_DAYS_MIN, \
|
UNREAD_NOTIFICATIONS_REQUEST_INTERVAL, SHARE_LINK_EXPIRE_DAYS_MIN, \
|
||||||
SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_DEFAULT, \
|
SHARE_LINK_EXPIRE_DAYS_MAX, SHARE_LINK_EXPIRE_DAYS_DEFAULT, \
|
||||||
SEAFILE_COLLAB_SERVER, ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, \
|
SEAFILE_COLLAB_SERVER, ENABLE_RESET_ENCRYPTED_REPO_PASSWORD, \
|
||||||
SHOW_EXTRA_LOGOUT_ICON, EXTRA_SHARE_DIALOG_NOTE, EXTRA_APP_BOTTOM_LINKS, EXTRA_ABOUT_DIALOG_LINKS
|
EXTRA_SHARE_DIALOG_NOTE, EXTRA_APP_BOTTOM_LINKS, EXTRA_ABOUT_DIALOG_LINKS
|
||||||
|
|
||||||
from seahub.wopi.settings import ENABLE_OFFICE_WEB_APP
|
from seahub.wopi.settings import ENABLE_OFFICE_WEB_APP
|
||||||
from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE
|
from seahub.onlyoffice.settings import ENABLE_ONLYOFFICE
|
||||||
@@ -1278,7 +1278,6 @@ def react_fake_view(request, **kwargs):
|
|||||||
'folder_perm_enabled': folder_perm_enabled,
|
'folder_perm_enabled': folder_perm_enabled,
|
||||||
'file_audit_enabled' : FILE_AUDIT_ENABLED,
|
'file_audit_enabled' : FILE_AUDIT_ENABLED,
|
||||||
'custom_nav_items' : json.dumps(CUSTOM_NAV_ITEMS),
|
'custom_nav_items' : json.dumps(CUSTOM_NAV_ITEMS),
|
||||||
'show_extra_logout_icon': SHOW_EXTRA_LOGOUT_ICON,
|
|
||||||
'extra_share_dialog_note': EXTRA_SHARE_DIALOG_NOTE,
|
'extra_share_dialog_note': EXTRA_SHARE_DIALOG_NOTE,
|
||||||
'extra_app_bottom_links': EXTRA_APP_BOTTOM_LINKS,
|
'extra_app_bottom_links': EXTRA_APP_BOTTOM_LINKS,
|
||||||
'extra_about_dialog_links': EXTRA_ABOUT_DIALOG_LINKS
|
'extra_about_dialog_links': EXTRA_ABOUT_DIALOG_LINKS
|
||||||
|
Reference in New Issue
Block a user