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

94 lines
3.5 KiB
HTML

<a name="comments"></a>
{% 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">
{% 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 %}<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>
<form name="comment" action="{{ url_for('comment.preview') }}" method="POST">
<input type="hidden" name="token" value="{{ csrf_token() }}">
<input type="hidden" name="thread" value="{{ thread }}">
<input type="hidden" name="url" value="{{ url }}">
<input type="hidden" name="subject" value="{{ subject }}">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td align="left" valign="middle">
Your name:
</td>
<td align="left" valign="middle">
{% if session["login"] %}
<strong>{{ session["name"] }}</strong>
{% else %}
<input type="text" size="40" name="name">
{% endif %}
</td>
</tr>
<tr>
<td align="left" valign="middle">
Your Email:
</td>
<td align="left" valign="middle">
<input type="text" size="40" name="contact">
<small>(optional)</small>
</td>
</tr>
<tr>
<td align="left" valign="top">
Message:
</td>
<td align="left" valign="top">
<textarea cols="40" rows="8" name="message" style="width: 100%"></textarea><br>
<small>Comments can be formatted with <a href="https://daringfireball.net/projects/markdown/syntax" target="_blank">Markdown</a>,
and you can use<br><a href="{{ url_for('emoticons.index') }}" target="_blank">emoticons</a>
in your comment.</small>
</td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<label>
<input type="checkbox" name="subscribe" value="true">
Notify me of future comments on this page via e-mail
(<a href="{{ url_for('comment.privacy') }}" target="_blank">Privacy Policy</a>)
</label>
</td>
</tr>
</table><p>
<div style="display: none">
If you can see this, don't touch the following fields.<br>
<input type="text" name="website" value="http://"><br>
<input type="text" name="email" value="">
</div>
<button type="submit">Leave Comment</button>
</form>