|
@@ -37,12 +37,12 @@
|
|
{% for thread in threads %}
|
|
{% for thread in threads %}
|
|
<tr id="watch-{{ loop.index }}">
|
|
<tr id="watch-{{ loop.index }}">
|
|
<td>
|
|
<td>
|
|
- <a href="{{ thread_new(thread) }}" class="thread-icon{% if not thread.is_read %} thread-new{% endif %} tooltip-top" title="{% if not thread.is_read -%}
|
|
|
|
|
|
+ <a href="{{ thread_url(thread, 'new') }}" class="thread-icon{% if not thread.is_read %} thread-new{% endif %} tooltip-top" title="{% if not thread.is_read -%}
|
|
{% trans %}Click to see first unread post{% endtrans %}
|
|
{% trans %}Click to see first unread post{% endtrans %}
|
|
{%- else -%}
|
|
{%- else -%}
|
|
{% trans %}Click to see last post{% endtrans %}
|
|
{% trans %}Click to see last post{% endtrans %}
|
|
{%- endif %}"><i class="icon-comment"></i></a>
|
|
{%- endif %}"><i class="icon-comment"></i></a>
|
|
- <a href="{{ thread_start(thread) }}" class="thread-name">{{ thread.name }}</a>
|
|
|
|
|
|
+ <a href="{{ thread_url(thread) }}" class="thread-name">{{ thread.name }}</a>
|
|
<span class="thread-details">
|
|
<span class="thread-details">
|
|
{% trans user=thread_starter(thread), forum=thread_forum(thread), start=thread.start|reltimesince|low %}by {{ user }} in {{ forum }} {{ start }}{% endtrans %}
|
|
{% trans user=thread_starter(thread), forum=thread_forum(thread), start=thread.start|reltimesince|low %}by {{ user }} in {{ forum }} {{ start }}{% endtrans %}
|
|
</span>
|
|
</span>
|
|
@@ -53,13 +53,13 @@
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</td>
|
|
<td class="watched-thread-flags">
|
|
<td class="watched-thread-flags">
|
|
- <form action="{% url 'thread_unwatch' thread=thread.pk, slug=thread.slug %}" method="post">
|
|
|
|
|
|
+ <form action="{{ thread_url(thread, 'unwatch') }}" method="post">
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
<input type="hidden" name="retreat" value="{{ delete_retreat(loop) }}">
|
|
<input type="hidden" name="retreat" value="{{ delete_retreat(loop) }}">
|
|
<button type="submit" class="btn btn-danger tooltip-top" title="{% trans %}Unwatch{% endtrans %}"><i class="icon-remove"></i></button>
|
|
<button type="submit" class="btn btn-danger tooltip-top" title="{% trans %}Unwatch{% endtrans %}"><i class="icon-remove"></i></button>
|
|
</form>
|
|
</form>
|
|
|
|
|
|
- <form action="{% if thread.send_email %}{% url 'thread_unwatch_email' thread=thread.pk, slug=thread.slug %}{% else %}{% url 'thread_watch_email' thread=thread.pk, slug=thread.slug %}{% endif %}" method="post">
|
|
|
|
|
|
+ <form action="{% if thread.send_email %}{{ thread_url(thread, 'unwatch_email') }}{% else %}{{ thread_url(thread, 'watch_email') }}{% endif %}" method="post">
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
<input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
<input type="hidden" name="retreat" value="{{ request_path }}#watch-{{ loop.index }}">
|
|
<input type="hidden" name="retreat" value="{{ request_path }}#watch-{{ loop.index }}">
|
|
<button type="submit" class="btn btn-{% if thread.send_email %}success{% else %}inverse{% endif %} tooltip-top" title="{% if thread.send_email %}{% trans %}Don't notify with e-mail{% endtrans %}{% else %}{% trans %}Notify with e-mail{% endtrans %}{% endif %}"><i class="icon-envelope"></i></button>
|
|
<button type="submit" class="btn btn-{% if thread.send_email %}success{% else %}inverse{% endif %} tooltip-top" title="{% if thread.send_email %}{% trans %}Don't notify with e-mail{% endtrans %}{% else %}{% trans %}Notify with e-mail{% endtrans %}{% endif %}"><i class="icon-envelope"></i></button>
|
|
@@ -82,24 +82,14 @@
|
|
{% endblock %}
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
-{% macro thread_new(thread) -%}
|
|
|
|
-{% if thread.forum_id == private_threads.pk %}
|
|
|
|
-{% url 'private_thread_new' thread=thread.pk, slug=thread.slug %}
|
|
|
|
-{% elif thread.forum_id == reports.pk %}
|
|
|
|
-TODO!
|
|
|
|
-{% else %}
|
|
|
|
-{% url 'thread_new' thread=thread.pk, slug=thread.slug %}
|
|
|
|
-{% endif%}
|
|
|
|
-{%- endmacro%}
|
|
|
|
-
|
|
|
|
-{% macro thread_start(thread) -%}
|
|
|
|
-{% if thread.forum_id == private_threads.pk %}
|
|
|
|
-{% url 'private_thread' thread=thread.pk, slug=thread.slug %}
|
|
|
|
-{% elif thread.forum_id == reports.pk %}
|
|
|
|
-TODO!
|
|
|
|
-{% else %}
|
|
|
|
-{% url 'thread' thread=thread.pk, slug=thread.slug %}
|
|
|
|
-{% endif%}
|
|
|
|
|
|
+{% macro thread_url(thread, route='') -%}{% filter url(thread=thread.pk, slug=thread.slug) %}{% filter trim %}
|
|
|
|
+{% if thread.forum_id == private_threads.pk -%}
|
|
|
|
+private_thread
|
|
|
|
+{%- elif thread.forum_id == reports.pk -%}
|
|
|
|
+report
|
|
|
|
+{%- else -%}
|
|
|
|
+thread
|
|
|
|
+{%- endif -%}{%- if route %}_{{ route }}{% endif %}{% endfilter %}{% endfilter %}
|
|
{%- endmacro%}
|
|
{%- endmacro%}
|
|
|
|
|
|
{% macro replies(thread_replies) -%}
|
|
{% macro replies(thread_replies) -%}
|