socialforge/app/views/users/user_messages.html.erb

68 lines
2.0 KiB
Plaintext

<%= render :partial => 'users/selector_for_messages'%>
<div class="resources mt10" id="users_setting">
<div>
<% if (!@message_alls.nil? && @message_alls.count >0) %>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting">
<% count = unviewed_message(@user) %>
有&nbsp;<span class="c_red"><%= count %></span>&nbsp;条未读
<% unless (count == 0 || User.current != @user) %>
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
<% end %>
</div>
<% end %>
<!--总消息列表-->
<div id="all_message_list">
<% unless @message_alls.nil? %>
<%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %>
<% end %>
</div>
<!--项目消息-->
<% else %>
<div class="flash notice">您目前还没有相关消息!</div>
<% end %>
<div class="cl"></div>
</div>
</div>
<script>
function message_titile_show(obj,e)
{
obj.parent().next("div").show();
obj.parent().next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
}
function message_titile_hide(obj)
{
obj.parent().next("div").hide();
}
function show_more_system_messages(list,content, id2, id3) {
$(list).toggleClass("show_more_li");
$(content).toggleClass("show_more_system_message");
var information = $(id2);
var val = information.attr("value");
if (val == "show_more") {
$(id2).text("[收起]");
information.attr("value", "hide_more");
information.attr("style", "color:#3ca5c6");
}
else {
$(id2).text("[展开]");
information.attr("value", "show_more");
information.attr("style", "color:#0781b4;");
}
}
</script>