Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
jingquan huang 6 years ago
commit d05d1e8480

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

@ -7,6 +7,8 @@ class Admins::BaseController < ApplicationController
before_action :require_login, :require_admin!
after_action :rebind_event_if_ajax_render_partial
private
def require_login
@ -21,4 +23,16 @@ class Admins::BaseController < ApplicationController
render_forbidden
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

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

@ -1,12 +1,12 @@
<table class="table table-hover daily-school-statistic-list-table">
<thead class="thead-light">
<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: 'student_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: '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="12%">
<%= sort_tag('实训评测总数', name: 'shixun_evaluate_count', path: admins_daily_school_statistics_path) %>
@ -14,17 +14,16 @@
</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="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>
</thead>
<tbody>
<% if statistics.present? %>
<% statistics.each do |statistic| %>
<tr>
<td class="edu-txt-left">
<%= link_to '#' do %>
<%= overflow_hidden_span statistic[:name], width: '200px' %>
<% end %>
<td class="text-left">
<%= link_to statistic[:name], "/colleges/#{statistic[:id]}/statistics",
target: '_blank', data: { toggle: 'tooltip', title: '点击查看学校统计概况' } %>
</td>
<td><%= statistic[:teacher_count].to_i %></td>
<td><%= statistic[:student_count].to_i %></td>

@ -30,7 +30,8 @@
<% statistics.each do |statistic| %>
<tr>
<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><%= statistic['total'] %></td>
<td><%= statistic['other_total'] %></td>

@ -35,7 +35,8 @@
<% statistics.each do |statistic| %>
<tr>
<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><%= statistic.teacher_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();

@ -410,14 +410,15 @@ class DetailTop extends Component{
</style>
{this.props.courses===undefined?"":detailInfoList.is_creator===true?this.state.courseslist.map((item,key)=>{
return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}>
{this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{
if(item.course_identity<4){
return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}>
<a href={`/courses/${item.course_id}/newgolds/settings`} target={"_blank"}>
<i className="iconfont icon-bianji1 newbianji1"></i>
<i className="iconfont icon-bianji1 newbianji1"></i>
</a>
</Tooltip>
)}):""
</Tooltip>
)}})
}
@ -530,22 +531,20 @@ class DetailTop extends Component{
<div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:"":""}
{item.course_status.status===0?
detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1?
detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""}
{item.course_status.status===2?
detailInfoList.is_creator===true||detailInfoList.allow_add_member===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>:""}

Loading…
Cancel
Save