rophako/rophako/modules/comment/templates/comment/index.inc.html

48 lines
1.6 KiB
HTML
Raw Normal View History

<a name="comments"></a>
2014-04-06 22:45:43 +00:00
{% if header %}
2015-08-12 00:39:16 +00:00
<h1>Comments</h1>
2014-04-06 22:45:43 +00:00
{% endif %}
There {% if comments|length == 1 %}is{% else %}are{% endif %}
2015-08-12 00:39:16 +00:00
{{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
on this page.<p>
2014-04-06 22:45:43 +00:00
{% for comment in comments %}
2015-08-12 00:39:16 +00:00
<div class="comment">
<div class="comment-author">
{% if comment["image"] and (comment["image"].startswith('http:') or comment["image"].startswith('https:') or comment["image"].startswith('//')) %}
<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 %}
<div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div>
</div>
2014-04-06 22:45:43 +00:00
2015-08-12 00:39:16 +00:00
<strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p>
2014-04-06 22:45:43 +00:00
2015-08-12 00:39:16 +00:00
{{ comment["formatted_message"]|safe }}
2014-04-06 22:45:43 +00:00
2015-08-12 00:39:16 +00:00
<div class="clear">
{% if session["login"] or comment["editable"] %}
[
{% if session["login"] %}
IP: {{ comment["ip"] }}
{% else %}
<em class="comment-editable">You recently posted this</em>
{% endif %}
2015-08-12 00:39:16 +00:00
|
<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>
]
2015-08-12 00:39:16 +00:00
{% endif %}
</div>
</div><p>
2014-04-06 22:45:43 +00:00
{% endfor %}
<h2>Add a Comment</h2>
2014-12-02 23:47:44 +00:00
{% include "comment/form.inc.html" %}