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.

36 lines
1.5 KiB

  1. <ul class="posts">
  2. {% for post in posts %}
  3. <li class="post">
  4. <div class="post-thumbnail">
  5. <a href="{{ url_for('.user', username=post.author.username) }}">
  6. <img class="img-rounded profile-thumbnail" src="{{ post.author.gravatar(size=40) }}">
  7. </a>
  8. </div>
  9. <div class="post-content">
  10. <div class="post-date">{{ moment(post.timestamp).fromNow() }}</div>
  11. <div class="post-author"><a href="{{ url_for('.user', username=post.author.username) }}">{{ post.author.username }}</a></div>
  12. <div class="post-body">
  13. {% if post.body_html %}
  14. {{ post.body_html | safe }}
  15. {% else %}
  16. {{ post.body }}
  17. {% endif %}
  18. </div>
  19. <div class="post-footer">
  20. {% if current_user == post.author %}
  21. <a href="{{ url_for('.edit', id=post.id) }}">
  22. <span class="label label-primary">Edit</span>
  23. </a>
  24. {% elif current_user.is_administrator() %}
  25. <a href="{{ url_for('.edit', id=post.id) }}">
  26. <span class="label label-danger">Edit [Admin]</span>
  27. </a>
  28. {% endif %}
  29. <a href="{{ url_for('.post', id=post.id) }}">
  30. <span class="label label-default">Permalink</span>
  31. </a>
  32. </div>
  33. </div>
  34. </li>
  35. {% endfor %}
  36. </ul>