Commit 463e0b70 authored by Skia's avatar Skia

Again some small forum improvements

Signed-off-by: Skia's avatarSkia <skia@libskia.so>
parent 136d0f3f
Pipeline #1003 failed with stage
in 4 minutes and 43 seconds
......@@ -6,9 +6,10 @@
{% endblock %}
{% block content %}
<p>
<p>
<a href="{{ url('forum:main') }}">Forum</a> >
</p>
</p>
<div id="forum">
<h3>{% trans %}Forum{% endtrans %}</h3>
<h4>{% trans %}Last unread messages{% endtrans %}</h4>
<p>
......@@ -26,6 +27,7 @@
</span>
{% endfor %}
</p>
</div>
{% endblock %}
......
......@@ -99,8 +99,18 @@
</div>
<div class="msg_content {% if m.deleted %}deleted{% endif %}" {% if m.id == first_unread_message_id %}id="first_unread"{% endif %}>
<div class="msg_header">
<div class="ib w_big title">{{ m.title }}</div>
<div class="ib w_big title">
<a href="{{ m.get_absolute_url() }}">
{{ m.date|localtime|date(DATETIME_FORMAT) }}
{{ m.date|localtime|time(DATETIME_FORMAT) }}
{%- if m.title -%}
- {{ m.title }}
{%- endif -%}
</a>
</div>
<div class="ib w_small">
<span><a href="{{ m.get_absolute_url() }}">#{{ m.id }}</a></span>
<br/>
<span><a href="{{ url('forum:new_message', topic_id=m.topic.id) }}?quote_id={{ m.id }}">
{% trans %}Reply as quote{% endtrans %}</a></span>
{% if user.can_edit(m) %}
......@@ -113,8 +123,6 @@
<span> <a href="{{ url('forum:delete_message', message_id=m.id) }}">{% trans %}Delete{% endtrans %}</a></span>
{% endif %}
{% endif %}
<br/>
<span>{{ m.date|localtime|date(DATETIME_FORMAT) }} {{ m.date|localtime|time(DATETIME_FORMAT) }}</span>
</div>
</div>
<hr>
......
......@@ -67,7 +67,8 @@ class ForumLastUnread(ListView):
topic_list = self.model.objects.filter(_last_message__date__gt=self.request.user.forum_infos.last_read_date)\
.exclude(_last_message__readers=self.request.user)\
.order_by('-_last_message__date')\
.select_related('_last_message__author__avatar_pict')
.select_related('_last_message__author', 'author')\
.prefetch_related('forum__edit_groups')
return topic_list
class ForumForm(forms.ModelForm):
......@@ -122,7 +123,8 @@ class ForumDetailView(CanViewMixin, DetailView):
def get_context_data(self, **kwargs):
kwargs = super(ForumDetailView, self).get_context_data(**kwargs)
qs = self.object.topics.order_by('-_last_message__date').select_related('_last_message__author', 'author')\
qs = self.object.topics.order_by('-_last_message__date')\
.select_related('_last_message__author', 'author')\
.prefetch_related("forum__edit_groups")
paginator = Paginator(qs,
settings.SITH_FORUM_PAGE_LENGTH)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment