mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
forum: reply page, CSS, and first_unread fix
This commit is contained in:
parent
777fdd7bd5
commit
7d99f02a4d
@ -247,10 +247,16 @@ tbody>tr:hover {
|
|||||||
background: darkgrey;
|
background: darkgrey;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
.highlight {
|
.highlight {
|
||||||
background: orange;
|
background: orange;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.underline {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
.tool-bar {
|
.tool-bar {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
|
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">{% trans %}Reply{% endtrans %}</a></p>
|
||||||
|
|
||||||
{% for m in topic.messages.select_related('author__avatar_pict').all() %}
|
{% for m in topic.messages.select_related('author__avatar_pict').all() %}
|
||||||
|
{% if m.id == first_unread_message_id %}
|
||||||
|
<span id="first_unread"></span>
|
||||||
|
{% endif %}
|
||||||
{% if m.id >= first_unread_message_id %}
|
{% if m.id >= first_unread_message_id %}
|
||||||
{{ display_message(m, user, True) }}
|
{{ display_message(m, user, True) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -144,13 +144,18 @@ class ForumTopicDetailView(CanViewMixin, DetailView):
|
|||||||
class ForumMessageEditView(CanEditMixin, UpdateView):
|
class ForumMessageEditView(CanEditMixin, UpdateView):
|
||||||
model = ForumMessage
|
model = ForumMessage
|
||||||
fields = ['title', 'message']
|
fields = ['title', 'message']
|
||||||
template_name = "core/edit.jinja"
|
template_name = "forum/reply.jinja"
|
||||||
pk_url_kwarg = "message_id"
|
pk_url_kwarg = "message_id"
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
ForumMessageMeta(message=self.object, user=self.request.user, action="EDIT").save()
|
ForumMessageMeta(message=self.object, user=self.request.user, action="EDIT").save()
|
||||||
return super(ForumMessageEditView, self).form_valid(form)
|
return super(ForumMessageEditView, self).form_valid(form)
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
kwargs = super(ForumMessageEditView, self).get_context_data(**kwargs)
|
||||||
|
kwargs['topic'] = self.object.topic
|
||||||
|
return kwargs
|
||||||
|
|
||||||
class ForumMessageDeleteView(SingleObjectMixin, RedirectView):
|
class ForumMessageDeleteView(SingleObjectMixin, RedirectView):
|
||||||
model = ForumMessage
|
model = ForumMessage
|
||||||
pk_url_kwarg = "message_id"
|
pk_url_kwarg = "message_id"
|
||||||
|
Loading…
Reference in New Issue
Block a user