Date: Thu, 25 Jul 2019 10:32:22 +0800
Subject: [PATCH 03/10] set profile completed false when delete school apply &&
fix agree identity auth
---
app/controllers/managements_controller.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 98b58614..623268d2 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -1661,7 +1661,7 @@ end
# 删除单位
def delete_school
school = School.where(:id => params[:school]).first
- UserExtensions.where(:school_id => params[:school]).update_all(:school_id => nil, :department_id => nil)
+ UserExtensions.where(:school_id => params[:school]).update_all(school_id: nil, department_id: nil, profile_completed: false)
ApplyAddSchools.where(:school_id => params[:school]).destroy_all
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
school.destroy
@@ -1752,7 +1752,7 @@ end
Tiding.create(:user_id => applied_department.user_id, :trigger_user_id => 0, :container_id => applied_department.id, :container_type =>'ApplyAddDepartment', :belong_container_id => applied_department.department.school_id, :belong_container_type=> 'School', :tiding_type => "System", :status => 2, :extra => params[:reason])
# 删除学校的用户
users = UserExtensions.where("department_id = #{applied_department.department_id}")
- users.update_all(:department_id => nil)
+ users.update_all(department_id: nil, profile_completed: false)
applied_department.department.destroy
# 已审批删除
elsif params[:tip] == "applied"
@@ -3692,7 +3692,7 @@ end
diskfile1 = disk_filename("UserAuthentication", apply_user.user_id) +"ID"
apply_user.update_attributes(:is_delete => true)
- File.delete(diskfile1)
+ File.delete(diskfile1) if File.exist?(diskfile1)
=begin
begin
From ac54319542a8487e3cc95efb827edc1767b8402d Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 25 Jul 2019 14:02:44 +0800
Subject: [PATCH 04/10] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=91=98=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=9A=84=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/managements_controller.rb | 3 +++
app/views/managements/update_user.html.erb | 17 ++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 98b58614..83bee45d 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -220,6 +220,9 @@ class ManagementsController < ApplicationController
@user.nickname = params[:nickname]
@user.lastname = params[:lastname]
@user.business = params[:business].to_i
+ if params[:admin]
+ @user.admin = params[:admin].to_i
+ end
@user.firstname = ""
@user.mail = params[:mail].strip == "" ? nil : params[:mail]
@user.phone = params[:phone].strip == "" ? nil : params[:phone]
diff --git a/app/views/managements/update_user.html.erb b/app/views/managements/update_user.html.erb
index 4ef8e9e6..af1c59c0 100644
--- a/app/views/managements/update_user.html.erb
+++ b/app/views/managements/update_user.html.erb
@@ -190,6 +190,14 @@
name="business" value="<%= @user.business? ? "1" : "0" %>" id="person_business" class="magic-checkbox" style="float:left; margin-top: 8px;">
+ <% if User.current.admin? %>
+
+
+ name="admin" value="<%= @user.admin? ? "1" : "0" %>" id="person_admin" class="magic-checkbox" style="float:left; margin-top: 8px;">
+
+
+ <% end %>
+
@@ -625,7 +633,14 @@
}else{
document.getElementById('person_business').value = "0";
}
-
+ <% if User.current.admin? %>
+ var admin_check = document.getElementById('person_admin').checked;
+ if (admin_check) {
+ document.getElementById('person_admin').value = "1";
+ } else {
+ document.getElementById('person_admin').value = "0";
+ }
+ <% end %>
my_account_form_submit();
});
function my_account_form_submit(){
From 84a1acf9174792781442b259d1c881fd649e24f5 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Thu, 25 Jul 2019 17:42:49 +0800
Subject: [PATCH 05/10] =?UTF-8?q?=E7=AB=9E=E8=B5=9B-=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E6=A0=87=E6=B3=A8=E7=BB=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/competitions/_gq_second_code_competition.html.erb | 6 +++++-
public/stylesheets/educoder/edu-all.css | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/app/views/competitions/_gq_second_code_competition.html.erb b/app/views/competitions/_gq_second_code_competition.html.erb
index 02847743..7eb0865d 100644
--- a/app/views/competitions/_gq_second_code_competition.html.erb
+++ b/app/views/competitions/_gq_second_code_competition.html.erb
@@ -120,7 +120,11 @@
项目简介
<%= raw row_data[:description] %>
标注任务
- <%= row_data[:task] %>
+ <% if index ==2 %>
+ <%= row_data[:task] %>
+ <% else %>
+ <%= row_data[:task] %>
+ <% end %>
经典算法解读:
<%= row_data[:link_name] %>
diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css
index 09d24d8d..28989a5b 100644
--- a/public/stylesheets/educoder/edu-all.css
+++ b/public/stylesheets/educoder/edu-all.css
@@ -712,7 +712,7 @@ li.challenge_box{
color: #0B8298;font-size: 20px;line-height: 20px;text-align: left;font-weight: bold;margin-bottom: 40px;padding-left: 3px;
}
.challenge_b_des{
- line-height: 20px;color: #0B8298;font-size: 18px;text-align: left;text-align:justify;margin-bottom: 40px;min-height: 220px;
+ line-height: 20px;color: #0B8298;font-size: 18px;text-align: left;text-align:justify;margin-bottom: 30px;min-height: 240px;
}
li.challenge_box:last-child{
margin-right: 0px;
From 08575044f56003883a2ea7f8e902f4164850e0d7 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Thu, 25 Jul 2019 17:58:05 +0800
Subject: [PATCH 06/10] =?UTF-8?q?=E7=AB=9E=E8=B5=9B-=E4=BB=A3=E7=A0=81?=
=?UTF-8?q?=E6=A0=87=E6=B3=A8=E7=BB=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/competitions/_gq_second_code_competition.html.erb | 5 +----
public/stylesheets/educoder/edu-all.css | 4 ++--
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/app/views/competitions/_gq_second_code_competition.html.erb b/app/views/competitions/_gq_second_code_competition.html.erb
index 7eb0865d..0baf1fe4 100644
--- a/app/views/competitions/_gq_second_code_competition.html.erb
+++ b/app/views/competitions/_gq_second_code_competition.html.erb
@@ -82,10 +82,7 @@
second_section = stage.competition_stage_sections[1]
%>
">
- <% if i.zero? %>
-
<%= stage.name %>
- <% end %>
-
+
<%= stage.name %>
-
<%= first_section.try(:name) %>
diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css
index 28989a5b..7b4d9814 100644
--- a/public/stylesheets/educoder/edu-all.css
+++ b/public/stylesheets/educoder/edu-all.css
@@ -709,7 +709,7 @@ li.challenge_box{
font-size: 30px;color: #0E8B87;line-height: 30px;margin-bottom: 30px;
}
.challenge_b_d{
- color: #0B8298;font-size: 20px;line-height: 20px;text-align: left;font-weight: bold;margin-bottom: 40px;padding-left: 3px;
+ color: #0B8298;font-size: 20px;line-height: 20px;text-align: left;font-weight: bold;margin-bottom: 30px;padding-left: 3px;
}
.challenge_b_des{
line-height: 20px;color: #0B8298;font-size: 18px;text-align: left;text-align:justify;margin-bottom: 30px;min-height: 240px;
@@ -718,7 +718,7 @@ li.challenge_box:last-child{
margin-right: 0px;
}
.algorithm{margin-bottom: 40px;}
-.algorithm a{display: block;text-align: left;color: #23A8FD;position: relative;float: left;font-size: 18px;line-height: 22px;}
+.algorithm a{display: block;text-align: left;color: #23A8FD;position: relative;float: left;font-size: 17px;line-height: 22px;}
.algorithm a:after{position: absolute;left: 0px;bottom: -2px;background:#23A8FD;width: 100%;height: 1px;content: ''; }
From 8227a14960b4ccf91bc0c61a446819f68110d82f Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 25 Jul 2019 18:32:11 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?=E5=90=8E=EF=BC=8C=E9=9C=80=E8=A6=81=E9=87=8D=E6=96=B0=E5=AE=8C?=
=?UTF-8?q?=E5=96=84=E8=B5=84=E6=96=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/managements_controller.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index e3d560aa..980c775b 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -1664,7 +1664,8 @@ end
# 删除单位
def delete_school
school = School.where(:id => params[:school]).first
- UserExtensions.where(:school_id => params[:school]).update_all(school_id: nil, department_id: nil, profile_completed: false)
+ UserExtensions.where(:school_id => params[:school]).update_all(school_id: nil, department_id: nil)
+ User.joins(:user_extension).where(user_extensions: {school_id: params[:school]}).update_all(profile_completed: false)
ApplyAddSchools.where(:school_id => params[:school]).destroy_all
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
school.destroy
From e0a18f44f81f7725ab940ca8fcf6d35646a97337 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 25 Jul 2019 18:42:26 +0800
Subject: [PATCH 08/10] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=A6=E6=A0=A1?=
=?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=9B=B4=E6=96=B0=E8=AE=A4=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/managements_controller.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb
index 980c775b..bfd4b8be 100644
--- a/app/controllers/managements_controller.rb
+++ b/app/controllers/managements_controller.rb
@@ -1870,6 +1870,7 @@ end
# 删除学校的用户
users = UserExtensions.where("school_id = #{applied_school.school_id}")
+ User.where(id: users.map(&:user_id)).update_all(profile_completed: false)
# 申请了职业认证的用户撤销申请
apply_user_auth = ApplyUserAuthentication.where(:user_id => users.map(&:user_id), :auth_type => 2, :status => 0)
From c575fdf8cfcbf0cc735f65f05cd8ff71e1e41d56 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 25 Jul 2019 21:09:34 +0800
Subject: [PATCH 09/10] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=91=98=E5=8A=9F=E8=83=BD=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/managements/update_user.html.erb | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/views/managements/update_user.html.erb b/app/views/managements/update_user.html.erb
index af1c59c0..fab25083 100644
--- a/app/views/managements/update_user.html.erb
+++ b/app/views/managements/update_user.html.erb
@@ -641,6 +641,7 @@
document.getElementById('person_admin').value = "0";
}
<% end %>
+ console.log("######" + document.getElementById('person_admin'));
my_account_form_submit();
});
function my_account_form_submit(){
From 80782efab6d937e6939ff8688d470b7107c10644 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 25 Jul 2019 21:14:13 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/managements/update_user.html.erb | 1 -
1 file changed, 1 deletion(-)
diff --git a/app/views/managements/update_user.html.erb b/app/views/managements/update_user.html.erb
index fab25083..af1c59c0 100644
--- a/app/views/managements/update_user.html.erb
+++ b/app/views/managements/update_user.html.erb
@@ -641,7 +641,6 @@
document.getElementById('person_admin').value = "0";
}
<% end %>
- console.log("######" + document.getElementById('person_admin'));
my_account_form_submit();
});
function my_account_form_submit(){