Add placeholder for when a long desc hasn't been set

this is only visible to group admins.
pull/21833/head
Luke Barnard 2017-11-06 18:35:52 +00:00
parent 137f1311b3
commit 477051cfa6
2 changed files with 14 additions and 1 deletions

View File

@ -22,7 +22,7 @@ import MatrixClientPeg from '../../MatrixClientPeg';
import sdk from '../../index';
import dis from '../../dispatcher';
import { sanitizedHtmlNode } from '../../HtmlUtils';
import { _t } from '../../languageHandler';
import { _t, _tJsx } from '../../languageHandler';
import AccessibleButton from '../views/elements/AccessibleButton';
import Modal from '../../Modal';
import classnames from 'classnames';
@ -856,6 +856,18 @@ export default React.createClass({
let description = null;
if (summary.profile && summary.profile.long_description) {
description = sanitizedHtmlNode(summary.profile.long_description);
} else if (this.state.isUserPrivileged) {
description = <div
className="mx_GroupView_groupDesc_placeholder"
onClick={this._onEditClick}
>
{ _tJsx(
'Your community hasn\'t got a Long Description, a HTML page to show to community members.<br />' +
'Click here to open settings and give it one!',
[/<br \/>/],
[(sub) => <br />])
}
</div>;
}
const groupDescEditingClasses = classnames({
"mx_GroupView_groupDesc": true,

View File

@ -702,6 +702,7 @@
"You are a member of this community": "You are a member of this community",
"Community Member Settings": "Community Member Settings",
"Publish this community on your profile": "Publish this community on your profile",
"Your community hasn't got a Long Description, a HTML page to show to community members.<br />Click here to open settings and give it one!": "Your community hasn't got a Long Description, a HTML page to show to community members.<br />Click here to open settings and give it one!",
"Long Description (HTML)": "Long Description (HTML)",
"<h1>HTML for your community's page</h1>\n<p>\n Use the Long Description to introduce new members to the community, or distribute some important <a href=\"https://about.riot.im\">links</a>.\n</p> \n<p> \n You can even use \"img\" tags, but only for images reachable from MXC URLs.\n</p>\n": "<h1>HTML for your community's page</h1>\n<p>\n Use the Long Description to introduce new members to the community, or distribute some important <a href=\"https://about.riot.im\">links</a>.\n</p> \n<p> \n You can even use \"img\" tags, but only for images reachable from MXC URLs.\n</p>\n",
"Description": "Description",