2014-04-24 19:02:11 +00:00
|
|
|
<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">
|
2014-12-02 23:47:44 +00:00
|
|
|
{% endif %}
|
|
|
|
<div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div>
|
2014-04-06 22:45:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p>
|
|
|
|
|
|
|
|
{{ comment["formatted_message"]|safe }}
|
|
|
|
|
|
|
|
<div class="clear">
|
|
|
|
{% if session["login"] %}
|
2014-09-12 05:26:45 +00:00
|
|
|
[IP: {{ comment["ip"] }}
|
|
|
|
|
|
|
|
|
<a href="{{ url_for('comment.edit', thread=thread, cid=comment['id'], url=url) }}">Edit</a>
|
|
|
|
|
|
|
|
|
<a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>]
|
2014-04-06 22:45:43 +00:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</div><p>
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
<h2>Add a Comment</h2>
|
|
|
|
|
2014-12-02 23:47:44 +00:00
|
|
|
{% include "comment/form.inc.html" %}
|