-Subproject commit 1cbac3a1521e26b9b5c1c97a0c9852655ddcf00b
+Subproject commit 29c689af8d16417c1b84d9491f6bcea888720a87
{i18n.t("modlog")}
</NavLink>
</li>
+ {this.props.site.site_view?.site.legal_information && (
+ <li className="nav-item">
+ <NavLink className="nav-link" to="/legal">
+ {i18n.t("legal_information")}
+ </NavLink>
+ </li>
+ )}
{this.props.site.federated_instances && (
<li class="nav-item">
<NavLink className="nav-link" to="/instances">
event.preventDefault();
i.state.siteConfigLoading = true;
let form: SaveSiteConfig = {
- config_hjson: this.state.siteConfigHjson,
+ config_hjson: i.state.siteConfigHjson,
auth: authField(),
};
WebSocketService.Instance.send(wsClient.saveSiteConfig(form));
--- /dev/null
+import { Component } from "inferno";
+import { GetSiteResponse } from "lemmy-js-client";
+import { i18n } from "../../i18next";
+import { mdToHtml, setIsoData } from "../../utils";
+import { HtmlTags } from "../common/html-tags";
+
+interface LegalState {
+ siteRes: GetSiteResponse;
+}
+
+export class Legal extends Component<any, LegalState> {
+ private isoData = setIsoData(this.context);
+ private emptyState: LegalState = {
+ siteRes: this.isoData.site_res,
+ };
+
+ constructor(props: any, context: any) {
+ super(props, context);
+ this.state = this.emptyState;
+ }
+
+ get documentTitle(): string {
+ return i18n.t("legal_information");
+ }
+
+ render() {
+ return (
+ <div class="container">
+ <HtmlTags
+ title={this.documentTitle}
+ path={this.context.router.route.match.url}
+ />
+ <div
+ className="md-div"
+ dangerouslySetInnerHTML={mdToHtml(
+ this.state.siteRes.site_view.site.legal_information
+ )}
+ />
+ </div>
+ );
+ }
+}
private_instance: null,
default_theme: null,
default_post_listing_type: null,
+ legal_information: null,
auth: authField(false),
},
loading: false,
this.state = this.emptyState;
this.handleSiteSidebarChange = this.handleSiteSidebarChange.bind(this);
+ this.handleSiteLegalInfoChange = this.handleSiteLegalInfoChange.bind(this);
this.handleSiteApplicationQuestionChange =
this.handleSiteApplicationQuestionChange.bind(this);
private_instance: site.private_instance,
default_theme: site.default_theme,
default_post_listing_type: site.default_post_listing_type,
+ legal_information: site.legal_information,
auth: authField(false),
};
}
/>
</div>
</div>
+ <div class="form-group row">
+ <label class="col-12 col-form-label">
+ {i18n.t("legal_information")}
+ </label>
+ <div class="col-12">
+ <MarkdownTextArea
+ initialContent={this.state.siteForm.legal_information}
+ onContentChange={this.handleSiteLegalInfoChange}
+ hideNavigationWarnings
+ />
+ </div>
+ </div>
{this.state.siteForm.require_application && (
<div class="form-group row">
<label class="col-12 col-form-label">
this.setState(this.state);
}
+ handleSiteLegalInfoChange(val: string) {
+ this.state.siteForm.legal_information = val;
+ this.setState(this.state);
+ }
+
handleSiteApplicationQuestionChange(val: string) {
this.state.siteForm.application_question = val;
this.setState(this.state);
import { AdminSettings } from "./components/home/admin-settings";
import { Home } from "./components/home/home";
import { Instances } from "./components/home/instances";
+import { Legal } from "./components/home/legal";
import { Login } from "./components/home/login";
import { Setup } from "./components/home/setup";
import { Signup } from "./components/home/signup";
component: VerifyEmail,
},
{ path: `/instances`, component: Instances },
+ { path: `/legal`, component: Legal },
];