Merge branch 'develop' into educoder

dev_partners
daiao 6 years ago
commit 1ce97f9ed9

@ -140,6 +140,7 @@ class CollegesController < ApplicationController
course[:task_count] = course.hcm_count.to_i + course.attachments_count.to_i + course.messages_count.to_i + course.hcm_nonshixun_count.to_i + course.exercises_count.to_i + course.polls_count.to_i course[:task_count] = course.hcm_count.to_i + course.attachments_count.to_i + course.messages_count.to_i + course.hcm_nonshixun_count.to_i + course.exercises_count.to_i + course.polls_count.to_i
end end
@courses = @courses.sort{|x,y| [y[:evaluating_count], y[:task_count]] <=> [x[:evaluating_count], x[:task_count]] } @courses = @courses.sort{|x,y| [y[:evaluating_count], y[:task_count]] <=> [x[:evaluating_count], x[:task_count]] }
@courses = @courses.sort_by { |course| course.is_end ? 1 : 0 }
# SELECT c.id, (select concat(firstname,lastname) from users u where u.id=c.tea_id) as username, # SELECT c.id, (select concat(firstname,lastname) from users u where u.id=c.tea_id) as username,
# (select count(sfc.id) from students_for_courses sfc where c.id=sfc.course_id group by c.id) as student_count, # (select count(sfc.id) from students_for_courses sfc where c.id=sfc.course_id group by c.id) as student_count,

@ -4107,7 +4107,7 @@ end
sheet1 = book.create_worksheet :name => "sheet" sheet1 = book.create_worksheet :name => "sheet"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue sheet1.row(0).default_format = blue
sheet1.row(0).concat(["序号","创建者","发布时间", "ID", "实训名称","技术平台","fork源", "实践任务"]) sheet1.row(0).concat(["序号","创建者","发布时间", "ID", "实训名称","技术平台","fork源", "实践任务", "实训链接"])
count_row = 1 count_row = 1
shixuns.find_each do |shixun| shixuns.find_each do |shixun|
sheet1[count_row, 0] = count_row sheet1[count_row, 0] = count_row
@ -4118,6 +4118,7 @@ end
sheet1[count_row, 5] = show_shixun_mirror(shixun) sheet1[count_row, 5] = show_shixun_mirror(shixun)
sheet1[count_row, 6] = shixun.fork_identifier sheet1[count_row, 6] = shixun.fork_identifier
sheet1[count_row, 7] = shixun.challenges.count sheet1[count_row, 7] = shixun.challenges.count
sheet1[count_row, 7] = Setting.server_url + shixun_path(shixun)
count_row += 1 count_row += 1
end end
book.write xls_report book.write xls_report

@ -8,7 +8,7 @@
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'educoder/edu-main','educoder/edu-all' %> <%= stylesheet_link_tag 'educoder/edu-main','educoder/edu-all' %>
<%= javascript_include_tag 'jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'educoder/edu_application', 'educoder/edu_account' %> <%= javascript_include_tag 'jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'jquery.colorbox-min','educoder/edu_application', 'educoder/edu_account' %>
</head> </head>
<body> <body>

@ -89,6 +89,8 @@ wiki_compression:
default: "" default: ""
default_language: default_language:
default: zh default: zh
server_url:
default: https://www.educoder.net/
host_name: host_name:
default: forge.trustie.net default: forge.trustie.net
host_course: host_course:

@ -836,12 +836,12 @@ $(function(){
var image = $("#ren_zheng_image"); var image = $("#ren_zheng_image");
var element = $("<a></a>").attr("href", image.attr('src')+".png"); var element = $("<a></a>").attr("href", image.attr('src')+".png");
image.wrap(element); image.wrap(element);
//image.parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false}); image.parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});
var auth_image = $("#upload_id_image"); var auth_image = $("#upload_id_image");
var auth_element = $("<a></a>").attr("href", auth_image.attr('src')+".png"); var auth_element = $("<a></a>").attr("href", auth_image.attr('src')+".png");
auth_image.wrap(auth_element); auth_image.wrap(auth_element);
//auth_image.parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false}); auth_image.parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});
$("#user_auth_submit_a").one("click", function(){ $("#user_auth_submit_a").one("click", function(){
user_auth_submit(1); user_auth_submit(1);

Loading…
Cancel
Save