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

dev_hs
杨树明 6 years ago
commit feb924fd6f

@ -19,6 +19,8 @@
$.fn.select2.defaults.set('theme', 'bootstrap4'); $.fn.select2.defaults.set('theme', 'bootstrap4');
$.fn.select2.defaults.set('language', 'zh-CN'); $.fn.select2.defaults.set('language', 'zh-CN');
Turbolinks.setProgressBarDelay(200);
$(document).on('turbolinks:load', function(){ $(document).on('turbolinks:load', function(){
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover(); $('[data-toggle="popover"]').popover();

@ -7,6 +7,8 @@ class Admins::BaseController < ApplicationController
before_action :require_login, :require_admin! before_action :require_login, :require_admin!
after_action :rebind_event_if_ajax_render_partial
private private
def require_login def require_login
@ -21,4 +23,16 @@ class Admins::BaseController < ApplicationController
render_forbidden render_forbidden
end end
# 触发after ajax render partial hooks执行一些因为局部刷新后失效的绑定事件
def rebind_event_if_ajax_render_partial
return if request.format.symbol != :js
return if response.content_type != 'text/javascript'
path = Rails.root.join('app/views/admins/shared/after_render_js_hook.js.erb')
return unless File.exists?(path)
append_js = ERB.new(File.open(path).read).result
response.body += append_js
end
end end

@ -40,7 +40,7 @@ class ApplicationController < ActionController::Base
if @user_course_identity > Course::STUDENT && @course.is_public == 0 if @user_course_identity > Course::STUDENT && @course.is_public == 0
tip_exception(401, "..") unless User.current.logged? tip_exception(401, "..") unless User.current.logged?
check_account check_account
tip_exception(409, "您没有权限进入") tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
end end
uid_logger("###############user_course_identity:#{@user_course_identity}") uid_logger("###############user_course_identity:#{@user_course_identity}")
end end

@ -1,12 +1,12 @@
<table class="table table-hover daily-school-statistic-list-table"> <table class="table table-hover daily-school-statistic-list-table">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th width="18%" class="edu-txt-left">单位名称</th> <th width="14%" class="text-left">单位名称</th>
<th width="10%"><%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('教师总数', name: 'teacher_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('学生总数', name: 'student_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('课堂总数', name: 'course_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %></th> <th width="14%"><%= sort_tag('正在进行课堂数', name: 'active_course_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('实训总数', name: 'shixun_count', path: admins_daily_school_statistics_path) %></th>
<th width="12%"> <th width="12%">
<%= sort_tag('实训评测总数', name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) %> <%= sort_tag('实训评测总数', name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) %>
@ -14,17 +14,16 @@
</th> </th>
<th width="10%"><%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('实训作业总数', name: 'homework_count', path: admins_daily_school_statistics_path) %></th>
<th width="10%"><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %></th> <th width="10%"><%= sort_tag('其它作业总数', name: 'other_homework_count', path: admins_daily_school_statistics_path) %></th>
<th width="14%"><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %></th> <th width="13%"><%= sort_tag('动态时间', name: 'nearly_course_time', path: admins_daily_school_statistics_path) %></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% if statistics.present? %> <% if statistics.present? %>
<% statistics.each do |statistic| %> <% statistics.each do |statistic| %>
<tr> <tr>
<td class="edu-txt-left"> <td class="text-left">
<%= link_to '#' do %> <%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics",
<%= overflow_hidden_span statistic[:name], width: '200px' %> target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %>
<% end %>
</td> </td>
<td><%= statistic[:teacher_count].to_i %></td> <td><%= statistic[:teacher_count].to_i %></td>
<td><%= statistic[:student_count].to_i %></td> <td><%= statistic[:student_count].to_i %></td>

@ -30,7 +30,8 @@
<% statistics.each do |statistic| %> <% statistics.each do |statistic| %>
<tr> <tr>
<td class="text-left"> <td class="text-left">
<%= link_to statistic.school_name, '' %> <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics",
target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %>
</td> </td>
<td><%= statistic['total'] %></td> <td><%= statistic['total'] %></td>
<td><%= statistic['other_total'] %></td> <td><%= statistic['other_total'] %></td>

@ -35,7 +35,8 @@
<% statistics.each do |statistic| %> <% statistics.each do |statistic| %>
<tr> <tr>
<td class="text-left"> <td class="text-left">
<%= link_to statistic.school_name, '' %> <%= link_to statistic.school_name, "/colleges/#{statistic.school_id}/statistics",
target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %>
</td> </td>
<td><%= statistic.teacher_increase_count.to_i %></td> <td><%= statistic.teacher_increase_count.to_i %></td>
<td><%= statistic.student_increase_count.to_i %></td> <td><%= statistic.student_increase_count.to_i %></td>

@ -0,0 +1,3 @@
;
$('[data-toggle="tooltip"]').tooltip();
$('[data-toggle="popover"]').popover();

@ -53,10 +53,10 @@ namespace :sync do
end end
discusses = Discuss.where(dis_id: shixun_id).where("parent_id is null and created_at >? and created_at <?", start_time, end_time) discusses = Discuss.where(dis_id: shixun_id).where("parent_id is null and created_at >? and created_at <?", start_time, end_time)
discusses.each do |discusse| discusses.each do |discuss|
puts discusse.id puts discuss.id
# 找到所有的子回复 # 找到所有的子回复
replies = Discuss.where(parent_id: discusse.id) replies = Discuss.where(parent_id: discuss.id)
# 如果有子回复,除了创建父回复外,还需要同步子回复 # 如果有子回复,除了创建父回复外,还需要同步子回复
new_message = Message.create!(board_id: board_id.to_i, author_id: discuss.user_id, parent_id: message_id, root_id: message_id) new_message = Message.create!(board_id: board_id.to_i, author_id: discuss.user_id, parent_id: message_id, root_id: message_id)

@ -275,6 +275,11 @@ class App extends Component {
}) })
window.location.href = "/"; window.location.href = "/";
}; };
ModalshowCancelsy=()=>{
this.setState({
mydisplay:true,
})
};
componentDidMount() { componentDidMount() {
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
@ -327,7 +332,7 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview> <Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/> <Addcourses {...this.props} {...this.state} HideAddcoursestypess={(i)=>this.HideAddcoursestypess(i)}/>
<AccountProfile {...this.props} {...this.state} /> <AccountProfile {...this.props} {...this.state} />
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy}/> <Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy} ModalshowCancelsy={this.ModalshowCancelsy}/>
<Router> <Router>
<Switch> <Switch>

@ -581,8 +581,8 @@ class CoursesBanner extends Component {
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a> onClick={() => this.tojoinclass(1)}>加入课堂</a>
: :
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}} <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.myyslgradin()}>加入课堂</a> onClick={() => this.myyslgradin(1)}>加入课堂</a>
) )
: ""} : ""}
@ -591,8 +591,8 @@ class CoursesBanner extends Component {
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a> onClick={() => this.tojoinclass(1)}>加入课堂</a>
: :
<a className="fr user_default_btn user_white_btn mr20 font-18" style={{width:"130px"}} <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.myyslgradin()}>加入课堂</a> onClick={() => this.myyslgradin(1)}>加入课堂</a>
: ""} : ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true? {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?

@ -442,7 +442,8 @@ class Goldsubject extends Component {
var subjectids=this.props.match.params.subjectid; var subjectids=this.props.match.params.subjectid;
window.location.href=`/paths/${subjectids}` window.location.href=`/paths/${subjectids}`
}else{ }else{
this.props.history.goBack(); // this.props.history.goBack();
window.location.href=`/courses/${this.props.match.params.coursesId}/informs`
} }
} }

@ -18,20 +18,23 @@ class Certifiedprofessional extends Component {
componentDidMount() { componentDidMount() {
// console.log("加入金品课堂"); // console.log("加入金品课堂");
// console.log(this.props); // console.log(this.props);
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === 410) {
try {
this.props.ModalshowCancelsy();
}catch (e) {
} }
componentDidMount() {
// axios.interceptors.response.use((response) => { }
// if (response != undefined) return response;
// if (response && response.data.status === -1) { }, (error) => {
//
// } });
// return response;
// }, (error) => {
// //TODO 这里如果样式变了会出现css不加载的情况
//
// });
} }
modalCancel=()=>{ modalCancel=()=>{
this.props.ModalCancelsy(); this.props.ModalCancelsy();
}; };

Loading…
Cancel
Save