1
1
Fork 0

Comment shit

master
Jan Kužílek 5 years ago
parent 527c11d75e
commit 125675d3dc

@ -348,9 +348,18 @@ label {
justify-content: space-between; justify-content: space-between;
align-items: baseline; align-items: baseline;
h4 { .head-left {
margin: 0; display: flex;
padding: .4em; align-items: baseline;
h4 {
margin: 0;
padding: .4em;
}
.time {
margin-left: 1em;
font-size: .7em;
}
} }
a, label { a, label {

File diff suppressed because one or more lines are too long

@ -21,13 +21,18 @@
</div> </div>
{% endmacro %} {% endmacro %}
{% macro render_comment(comment, editform) %} {% macro render_comment(comment, editform, comment_link=None, user_link=None) %}
<article id="comment-{{ comment.id }}" class="comment editingable"> <article id="comment-{{ comment.id }}" class="comment editingable">
<form action="{{ url_for('post.comment') }}" method="post"> <form action="{{ url_for('post.comment') }}" method="post">
{{ editform.csrf_token }} {{ editform.csrf_token }}
{{ editform.id() }} {{ editform.id() }}
<div class="comment-head"> <div class="comment-head">
<a href="{{ url_for('user.profile', username=comment.user.username).replace('%40', '@') }}"><h4>{{ comment.user.username or "Deleted account" }}</h4></a> <div class="head-left">
{%if user_link%}<a href="{{ user_link }}">{%endif-%}
<h4>{{ comment.user.username or "Deleted account" }}</h4>
{%-if user_link%}</a>{%endif%}
<span class="time">Posted {{ comment.natural_created() }}{%if comment.created!=comment.updated%}, edited {{ comment.natural_updated() }}{%endif%}</span>
</div>
<span class="controls"> <span class="controls">
{% if current_user.is_moderator %} {% if current_user.is_moderator %}
{% if not comment.deleted %} {% if not comment.deleted %}
@ -47,7 +52,9 @@
<div class="comment-editform baseform"> <div class="comment-editform baseform">
{% if not comment.deleted or comment.is_author or current_user.is_moderator %} {% if not comment.deleted or comment.is_author or current_user.is_moderator %}
{%if comment_link%}<a href="{{ comment_link }}">{%endif-%}
<p class="{%if comment.is_author%}jsoff-show {%endif%}comment-content notedit">{{ comment.content }}</p> <p class="{%if comment.is_author%}jsoff-show {%endif%}comment-content notedit">{{ comment.content }}</p>
{%-if comment_link%}</a>{%endif%}
{% endif %} {% endif %}
{% if comment.is_author %} {% if comment.is_author %}
{{ editform.content(class="jsoff-show edit") }} {{ editform.content(class="jsoff-show edit") }}

@ -57,7 +57,7 @@
{{ editform.parent }} {{ editform.parent }}
</div> </div>
{{ render_tag_input(editform.tags, {'alt-selblock': 'section.sidepanel article.tags .tags-inpage'}) }} {{ render_tag_input(editform.tags, param_dict={'alt-selblock': 'section.sidepanel article.tags .tags-inpage'}) }}
{{ editform.edit() }}{{ editform.approve() }} {{ editform.edit() }}{{ editform.approve() }}
</form> </form>
@ -78,7 +78,7 @@
<h3>Comments</h3> <h3>Comments</h3>
<div class="comment-container"> <div class="comment-container">
{% for comment in comments %} {% for comment in comments %}
{{ render_comment(comment, comment.editform) }} {{ render_comment(comment, comment.editform, user_link=url_for('user.profile', username=comment.user.username).replace('%40', '@')) }}
{% endfor %} {% endfor %}
{% if not comments %} {% if not comments %}

@ -46,7 +46,7 @@
<h3>Last comments</h3> <h3>Last comments</h3>
<div class="comment-container"> <div class="comment-container">
{% for comment in comments %} {% for comment in comments %}
{{ render_comment(comment, comment.editform) }} {{ render_comment(comment, comment.editform, comment_link="{}#comment-{}".format(url_for('post.post_show', id=comment.post_id), comment.id) ) }}
{% endfor %} {% endfor %}
{% if not comments %} {% if not comments %}

Loading…
Cancel
Save