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('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();

@ -410,14 +410,15 @@ class DetailTop extends Component{
</style> </style>
{this.props.courses===undefined?"":detailInfoList.is_creator===true?this.state.courseslist.map((item,key)=>{ {this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{
return( if(item.course_identity<4){
<Tooltip placement="bottom" title={"编辑课堂"} key={key}> return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}>
<a href={`/courses/${item.course_id}/newgolds/settings`} target={"_blank"}> <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> </a>
</Tooltip> </Tooltip>
)}):"" )}})
} }
@ -530,22 +531,20 @@ class DetailTop extends Component{
<div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:"":""} <div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:"":""}
{item.course_status.status===0? {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>: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>:""} :<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? {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>: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>:""} </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? {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"> 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>: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>:""} </a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>:""}

Loading…
Cancel
Save