|
@@ -1,6 +1,5 @@
|
|
|
{% extends "sora/layout.html" %}
|
|
|
{% load i18n %}
|
|
|
-{% import "_forms.html" as form_theme with context %}
|
|
|
{% import "sora/macros.html" as macros with context %}
|
|
|
|
|
|
{% block title %}{{ macros.page_title(title=_('Threads you are watching')) }}{% endblock %}
|
|
@@ -13,7 +12,9 @@
|
|
|
{% if message %}{{ macros.draw_message(message) }}{% endif %}
|
|
|
|
|
|
<div class="list-nav">
|
|
|
+ {% if items_total %}
|
|
|
{{ pager() }}
|
|
|
+ {% endif %}
|
|
|
<ul class="nav nav-pills pull-right">
|
|
|
<li class="{% if new %}primary{% else %}info{% endif %}"><a href="{% url 'watched_threads_new' %}">{% trans %}Unread Threads{% endtrans %}</a></li>
|
|
|
<li class="{% if not new %}primary{% else %}info{% endif %}"><a href="{% url 'watched_threads' %}">{% trans %}All Threads{% endtrans %}</a></li>
|
|
@@ -21,58 +22,38 @@
|
|
|
</div>
|
|
|
|
|
|
{% if threads %}
|
|
|
-<table class="table table-striped threads-list">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th style="width: 1%;"> </th>
|
|
|
- <th>{% trans %}Thread{% endtrans %}</th>
|
|
|
- <th>{% trans %}Forum{% endtrans %}</th>
|
|
|
- <th>{% trans %}Replies{% endtrans %}</th>
|
|
|
- <th>{% trans %}Last Poster{% endtrans %}</th>
|
|
|
- <th class="check-cell"><label class="checkbox"><input type="checkbox" class="checkbox-master"></label></th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- {% for thread in threads %}
|
|
|
- <tr>
|
|
|
- <td><span class="thread-icon{% if not thread.is_read %} {% if thread.closed %}thread-closed{% else %}thread-new{% endif %}{% endif %}"><i class="icon-comment icon-white"></i></span></td>
|
|
|
- <td>
|
|
|
- <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{% if not thread.is_read %}<strong>{{ thread.name }}</strong>{% else %}{{ thread.name }}{% endif %}</a> {% if not thread.is_read -%}
|
|
|
- <a href="{% url 'thread_new' thread=thread.pk, slug=thread.slug %}" class="jump jump-new tooltip-top" title="{% trans %}Jump to first unread post{% endtrans %}"><i class="icon-chevron-right"></i></a>
|
|
|
- {%- else -%}
|
|
|
- <a href="{% url 'thread_last' thread=thread.pk, slug=thread.slug %}" class="jump jump-last tooltip-top" title="{% trans %}Jump to last post{% endtrans %}"><i class="icon-chevron-right"></i></a>
|
|
|
- {%- endif %}
|
|
|
- <ul class="unstyled thread-flags">
|
|
|
- {% if thread.send_email %}<li><span class="label label-success tooltip-top" title="{% trans %}You will receive notification on your e-mail when somebody replies to this thread.{% endtrans %}"><i class="icon-envelope icon-white"></i></span></li>{% endif %}
|
|
|
- {% if thread.closed %}<li><span class="tooltip-top" title="{% trans %}This thread is closed for new replies.{% endtrans %}"><i class="icon-lock"></i></span></li>{% endif %}
|
|
|
- {% if thread.moderated %}<li><span class="tooltip-top" title="{% trans %}This thread will not be visible to other members until moderator reviews it.{% endtrans %}"><i class="icon-eye-close"></i></span></li>{% endif %}
|
|
|
- {% if thread.deleted %}<li><span class="tooltip-top" title="{% trans %}This thread has been deleted.{% endtrans %}"><i class="icon-remove"></i></span></li>{% endif %}
|
|
|
- </ul>
|
|
|
- </td>
|
|
|
- <td class="span3 thread-author"><span class="tooltip-top" title="{{ thread.start|reltimesince }}">
|
|
|
- <a href="{% url 'forum' forum=thread.forum.pk, slug=thread.forum.slug %}">{{ thread.forum.name }}</a>
|
|
|
- </td>
|
|
|
- <td class="span1 thread-stat">{{ thread.replies|intcomma }}</td>
|
|
|
- <td class="span3 thread-poster"><span class="tooltip-top" title="{{ thread.last|reltimesince }}">{% if thread.last_poster_ignored -%}
|
|
|
- {% if settings.avatars_on_threads_list %}<img src="{{ macros.avatar_guest(24) }}" alt="" class="avatar-tiny"> {% endif %}<em class="muted">{% trans %}Ignored Member{% endtrans %}</em>
|
|
|
- {%- elif thread.last_poster_id -%}
|
|
|
- {% if settings.avatars_on_threads_list %}<img src="{{ thread.last_poster.get_avatar(24) }}" alt="" class="avatar-tiny"> {% endif %}<a href="{% url 'user' user=thread.last_poster_id, username=thread.last_poster_slug %}">{{ thread.last_poster_name }}</a>
|
|
|
+<ul class="unstyled shorts-list">
|
|
|
+ {% for thread in threads %}
|
|
|
+ <li id="watch-{{ loop.index }}">
|
|
|
+ <div class="row">
|
|
|
+ <div class="span7">
|
|
|
+ <img src="{% if thread.start_post_id %}{{ thread.start_poster.get_avatar(36) }}{% else %}{{ macros.avatar_guest(24) }}{% endif %}" class="avatar tooltip-top" title="{% trans username=thread.start_poster_name %}Thread started by {{ username }}{% endtrans %}">
|
|
|
+ <p class="title">
|
|
|
+ <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}" class="hover-opacity tooltip-top" title="{% trans %}Jump to thread start{% endtrans %}"><i class="icon-asterisk"></i></a>
|
|
|
+ {% if not thread.is_read -%}
|
|
|
+ <a href="{% url 'thread_new' thread=thread.pk, slug=thread.slug %}" class="jump jump-new tooltip-top" title="{% trans %}Jump to first unread post{% endtrans %}">
|
|
|
{%- else -%}
|
|
|
- {% if settings.avatars_on_threads_list %}<img src="{{ macros.avatar_guest(24) }}" alt="" class="avatar-tiny"> {% endif %}<em class="muted">{{ thread.last_poster_name }}</em>
|
|
|
- {%- endif %}</span></td>
|
|
|
- <td class="check-cell"><label class="checkbox"><input form="threads_form" name="{{ list_form['list_items']['html_name'] }}" type="checkbox" class="checkbox-member" value="{{ thread.pk }}"{% if list_form['list_items']['has_value'] and ('' ~ thread.pk) in list_form['list_items']['value'] %} checked="checked"{% endif %}></label></td>
|
|
|
- </tr>
|
|
|
- {% endfor %}
|
|
|
- </tbody>
|
|
|
-</table>
|
|
|
-<div class="form-actions table-footer">
|
|
|
- <form id="threads_form" class="form-inline pull-right" action="{% if new %}{% url 'watched_threads_new' %}{% else %}{% url 'watched_threads' %}{% endif %}" method="POST">
|
|
|
- <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
- {{ form_theme.input_select(list_form['list_action'],width=3) }}
|
|
|
- <button type="submit" class="btn btn-primary">{% trans %}Go{% endtrans %}</button>
|
|
|
- </form>
|
|
|
-</div>
|
|
|
-
|
|
|
+ <a href="{% url 'thread_last' thread=thread.pk, slug=thread.slug %}" class="jump jump-last tooltip-top" title="{% trans %}Jump to last post{% endtrans %}">
|
|
|
+ {%- endif -%}{% if not thread.is_read %}<strong>{{ thread.name }}</strong>{% else %}{{ thread.name }}{% endif %}</a>
|
|
|
+ </p>
|
|
|
+ <p class="location">{% trans forum=forum(thread.forum), starter=username(thread.start_poster_id, thread.start_poster_name, thread.start_poster_slug), start=thread.start|reldate %}Thread started by {{ starter }} in {{ forum }} on {{ start }}.{% endtrans %}</p>
|
|
|
+ </div>
|
|
|
+ <div class="span5 span-actions hover-opacity-strong">
|
|
|
+ <form action="{% url 'thread_unwatch' thread=thread.pk, slug=thread.slug %}" class="form-inline pull-right" method="post">
|
|
|
+ <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
+ <input type="hidden" name="retreat" value="{{ delete_retreat(loop) }}">
|
|
|
+ <button class="btn btn-danger"><i class="icon-remove icon-white"></i> {% trans %}Unwatch{% endtrans %}</button>
|
|
|
+ </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 %}" class="form-inline pull-right" method="post">
|
|
|
+ <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
|
|
|
+ <input type="hidden" name="retreat" value="{{ request_path }}#watch-{{ loop.index }}">
|
|
|
+ <button class="btn{% if thread.send_email %} btn-success{% endif %}"><i class="icon-envelope{% if thread.send_email %} icon-white{% endif %}"></i> {% trans %}E-mail{% endtrans %}</button>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ {% endfor %}
|
|
|
+</ul>
|
|
|
<div class="list-nav last">
|
|
|
{{ pager() }}
|
|
|
</div>
|
|
@@ -121,3 +102,33 @@
|
|
|
</li>
|
|
|
</ul>
|
|
|
{%- endmacro %}
|
|
|
+
|
|
|
+
|
|
|
+{% macro forum(forum) -%}
|
|
|
+<a href="{% url 'forum' forum=forum.pk, slug=forum.slug %}">{{ forum.name }}</a>
|
|
|
+{%- endmacro %}
|
|
|
+
|
|
|
+{% macro username(id, username, slug) -%}
|
|
|
+{%- if id -%}
|
|
|
+<a href="{% url 'user' user=id, username=slug %}">{{ username }}</a>
|
|
|
+{%- else -%}
|
|
|
+{{ username }}
|
|
|
+{%- endif -%}
|
|
|
+{%- endmacro %}
|
|
|
+
|
|
|
+
|
|
|
+{% macro delete_retreat(loop) -%}
|
|
|
+{%- if pagination['page'] == 1 -%}
|
|
|
+ {{ request_path }}{% if not (loop.first and loop.last) %}#watch-{{ loop.index }}{% endif %}
|
|
|
+{%- else -%}
|
|
|
+ {%- if loop.first and loop.last -%}
|
|
|
+ {%- if new -%}
|
|
|
+ {%- if pagination['prev'] > 1 %}{% url 'watched_threads_new' page=pagination['prev'] %}{% else %}{% url 'watched_threads_new' %}{% endif %}
|
|
|
+ {%- else -%}
|
|
|
+ {%- if pagination['prev'] > 1 %}{% url 'watched_threads' page=pagination['prev'] %}{% else %}{% url 'watched_threads' %}{% endif %}
|
|
|
+ {%- endif -%}#watch-{{ settings.threads_per_page }}
|
|
|
+ {%- else -%}
|
|
|
+ {{ request_path }}#watch-{{ loop.index }}
|
|
|
+ {%- endif -%}
|
|
|
+{%- endif -%}
|
|
|
+{%- endmacro %}
|