1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 10:26:17 +00:00

Fix new line bug in leaving message and escape message replies to show <br />

This commit is contained in:
xiez
2012-07-31 10:51:50 +08:00
parent 220f9c9c24
commit 391c25fa40
2 changed files with 4 additions and 3 deletions

View File

@@ -80,7 +80,7 @@
{% endif %}
<div id="group-reply">
<h3>留言板</h3>
<h3>信息栏</h3>
<form action="" method="post">
<textarea name="message" id="message">{{ form.data.message }}</textarea><br />
{% for error in form.message.errors %}
@@ -102,7 +102,7 @@
<a href="{{ SITE_ROOT }}profile/{{ msg.from_email }}/">{{ msg.from_email|email2nickname }}</a>
</div>
<div class="msg-bd">
<p>{{ msg.message|urlize|url_target_blank|find_at }}</p>
<p>{{ msg.message|linebreaksbr|urlize|url_target_blank|find_at }}</p>
{% if msg.reply_cnt == 0 %}
<a class="reply op" href="#" data="{{ msg.id }}">回复</a>
{% else %}

View File

@@ -241,7 +241,8 @@ def msg_reply(request, msg_id):
d = {}
d['from_email'] = e.from_email
d['nickname'] = e.nickname
d['message'] = e.message
from django.utils.html import escape
d['message'] = escape(e.message)
l.append(d)
return HttpResponse(json.dumps(l), content_type=content_type)