diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 9f7b42e6..df500de8 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -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 end @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 count(sfc.id) from students_for_courses sfc where c.id=sfc.course_id group by c.id) as student_count, diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index d1ef793d..53eb23ae 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1011,7 +1011,7 @@ class ManagementsController < ApplicationController end @courselist = @courselist.reorder("created_at desc") @courselist_count = @courselist.count - + @limit = 15 @is_remote = true @page = params['page'] ? params['page'].to_i : 1 @@ -3635,7 +3635,7 @@ end apply_user.tidings.where(:tiding_type => "Apply").update_all(:status => 1) Tiding.create(:user_id => apply_user.user_id ,:trigger_user_id => 0, :container_id => apply_user.id, :container_type => "ApplyUserAuthentication", :belong_container_id => apply_user.user_id, :belong_container_type =>'User', :status => 1, :tiding_type => "System") - + @unapproved_user = ApplyUserAuthentication.where(:status => 0, :auth_type => 1).order("updated_at desc") @unapproved_user_count = @unapproved_user.count @limit = 15 @@ -4107,7 +4107,7 @@ end sheet1 = book.create_worksheet :name => "sheet" blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue - sheet1.row(0).concat(["序号","创建者","发布时间", "ID", "实训名称","技术平台","fork源", "实践任务"]) + sheet1.row(0).concat(["序号","创建者","发布时间", "ID", "实训名称","技术平台","fork源", "实践任务", "实训链接"]) count_row = 1 shixuns.find_each do |shixun| sheet1[count_row, 0] = count_row @@ -4118,6 +4118,7 @@ end sheet1[count_row, 5] = show_shixun_mirror(shixun) sheet1[count_row, 6] = shixun.fork_identifier sheet1[count_row, 7] = shixun.challenges.count + sheet1[count_row, 7] = Setting.server_url + shixun_path(shixun) count_row += 1 end book.write xls_report diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index e8ad5ae9..1672c110 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -8,7 +8,7 @@ <%= csrf_meta_tag %> <%= favicon %> <%= 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' %>
diff --git a/config/settings.yml b/config/settings.yml index f6c5b2e4..9e189978 100755 --- a/config/settings.yml +++ b/config/settings.yml @@ -89,6 +89,8 @@ wiki_compression: default: "" default_language: default: zh +server_url: + default: https://www.educoder.net/ host_name: default: forge.trustie.net host_course: @@ -211,7 +213,7 @@ default_projects_modules: # - dts default_projects_tracker_ids: serialized: true - default: + default: # Role given to a non-admin user who creates a project new_project_user_role_id: format: int diff --git a/public/javascripts/educoder/edu_account.js b/public/javascripts/educoder/edu_account.js index a93916db..e01baef0 100644 --- a/public/javascripts/educoder/edu_account.js +++ b/public/javascripts/educoder/edu_account.js @@ -836,12 +836,12 @@ $(function(){ var image = $("#ren_zheng_image"); var element = $("").attr("href", image.attr('src')+".png"); 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_element = $("").attr("href", auth_image.attr('src')+".png"); 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(1);