diff --git a/frontend/src/components/dialog/invite-people-dialog.js b/frontend/src/components/dialog/invite-people-dialog.js index 0c6deb4bcc..da89ab9335 100644 --- a/frontend/src/components/dialog/invite-people-dialog.js +++ b/frontend/src/components/dialog/invite-people-dialog.js @@ -104,7 +104,7 @@ class InvitePeopleDialog extends React.Component { const { isSubmitting } = this.state; return ( - {gettext('Invite People')} + {gettext('Invite Guest')} - {gettext('Invite People')} + {gettext('Invite Guest')} } diff --git a/frontend/src/components/dialog/share-to-invite-people.js b/frontend/src/components/dialog/share-to-invite-people.js index b5b300b9a5..e4dc43e3b4 100644 --- a/frontend/src/components/dialog/share-to-invite-people.js +++ b/frontend/src/components/dialog/share-to-invite-people.js @@ -251,7 +251,7 @@ class ShareToInvitePeople extends React.Component { - + diff --git a/frontend/src/components/main-side-nav.js b/frontend/src/components/main-side-nav.js index a4372e9984..46af44041d 100644 --- a/frontend/src/components/main-side-nav.js +++ b/frontend/src/components/main-side-nav.js @@ -281,9 +281,9 @@ class MainSideNav extends React.Component { {canInvitePeople &&
  • - this.tabItemClick(e, 'invitations')}> + this.tabItemClick(e, 'invitations')}> - {gettext('Invite People')} + {gettext('Invite Guest')}
  • } diff --git a/frontend/src/components/toolbar/invitations-toolbar.js b/frontend/src/components/toolbar/invitations-toolbar.js index 49a078f66a..2085323e1a 100644 --- a/frontend/src/components/toolbar/invitations-toolbar.js +++ b/frontend/src/components/toolbar/invitations-toolbar.js @@ -27,11 +27,11 @@ class InvitationsToolbar extends React.Component { {Utils.isDesktop() ? (
    ) : ( - + )} diff --git a/frontend/src/pages/groups/group-view.js b/frontend/src/pages/groups/group-view.js index c0d33ed33e..5883632c36 100644 --- a/frontend/src/pages/groups/group-view.js +++ b/frontend/src/pages/groups/group-view.js @@ -126,9 +126,8 @@ class GroupView extends React.Component { if (currentGroup.parent_group_id === 0) { emptyTip = ( -

    {gettext('No library is shared to this group')}

    -

    {gettext('You can share libraries by clicking the "New Library" button above or the "Share" icon on your libraries list.')}

    -

    {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.')}

    +

    {gettext('No libraries shared with this group')}

    +

    {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.')}

    ); } else { diff --git a/frontend/src/pages/groups/groups-view.js b/frontend/src/pages/groups/groups-view.js index 020d5fe23d..caffef5c0a 100644 --- a/frontend/src/pages/groups/groups-view.js +++ b/frontend/src/pages/groups/groups-view.js @@ -185,10 +185,10 @@ class GroupsView extends React.Component { render() { const emptyTip = ( -

    {gettext('You are not in any groups')}

    +

    {gettext('No groups')}

    {canAddGroup ? -

    {gettext('Groups allow multiple people to collaborate on libraries. You can create a group by clicking the "New Group" button.')}

    : -

    {gettext('Groups allow multiple people to collaborate on libraries. Groups you join will be listed here.')}

    +

    {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.')}

    : +

    {gettext('You are not in any groups. Groups allow multiple people to collaborate on libraries. Groups you join will be listed here.')}

    }
    ); diff --git a/frontend/src/pages/invitations/invitations-view.js b/frontend/src/pages/invitations/invitations-view.js index 64681618c0..35020f2e43 100644 --- a/frontend/src/pages/invitations/invitations-view.js +++ b/frontend/src/pages/invitations/invitations-view.js @@ -179,7 +179,8 @@ class Content extends Component { if (!invitationsList.length) { return ( -

    {gettext('You have not invited any people.')}

    +

    {gettext('No guest invitations')}

    +

    {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.')}

    ); } @@ -269,7 +270,7 @@ class InvitationsView extends React.Component {
    -

    {gettext('Invite People')}

    +

    {gettext('Invite Guest')}

    diff --git a/frontend/src/pages/linked-devices/linked-devices.js b/frontend/src/pages/linked-devices/linked-devices.js index 02ef9445b9..524ea01faa 100644 --- a/frontend/src/pages/linked-devices/linked-devices.js +++ b/frontend/src/pages/linked-devices/linked-devices.js @@ -19,8 +19,8 @@ class Content extends Component { } else { const emptyTip = ( -

    {gettext('You do not have connected devices')}

    -

    {gettext('Your clients (Desktop/Android/iOS) will be listed here.')}

    +

    {gettext('No linked devices')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/my-libs/my-libs-deleted.js b/frontend/src/pages/my-libs/my-libs-deleted.js index 34322d9c0a..a41abc8bb1 100644 --- a/frontend/src/pages/my-libs/my-libs-deleted.js +++ b/frontend/src/pages/my-libs/my-libs-deleted.js @@ -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 && } {(!this.state.isLoading && this.state.deletedRepoList.length === 0) && -

    {gettext('No deleted libraries.')}

    +

    {gettext('No deleted libraries')}

    +

    {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)}

    } {this.state.deletedRepoList.length !== 0 &&
    -

    {gettext('Tip: libraries deleted 30 days ago will be cleaned automatically.')}

    +

    {gettext('Tip: libraries deleted {placeholder} days ago will be cleaned automatically.').replace('{placeholder}', trashReposExpireDays)}

    -

    {gettext('You have not created any libraries')}

    -

    {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.')}

    +

    {gettext('No libraries')}

    +

    {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.')}

    ); } 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 {
    {this.state.isLoading && } {!this.state.isLoading && this.state.errorMsg &&

    {this.state.errorMsg}

    } - {!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 && -

    {gettext('You have not shared any folders')}

    -

    {gettext('You can share a single folder with a registered user if you don\'t want to share a whole library.')}

    +

    {gettext('No folders shared')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/share-admin/libraries.js b/frontend/src/pages/share-admin/libraries.js index eea8899bb3..2ce654783a 100644 --- a/frontend/src/pages/share-admin/libraries.js +++ b/frontend/src/pages/share-admin/libraries.js @@ -29,8 +29,8 @@ class Content extends Component { } else { const emptyTip = ( -

    {gettext('You have not shared any libraries')}

    -

    {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.')}

    +

    {gettext('No libraries shared')}

    +

    {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".')}

    ); diff --git a/frontend/src/pages/share-admin/share-links.js b/frontend/src/pages/share-admin/share-links.js index 3cb7531b4d..879066e058 100644 --- a/frontend/src/pages/share-admin/share-links.js +++ b/frontend/src/pages/share-admin/share-links.js @@ -39,8 +39,8 @@ class Content extends Component { } else { const emptyTip = ( -

    {gettext('You don\'t have any share links')}

    -

    {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.')}

    +

    {gettext('No share links')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/share-admin/upload-links.js b/frontend/src/pages/share-admin/upload-links.js index 5700682ab2..db043fda12 100644 --- a/frontend/src/pages/share-admin/upload-links.js +++ b/frontend/src/pages/share-admin/upload-links.js @@ -25,8 +25,8 @@ class Content extends Component { const emptyTip = ( -

    {gettext('You don\'t have any upload links')}

    -

    {gettext('You can generate an upload link from any folder. Anyone who receives this link can upload files to this folder.')}

    +

    {gettext('No upload links')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/shared-libs/shared-libs.js b/frontend/src/pages/shared-libs/shared-libs.js index 378a6c84cc..03f09eb61d 100644 --- a/frontend/src/pages/shared-libs/shared-libs.js +++ b/frontend/src/pages/shared-libs/shared-libs.js @@ -44,8 +44,8 @@ class Content extends Component { const emptyTip = ( -

    {gettext('No libraries have been shared with you')}

    -

    {gettext('No libraries have been shared directly with you. You can find more shared libraries at "Shared with groups".')}

    +

    {gettext('No shared libraries')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/shared-with-all/public-shared-view.js b/frontend/src/pages/shared-with-all/public-shared-view.js index d651b4f189..f8ff288c31 100644 --- a/frontend/src/pages/shared-with-all/public-shared-view.js +++ b/frontend/src/pages/shared-with-all/public-shared-view.js @@ -167,7 +167,7 @@ class PublicSharedView extends React.Component { let emptyTip = (

    {gettext('No public libraries')}

    -

    {gettext('You can create a public library by clicking the "New Library" button, others can view and download this library.')}

    +

    {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.')}

    ); return ( diff --git a/frontend/src/pages/starred/starred.js b/frontend/src/pages/starred/starred.js index 73dd56d7f1..efab48e1b6 100644 --- a/frontend/src/pages/starred/starred.js +++ b/frontend/src/pages/starred/starred.js @@ -21,7 +21,8 @@ class Content extends Component { } else { const emptyTip = ( -

    {gettext('You don\'t have any favorite items yet')}

    +

    {gettext('No favorites')}

    +

    {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.')}

    ); diff --git a/frontend/src/pages/wikis/wikis.js b/frontend/src/pages/wikis/wikis.js index 011725c7d7..57ede5e55b 100644 --- a/frontend/src/pages/wikis/wikis.js +++ b/frontend/src/pages/wikis/wikis.js @@ -145,8 +145,8 @@ class Wikis extends Component { } {(!this.state.loading && this.state.wikis.length === 0) && -

    {gettext('You do not have any public library')}

    -

    {gettext('Public libraries are for publishing your contents in an organized way.')}

    +

    {gettext('No published libraries')}

    +

    {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.')}

    }
    diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index 2534bf1a41..527e063023 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -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; diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html index 7339e1ad6c..e96aec7b1b 100644 --- a/seahub/templates/base_for_react.html +++ b/seahub/templates/base_for_react.html @@ -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 %}, diff --git a/seahub/views/__init__.py b/seahub/views/__init__.py index 02993e2a0e..e0ad20a40e 100644 --- a/seahub/views/__init__.py +++ b/seahub/views/__init__.py @@ -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),
    {gettext('Invite People')}{gettext('Invite Guest')} {gettext('Permission')} {''}