| ID |
- 实训名称 |
+ 实训名称 |
技术平台 |
+ Fork源 |
实践任务 |
选择任务 |
状态 |
- 创建者 |
+ 创建者 |
创建时间 color-light-green ml5" title="功能完善中,敬请期待"> |
操作 |
@@ -16,10 +17,17 @@
<%= shixun.identifier %> |
<%= link_to shixun.name, shixun_path(shixun), :target => "_blank", :title => shixun.name %> |
<%= shixun.language %> |
+
+ <% unless shixun.try(:fork_from).nil? %>
+ <%= link_to shixun.try(:fork_from),shixun_path(shixun), target: '_blank'%>
+ <% else%>
+ --
+ <% end%>
+ |
<%= shixun.challenges.where(:st => 0).count %> |
<%= shixun.challenges.where(:st => 1).count %> |
<%= shixun_authentication_status shixun %> |
- <%= shixun.owner.try(:show_real_name) %> |
+ <%= link_to shixun.owner.try(:show_real_name),user_path(shixun.user_id),target:'_blank' %> |
<%= format_time shixun.created_at %> |
diff --git a/db/migrate/20171013081923_add_school_id_code_to_schools.rb b/db/migrate/20171013081923_add_school_id_code_to_schools.rb
new file mode 100644
index 000000000..8b45b30b2
--- /dev/null
+++ b/db/migrate/20171013081923_add_school_id_code_to_schools.rb
@@ -0,0 +1,18 @@
+class AddSchoolIdCodeToSchools < ActiveRecord::Migration
+ def change
+ add_column :schools, :shool_code, :string
+ count = School.all.count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ School.page(i).per(30).each do |school|
+ if school.city.nil? || school.province.nil? || school.address.nil?
+ apply_add_school = ApplyAddSchools.where(:school_id => school.id).last
+ if apply_add_school
+ school.update_attributes(:city => apply_add_school.city, :province => apply_add_school.province, :address => apply_add_school.address)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/db/migrate/20171013083722_add_new_column_to_department.rb b/db/migrate/20171013083722_add_new_column_to_department.rb
new file mode 100644
index 000000000..d005a2ba2
--- /dev/null
+++ b/db/migrate/20171013083722_add_new_column_to_department.rb
@@ -0,0 +1,11 @@
+class AddNewColumnToDepartment < ActiveRecord::Migration
+ def change
+ add_column :departments, :is_auth, :boolean, :default => 0
+
+ Department.where("0=0").each do |dep|
+ if ApplyAddDepartment.where(:department_id => dep.id, :status => 1).count > 0
+ dep.update_column("is_auth", 1)
+ end
+ end
+ end
+end
|