This commit is contained in:
yutao 2015-06-05 10:33:42 +08:00
parent 8fcf7ac7a8
commit a456616212
2 changed files with 4 additions and 4 deletions

View File

@ -15,11 +15,10 @@ class ActivityNotifysController < ApplicationController
end
if( query != nil )
logger.info('xxoo')
limit = 10;
@obj_count = query.count();
@obj_pages = Paginator.new @obj_count,limit,params['page']
list = query.order('id desc').limit(limit).offset(@obj_pages.offset).all();
list = query.order('is_read,id desc').limit(limit).offset(@obj_pages.offset).all();
events=[];
for item in list
event = item.activity;
@ -29,7 +28,6 @@ class ActivityNotifysController < ApplicationController
end
@events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)}
@controller_name = 'ActivityNotifys'
logger.info('aavv')
end
respond_to do |format|
format.html {render :template => 'courses/show', :layout => 'base_courses'}

View File

@ -3,7 +3,9 @@
<a class="fl about_me" href="<%=course_path(@course)%>"><%= l(:label_activity)%></a>
<h2 class="fl project_h2">与我相关</h2>
<div class="fr mt10 mr5 c_grey02">
<label class="mr5" style="cursor:pointer;" data-href="<%= course_activity_notifys_path(@course) %>/chang_read_flag" nhname='nh_act_link_all'>全部标为已读</label>
<a class="c_dblue">
<label class="mr5" style="cursor:pointer;" data-href="<%= course_activity_notifys_path(@course) %>/chang_read_flag" nhname='nh_act_link_all'>全部标为已读</label>
</a>
</div>
<% else %>
<h2 class="fl project_h2"><%= l(:label_activity)%></h2>