From e1f107bf4fb22a757132a45981f6793b5614da1d Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 19 Jan 2017 15:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=8F=90=E4=BE=9B=E5=BC=80?= =?UTF-8?q?=E6=BA=90=E6=A3=80=E7=B4=A2=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admin/syllabuses.html.erb | 5 +++++ app/views/layouts/base_courses.html.erb | 4 +++- db/migrate/20170119072629_add_os_allow_to_course.rb | 5 +++++ db/schema.rb | 3 ++- public/stylesheets/css/public.css | 1 + 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20170119072629_add_os_allow_to_course.rb diff --git a/app/views/admin/syllabuses.html.erb b/app/views/admin/syllabuses.html.erb index d24f7d39a..c255c3c2c 100644 --- a/app/views/admin/syllabuses.html.erb +++ b/app/views/admin/syllabuses.html.erb @@ -38,6 +38,9 @@ <%=l(:field_created_on)%> + + 开源检索 + @@ -57,6 +60,7 @@ <%= format_date(syllabus.created_at) %> + <% courses = syllabus.courses.not_deleted %> <% courses.each do |course| %> @@ -75,6 +79,7 @@ <%= format_date(course.created_at) %> + <%= course.try(:os_allow) == 0 ? 不允许 : 允许 %> <% end %> <% end %> diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index a437ea01f..164c5cf64 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -147,7 +147,9 @@ <%# 课程英雄榜 %> <%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
-

推荐

+

推荐 + 开源检索 +

<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<%# 更新访问数,刷新的时候更新访问次数 %> diff --git a/db/migrate/20170119072629_add_os_allow_to_course.rb b/db/migrate/20170119072629_add_os_allow_to_course.rb new file mode 100644 index 000000000..461e5ab4c --- /dev/null +++ b/db/migrate/20170119072629_add_os_allow_to_course.rb @@ -0,0 +1,5 @@ +class AddOsAllowToCourse < ActiveRecord::Migration + def change + add_column :courses, :os_allow, :integer, :default => 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 09866ad15..2498fb3af 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 => 20170112082231) do +ActiveRecord::Schema.define(:version => 20170119072629) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -731,6 +731,7 @@ ActiveRecord::Schema.define(:version => 20170112082231) do t.integer "qrcode_expiretime", :default => 0 t.integer "professional_level_id", :limit => 1 t.integer "invite_code_halt", :limit => 1, :default => 0 + t.integer "os_allow", :default => 0 end add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index ff203e977..52298db25 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -415,6 +415,7 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no- a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;} .creatPost {width:80px; height:25px; border-radius:3px; color:#ffffff; text-align:center; float:right; line-height:25px; vertical-align:middle; margin-top:2px;} .creatPostIcon {background:url(../images/post_image_list.png) -40px -54px no-repeat; width:70px; height:25px; padding-left:10px; border-radius:3px;} +.creatPostIcon2 {width:60px; height:20px; padding-left:10px; border-radius:3px;} .postRow {width:970px; border-bottom:1px solid #efefef; padding:15px 0;} .postPortrait {width:75px; height:75px; float:left; margin-right:15px;} .postWrap {width:690px; float:left; margin-right:95px;}