Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_cs
杨树明 6 years ago
commit 631a916b79

@ -13,6 +13,7 @@
//= require bootstrap-datepicker //= require bootstrap-datepicker
//= require bootstrap.viewer //= require bootstrap.viewer
//= require jquery.mloading //= require jquery.mloading
//= require jquery-confirm.min
//= require common //= require common
//= require echarts //= require echarts

@ -0,0 +1,12 @@
$(document).on('turbolinks:load', function(){
$(document).on('click', '.batch-all-check-box', function(){
var $checkAll = $(this);
$('.batch-check-box').prop('checked', $checkAll.is(':checked'));
})
$(document).on('click', '.batch-check-box', function(){
var allChecked = $('.batch-check-box:checked').length === $('.batch-check-box').length
$('.batch-all-check-box').prop('checked', allChecked);
})
});

@ -10,11 +10,41 @@ $(document).on('turbolinks:load', function() {
$searchFrom.find('select[name="status"]').val('processed'); $searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){ if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show(); $searchFrom.find('.status-filter').show();
} else { } else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide(); $searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending'); $searchFrom.find('select[name="status"]').val('pending');
} }
}); });
$('.batch-agree-btn').on('click', function(){
if($('.batch-check-box:checked').length === 0){
$.notify({ message: '请先选择数据' }, { type: 'info' });
return;
}
customConfirm({
content: '确认审核通过?',
ok: function(){
var ids = $('.batch-check-box:checked').map(function(_, e){ return $(e).val() }).get();
$.ajax({
url: '/admins/identity_authentications/batch_agree',
method: 'POST',
dataType: 'json',
data: { ids: ids },
success: function(data){
$.notify({ message: '操作成功' });
window.location.reload();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
})
}
})
})
} }
}) })

@ -10,11 +10,41 @@ $(document).on('turbolinks:load', function() {
$searchFrom.find('select[name="status"]').val('processed'); $searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){ if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show(); $searchFrom.find('.status-filter').show();
} else { } else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide(); $searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending'); $searchFrom.find('select[name="status"]').val('pending');
} }
}); });
$('.batch-agree-btn').on('click', function(){
if($('.batch-check-box:checked').length === 0){
$.notify({ message: '请先选择数据' }, { type: 'info' });
return;
}
customConfirm({
content: '确认审核通过?',
ok: function(){
var ids = $('.batch-check-box:checked').map(function(_, e){ return $(e).val() }).get();
$.ajax({
url: '/admins/professional_authentications/batch_agree',
method: 'POST',
dataType: 'json',
data: { ids: ids },
success: function(data){
$.notify({ message: '操作成功' });
window.location.reload();
},
error: function(res){
$.notify({ message: res.responseJSON.message }, { type: 'danger' });
}
})
}
})
})
} }
}) })

@ -43,3 +43,25 @@ function resetFileInputFunc(file){
file.after(file.clone().val("")); file.after(file.clone().val(""));
file.remove(); file.remove();
} }
function customConfirm(opts){
var okCallback = opts.ok;
var cancelCallback = opts.cancel;
var defaultOpts = {
title: '提示',
buttons: {
ok: {
text: '确认',
btnClass: 'btn btn-primary',
action: okCallback
},
cancel: {
text: '取消',
btnClass: 'btn btn-secondary',
action: cancelCallback
},
}
}
return $.confirm($.extend({}, defaultOpts, opts))
}

File diff suppressed because one or more lines are too long

@ -6,6 +6,7 @@
@import "bootstrap-datepicker"; @import "bootstrap-datepicker";
@import "bootstrap-datepicker.standalone"; @import "bootstrap-datepicker.standalone";
@import "jquery.mloading"; @import "jquery.mloading";
@import "jquery-confirm.min";
@import "codemirror/lib/codemirror"; @import "codemirror/lib/codemirror";
@import "editormd/css/editormd.min"; @import "editormd/css/editormd.min";

@ -110,5 +110,11 @@
.CodeMirror { .CodeMirror {
border: 1px solid #ced4da; border: 1px solid #ced4da;
} }
.batch-action-container {
margin-bottom: -15px;
padding: 10px 20px 0;
background: #fff;
}
} }

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
class Admins::IdentityAuthenticationsController < Admins::BaseController class Admins::IdentityAuthenticationsController < Admins::BaseController
def index def index
params[:status] ||= 'pending' params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1)) applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 1))
@ -18,6 +19,24 @@ class Admins::IdentityAuthenticationsController < Admins::BaseController
render_success_js render_success_js
end end
def batch_agree
ApplyUserAuthentication.real_name_auth.where(id: params[:ids]).each do |apply|
begin
Admins::IdentityAuths::AgreeApplyService.call(apply)
rescue => e
Util.logger_error(e)
end
end
render_ok
end
def revoke
Admins::IdentityAuths::RevokeApplyService.call(current_apply)
render_success_js
end
private private
def current_apply def current_apply

@ -1,6 +1,7 @@
class Admins::ProfessionalAuthenticationsController < Admins::BaseController class Admins::ProfessionalAuthenticationsController < Admins::BaseController
def index def index
params[:status] ||= 'pending' params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2)) applies = Admins::ApplyUserAuthenticationQuery.call(params.merge(type: 2))
@ -18,6 +19,23 @@ class Admins::ProfessionalAuthenticationsController < Admins::BaseController
render_success_js render_success_js
end end
def batch_agree
ApplyUserAuthentication.professional_auth.where(id: params[:ids]).each do |apply|
begin
Admins::ProfessionalAuths::AgreeApplyService.call(apply)
rescue => e
Util.logger_error(e)
end
end
render_ok
end
def revoke
Admins::ProfessionalAuths::RevokeApplyService.call(current_apply)
render_success_js
end
private private
def current_apply def current_apply

@ -51,7 +51,8 @@ class CommonsController < ApplicationController
200 200
end end
when 'journals_for_message' when 'journals_for_message'
if current_user.course_identity(@object.jour.course) >= Course::STUDENT && @object.user != current_user course = @object.jour&.course || @object.jour&.student_work&.homework_common&.course
if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user
403 403
else else
200 200

@ -415,6 +415,20 @@ class SubjectsController < ApplicationController
order by ue_count desc limit 10") order by ue_count desc limit 10")
end end
# 预约报名
def appointment
tip_exception("还存在未结束的课堂") unless @subject.max_course_end_date.nil? || @subject.max_course_end_date < Date.today
tip_exception("无需重复报名") if @subject.subject_appointments.exists?(user_id: current_user.id)
ActiveRecord::Base.transaction do
@subject.subject_appointments << SubjectAppointment.new(user_id: current_user.id)
@subject.increment!(:participant_count)
if @subject.participant_count == @subject.student_count
@subject.start_course_notify
end
normal_status("预约成功")
end
end
private private
def subject_params def subject_params
tip_exception("实训路径名称不能为空") if params[:name].blank? tip_exception("实训路径名称不能为空") if params[:name].blank?

@ -384,4 +384,8 @@ module TidingDecorator
def public_course_start_content def public_course_start_content
I18n.t(locale_format) % [belong_container&.name, belong_container&.start_date&.strftime("%Y-%m-%d")] I18n.t(locale_format) % [belong_container&.name, belong_container&.start_date&.strftime("%Y-%m-%d")]
end end
def subject_start_course_content
I18n.t(locale_format) % belong_container&.name
end
end end

@ -18,6 +18,10 @@ class ApplyUserAuthentication < ApplicationRecord
nil nil
end end
def revoke!
update!(status: 3)
end
private private
def send_tiding def send_tiding

@ -1,6 +1,6 @@
class StudentWorksScore < ApplicationRecord class StudentWorksScore < ApplicationRecord
#appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效 #appeal_status: 0正常1申诉中2撤销申诉3申诉成功4申诉被拒绝5申诉失效
belongs_to :student_work belongs_to :student_work
belongs_to :user belongs_to :user
has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy has_many :journals_for_messages, -> { order('created_on desc') }, as: :jour, dependent: :destroy
has_one :student_works_scores_appeal, dependent: :destroy has_one :student_works_scores_appeal, dependent: :destroy

@ -13,6 +13,8 @@ class Subject < ApplicationRecord
has_many :stage_shixuns, dependent: :destroy has_many :stage_shixuns, dependent: :destroy
has_many :shixuns, through: :stage_shixuns has_many :shixuns, through: :stage_shixuns
has_many :subject_appointments, dependent: :destroy
has_many :subject_members, ->{ order("subject_members.position asc")}, dependent: :destroy has_many :subject_members, ->{ order("subject_members.position asc")}, dependent: :destroy
has_many :users, through: :subject_members has_many :users, through: :subject_members
has_many :tidings, as: :container, dependent: :destroy has_many :tidings, as: :container, dependent: :destroy
@ -44,6 +46,10 @@ class Subject < ApplicationRecord
courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0 courses.where("start_date <= '#{Date.today}' and end_date >= '#{Date.today}'").count > 0
end end
def has_participate?
subject_appointments.exists?(user_id: User.current.id)
end
# 挑战过路径的成员数(金课统计去重后的报名人数) # 挑战过路径的成员数(金课统计去重后的报名人数)
def member_count def member_count
excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum excellent ? CourseMember.where(role: 4, course_id: courses.pluck(:id)).pluck(:user_id).length : shixuns.pluck(:myshixuns_count).sum
@ -109,4 +115,10 @@ class Subject < ApplicationRecord
def learning? user_id def learning? user_id
Myshixun.where(user_id: user_id, shixun_id: shixuns).exists? Myshixun.where(user_id: user_id, shixun_id: shixuns).exists?
end end
def start_course_notify
Tiding.create(user_id: user_id, trigger_user_id: 0, container_id: id,
container_type: 'SubjectStartCourse', belong_container_id: id,
belong_container_type: 'Subject', tiding_type: 'System')
end
end end

@ -0,0 +1,4 @@
class SubjectAppointment < ApplicationRecord
belongs_to :subject
belongs_to :user
end

@ -346,7 +346,7 @@ class User < ApplicationRecord
elsif business? elsif business?
Course::BUSINESS Course::BUSINESS
else else
role = course.course_members.find_by(user_id: id, is_active: 1)&.role role = course&.course_members&.find_by(user_id: id, is_active: 1)&.role
case role case role
when nil then Course::NORMAL when nil then Course::NORMAL
when 'CREATOR' then Course::CREATOR when 'CREATOR' then Course::CREATOR

@ -0,0 +1,26 @@
class Admins::IdentityAuths::RevokeApplyService < ApplicationService
attr_reader :apply, :user
def initialize(apply)
@apply = apply
@user = apply.user
end
def call
ActiveRecord::Base.transaction do
apply.revoke!
user.update!(authentication: false)
deal_tiding!
end
end
private
def deal_tiding!
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
container_id: apply.id, container_type: 'CancelUserAuthentication',
belong_container_id: apply.user_id, belong_container_type: 'User',
status: 1, tiding_type: 'System')
end
end

@ -0,0 +1,26 @@
class Admins::ProfessionalAuths::RevokeApplyService < ApplicationService
attr_reader :apply, :user
def initialize(apply)
@apply = apply
@user = apply.user
end
def call
ActiveRecord::Base.transaction do
apply.revoke!
user.update!(professional_certification: false)
deal_tiding!
end
end
private
def deal_tiding!
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
container_id: apply.id, container_type: 'CancelUserProCertification',
belong_container_id: apply.user_id, belong_container_type: 'User',
status: 1, tiding_type: 'System')
end
end

@ -25,6 +25,10 @@
<% end %> <% end %>
</div> </div>
<div class="batch-action-container">
<%= javascript_void_link '批量同意', class: 'btn btn-outline-primary btn-sm batch-agree-btn' %>
</div>
<div class="box identity-authentication-list-container"> <div class="box identity-authentication-list-container">
<%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %> <%= render(partial: 'admins/identity_authentications/shared/list', locals: { applies: @applies }) %>
</div> </div>

@ -3,6 +3,12 @@
<table class="table table-hover text-center identity-authentication-list-table"> <table class="table table-hover text-center identity-authentication-list-table">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
data: { toggle: 'tooltip', title: '全选' }) %>
</th>
<% end %>
<th width="8%">头像</th> <th width="8%">头像</th>
<th width="10%">姓名</th> <th width="10%">姓名</th>
<th width="14%">身份证号</th> <th width="14%">身份证号</th>
@ -14,12 +20,14 @@
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i> <i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
</th> </th>
<% end %> <% end %>
<th width="16%">时间</th>
<% if is_processed %> <% if is_processed %>
<th width="14%">拒绝原因</th> <th width="10%">时间</th>
<th width="12%">拒绝原因</th>
<th width="8%">状态</th> <th width="8%">状态</th>
<th width="8%">操作</th>
<% else %> <% else %>
<th width="20%">操作</th> <th width="16%">时间</th>
<th width="16%">操作</th>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
@ -28,6 +36,9 @@
<% applies.each do |apply| %> <% applies.each do |apply| %>
<% user = apply.user %> <% user = apply.user %>
<tr class="identity-authentication-item identity-authentication-<%= apply.id %>"> <tr class="identity-authentication-item identity-authentication-<%= apply.id %>">
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>
<td> <td>
<%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> <%= link_to "/users/#{user.login}", class: 'identity-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" /> <img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
@ -53,6 +64,11 @@
<% if is_processed %> <% if is_processed %>
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td> <td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td> <td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
<td>
<% if apply.status == 1 %>
<%= agree_link '撤销', revoke_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '是否确认撤销认证??' %>
<% end %>
</td>
<% else %> <% else %>
<td class="action-container"> <td class="action-container">
<%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %> <%= agree_link '同意', agree_admins_identity_authentication_path(apply, element: ".identity-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?' %>

@ -25,6 +25,10 @@
<% end %> <% end %>
</div> </div>
<div class="batch-action-container">
<%= javascript_void_link '批量同意', class: 'btn btn-outline-primary btn-sm batch-agree-btn' %>
</div>
<div class="box professional-authentication-list-container"> <div class="box professional-authentication-list-container">
<%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %> <%= render(partial: 'admins/professional_authentications/shared/list', locals: { applies: @applies }) %>
</div> </div>

@ -3,12 +3,18 @@
<table class="table table-hover text-center professional-authentication-list-table"> <table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<% unless is_processed %>
<th width="4%">
<%= check_box_tag('all-check', 1, false, id: nil, class: 'batch-all-check-box',
data: { toggle: 'tooltip', title: '全选' }) %>
</th>
<% end %>
<th width="8%">头像</th> <th width="8%">头像</th>
<th width="14%">姓名</th> <th width="14%">姓名</th>
<th width="28%">学校/单位</th> <th width="20%">学校/单位</th>
<th width="12%">职称</th> <th width="12%">职称</th>
<% unless is_processed %> <% unless is_processed %>
<th width="10%"> <th width="14%">
照片 照片
<i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i> <i class="fa fa-question-circle" data-toggle="tooltip" data-html="true" data-placement="top" title="审核完成后自动删除图片"></i>
</th> </th>
@ -17,8 +23,9 @@
<% if is_processed %> <% if is_processed %>
<th width="14%">拒绝原因</th> <th width="14%">拒绝原因</th>
<th width="8%">状态</th> <th width="8%">状态</th>
<th width="8%">操作</th>
<% else %> <% else %>
<th width="18%">操作</th> <th width="22%">操作</th>
<% end %> <% end %>
</tr> </tr>
</thead> </thead>
@ -27,6 +34,9 @@
<% applies.each do |apply| %> <% applies.each do |apply| %>
<% user = apply.user %> <% user = apply.user %>
<tr class="professional-authentication-item professional-authentication-<%= apply.id %>"> <tr class="professional-authentication-item professional-authentication-<%= apply.id %>">
<% unless is_processed %>
<td><%= check_box_tag('ids[]', apply.id, false, id: nil, class: 'batch-check-box') %></td>
<% end %>
<td> <td>
<%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %> <%= link_to "/users/#{user.login}", class: 'professional-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" /> <img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
@ -51,6 +61,11 @@
<% if is_processed %> <% if is_processed %>
<td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td> <td class="text-secondary"><%= overflow_hidden_span apply.remarks, width: 140 %></td>
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td> <td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
<td>
<% if apply.status == 1 %>
<%= agree_link '撤销', revoke_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '是否确认撤销认证??' %>
<% end %>
</td>
<% else %> <% else %>
<td class="action-container"> <td class="action-container">
<%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?', 'data-disable-with': "提交中..." %> <%= agree_link '同意', agree_admins_professional_authentication_path(apply, element: ".professional-authentication-#{apply.id}"), 'data-confirm': '确认审核通过?', 'data-disable-with': "提交中..." %>

@ -9,8 +9,10 @@ json.results do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '') # 附件的替换
highlights[:content]&.first&.sub!(reg, '') atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '')
json.content highlights json.content highlights
end end

@ -7,11 +7,13 @@ json.shixun_list do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
highlights[:description]&.first&.sub!(reg, '') # 附件的替换
highlights[:content]&.first&.sub!(reg, '') atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
highlights[:content]&.first&.sub!(reg, '')&.sub!(atta_reg, '')
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300] json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')
json.content highlights json.content highlights
json.level level_to_s(obj.trainee) json.level level_to_s(obj.trainee)

@ -24,4 +24,10 @@ if @subject.excellent
json.course_identity @user.course_identity(course) json.course_identity @user.course_identity(course)
json.course_status subject_course_status course json.course_status subject_course_status course
end end
if @subject.max_course_end_date.nil? || @subject.max_course_end_date < Date.today
json.student_count @subject.student_count
json.participant_count @subject.participant_count
json.has_participate @subject.has_participate?
end
end end

@ -10,7 +10,7 @@
"2_1_end": "你提交的职业认证申请,审核已通过" "2_1_end": "你提交的职业认证申请,审核已通过"
"2_2_end": "你提交的职业认证申请,审核未通过<br/><span>原因:%{reason}</span>" "2_2_end": "你提交的职业认证申请,审核未通过<br/><span>原因:%{reason}</span>"
CancelUserAuthentication_end: "取消了你的实名认证:%s %s" CancelUserAuthentication_end: "取消了你的实名认证:%s %s"
CancelUserProCertification_end: "取消了你的实名认证:%s %s" CancelUserProCertification_end: "取消了你的职业认证:%s %s"
JoinCourse: JoinCourse:
"9_end": "申请加入课堂:%s教师" "9_end": "申请加入课堂:%s教师"
"7_end": "申请加入课堂:%s助教" "7_end": "申请加入课堂:%s助教"
@ -227,3 +227,4 @@
1_end: "你提交的发布视频申请:%s审核已通过" 1_end: "你提交的发布视频申请:%s审核已通过"
2_end: "你提交的发布视频申请:%s审核未通过<br/><span>原因:%{reason}</span>" 2_end: "你提交的发布视频申请:%s审核未通过<br/><span>原因:%{reason}</span>"
PublicCourseStart_end: "你报名参与的开放课程:%s将于%s正式开课" PublicCourseStart_end: "你报名参与的开放课程:%s将于%s正式开课"
SubjectStartCourse_end: "您创建的开放课程:%s 已达到开课人数要求。您可以在24小时内自主开设新一期课程。如果超过24小时未开课平台将自动开课并复制您上一期的课程内容。"

@ -284,6 +284,7 @@ Rails.application.routes.draw do
post :up_member_position post :up_member_position
post :down_member_position post :down_member_position
get :right_banner get :right_banner
post :appointment
end end
collection do collection do
@ -879,12 +880,22 @@ Rails.application.routes.draw do
member do member do
post :agree post :agree
post :refuse post :refuse
post :revoke
end
collection do
post :batch_agree
end end
end end
resources :professional_authentications, only: [:index] do resources :professional_authentications, only: [:index] do
member do member do
post :agree post :agree
post :refuse post :refuse
post :revoke
end
collection do
post :batch_agree
end end
end end
resources :shixun_authorizations, only: [:index] do resources :shixun_authorizations, only: [:index] do

@ -0,0 +1,6 @@
class AddCourseMemberToSubjects < ActiveRecord::Migration[5.2]
def change
add_column :subjects, :student_count, :integer, :default => 0
add_column :subjects, :participant_count, :integer, :default => 0
end
end

@ -0,0 +1,10 @@
class CreateSubjectAppointments < ActiveRecord::Migration[5.2]
def change
create_table :subject_appointments do |t|
t.references :subject, index: true
t.references :user, index: true
t.timestamps
end
end
end

File diff suppressed because one or more lines are too long

@ -65,8 +65,8 @@
"<label>" + imageLang.alt + "</label>" + "<label>" + imageLang.alt + "</label>" +
"<input type=\"text\" value=\"" + selection + "\" data-alt />" + "<input type=\"text\" value=\"" + selection + "\" data-alt />" +
"<br/>" + "<br/>" +
"<label>" + imageLang.link + "</label>" + "<label class=\"image-link\">" + imageLang.link + "</label>" +
"<input type=\"text\" value=\"http://\" data-link />" + "<input class=\"image-link\" type=\"text\" value=\"http://\" data-link />" +
"<br/>" + "<br/>" +
( (settings.imageUpload) ? "</form>" : "</div>"); ( (settings.imageUpload) ? "</form>" : "</div>");

@ -72,6 +72,13 @@ html, body {
/* 某些情况下被cm盖住了 */ /* 某些情况下被cm盖住了 */
z-index: 99; z-index: 99;
} }
/* 图片点击放大的场景,隐藏图片链接 */
.editormd-image-click-expand .editormd-image-dialog {
height: 234px !important;
}
.editormd-image-click-expand .editormd-image-dialog .image-link {
display: none;
}
/* 解决鼠标框选时,左边第一列没高亮的问题 */ /* 解决鼠标框选时,左边第一列没高亮的问题 */
.CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like { .CodeMirror .CodeMirror-lines pre.CodeMirror-line, .CodeMirror .CodeMirror-lines pre.CodeMirror-line-like {
padding: 0 12px ; padding: 0 12px ;

@ -2,7 +2,7 @@ import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
import {Link} from 'react-router-dom'; import {Link} from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, ConditionToolTip, queryString,getImageUrl, on, off} from 'educoder'; import { WordsBtn, ConditionToolTip, queryString,getImageUrl, on, off, NoneData} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
@ -817,10 +817,8 @@ class CommonWorkList extends Component{
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<div id="forum_list" className="forum_table"> <div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white"> <div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/> <NoneData></NoneData>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
</div> </div>
</div> </div>
</Spin> </Spin>

@ -86,7 +86,7 @@ class WorkDetailPageHeader extends Component{
background: #fff; background: #fff;
} }
.workDetailPageHeader .summaryname { .workDetailPageHeader .summaryname {
line-height:30px line-height:28px
} }
`}</style> `}</style>
<CBreadcrumb items={[ <CBreadcrumb items={[

@ -250,7 +250,7 @@ class CommonReply extends Component{
} }
`}</style> `}</style>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么" <MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} height={160} showError={true} imageExpand={true}
replyComment={this.replyComment} replyComment={this.replyComment}
commentsLength={comments ? comments.length : 0} commentsLength={comments ? comments.length : 0}
></MemoDetailMDEditor> ></MemoDetailMDEditor>

@ -80,7 +80,10 @@ class AddStudentModal extends Component{
} }
setVisible = (visible) => { setVisible = (visible) => {
if (visible) { if (visible) {
this.setState({school_name: this.props.user.user_school},()=>{ this.setState({
school_name: this.props.user.user_school,
name: undefined
},()=>{
this.fetchMemberList(); this.fetchMemberList();
}) })
this.fetchOptions() this.fetchOptions()
@ -88,7 +91,7 @@ class AddStudentModal extends Component{
this.refs.modalWrapper.setVisible(visible) this.refs.modalWrapper.setVisible(visible)
if (visible == false) { if (visible == false) {
this.setState({ this.setState({
checkBoxValues: [] checkBoxValues: [],
}) })
} }
} }

@ -130,7 +130,7 @@ class MemoDetailMDEditor extends Component {
} }
} }
render() { render() {
const { match, history, memo, placeholder, className } = this.props const { match, history, memo, placeholder, className, imageExpand } = this.props
const { isInited, errorMsg } = this.state const { isInited, errorMsg } = this.state
if (!memo) { if (!memo) {
return <div></div> return <div></div>
@ -185,7 +185,8 @@ class MemoDetailMDEditor extends Component {
` `
} */} } */}
</style> </style>
<div nhname={`new_message_${memo.id}`} className={`commentInput commentInputs ${className}`} <div nhname={`new_message_${memo.id}`}
className={`commentInput commentInputs ${className} ${imageExpand && 'editormd-image-click-expand' }`}
style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} > style={{ padding: '30px',boxSizing:"border-box", display: isInited ? '' : 'none', paddingBottom: '40px' }} >
<div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px' <div id="memo_comment_editorMd" className="editorMD" style={{ marginBottom: '0px'
, border: errorMsg ? '1px solid red' : '1px solid #ddd'}}> , border: errorMsg ? '1px solid red' : '1px solid #ddd'}}>

@ -40,8 +40,9 @@ class CodeRepositoryView extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.treeExpanded = false;
this.state = { this.state = {
autoExpandParent: true, autoExpandParent: false,
expandedKeys: [], expandedKeys: [],
addtionalSSHArray: [], addtionalSSHArray: [],
@ -52,24 +53,28 @@ class CodeRepositoryView extends Component {
const { game, challenge, hide_code, tabIndex, } = this.props const { game, challenge, hide_code, tabIndex, } = this.props
if ( // 初始化 或者 game切换 if ( // 初始化 或者 game切换
challenge.path && challenge.path.length && this.state.expandedKeys.length === 0 || !this.treeExpanded && challenge.path && challenge.path.length && this.state.expandedKeys.length === 0 ||
game && (!prevProps.game game && (!prevProps.game
|| prevProps.game.identifier !== this.props.game.identifier) ) { || prevProps.game.identifier !== this.props.game.identifier) ) {
const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
let _ar = []; if (!this.treeExpanded) {
const expandedKeys = []; this.treeExpanded = true
if (_path) { const _path = challenge.multiPath ? challenge.path[0] : challenge.path;
_ar = _path.split('/') let _ar = [];
_ar.length = _ar.length - 1 const expandedKeys = [];
_ar.forEach( (item, index) => { if (_path) {
expandedKeys.push( index === 0 ? item : expandedKeys[index - 1] + '/' + item) _ar = _path.split('/')
_ar.length = _ar.length - 1
_ar.forEach( (item, index) => {
expandedKeys.push( index === 0 ? item : expandedKeys[index - 1] + '/' + item)
})
}
expandedKeys.length = 1 // 没办法做到多级初始化,而且会引起点击其他子目录,加载当前文件目录的问题
// 初始化时无法展开到根节点 https://github.com/fis-components/rc-tree/issues/3
expandedKeys.length && this.setState({
expandedKeys,
}) })
} }
expandedKeys.length = 1 // 没办法做到多级初始化
// 初始化时无法展开到根节点 https://github.com/fis-components/rc-tree/issues/3
expandedKeys.length && this.setState({
expandedKeys,
})
if (game && (!prevProps.game if (game && (!prevProps.game
|| prevProps.game.identifier !== this.props.game.identifier)) { || prevProps.game.identifier !== this.props.game.identifier)) {

@ -191,6 +191,10 @@ class CodeRepositoryViewContainer extends Component {
// withCredentials: true, // withCredentials: true,
}) })
.then((response) => { .then((response) => {
// if (!response) {
// resolve && resolve();
// return;
// }
const repoFilesData = this.map2OldData(response.data.trees) const repoFilesData = this.map2OldData(response.data.trees)
if (!this.state.fileTreeData || this.state.fileTreeData.length === 0) { // 还没树节点,没加载过 if (!this.state.fileTreeData || this.state.fileTreeData.length === 0) { // 还没树节点,没加载过

@ -317,14 +317,14 @@ export default class TPMMDEditor extends Component {
let { let {
showError showError
} = this.state; } = this.state;
let { mdID, className, noStorage } = this.props; let { mdID, className, noStorage, imageExpand } = this.props;
let _style = {} let _style = {}
if (showError) { if (showError) {
_style.border = '1px solid red' _style.border = '1px solid red'
} }
return ( return (
<React.Fragment> <React.Fragment>
<div className={`df ${className}`} > <div className={`df ${className} ${imageExpand && 'editormd-image-click-expand' }`} >
{/* padding10-20 */} {/* padding10-20 */}
<div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}> <div className="edu-back-greyf5 radius4" id={`mdEditor_${mdID}`} style={{..._style}}>
<textarea style={{display: 'none'}} id={`mdEditors_${mdID}`} name="content"></textarea> <textarea style={{display: 'none'}} id={`mdEditors_${mdID}`} name="content"></textarea>

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SubjectAppointment, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save