Skip to content

Commit

Permalink
Fix posts feed markup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalp committed Jan 15, 2023
1 parent 6f220ea commit 63a5af1
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 63 deletions.
1 change: 0 additions & 1 deletion frontend/src/components/post-feed/post/body.js
@@ -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
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
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
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
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

0 comments on commit 63a5af1

Please sign in to comment.