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