A Python content management system designed for kirsle.net featuring a blog, comments and photo albums. https://rophako.kirsle.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

48 lines
1.6 KiB

  1. <a name="comments"></a>
  2. {% if header %}
  3. <h1>Comments</h1>
  4. {% endif %}
  5. There {% if comments|length == 1 %}is{% else %}are{% endif %}
  6. {{ comments|length }} comment{% if comments|length != 1 %}s{% endif %}
  7. on this page.<p>
  8. {% for comment in comments %}
  9. <div class="comment">
  10. <div class="comment-author">
  11. {% if comment["image"] and (comment["image"].startswith('http:') or comment["image"].startswith('https:') or comment["image"].startswith('//')) %}
  12. <img src="{{ comment['image'] }}" alt="Avatar" width="96" height="96">
  13. {% elif comment["image"] %}
  14. <img src="{{ photo_url }}/{{ comment['image'] }}" alt="Avatar" width="96" height="96">
  15. {% else %}
  16. <img src="/static/avatars/default.png" alt="guest" width="96" height="96">
  17. {% endif %}
  18. <div><strong>{% if comment['username'] %}{{ comment['username'] }}{% else %}guest{% endif %}</strong></div>
  19. </div>
  20. <strong>Posted on {{ comment["pretty_time"] }} by {{ comment["name"] }}.</strong><p>
  21. {{ comment["formatted_message"]|safe }}
  22. <div class="clear">
  23. {% if session["login"] or comment["editable"] %}
  24. [
  25. {% if session["login"] %}
  26. IP: {{ comment["ip"] }}
  27. {% else %}
  28. <em class="comment-editable">You recently posted this</em>
  29. {% endif %}
  30. |
  31. <a href="{{ url_for('comment.edit', thread=thread, cid=comment['id'], url=url) }}">Edit</a>
  32. |
  33. <a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>
  34. ]
  35. {% endif %}
  36. </div>
  37. </div><p>
  38. {% endfor %}
  39. <h2>Add a Comment</h2>
  40. {% include "comment/form.inc.html" %}