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.
 
 
 
 
 

42 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"] %}
  24. [IP: {{ comment["ip"] }}
  25. |
  26. <a href="{{ url_for('comment.edit', thread=thread, cid=comment['id'], url=url) }}">Edit</a>
  27. |
  28. <a href="{{ url_for('comment.delete', thread=thread, cid=comment['id'], url=url) }}" onclick="return window.confirm('Are you sure?')">Delete</a>]
  29. {% endif %}
  30. </div>
  31. </div><p>
  32. {% endfor %}
  33. <h2>Add a Comment</h2>
  34. {% include "comment/form.inc.html" %}