changelog.html 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. {% extends "cranefly/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "cranefly/macros.html" as macros with context %}
  5. {% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog") % {'post': post.pk}),parent=thread.name) }}{% endblock %}
  6. {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
  7. {% for parent in parents %}
  8. <li><a href="{{ parent.type|url(forum=parent.pk, slug=parent.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
  9. {% endfor %}
  10. <li><a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{{ thread.name }}</a> <span class="divider">/</span></li>
  11. <li class="active">{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %}
  12. {%- endblock %}
  13. {% block content %}
  14. <div class="page-header">
  15. <ul class="breadcrumb">
  16. {{ self.breadcrumb() }}</li>
  17. </ul>
  18. <h1>{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %} <small>{{ thread.name }}</small></h1>
  19. <ul class="unstyled thread-info">
  20. <li><i class="icon-time"></i> <a href="{% url 'thread_find' thread=thread.pk, slug=thread.slug, post=post.pk %}">{{ post.date|reltimesince }}</a></li>
  21. <li><i class="icon-user"></i> {% if post.user %}<a href="{% url 'user' user=post.user.pk, username=post.user.username_slug %}">{{ post.user.username }}</a>{% else %}{{ post.user_name }}{% endif %}</li>
  22. <li><i class="icon-pencil"></i> {% trans edits=post.edits %}One edit{% pluralize %}{{ edits }} edits{% endtrans %}</li>
  23. {% if post.protected %}<li><i class="icon-lock"></i> {% trans %}Protected{% endtrans %}</li>{% endif %}
  24. </ul>
  25. </div>
  26. {% if edits %}
  27. <table class="table table-striped">
  28. <thead>
  29. <tr>
  30. <th>{% trans %}Logged Changes{% endtrans %}</th>
  31. </tr>
  32. </thead>
  33. <tbody>
  34. {% for edit in edits %}
  35. <tr>
  36. <td>
  37. <div><strong><a href="{% url 'changelog_diff' thread=thread.pk, slug=thread.slug, post=post.pk, change=edit.pk %}">#{{ loop.revindex }}</a></strong>{% if edit.change != 0 %} {% if edit.change > 0 -%}
  38. {% trans chars=edit.change %}Added one character to post.{% pluralize %}Added {{ chars }} characters to post.{% endtrans %}
  39. {%- elif edit.change < 0 -%}
  40. {% trans chars=edit.change|abs %}Removed one character from post.{% pluralize %}Removed {{ chars }} characters from post.{% endtrans %}
  41. {%- endif %}{% endif %}{% if edit.thread_name_old %} {% trans old=edit.thread_name_old, new=edit.thread_name_new %}Changed thread name from "{{ old }}" to "{{ new }}".{% endtrans %}{% endif %}{% if edit.thread_name_old %} {% trans old=edit.thread_name_old, new=edit.thread_name_new %}Renamed thread from "{{ old }}" to "{{ new }}".{% endtrans %}{% endif %}</div>
  42. <div class="muted">{% if edit.user_id %}<a href="{% url 'user' user=edit.user_id, username=edit.user_slug %}">{{ edit.user_name }}</a>{% else %}{{ edit.user_name }}{% endif %}, {{ edit.date|reltimesince }}{% if edit.reason %}, <em>{{ edit.reason }}</em>{% endif %}</div>
  43. </td>
  44. </tr>
  45. {% endfor %}
  46. </tbody>
  47. </table>
  48. {% else %}
  49. <p class="lead">{% trans %}This post was never edited.{% endtrans %}</p>
  50. {% endif %}
  51. {% endblock %}