1
1
Fork 0

Comment shit

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

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

File diff suppressed because one or more lines are too long

@ -21,13 +21,18 @@
</div>
{% 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">
<form action="{{ url_for('post.comment') }}" method="post">
{{ editform.csrf_token }}
{{ editform.id() }}
<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">
{% if current_user.is_moderator %}
{% if not comment.deleted %}
@ -47,7 +52,9 @@
<div class="comment-editform baseform">
{% 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>
{%-if comment_link%}</a>{%endif%}
{% endif %}
{% if comment.is_author %}
{{ editform.content(class="jsoff-show edit") }}

@ -57,7 +57,7 @@
{{ editform.parent }}
</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() }}
</form>
@ -78,7 +78,7 @@
<h3>Comments</h3>
<div class="comment-container">
{% 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 %}
{% if not comments %}

@ -46,7 +46,7 @@
<h3>Last comments</h3>
<div class="comment-container">
{% 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 %}
{% if not comments %}

Loading…
Cancel
Save