mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
improved empty tips (#4391)
This commit is contained in:
@@ -104,7 +104,7 @@ class InvitePeopleDialog extends React.Component {
|
||||
const { isSubmitting } = this.state;
|
||||
return (
|
||||
<Modal isOpen={true} toggle={this.props.toggleDialog}>
|
||||
<ModalHeader toggle={this.props.toggleDialog}>{gettext('Invite People')}</ModalHeader>
|
||||
<ModalHeader toggle={this.props.toggleDialog}>{gettext('Invite Guest')}</ModalHeader>
|
||||
<ModalBody>
|
||||
<label htmlFor="emails">{gettext('Emails')}</label>
|
||||
<Input
|
||||
|
@@ -121,7 +121,7 @@ class ShareDialog extends React.Component {
|
||||
{canInvitePeople &&
|
||||
<NavItem>
|
||||
<NavLink className={activeTab === 'invitePeople' ? 'active' : ''} onClick={this.toggle.bind(this, 'invitePeople')}>
|
||||
{gettext('Invite People')}
|
||||
{gettext('Invite Guest')}
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
}
|
||||
|
@@ -251,7 +251,7 @@ class ShareToInvitePeople extends React.Component {
|
||||
<table className="table-thead-hidden">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50%">{gettext('Invite People')}</th>
|
||||
<th width="50%">{gettext('Invite Guest')}</th>
|
||||
<th width="35%">{gettext('Permission')}</th>
|
||||
<th width="15%">{''}</th>
|
||||
</tr>
|
||||
|
@@ -281,9 +281,9 @@ class MainSideNav extends React.Component {
|
||||
</li>
|
||||
{canInvitePeople &&
|
||||
<li className="nav-item">
|
||||
<Link className={`nav-link ellipsis ${this.getActiveClass('invitations')}`} to={siteRoot + 'invitations/'} title={gettext('Invite People')} onClick={(e) => this.tabItemClick(e, 'invitations')}>
|
||||
<Link className={`nav-link ellipsis ${this.getActiveClass('invitations')}`} to={siteRoot + 'invitations/'} title={gettext('Invite Guest')} onClick={(e) => this.tabItemClick(e, 'invitations')}>
|
||||
<span className="sf2-icon-invite" aria-hidden="true"></span>
|
||||
<span className="nav-text">{gettext('Invite People')}</span>
|
||||
<span className="nav-text">{gettext('Invite Guest')}</span>
|
||||
</Link>
|
||||
</li>
|
||||
}
|
||||
|
@@ -27,11 +27,11 @@ class InvitationsToolbar extends React.Component {
|
||||
{Utils.isDesktop() ? (
|
||||
<div className="operation">
|
||||
<Button color="btn btn-secondary operation-item" onClick={toggleInvitePeopleDialog}>
|
||||
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Invite People')}
|
||||
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('Invite Guest')}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<span className="sf2-icon-plus mobile-toolbar-icon" title={gettext('Invite People')} onClick={toggleInvitePeopleDialog}></span>
|
||||
<span className="sf2-icon-plus mobile-toolbar-icon" title={gettext('Invite Guest')} onClick={toggleInvitePeopleDialog}></span>
|
||||
)}
|
||||
</div>
|
||||
<CommonToolbar searchPlaceholder={this.props.searchPlaceholder} onSearchedClick={onSearchedClick}/>
|
||||
|
@@ -126,9 +126,8 @@ class GroupView extends React.Component {
|
||||
if (currentGroup.parent_group_id === 0) {
|
||||
emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('No library is shared to this group')}</h2>
|
||||
<p>{gettext('You can share libraries by clicking the "New Library" button above or the "Share" icon on your libraries list.')}</p>
|
||||
<p>{gettext('Libraries shared as writable can be downloaded and synced by other group members. Read only libraries can only be downloaded, updates by others will not be uploaded.')}</p>
|
||||
<h2>{gettext('No libraries shared with this group')}</h2>
|
||||
<p>{gettext('No libraries have been shared with this group yet. A library shared with a group can be accessed by all group members. You can share a library with a group in "My Libraries". You can also create a new library to be shared with this group by clicking the "New Library" button in the menu bar.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
} else {
|
||||
|
@@ -185,10 +185,10 @@ class GroupsView extends React.Component {
|
||||
render() {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You are not in any groups')}</h2>
|
||||
<h2>{gettext('No groups')}</h2>
|
||||
{canAddGroup ?
|
||||
<p>{gettext('Groups allow multiple people to collaborate on libraries. You can create a group by clicking the "New Group" button.')}</p> :
|
||||
<p>{gettext('Groups allow multiple people to collaborate on libraries. Groups you join will be listed here.')}</p>
|
||||
<p>{gettext('You are not in any groups. Groups allow multiple people to collaborate on libraries. You can create a group by clicking the "New Group" button in the menu bar.')}</p> :
|
||||
<p>{gettext('You are not in any groups. Groups allow multiple people to collaborate on libraries. Groups you join will be listed here.')}</p>
|
||||
}
|
||||
</EmptyTip>
|
||||
);
|
||||
|
@@ -179,7 +179,8 @@ class Content extends Component {
|
||||
if (!invitationsList.length) {
|
||||
return (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You have not invited any people.')}</h2>
|
||||
<h2>{gettext('No guest invitations')}</h2>
|
||||
<p>{gettext('You have not invited any guests yet. A guest can access shared libraries through the web interface allowing more efficient ways to collaborate than through links. You can invite a guest by clicking the "Invite Guest" button in the menu bar.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
}
|
||||
@@ -269,7 +270,7 @@ class InvitationsView extends React.Component {
|
||||
<div className="main-panel-center flex-row">
|
||||
<div className="cur-view-container">
|
||||
<div className="cur-view-path">
|
||||
<h3 className="sf-heading">{gettext('Invite People')}</h3>
|
||||
<h3 className="sf-heading">{gettext('Invite Guest')}</h3>
|
||||
</div>
|
||||
<div className="cur-view-content">
|
||||
<Content data={this.state} />
|
||||
|
@@ -19,8 +19,8 @@ class Content extends Component {
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You do not have connected devices')}</h2>
|
||||
<p>{gettext('Your clients (Desktop/Android/iOS) will be listed here.')}</p>
|
||||
<h2>{gettext('No linked devices')}</h2>
|
||||
<p>{gettext('You have not accessed your files with any client (desktop or mobile) yet. Configure clients on your devices to access your data more comfortably.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import React, { Component, Fragment } from 'react';
|
||||
import { Link } from '@reach/router';
|
||||
import moment from 'moment';
|
||||
import { gettext, siteRoot, lang } from '../../utils/constants';
|
||||
import { gettext, siteRoot, lang, trashReposExpireDays } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import toaster from '../../components/toast';
|
||||
@@ -59,12 +59,13 @@ class MyLibsDeleted extends Component {
|
||||
{this.state.isLoading && <Loading />}
|
||||
{(!this.state.isLoading && this.state.deletedRepoList.length === 0) &&
|
||||
<EmptyTip>
|
||||
<h2>{gettext('No deleted libraries.')}</h2>
|
||||
<h2>{gettext('No deleted libraries')}</h2>
|
||||
<p>{gettext('You have not deleted any libraries in the last {placeholder} days. A deleted library will be cleaned automatically after this period.').replace('{placeholder}', trashReposExpireDays)}</p>
|
||||
</EmptyTip>
|
||||
}
|
||||
{this.state.deletedRepoList.length !== 0 &&
|
||||
<div>
|
||||
<p className="tip">{gettext('Tip: libraries deleted 30 days ago will be cleaned automatically.')}</p>
|
||||
<p className="tip mt-2">{gettext('Tip: libraries deleted {placeholder} days ago will be cleaned automatically.').replace('{placeholder}', trashReposExpireDays)}</p>
|
||||
<DeletedRepoTable
|
||||
deletedRepoList={this.state.deletedRepoList}
|
||||
refreshDeletedRepoList={this.refreshDeletedRepoList}
|
||||
|
@@ -34,17 +34,16 @@ class MyLibraries extends Component {
|
||||
sortOrder: cookie.load('seafile-repo-dir-sort-order') || 'asc', // 'asc' or 'desc'
|
||||
};
|
||||
|
||||
this.emptyMessage = (
|
||||
this.emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You have not created any libraries')}</h2>
|
||||
<p>{gettext('You can create a library to organize your files. For example, you can create one for each of your projects. Each library can be synchronized and shared separately.')}</p>
|
||||
<h2>{gettext('No libraries')}</h2>
|
||||
<p>{gettext('You have not created any libraries yet. A library is a container to organize your files and folders. A library can also be shared with others and synced to your connected devices. You can create a library by clicking the "New Library" button in the menu bar.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
seafileAPI.listRepos({type: 'mine'}).then((res) => {
|
||||
// res: {data: {...}, status: 200, statusText: "OK", headers: {…}, config: {…}, …}
|
||||
let repoList = res.data.repos.map((item) => {
|
||||
return new Repo(item);
|
||||
});
|
||||
@@ -160,7 +159,7 @@ class MyLibraries extends Component {
|
||||
<div className="cur-view-content">
|
||||
{this.state.isLoading && <Loading />}
|
||||
{!this.state.isLoading && this.state.errorMsg && <p className="error text-center mt-8">{this.state.errorMsg}</p>}
|
||||
{!this.state.isLoading && !this.state.errorMsg && this.state.repoList.length === 0 && this.emptyMessage}
|
||||
{!this.state.isLoading && !this.state.errorMsg && this.state.repoList.length === 0 && this.emptyTip}
|
||||
{!this.state.isLoading && !this.state.errorMsg && this.state.repoList.length > 0 &&
|
||||
<MylibRepoListView
|
||||
sortBy={this.state.sortBy}
|
||||
|
@@ -30,8 +30,8 @@ class Content extends Component {
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You have not shared any folders')}</h2>
|
||||
<p>{gettext('You can share a single folder with a registered user if you don\'t want to share a whole library.')}</p>
|
||||
<h2>{gettext('No folders shared')}</h2>
|
||||
<p>{gettext('You have not shared any folders with other users yet. You can share a folder with other users by clicking the share icon to the right of a folder\'s name.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -29,8 +29,8 @@ class Content extends Component {
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You have not shared any libraries')}</h2>
|
||||
<p>{gettext('You can share libraries with your friends and colleagues by clicking the share icon of your own libraries in your home page or creating a new library in groups you are in.')}</p>
|
||||
<h2>{gettext('No libraries shared')}</h2>
|
||||
<p>{gettext('You have not shared any libraries with other users yet. You can share a library with other users by clicking the share icon to the right of a library\'s name in "My Libraries".')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -39,8 +39,8 @@ class Content extends Component {
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You don\'t have any share links')}</h2>
|
||||
<p>{gettext('You can generate a share link for a folder or a file. Anyone who receives this link can view the folder or the file online.')}</p>
|
||||
<h2>{gettext('No share links')}</h2>
|
||||
<p>{gettext('You have not created any share links yet. A share link can be used to share files and folders with anyone. You can create a share link for a file or folder by clicking the share icon to the right of its name.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -25,8 +25,8 @@ class Content extends Component {
|
||||
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You don\'t have any upload links')}</h2>
|
||||
<p>{gettext('You can generate an upload link from any folder. Anyone who receives this link can upload files to this folder.')}</p>
|
||||
<h2>{gettext('No upload links')}</h2>
|
||||
<p>{gettext('You have not created any upload links yet. An upload link allows anyone to upload files to a folder or library. You can create an upload link for a folder or library by clicking the share icon to the right of its name.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -44,8 +44,8 @@ class Content extends Component {
|
||||
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('No libraries have been shared with you')}</h2>
|
||||
<p>{gettext('No libraries have been shared directly with you. You can find more shared libraries at "Shared with groups".')}</p>
|
||||
<h2>{gettext('No shared libraries')}</h2>
|
||||
<p>{gettext('No libraries have been shared directly with you. A shared library can be shared with full or restricted permission. If you need access to a library owned by another user, ask the user to share the library with you.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -167,7 +167,7 @@ class PublicSharedView extends React.Component {
|
||||
let emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('No public libraries')}</h2>
|
||||
<p>{gettext('You can create a public library by clicking the "New Library" button, others can view and download this library.')}</p>
|
||||
<p>{gettext('No public libraries have been created yet. A public library is accessible by all users. You can create a public library by clicking the "Add Library" button in the menu bar.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
return (
|
||||
|
@@ -21,7 +21,8 @@ class Content extends Component {
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You don\'t have any favorite items yet')}</h2>
|
||||
<h2>{gettext('No favorites')}</h2>
|
||||
<p>{gettext('You have not added any libraries, folders or files to your favorites yet. A favorite gives you quick access to your most frequently used objects. You can add a library, folder or file to your favorites by clicking the star to the left of its name.')}</p>
|
||||
</EmptyTip>
|
||||
);
|
||||
|
||||
|
@@ -145,8 +145,8 @@ class Wikis extends Component {
|
||||
}
|
||||
{(!this.state.loading && this.state.wikis.length === 0) &&
|
||||
<EmptyTip>
|
||||
<h2>{gettext('You do not have any public library')}</h2>
|
||||
<p>{gettext('Public libraries are for publishing your contents in an organized way.')}</p>
|
||||
<h2>{gettext('No published libraries')}</h2>
|
||||
<p>{gettext('You have not published any libraries yet. A published library can be accessed by anyone, not only users, via its URL. You can publish a library by clicking the "Publish a Library" button in the menu bar.')}</p>
|
||||
</EmptyTip>
|
||||
}
|
||||
</div>
|
||||
|
@@ -21,6 +21,7 @@ export const faviconPath = window.app.config.faviconPath;
|
||||
export const loginBGPath = window.app.config.loginBGPath;
|
||||
|
||||
//pageOptions
|
||||
export const trashReposExpireDays = window.app.pageOptions.trashReposExpireDays;
|
||||
export const dtableWebServer = window.app.pageOptions.dtableWebServer;
|
||||
export const seafileCollabServer = window.app.pageOptions.seafileCollabServer;
|
||||
export const name = window.app.pageOptions.name;
|
||||
|
@@ -55,6 +55,7 @@
|
||||
contactEmail: "{{request.user.username|email2contact_email|escapejs}}",
|
||||
username: "{{request.user.username|escapejs}}",
|
||||
guideEnabled: {% if guide_enabled %} true {% else %} false {% endif %},
|
||||
trashReposExpireDays: {{ trash_repos_expire_days }},
|
||||
canAddRepo: {% if user.permissions.can_add_repo %} true {% else %} false {% endif %},
|
||||
canAddGroup: {% if user.permissions.can_add_group %} true {% else %} false {% endif %},
|
||||
canGenerateShareLink: {% if user.permissions.can_generate_share_link %} true {% else %} false {% endif %},
|
||||
|
@@ -1123,10 +1123,17 @@ def react_fake_view(request, **kwargs):
|
||||
if guide_enabled:
|
||||
create_default_library(request)
|
||||
|
||||
try:
|
||||
expire_days = seafile_api.get_server_config_int('library_trash', 'expire_days')
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
expire_days = -1
|
||||
|
||||
folder_perm_enabled = True if is_pro_version() and ENABLE_FOLDER_PERM else False
|
||||
|
||||
return render(request, "react_app.html", {
|
||||
"guide_enabled": guide_enabled,
|
||||
'trash_repos_expire_days': expire_days if expire_days > 0 else 30,
|
||||
'dtable_web_server': DTABLE_WEB_SERVER,
|
||||
'seafile_collab_server': SEAFILE_COLLAB_SERVER,
|
||||
'storages': get_library_storages(request),
|
||||
|
Reference in New Issue
Block a user