mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-21 02:42:26 +00:00
show empty tip when no terms (#8294)
* show empty tip when no terms * update
This commit is contained in:
@@ -38,7 +38,7 @@ class Content extends Component {
|
||||
return <p className="error text-center">{errorMsg}</p>;
|
||||
} else {
|
||||
const emptyTip = (
|
||||
<EmptyTip text={gettext('No terms and conditions')}>
|
||||
<EmptyTip text={gettext('There is no teams and conditions yet.')}>
|
||||
</EmptyTip>
|
||||
);
|
||||
const table = (
|
||||
|
@@ -1,9 +1,11 @@
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import Logo from './components/logo';
|
||||
import EmptyTip from './components/empty-tip';
|
||||
import Account from './components/common/account';
|
||||
import TermsPreviewWidget from './components/terms-preview-widget';
|
||||
import { Utils } from './utils/utils';
|
||||
import { gettext } from './utils/constants';
|
||||
|
||||
import './css/tc-accept.css';
|
||||
|
||||
@@ -21,14 +23,26 @@ class TCView extends React.Component {
|
||||
<Logo />
|
||||
<Account />
|
||||
</div>
|
||||
<div className="o-auto">
|
||||
<div className="py-4 px-4 my-6 mx-auto content">
|
||||
<h2 dangerouslySetInnerHTML={{ __html: Utils.HTMLescape(termsName) }}></h2>
|
||||
<div className="article">
|
||||
<TermsPreviewWidget content={termsText} />
|
||||
{ termsText ?
|
||||
<div className="o-auto">
|
||||
<div className="py-4 px-4 my-6 mx-auto content">
|
||||
<h2 dangerouslySetInnerHTML={{ __html: Utils.HTMLescape(termsName) }}></h2>
|
||||
<div className="article">
|
||||
<TermsPreviewWidget content={termsText} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
<div className="cur-view-content">
|
||||
<EmptyTip
|
||||
text={
|
||||
<>
|
||||
<p className="m-0">{gettext('There is no teams and conditions yet.')}</p>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ class TermsAndConditions(models.Model):
|
||||
date_active__lte=timezone.now(),
|
||||
slug=slug).latest('date_active')
|
||||
except TermsAndConditions.DoesNotExist:
|
||||
raise Http404
|
||||
active_terms = None
|
||||
|
||||
return active_terms
|
||||
|
||||
|
Reference in New Issue
Block a user