diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 07f7a0ed8..336c6937b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -49,6 +49,11 @@ module ApplicationHelper
end
end
+ # 判断课程是否为精品课程
+ def is_excellent_course course
+ course.is_excellent? ? true : false
+ end
+
# 获取项目/课程总分
# 发布缺陷 4分 回复缺陷 1分 提交一次 4分 讨论帖子 2分 回复帖子 1分 发布新闻 1分
def static_project_score obj
diff --git a/app/views/courses/_recommendation.html.erb b/app/views/courses/_recommendation.html.erb
new file mode 100644
index 000000000..8e14e1130
--- /dev/null
+++ b/app/views/courses/_recommendation.html.erb
@@ -0,0 +1,41 @@
+
\ No newline at end of file
diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb
index 60fc6f96d..9a9d34e54 100644
--- a/app/views/layouts/_project_info.html.erb
+++ b/app/views/layouts/_project_info.html.erb
@@ -3,14 +3,14 @@
<% student_num = studentCount(@course) %>
<% course_file_num = visable_attachemnts_incourse(@course).count%>
- <% if @course.id == 370 %>
+ <% if is_excellent_course(@course) %>

<% end %>
<%= image_tag(url_to_avatar(@course), :width => "60", :height => "60") %>
<%= @course.is_public == 0 ? "私有课程" : "公开课程" %>
- <% if @course.id == 370 %>
+ <% if is_excellent_course(@course) %>

<% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb
index b57e9ac54..9d61a6fbb 100644
--- a/app/views/layouts/base_courses.html.erb
+++ b/app/views/layouts/base_courses.html.erb
@@ -205,45 +205,7 @@
-
- 课程推荐
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
+ <%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 34a526734..d5b249e8d 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -2106,4 +2106,6 @@ zh:
label_org_name: 组织名称:
label_blank_user_lists_for_org: 用户不能为空
-
+ # 课程推荐
+ label_homework_commont: 作业
+ label_homework_recommendation: 课程推荐
\ No newline at end of file
diff --git a/db/schema.rb b/db/schema.rb
index bac1882c5..601b09561 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20160115125217) do
+ActiveRecord::Schema.define(:version => 20160118014219) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -499,6 +499,7 @@ ActiveRecord::Schema.define(:version => 20160115125217) do
t.integer "is_delete", :default => 0
t.integer "end_time"
t.string "end_term"
+ t.integer "is_excellent", :default => 0
end
create_table "custom_fields", :force => true do |t|