12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- {% extends "sora/layout.html" %}
- {% load i18n %}
- {% load url from future %}
- {% import "sora/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=(_("Post #%(post)s Changelog") % {'post': post.pk}),parent=thread.name) }}{% endblock %}
- {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
- {% for parent in parents %}
- <li><a href="{{ parent.type|url(forum=forum.pk, slug=forum.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
- {% endfor %}
- <li><a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{{ thread.name }}</a> <span class="divider">/</span></li>
- <li><a href="{% url 'changelog' thread=thread.pk, slug=thread.slug, post=post.pk %}">{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %}</a> <span class="divider">/</span></li>
- <li class="active">{% trans date=change.date|reltimesince|low %}Edit from {{ date }}{% endtrans %}
- {%- endblock %}
- {% block content %}
- <div class="page-header">
- <ul class="breadcrumb">
- {{ self.breadcrumb() }}</li>
- </ul>
- <h1>{% trans post=post.pk %}Post #{{ post }} Changelog{% endtrans %} <small>{{ thread.name }}</small></h1>
- <ul class="unstyled thread-info">
- <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>
- <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>
- <li><i class="icon-pencil"></i> {% trans edits=post.edits %}One edit{% pluralize %}{{ edits }} edits{% endtrans %}</li>
- {% if post.protected %}<li><i class="icon-lock"></i> {% trans %}Protected{% endtrans %}</li>{% endif %}
- </ul>
- </div>
- {% if message %}{{ macros.draw_message(message, 'alert-form') }}{% endif %}
- <h2>{% trans date=change.date|reltimesince|low %}Edit from {{ date }}{% endtrans %} <small>#{{ change.pk }}</small></h2>
- <ul class="unstyled thread-info">
- <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>
- <li><i class="icon-user"></i> {% if change.user_id %}<a href="{% url 'user' user=change.user_id, username=change.user_slug %}">{{ change.user_name }}</a>{% else %}{{ change.user_name }}{% endif %}</li>
- {% if change.change != 0 %}<li><i class="icon-{% if change.change > 0 %}plus{% elif change.change < 0 %}minus{% endif %}"></i> {% if change.change > 0 -%}
- {% trans chars=change.change %}Added one character{% pluralize %}Added {{ chars }} characters{% endtrans %}
- {%- elif change.change < 0 -%}
- {% trans chars=change.change|abs %}Removed one character{% pluralize %}Removed {{ chars }} characters{% endtrans %}
- {%- endif %}</li>{% endif %}
- </ul>
- {% if change.reason %}
- <p class="lead">{{ change.reason }}</p>
- {% endif %}
- {% if acl.threads.can_edit_reply(user, forum, thread, post) or prev or next %}
- <div class="list-nav">
- {{ pager() }}
- {% if user.is_authenticated() and acl.threads.can_edit_reply(user, forum, thread, post) %}
- <form class="form-inline" action="{% url 'changelog_revert' thread=thread.pk, slug=thread.slug, post=post.pk, change=change.pk %}" method="post">
- <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
- <ul class="nav nav-pills pull-right">
- <li class="danger"><button type="submit" class="btn btn-danger">{% trans %}Revert this edit{% endtrans %}</button></li>
- </ul>
- </form>
- {%- endif %}
- </div>
- {% endif %}
- <div class="well diff">
- <table>
- {% for line in diff %}{% if line[0] != "?" %}
- <tr>
- <td class="line"><a href="#{{ l }}">{{ l }}.</a></td>
- <td class="{% if line[0] == '+' %}added{% elif line[0] == '-' %}removed{% else %}stag{% endif %}{% if l is even %} even{% endif %}">{% if line[2:] %}{{ line[2:] }}{% else %} {% endif %}</td>
- </tr>
- {% set l = l + 1 %}
- {% endif %}{% endfor %}
- </table>
- </div>
- {% if prev or next %}
- <div class="list-nav last">
- {{ pager() }}
- </div>
- {% endif %}
- {% endblock %}
- {% macro pager() %}
- <ul class="pager pull-left">
- {% if prev %}<li><a href="{% url 'changelog_diff' thread=thread.pk, slug=thread.slug, post=post.pk, change=prev.pk %}"><i class="icon-chevron-left"></i> {{ prev.date|reldate }}</a></li>{% endif %}
- {% if next %}<li><a href="{% url 'changelog_diff' thread=thread.pk, slug=thread.slug, post=post.pk, change=next.pk %}">{{ next.date|reldate }} <i class="icon-chevron-right"></i></a></li>{% endif %}
- </ul>
- {% endmacro %}
|