From c1e780a0f84149d8a30bbf769e9a633a2fc166db Mon Sep 17 00:00:00 2001 From: linchun Date: Mon, 23 Jun 2014 18:48:57 +0800 Subject: [PATCH] yan --- app/controllers/projects_controller.rb | 16 ++-------------- app/views/bids/_bid_homework_show.html.erb | 5 +---- app/views/welcome/index.html.erb | 8 -------- 3 files changed, 3 insertions(+), 26 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 33adb3ac..c0c3ce76 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -361,22 +361,10 @@ class ProjectsController < ApplicationController #Added by young def homework @offset, @limit = api_offset_and_limit({:limit => 10}) - @bids = @project.homeworks.order('deadline DESC') + @bids = @project.homeworks.order('deadline') @bids = @bids.like(params[:name]) if params[:name].present? - @bid_count = @bids.count - @bid_pages = Paginator.new @bid_count, @limit, params['page'] - @offset ||= @bid_pages.reverse_offset - #@bids = @bids.offset(@offset).limit(@limit).all.reverse - unless @offset == 0 - @bids = @bids.offset(@offset).limit(@limit).all.reverse - else - limit = @bid_count % @limit - if limit == 0 - limit = 10 - end - @bids = @bids.offset(@offset).limit(limit).all.reverse - end + @bids = paginateHelper @bids render :layout => 'base_courses' end diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index c4eb875a..e8913108 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -92,9 +92,6 @@ <% end %> <% end %> - \ No newline at end of file diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 16a4cbf2..6dbfd67d 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -54,7 +54,6 @@ @@ -88,7 +86,6 @@
<%activities = find_all_activities%> <% activities.each do |event| %> -
  • <%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %> @@ -99,7 +96,6 @@

    <%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前     <%= show_event_reply event %>

  • - <% end %>
    @@ -107,7 +103,6 @@