changelog.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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"><i class="icon-chevron-right"></i></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"><i class="icon-chevron-right"></i></span></li>
  9. {% endfor %}
  10. <li><a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{{ thread.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
  11. <li class="active">{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %}
  12. {%- endblock %}
  13. {% block container %}
  14. <div class="page-header header-primary">
  15. <div class="container">
  16. {{ messages_list(messages) }}
  17. <ul class="breadcrumb">
  18. {{ self.breadcrumb() }}</li>
  19. </ul>
  20. <h1>{% trans post=post.pk %}Post #{{ post }} Votes{% endtrans %} <small>{{ thread.name }}</small></h1>
  21. <ul class="unstyled header-stats">
  22. <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>
  23. <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>
  24. <li><i class="icon-pencil"></i> {% trans edits=post.edits %}One edit{% pluralize %}{{ edits }} edits{% endtrans %}</li>
  25. {% if post.protected %}<li><i class="icon-lock"></i> {% trans %}Protected{% endtrans %}</li>{% endif %}
  26. </ul>
  27. </div>
  28. </div>
  29. <div class="container container-primary">
  30. <div class="post-changelog">
  31. {% if edits %}
  32. {% else %}
  33. <p class="lead">{% trans %}This post was never edited.{% endtrans %}</p>
  34. {% endif %}
  35. </div>
  36. </div>
  37. {% endblock %}
  38. {% block content %}
  39. <div class="page-header">
  40. <ul class="breadcrumb">
  41. {{ self.breadcrumb() }}</li>
  42. </ul>
  43. <h1>{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %} <small>{{ thread.name }}</small></h1>
  44. <ul class="unstyled thread-info">
  45. <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>
  46. <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>
  47. <li><i class="icon-pencil"></i> {% trans edits=post.edits %}One edit{% pluralize %}{{ edits }} edits{% endtrans %}</li>
  48. {% if post.protected %}<li><i class="icon-lock"></i> {% trans %}Protected{% endtrans %}</li>{% endif %}
  49. </ul>
  50. </div>
  51. {% if edits %}
  52. <table class="table table-striped">
  53. <thead>
  54. <tr>
  55. <th>{% trans %}Logged Changes{% endtrans %}</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. {% for edit in edits %}
  60. <tr>
  61. <td>
  62. <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 -%}
  63. {% trans chars=edit.change %}Added one character to post.{% pluralize %}Added {{ chars }} characters to post.{% endtrans %}
  64. {%- elif edit.change < 0 -%}
  65. {% trans chars=edit.change|abs %}Removed one character from post.{% pluralize %}Removed {{ chars }} characters from post.{% endtrans %}
  66. {%- 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>
  67. <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>
  68. </td>
  69. </tr>
  70. {% endfor %}
  71. </tbody>
  72. </table>
  73. {% else %}
  74. <p class="lead">{% trans %}This post was never edited.{% endtrans %}</p>
  75. {% endif %}
  76. {% endblock %}