课程提供开源检索配置功能

This commit is contained in:
huang 2017-01-19 15:51:53 +08:00
parent fc35fe5e48
commit e1f107bf4f
5 changed files with 16 additions and 2 deletions

View File

@ -38,6 +38,9 @@
<th style="width: 60px;">
<%=l(:field_created_on)%>
</th>
<th style="width: 30px;">
开源检索
</th>
</tr>
</thead>
<tbody>
@ -57,6 +60,7 @@
<td class="center">
<%= format_date(syllabus.created_at) %>
</td>
<td></td>
</tr>
<% courses = syllabus.courses.not_deleted %>
<% courses.each do |course| %>
@ -75,6 +79,7 @@
<td class="center">
<%= format_date(course.created_at) %>
</td>
<td style="text-align: center;"><a><%= course.try(:os_allow) == 0 ? 不允许 : 允许 %></a></td>
</tr>
<% end %>
<% end %>

View File

@ -147,7 +147,9 @@
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<div class="sy_class_leftbox" >
<h3 class="fontGrey7">推荐</h3>
<h3 class="fontGrey7"><span>推荐</span>
<a class="c_white db creatPostIcon2 bGreen fr" href="http://ossean.trustie.net?user_id=<%= User.current.id %>" target="_blank">开源检索</a>
</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>

View File

@ -0,0 +1,5 @@
class AddOsAllowToCourse < ActiveRecord::Migration
def change
add_column :courses, :os_allow, :integer, :default => 0
end
end

View File

@ -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

View File

@ -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;}