Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix posts feed markup #1435

Merged
merged 1 commit into from
Jan 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontend/src/components/post-feed/post/body.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react"
import MisagoMarkup from "misago/components/misago-markup"
import escapeHtml from "misago/utils/escape-html"

export default function (props) {
if (props.post.content) {
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/post-feed/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ export default function ({ post, poster }) {
<li className={className} id={"post-" + post.id}>
<div className="panel panel-default panel-post">
<div className="panel-body">
<PostSide post={post} poster={user} />
<Header post={post} />
<Body post={post} />
<div className="panel-content">
<PostSide post={post} poster={user} />
<Header post={post} />
<Body post={post} />
</div>
</div>
</div>
</li>
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/profile/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ const getModeration = (profile, user) => {
delete: false,
}

if (user.is_anonumous) return moderation
if (user.is_anonymouse) return moderation

moderation.rename = profile.acl.can_rename
moderation.avatar = profile.acl.can_moderate_avatar
moderation.delete = profile.acl.can_delete
moderation.available =
moderation.available = (
moderation.rename || moderation.avatar || moderation.delete
)

return moderation
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/style/misago/post-feed.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// --------------------------------------------------

.post-feed .post-side {
width: 100%;
padding-right: 0;

.media-heading {
margin: 0px;

Expand Down
2 changes: 1 addition & 1 deletion misago/static/misago/css/misago.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/css/misago.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js.map

Large diffs are not rendered by default.

108 changes: 55 additions & 53 deletions misago/templates/misago/profile/feed.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,66 @@
<li id="post-{{ post.pk }}" class="post {% if profile.rank.css_class %}post-{{ profile.rank.css_class }}{% endif %}">
<div class="panel panel-default panel-post">
<div class="panel-body">
<div class="post-side post-side-registered">
<a class="btn btn-default btn-icon pull-right" href="{{ post.get_absolute_url }}">
<span class="btn-text-left hidden-xs">
{% trans "See post" %}
</span>
<span class="material-icon">
chevron_right
</span>
</a>
<div class="media">
<div class="media-left">
<a href="{{ profile.get_absolute_url }}">
<img src="{{ profile|avatar:50 }}" class="poster-avatar" alt="" height="50" width="50"/>
</a>
</div>
<div class="media-body">
<div class="media-heading">
<a class="item-title" href="{{ profile.get_absolute_url }}">
{{ profile }}
<div class="panel-content">
<div class="post-side post-side-registered">
<a class="btn btn-default btn-icon pull-right" href="{{ post.get_absolute_url }}">
<span class="btn-text-left hidden-xs">
{% trans "See post" %}
</span>
<span class="material-icon">
chevron_right
</span>
</a>
<div class="media">
<div class="media-left">
<a href="{{ profile.get_absolute_url }}">
<img src="{{ profile|avatar:50 }}" class="poster-avatar" alt="" height="50" width="50"/>
</a>
</div>
{% if profile.rank.is_tab %}
<a href="{{ profile.rank.get_absolute_url }}" class="user-title {% if profile.rank.css_class %}user-title-{{ profile.rank.css_class }}{% endif %}">
{% else %}
<span class="user-title {% if profile.rank.css_class %}user-title-{{ profile.rank.css_class }}{% endif %}">
{% endif %}
{{ profile.get_any_title }}
{% if profile.rank.is_tab %}
</a>
{% else %}
</span>
{% endif %}
<div class="media-body">
<div class="media-heading">
<a class="item-title" href="{{ profile.get_absolute_url }}">
{{ profile }}
</a>
</div>
{% if profile.rank.is_tab %}
<a href="{{ profile.rank.get_absolute_url }}" class="user-title {% if profile.rank.css_class %}user-title-{{ profile.rank.css_class }}{% endif %}">
{% else %}
<span class="user-title {% if profile.rank.css_class %}user-title-{{ profile.rank.css_class }}{% endif %}">
{% endif %}
{{ profile.get_any_title }}
{% if profile.rank.is_tab %}
</a>
{% else %}
</span>
{% endif %}
</div>
</div>
</div>
</div>
<div class="post-heading">
<a class="btn btn-link item-title" href="{{ post.thread.get_absolute_url }}">
{{ post.thread }}
</a>
<a class="btn btn-link post-category" href="{{ post.category.get_absolute_url }}">
{{ post.category }}
</a>
<a class="btn btn-link posted-on" href="{{ post.get_absolute_url }}">
{{ post.posted_on|date:'DATETIME_FORMAT' }}
</a>
</div>
{% if post.is_valid %}
<div class="post-body">
<article class="misago-markup">
{{ post.content|safe }}
</article>
<div class="post-heading">
<a class="btn btn-link item-title" href="{{ post.thread.get_absolute_url }}">
{{ post.thread }}
</a>
<a class="btn btn-link post-category" href="{{ post.category.get_absolute_url }}">
{{ post.category }}
</a>
<a class="btn btn-link posted-on" href="{{ post.get_absolute_url }}">
{{ post.posted_on|date:'DATETIME_FORMAT' }}
</a>
</div>
{% else %}
<div class="post-body post-body-invalid">
<p class="lead">{% trans "This post's contents cannot be displayed." %}</p>
<p class="text-muted">{% trans "This error is caused by invalid post content manipulation." %}</p>
</div>
{% endif %}
{% if post.is_valid %}
<div class="post-body">
<article class="misago-markup">
{{ post.content|safe }}
</article>
</div>
{% else %}
<div class="post-body post-body-invalid">
<p class="lead">{% trans "This post's contents cannot be displayed." %}</p>
<p class="text-muted">{% trans "This error is caused by invalid post content manipulation." %}</p>
</div>
{% endif %}
</div>
</div>
</div>
</li>
Expand Down