rophako/rophako/www/comment/index.inc.html

37 lines
1.5 KiB
HTML
Raw Normal View History

<a name="comments"></a>
2014-04-06 22:45:43 +00:00
{% if header %}
<h1>Comments</h1>
{% endif %}
There {% if comments|length == 1 %}is{% else %}are{% endif %}
{{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
on this page.<p>
{% for comment in comments %}
<div class="comment">
<div class="comment-author">
2014-04-18 23:00:13 +00:00
{% if comment["image"] and (comment["image"].startswith('http:') or comment["image"].startswith('https:') or comment["image"].startswith('//')) %}
2014-04-06 22:45:43 +00:00
<img src="{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% elif comment["image"] %}
<img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96">
{% else %}
<img src="/static/avatars/default.png" alt="guest" width="96" height="96">
{% endif %}<br>
<strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong>
</div>
<strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p>
{{ comment["formatted_message"]|safe }}
<div class="clear">
{% if session["login"] %}
[IP: {{ comment["ip"] }} | <a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>]
{% endif %}
</div>
</div><p>
{% endfor %}
<h2>Add a Comment</h2>
{% include "comment/form.inc.html" %}