mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
Fix quote answer and unread messages display
This commit is contained in:
parent
254126fd79
commit
6764224856
@ -203,7 +203,11 @@ ul, ol {
|
|||||||
code {
|
code {
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
blockquote {
|
||||||
|
margin: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
border: solid 1px black;
|
||||||
|
}
|
||||||
.edit-bar {
|
.edit-bar {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
|
@ -10,7 +10,7 @@ register = template.Library()
|
|||||||
@register.filter(is_safe=False)
|
@register.filter(is_safe=False)
|
||||||
@stringfilter
|
@stringfilter
|
||||||
def markdown(text):
|
def markdown(text):
|
||||||
return mark_safe(md(escape(text)))
|
return mark_safe(md(text))
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
@stringfilter
|
@stringfilter
|
||||||
|
@ -36,18 +36,18 @@
|
|||||||
<h3>{{ topic.title }}</h3>
|
<h3>{{ topic.title }}</h3>
|
||||||
<p>{{ topic.description }}</p>
|
<p>{{ topic.description }}</p>
|
||||||
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">Reply</a></p>
|
<p><a href="{{ url('forum:new_message', topic_id=topic.id) }}">Reply</a></p>
|
||||||
{% set unread = False %}
|
|
||||||
|
{% set vars = {'unread': False} %} {# ugly hack to counter Jinja scopes #}
|
||||||
{% for m in topic.messages.all() %}
|
{% for m in topic.messages.all() %}
|
||||||
{% if m.id == first_unread_message_id %}
|
{% if m.id == first_unread_message_id and vars.update({'unread': True}) %} {# idem #}
|
||||||
<div class="message unread" id="first_unread">
|
<div class="message unread" id="first_unread">
|
||||||
{% set unread = True %}
|
{% elif vars.unread %}
|
||||||
{% elif unread %}
|
<div class="message unread">
|
||||||
<div class="message unread">
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="message">
|
<div class="message">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="msg_author">
|
<div class="msg_author">
|
||||||
{% if m.author.profile_pict %}
|
{% if m.author.profile_pict %}
|
||||||
<img src="{{ m.author.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
<img src="{{ m.author.profile_pict.get_download_url() }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||||
{% else %}
|
{% else %}
|
||||||
<img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
<img src="{{ static('core/img/unknown.jpg') }}" alt="{% trans %}Profile{% endtrans %}" id="picture" />
|
||||||
|
@ -148,7 +148,7 @@ class ForumMessageCreateView(CanCreateMixin, CreateView):
|
|||||||
init = super(ForumMessageCreateView, self).get_initial()
|
init = super(ForumMessageCreateView, self).get_initial()
|
||||||
try:
|
try:
|
||||||
init['message'] = "\n".join([
|
init['message'] = "\n".join([
|
||||||
" > " + line for line in ForumMessage.objects.filter(id=self.request.GET['quote_id']).first().message.split('\n')
|
"> " + line for line in ForumMessage.objects.filter(id=self.request.GET['quote_id']).first().message.split('\n')
|
||||||
])
|
])
|
||||||
except: pass
|
except: pass
|
||||||
return init
|
return init
|
||||||
|
Loading…
Reference in New Issue
Block a user