mirror of
https://github.com/haiwen/seahub.git
synced 2025-07-22 19:02:21 +00:00
improved grp msg
This commit is contained in:
parent
544cc7fb00
commit
dd3b28c70a
@ -67,7 +67,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="group-reply">
|
<div id="group-reply">
|
||||||
<h3>留言板<span class="msg-num">(全部{{ msg_cnt }}条)</span></h3>
|
<h3>留言板</h3>
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<textarea name="message" id="message">{{ form.data.message }}</textarea><br />
|
<textarea name="message" id="message">{{ form.data.message }}</textarea><br />
|
||||||
{% for error in form.message.errors %}
|
{% for error in form.message.errors %}
|
||||||
@ -79,7 +79,7 @@
|
|||||||
{% if group_msgs %}
|
{% if group_msgs %}
|
||||||
<ul class="msg-list">
|
<ul class="msg-list">
|
||||||
{% for msg in group_msgs %}
|
{% for msg in group_msgs %}
|
||||||
<li id="li{{ msg.id }}" class="msg w100 ovhd">
|
<li class="msg w100 ovhd">
|
||||||
<div class="pic fleft">
|
<div class="pic fleft">
|
||||||
<a href="{{ SITE_ROOT }}profile/{{ msg.from_email }}/">{% avatar msg.from_email 48 %}</a>
|
<a href="{{ SITE_ROOT }}profile/{{ msg.from_email }}/">{% avatar msg.from_email 48 %}</a>
|
||||||
</div>
|
</div>
|
||||||
@ -90,8 +90,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="msg-bd">
|
<div class="msg-bd">
|
||||||
<p>{{ msg.message }}</p>
|
<p>{{ msg.message }}</p>
|
||||||
<a class="reply op" href="#" data="{{ msg.id }}" >回复({{ msg.reply_cnt }})</a>
|
{% if msg.reply_cnt == 0 %}
|
||||||
<a class="replyclose op hide" href="#" data="{{ msg.id }}">收起回复</a>
|
<a class="reply op" href="#" data="{{ msg.id }}">回复</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="reply op" href="#" data="{{ msg.id }}">{{ msg.reply_cnt }} 回复</a>
|
||||||
|
{% endif %}
|
||||||
|
<a class="replyclose op hide" href="#">收起回复</a>
|
||||||
<ul class="reply-list hide"></ul>
|
<ul class="reply-list hide"></ul>
|
||||||
<form class="reply-form hide" method="post" action="">
|
<form class="reply-form hide" method="post" action="">
|
||||||
<input type="hidden" name="msg_id" value="{{ msg.id }}" />
|
<input type="hidden" name="msg_id" value="{{ msg.id }}" />
|
||||||
@ -229,8 +233,8 @@ $('#user-profile').hover(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$('.reply').click(function() {
|
$('.reply').click(function() {
|
||||||
var msg_id = $(this).attr('data');
|
var msg_id = $(this).attr('data'),
|
||||||
var msg_bd = $(this).parent();
|
msg_bd = $(this).parent();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ SITE_ROOT }}group/reply/' + msg_id + '/',
|
url: '{{ SITE_ROOT }}group/reply/' + msg_id + '/',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@ -308,7 +312,7 @@ $('#user-profile').hover(
|
|||||||
msg_bd.children('.reply-list').html(str).attr('class', 'reply-list');
|
msg_bd.children('.reply-list').html(str).attr('class', 'reply-list');
|
||||||
form.children('input[name="message"]').val('');
|
form.children('input[name="message"]').val('');
|
||||||
form.children('.error').attr('Class' , 'error hide');
|
form.children('.error').attr('Class' , 'error hide');
|
||||||
msg_bd.children('.reply').html('回复(' + data.length+ ')');
|
msg_bd.children('.reply').html(data.length + ' 回复');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -167,7 +167,6 @@ def render_group_info(request, group_id, form):
|
|||||||
msg.reply_list = MessageReply.objects.filter(reply_to=msg)
|
msg.reply_list = MessageReply.objects.filter(reply_to=msg)
|
||||||
msg.reply_cnt = len(msg.reply_list)
|
msg.reply_cnt = len(msg.reply_list)
|
||||||
|
|
||||||
msg_cnt = GroupMessage.objects.filter(group_id=group_id).count()
|
|
||||||
|
|
||||||
return render_to_response("group/group_info.html", {
|
return render_to_response("group/group_info.html", {
|
||||||
"managers": managers,
|
"managers": managers,
|
||||||
@ -178,7 +177,6 @@ def render_group_info(request, group_id, form):
|
|||||||
"is_staff": is_staff,
|
"is_staff": is_staff,
|
||||||
"is_join": joined,
|
"is_join": joined,
|
||||||
"group_msgs": group_msgs,
|
"group_msgs": group_msgs,
|
||||||
"msg_cnt": msg_cnt,
|
|
||||||
"form": form,
|
"form": form,
|
||||||
'current_page': current_page,
|
'current_page': current_page,
|
||||||
'prev_page': current_page-1,
|
'prev_page': current_page-1,
|
||||||
|
Loading…
Reference in New Issue
Block a user