mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 15:39:25 +00:00
Merge branch 'main' into feat/move-advanced-post-menu-into-dropdown
This commit is contained in:
commit
0668a52daa
|
@ -298,27 +298,22 @@ export class Signup extends Component<any, State> {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{this.renderCaptcha()}
|
{this.renderCaptcha()}
|
||||||
{siteView.local_site.enable_nsfw && (
|
<div className="form-group row">
|
||||||
<div className="form-group row">
|
<div className="col-sm-10">
|
||||||
<div className="col-sm-10">
|
<div className="form-check">
|
||||||
<div className="form-check">
|
<input
|
||||||
<input
|
className="form-check-input"
|
||||||
className="form-check-input"
|
id="register-show-nsfw"
|
||||||
id="register-show-nsfw"
|
type="checkbox"
|
||||||
type="checkbox"
|
checked={this.state.form.show_nsfw}
|
||||||
checked={this.state.form.show_nsfw}
|
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
|
||||||
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
|
/>
|
||||||
/>
|
<label className="form-check-label" htmlFor="register-show-nsfw">
|
||||||
<label
|
{i18n.t("show_nsfw")}
|
||||||
className="form-check-label"
|
</label>
|
||||||
htmlFor="register-show-nsfw"
|
|
||||||
>
|
|
||||||
{i18n.t("show_nsfw")}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
<input
|
<input
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
autoComplete="false"
|
autoComplete="false"
|
||||||
|
|
|
@ -21,7 +21,6 @@ import {
|
||||||
debounce,
|
debounce,
|
||||||
elementUrl,
|
elementUrl,
|
||||||
emDash,
|
emDash,
|
||||||
enableNsfw,
|
|
||||||
fetchCommunities,
|
fetchCommunities,
|
||||||
fetchThemeList,
|
fetchThemeList,
|
||||||
fetchUsers,
|
fetchUsers,
|
||||||
|
@ -642,22 +641,20 @@ export class Settings extends Component<any, SettingsState> {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{enableNsfw(this.state.siteRes) && (
|
<div className="form-group">
|
||||||
<div className="form-group">
|
<div className="form-check">
|
||||||
<div className="form-check">
|
<input
|
||||||
<input
|
className="form-check-input"
|
||||||
className="form-check-input"
|
id="user-show-nsfw"
|
||||||
id="user-show-nsfw"
|
type="checkbox"
|
||||||
type="checkbox"
|
checked={this.state.saveUserSettingsForm.show_nsfw}
|
||||||
checked={this.state.saveUserSettingsForm.show_nsfw}
|
onChange={linkEvent(this, this.handleShowNsfwChange)}
|
||||||
onChange={linkEvent(this, this.handleShowNsfwChange)}
|
/>
|
||||||
/>
|
<label className="form-check-label" htmlFor="user-show-nsfw">
|
||||||
<label className="form-check-label" htmlFor="user-show-nsfw">
|
{i18n.t("show_nsfw")}
|
||||||
{i18n.t("show_nsfw")}
|
</label>
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<div className="form-check">
|
<div className="form-check">
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -497,7 +497,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
const post = this.postView.post;
|
const post = this.postView.post;
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
className={`d-inline-block ${
|
className={`d-inline ${
|
||||||
!post.featured_community && !post.featured_local
|
!post.featured_community && !post.featured_local
|
||||||
? "text-body"
|
? "text-body"
|
||||||
: "text-primary"
|
: "text-primary"
|
||||||
|
@ -505,8 +505,8 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
to={`/post/${post.id}`}
|
to={`/post/${post.id}`}
|
||||||
title={i18n.t("comments")}
|
title={i18n.t("comments")}
|
||||||
>
|
>
|
||||||
<div
|
<span
|
||||||
className="d-inline-block"
|
className="d-inline"
|
||||||
dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
|
dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -519,88 +519,80 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="post-title overflow-hidden">
|
<div className="post-title overflow-hidden">
|
||||||
<h5>
|
<h5 className="d-inline">
|
||||||
{url ? (
|
{url && this.props.showBody ? (
|
||||||
this.props.showBody ? (
|
<a
|
||||||
<a
|
className={
|
||||||
className={`d-inline-block ${
|
!post.featured_community && !post.featured_local
|
||||||
!post.featured_community && !post.featured_local
|
? "text-body"
|
||||||
? "text-body"
|
: "text-primary"
|
||||||
: "text-primary"
|
}
|
||||||
}`}
|
href={url}
|
||||||
href={url}
|
title={url}
|
||||||
title={url}
|
rel={relTags}
|
||||||
rel={relTags}
|
dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
|
||||||
>
|
></a>
|
||||||
<div
|
|
||||||
className="d-inline-block"
|
|
||||||
dangerouslySetInnerHTML={mdToHtmlInline(post.name)}
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
) : (
|
|
||||||
this.postLink
|
|
||||||
)
|
|
||||||
) : (
|
) : (
|
||||||
this.postLink
|
this.postLink
|
||||||
)}
|
)}
|
||||||
{(url && isImage(url)) ||
|
|
||||||
(post.thumbnail_url && (
|
|
||||||
<button
|
|
||||||
className="btn btn-link text-monospace text-muted small d-inline-block"
|
|
||||||
data-tippy-content={i18n.t("expand_here")}
|
|
||||||
onClick={linkEvent(this, this.handleImageExpandClick)}
|
|
||||||
>
|
|
||||||
<Icon
|
|
||||||
icon={
|
|
||||||
!this.state.imageExpanded ? "plus-square" : "minus-square"
|
|
||||||
}
|
|
||||||
classes="icon-inline"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
{post.removed && (
|
|
||||||
<small className="ml-2 text-muted font-italic">
|
|
||||||
{i18n.t("removed")}
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
{post.deleted && (
|
|
||||||
<small
|
|
||||||
className="unselectable pointer ml-2 text-muted font-italic"
|
|
||||||
data-tippy-content={i18n.t("deleted")}
|
|
||||||
>
|
|
||||||
<Icon icon="trash" classes="icon-inline text-danger" />
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
{post.locked && (
|
|
||||||
<small
|
|
||||||
className="unselectable pointer ml-2 text-muted font-italic"
|
|
||||||
data-tippy-content={i18n.t("locked")}
|
|
||||||
>
|
|
||||||
<Icon icon="lock" classes="icon-inline text-danger" />
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
{post.featured_community && (
|
|
||||||
<small
|
|
||||||
className="unselectable pointer ml-2 text-muted font-italic"
|
|
||||||
data-tippy-content={i18n.t("featured")}
|
|
||||||
>
|
|
||||||
<Icon icon="pin" classes="icon-inline text-primary" />
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
{post.featured_local && (
|
|
||||||
<small
|
|
||||||
className="unselectable pointer ml-2 text-muted font-italic"
|
|
||||||
data-tippy-content={i18n.t("featured")}
|
|
||||||
>
|
|
||||||
<Icon icon="pin" classes="icon-inline text-secondary" />
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
{post.nsfw && (
|
|
||||||
<small className="ml-2 text-muted font-italic">
|
|
||||||
{i18n.t("nsfw")}
|
|
||||||
</small>
|
|
||||||
)}
|
|
||||||
</h5>
|
</h5>
|
||||||
|
{(url && isImage(url)) ||
|
||||||
|
(post.thumbnail_url && (
|
||||||
|
<button
|
||||||
|
className="btn btn-link text-monospace text-muted small d-inline-block"
|
||||||
|
data-tippy-content={i18n.t("expand_here")}
|
||||||
|
onClick={linkEvent(this, this.handleImageExpandClick)}
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon={
|
||||||
|
!this.state.imageExpanded ? "plus-square" : "minus-square"
|
||||||
|
}
|
||||||
|
classes="icon-inline"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
{post.removed && (
|
||||||
|
<small className="ml-2 text-muted font-italic">
|
||||||
|
{i18n.t("removed")}
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
|
{post.deleted && (
|
||||||
|
<small
|
||||||
|
className="unselectable pointer ml-2 text-muted font-italic"
|
||||||
|
data-tippy-content={i18n.t("deleted")}
|
||||||
|
>
|
||||||
|
<Icon icon="trash" classes="icon-inline text-danger" />
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
|
{post.locked && (
|
||||||
|
<small
|
||||||
|
className="unselectable pointer ml-2 text-muted font-italic"
|
||||||
|
data-tippy-content={i18n.t("locked")}
|
||||||
|
>
|
||||||
|
<Icon icon="lock" classes="icon-inline text-danger" />
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
|
{post.featured_community && (
|
||||||
|
<small
|
||||||
|
className="unselectable pointer ml-2 text-muted font-italic"
|
||||||
|
data-tippy-content={i18n.t("featured")}
|
||||||
|
>
|
||||||
|
<Icon icon="pin" classes="icon-inline text-primary" />
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
|
{post.featured_local && (
|
||||||
|
<small
|
||||||
|
className="unselectable pointer ml-2 text-muted font-italic"
|
||||||
|
data-tippy-content={i18n.t("featured")}
|
||||||
|
>
|
||||||
|
<Icon icon="pin" classes="icon-inline text-secondary" />
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
|
{post.nsfw && (
|
||||||
|
<small className="ml-2 text-muted font-italic">
|
||||||
|
{i18n.t("nsfw")}
|
||||||
|
</small>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue