1、消息为0的时候不显示 消息数和“全部设置已读”。

2、消息不为空,未读消息为空的时候不显示“全部设为已读”
This commit is contained in:
huang 2015-09-07 16:14:34 +08:00
parent 402c0b5173
commit 0a45e08488
1 changed files with 8 additions and 5 deletions

View File

@ -29,12 +29,15 @@
</div> </div>
<div class="resources mt10" id="users_setting"> <div class="resources mt10" id="users_setting">
<div> <div>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
</div>
<% end %>
<% if @message_alls.count >0 %> <% if @message_alls.count >0 %>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读
<% unless unviewed_message(@user) == 0 %>
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
<% end %>
</div>
<% end %>
<%# 课程消息 %> <%# 课程消息 %>
<% unless @message_alls.nil? %> <% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %> <% @message_alls.each do |ma| %>