From f487352d6dc3e7400dfeaa5340ecdf5ec44dad34 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Mon, 12 May 2014 16:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=93=E5=BD=93=E5=89=8D=E5=AD=A6=E6=A0=A1?= =?UTF-8?q?=E5=BC=80=E8=AE=BE=E8=AF=BE=E7=A8=8B=E6=95=B0=E4=BD=8D0?= =?UTF-8?q?=E6=97=B6=E6=8E=A8=E8=8D=90=E7=BB=99=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E7=94=B1=E5=BC=80=E8=AE=BE=E8=AF=BE=E7=A8=8B=E6=9C=80=E5=A4=9A?= =?UTF-8?q?=E7=9A=84=E5=87=A0=E4=B8=AA=E5=AD=A6=E6=A0=A1=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9C=AC=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=80=E5=A5=BD=E7=9A=84?= =?UTF-8?q?=E5=87=A0=E9=97=A8=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/courses_helper.rb | 4 ++- app/helpers/welcome_helper.rb | 2 +- app/models/course.rb | 1 - app/views/bids/show_course.html.erb | 3 +- app/views/welcome/course.html.erb | 43 +++++++++++++++++++++-------- 5 files changed, 38 insertions(+), 15 deletions(-) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index d474b5587..35a907ecc 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -108,5 +108,7 @@ module CoursesHelper now > cTime end - + def find_by_extra_from_project extra + Course.find_by_extra(try(extra)) + end end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index d0b0ee5ad..ed435fe6d 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -129,7 +129,7 @@ module WelcomeHelper # end #end end - + def find_miracle_project(sum, max_rate) max = sum*(max_rate.to_f/10) c1 = find_new_project(sum).to_a.dup diff --git a/app/models/course.rb b/app/models/course.rb index 9f0c42c6f..0420b1744 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -47,5 +47,4 @@ class Course < ActiveRecord::Base return time end end - end diff --git a/app/views/bids/show_course.html.erb b/app/views/bids/show_course.html.erb index 0d1bdee57..574bd117c 100644 --- a/app/views/bids/show_course.html.erb +++ b/app/views/bids/show_course.html.erb @@ -12,7 +12,8 @@ <%= l(:label_homework) %> (<%= link_to (course.homeworks.count), {:controller => 'projects', :action => 'homework', :id => course.identifier} %>)     <%= l(:label_course_news)%> (<%= link_to (course.news.count), {:controller => 'news', :action => 'index', :project_id => course.identifier} %>) - + + diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb index 329d205af..286ff60d3 100644 --- a/app/views/welcome/course.html.erb +++ b/app/views/welcome/course.html.erb @@ -1,6 +1,7 @@ <%= stylesheet_link_tag 'welcome' %> <%= javascript_include_tag 'welcome' %> -