Merge branches 'develop' and 'educoder' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into develop

dev_aliyun
杨树明 5 years ago
commit 973e7de200

@ -258,7 +258,7 @@ class CollegesController < ApplicationController
unless (User.current.admin? || User.current.business? ||
(@department.present? && DepartmentMember.where(:user_id => User.current.id, :department_id => @department.id).first.present?) ||
(User.current.user_extensions.try(:school_id) == @school.id && User.current.user_extensions.try(:identity) == 0) ||
(@school.try(:customer_id) && User.current.try(:partner).try(:customer_ids) && User.current.try(:partner).try(:customer_ids).include?(@school.try(:customer_id))))
(@school.try(:customer_id) && User.current.try(:partner).try(:customer_ids) && User.current.try(:partner).try(:customer_ids).include?(@school.try(:customer_id))))
render_403
end
end

@ -29,12 +29,21 @@ class ManagementsController < ApplicationController
end
def user_agents
@user_agents = UserAgent.where("user_agents.key is not null order by action_status, register_status")
@user_agents = UserAgent.where("user_agents.key is not null").order("action_status asc, register_status asc")
@agents_count = @user_agents.count
limit = 20
@agents_pages = Paginator.new @agents_count, limit, params['page'] || 1
@offset ||= @agents_pages.offset
@user_agents = paginateHelper @user_agents, limit
respond_to do |format|
format.html
format.xls{
time = Time.now.strftime("%Y%m%d")
filename = "引流情况#{time}.xls"
send_data(user_agents_export(), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
# 实训课程等级体系
@ -4369,6 +4378,39 @@ end
return sheet.rows
end
def user_agents_export
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "引流名单"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
count_row = 1
sheet1.row(0).concat(["序号", "LoginId", "姓名", "学校名称", "手机号", "邮箱", "参赛人数", "参赛队伍", "访问量"])
user_agents = UserAgent.where("user_agents.key is not null").pluck(:key).uniq
user_agents.each_with_index do |agent, index|
user = User.find_by_login(agent)
next if user.blank?
# 代理用户
agents = UserAgent.where(key: agent)
agents_count = agents.count
competion_users = agents.where(action_status: 2).pluck(:ip)
rank_user_id = UserActions.where(ip: competion_users).pluck(:user_id).uniq
team_ids = TeamMember.where(user_id: rank_user_id).pluck(:competition_team_id).uniq
sheet1[count_row, 0] = index + 1
sheet1[count_row, 1] = agent
sheet1[count_row, 2] = user.show_real_name
sheet1[count_row, 3] = user.school_name
sheet1[count_row, 4] = user.phone
sheet1[count_row, 5] = user.mail
sheet1[count_row, 6] = competion_users.count
sheet1[count_row, 7] = team_ids.count
sheet1[count_row, 8] = agents_count
count_row += 1
end
book.write xls_report
xls_report.string
end
def export_subject_level_system
xls_report = StringIO.new
book = Spreadsheet::Workbook.new

@ -28,7 +28,7 @@
<script>
$(function(){
//初始化最热评测柱状图
$.get('<%= student_hot_evaluations_college_path(@school) %>', function(data){
$.get('<%= student_hot_evaluations_college_path(@department.try(:identifier) || @school) %>', function(data){
InitHotEvaluating(data.names.reverse(), data.values.reverse());
})
});

@ -50,7 +50,7 @@
<div class="white-panel mb20 pl0 clearfix">
<li class="active" index="1"><a href="javascript:void(0);">课堂</a></li>
<li index="2"><a href="<%= student_shixun_college_path(@school) %>" data-remote="true">学生实训</a></li>
<li index="2"><a href="<%= student_shixun_college_path(@department.try(:identifier) || @school) %>" data-remote="true">学生实训</a></li>
<!--<li><a href="<%#= engineering_capability_college_path(@department) %>" data-remote="true">工程能力</a></li>-->
<!-- <li index="4"><a href="<%#= student_eval_college_path(@school) %>" data-remote="true">学生测评</a></li>-->
</div>
@ -139,15 +139,15 @@
})
});
$.get('<%= shixun_time_college_path(@school) %>', function(data){
$.get('<%= shixun_time_college_path(@department.try(:identifier) || @school) %>', function(data){
$('.shixun-time').html("<span data-tip-down=\"所有学员的实训耗时之和\">" + data.shixun_time + "</span>天");
});
$.get('<%= shixun_report_count_college_path(@school) %>', function(data){
$.get('<%= shixun_report_count_college_path(@department.try(:identifier) || @school) %>', function(data){
$('.shixun-report-count').html("<span>" + data.shixun_report_count + "</span>个");
});
// 教师排名
$.ajax({ url: '<%= teachers_college_path(@school) %>', method: 'GET', dataType: 'script' })
$.ajax({ url: '<%= teachers_college_path(@department.try(:identifier) || @school) %>', method: 'GET', dataType: 'script' })
$(".count_student_test a").click(function(){
$(".count_student_test a").removeClass("active");
@ -155,7 +155,7 @@
});
//初始化饼状图
$.get('<%= shixun_chart_data_college_path(@school) %>', function(data){
$.get('<%= shixun_chart_data_college_path(@department.try(:identifier) || @school) %>', function(data){
$('.pie-chart-loading').hide();
if (data.names.length > 0) {
$('.online_status .edu-tab-con-box').hide();
@ -166,7 +166,7 @@
}
});
$.get('<%= course_statistics_college_path(@school) %>');
$.get('<%= course_statistics_college_path(@department.try(:identifier) || @school) %>');
});
function InitPieChart(names, data){
var Color = ['#49A9EE', '#FFD86E', '#98D87D', '#8996E6', '#F3857B', '#B97BF3','#4DE8B4','#F37BDB','#566EFF','#FF961A'];

@ -63,7 +63,6 @@ display: none; right:110px;">
<li><%= link_to '我的实训项目', user_path(User.current, :type => 'a_shixun') %></li>
<li><%= link_to '我的实践课程', user_path(User.current, :type => 'a_path') %></li>
<li><%= link_to '我的开发项目', user_path(User.current, :type => 'a_project') %></li>
<li><%= link_to '我的众包', user_path(User.current, :type => 'a_package') %></li>
<% if User.current.partner.present? %>
<li><%= link_to '客户管理', partner_list_cooperate_path(User.current.partner) %></li>
<% end %>

@ -114,8 +114,8 @@
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 10 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">审批</a>
<ul class="edu-admin-nav-inner">
<li><%= link_to "实名认证", identity_authentication_managements_path %></li>
<li><%= link_to "职业认证", professional_authentication_managements_path %></li>
<!-- <li><%#= link_to "实名认证", identity_authentication_managements_path %></li>-->
<!-- <li><%#= link_to "职业认证", professional_authentication_managements_path %></li>-->
<li><%= link_to "试用授权", trial_authorization_managements_path %></li>
<li><%= link_to "部门审批", depart_managements_path %></li>
<li><%= link_to '单位审批', unit_managements_path %></li>

@ -8,6 +8,7 @@
<th width="10%">竞赛报名状态</th>
<th width="10%">ip</th>
<th width="20%">负责人</th>
<a href="<%= user_agents_managements_path(:format => "xls") %>" class="task-btn mr10 task-btn-orange fr">导出</a>
</thead>
<tbody>
<% @user_agents.each do |ua| %>

@ -30,35 +30,3 @@
</div>
<div id="trophyreturn" class="-task-sidebars" style="right: 65px !important;width: 154px;">
<a onclick="trophyreturnfun();" id="closeIcon" style="position: absolute;right: 12px;top: 10px; color: #000;">
<i class="iconfont icon-shanchudiao"></i>
</a>
<a href="/competitions">
<img src="/images/educoder/competition/lvmeng.png" width="150px" height="150px">
</a>
</div>
<script>
function trophyreturnfun(){
$("#trophyreturn").hide()
localStorage.setItem('trophy_uid', true);
}
$(function() {
var trophy_uid = false;
if (window.localStorage) {
trophy_uid = localStorage.getItem('trophy_uid');
} else {
trophy_uid = false
}
if(trophy_uid==="true"||trophy_uid===true){
$("#trophyreturn").hide()
}
})
</script>

@ -81,101 +81,101 @@
<!--导师排行榜-->
<div class="pt60 pb60 mb30 mentor-ranking">
<div class="educontent">
<div class="edu-txt-center">
<p class="color-dark edu-txt-center font-24" style="line-height: 30px">导师排行榜</p>
<p class="color-grey-cd font-12">MENTOR RANKING</p>
</div>
<div class="ranking clearfix">
<ul class="grade color-dark">
<% if @tea_users[1] %>
<li class="mt35 pr">
<img src="/images/educoder/huangguan-two.png" class="huangguan"/>
<a href="/users/<%= (@tea_users[1].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[1])) %>
<span class="task-hide rankName"><%= @tea_users[1].try(:show_name) %></span>
</a>
</li>
<% end %>
<% if @tea_users[0] %>
<li class="pr">
<img src="/images/educoder/huangguan.png" class="huangguan"/>
<a href="/users/<%= (@tea_users[0].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[0])) %>
<span class="task-hide rankName"><%= @tea_users[0].try(:show_name) %></span>
</a>
</li>
<% end %>
<% if @tea_users[2] %>
<li class="mt35 pr">
<img src="/images/educoder/huangguan-three.png" class="huangguan"/>
<a href="/users/<%=(@tea_users[2].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[2])) %>
<span class="task-hide rankName"><%= @tea_users[2].try(:show_name) %></span>
</a>
</li>
<% end %>
</ul>
<br/>
<ul class="grade mt30">
<% if @tea_users.size > 3 %>
<% @tea_users[3..@tea_users.size].each do |t_u| %>
<li>
<a href="/users/<%= t_u.try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(t_u)) %>
<span class="task-hide rankName"><%= t_u.try(:show_name) %></span>
</a>
</li>
<% end %>
<% end %>
</ul>
</div>
</div>
</div>
# <div class="pt60 pb60 mb30 mentor-ranking">
# <div class="educontent">
# <div class="edu-txt-center">
# <p class="color-dark edu-txt-center font-24" style="line-height: 30px">导师排行榜</p>
# <p class="color-grey-cd font-12">MENTOR RANKING</p>
# </div>
# <div class="ranking clearfix">
# <ul class="grade color-dark">
# <% if @tea_users[1] %>
# <li class="mt35 pr">
# <img src="/images/educoder/huangguan-two.png" class="huangguan"/>
# <a href="/users/<%= (@tea_users[1].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[1])) %>
# <span class="task-hide rankName"><%= @tea_users[1].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% if @tea_users[0] %>
# <li class="pr">
# <img src="/images/educoder/huangguan.png" class="huangguan"/>
# <a href="/users/<%= (@tea_users[0].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[0])) %>
# <span class="task-hide rankName"><%= @tea_users[0].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% if @tea_users[2] %>
# <li class="mt35 pr">
# <img src="/images/educoder/huangguan-three.png" class="huangguan"/>
# <a href="/users/<%=(@tea_users[2].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@tea_users[2])) %>
# <span class="task-hide rankName"><%= @tea_users[2].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# </ul>
# <br/>
# <ul class="grade mt30">
# <% if @tea_users.size > 3 %>
# <% @tea_users[3..@tea_users.size].each do |t_u| %>
# <li>
# <a href="/users/<%= t_u.try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(t_u)) %>
# <span class="task-hide rankName"><%= t_u.try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% end %>
# </ul>
# </div>
# </div>
# </div>
<!--程序员排行榜-->
<div class="pt60 pb60 mb30 pro-ranking">
<div class="educontent">
<div class="edu-txt-center">
<p class="color-dark edu-txt-center font-24" style="line-height: 30px">程序员排行榜</p>
<p class="color-grey-cd font-12">PROGRAMMER RANKING</p>
</div>
<div class="ranking clearfix">
<ul class="grade color-dark">
<% if @stu_users[1] %>
<li class="mt35 pr">
<img src="/images/educoder/huangguan-two.png" class="huangguan"/>
<a href="/users/<%= @stu_users[1].try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[1])) %>
<span class="task-hide rankName"><%= @stu_users[1].try(:show_name) %></span>
</a>
</li>
<% end %>
<% if @stu_users[0] %>
<li class="pr">
<img src="/images/educoder/huangguan.png" class="huangguan"/>
<a href="/users/<%= @stu_users[0].try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[0])) %>
<span class="task-hide rankName"><%= @stu_users[0].try(:show_name) %></span>
</a>
</li>
<% end %>
<% if @stu_users[2] %>
<li class="mt35 pr">
<img src="/images/educoder/huangguan-three.png" class="huangguan"/>
<a href="/users/<%= (@stu_users[2].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[2])) %>
<span class="task-hide rankName"><%= @stu_users[2].try(:show_name) %></span>
</a>
</li>
<% end %>
</ul>
<br/>
<ul class="grade mt30">
<% if @stu_users.size > 3 %>
<% @stu_users[3..@stu_users.size].each do |e_u| %>
<li>
<a href="/users/<%= e_u.try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(e_u)) %>
<span class="task-hide rankName"><%= e_u.try(:show_name) %></span>
</a>
</li>
<% end %>
<% end %>
</ul>
</div>
</div>
</div>
# <div class="pt60 pb60 mb30 pro-ranking">
# <div class="educontent">
# <div class="edu-txt-center">
# <p class="color-dark edu-txt-center font-24" style="line-height: 30px">程序员排行榜</p>
# <p class="color-grey-cd font-12">PROGRAMMER RANKING</p>
# </div>
# <div class="ranking clearfix">
# <ul class="grade color-dark">
# <% if @stu_users[1] %>
# <li class="mt35 pr">
# <img src="/images/educoder/huangguan-two.png" class="huangguan"/>
# <a href="/users/<%= @stu_users[1].try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[1])) %>
# <span class="task-hide rankName"><%= @stu_users[1].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% if @stu_users[0] %>
# <li class="pr">
# <img src="/images/educoder/huangguan.png" class="huangguan"/>
# <a href="/users/<%= @stu_users[0].try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[0])) %>
# <span class="task-hide rankName"><%= @stu_users[0].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% if @stu_users[2] %>
# <li class="mt35 pr">
# <img src="/images/educoder/huangguan-three.png" class="huangguan"/>
# <a href="/users/<%= (@stu_users[2].try(:login)) %>" class="color-dark"><%= image_tag(url_to_avatar(@stu_users[2])) %>
# <span class="task-hide rankName"><%= @stu_users[2].try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# </ul>
# <br/>
# <ul class="grade mt30">
# <% if @stu_users.size > 3 %>
# <% @stu_users[3..@stu_users.size].each do |e_u| %>
# <li>
# <a href="/users/<%= e_u.try(:login) %>" class="color-dark"><%= image_tag(url_to_avatar(e_u)) %>
# <span class="task-hide rankName"><%= e_u.try(:show_name) %></span>
# </a>
# </li>
# <% end %>
# <% end %>
# </ul>
# </div>
# </div>
# </div>
</div>

@ -609,19 +609,19 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'batch_authorization', :as => 'batch_authorization'
match 'search_user', :via => [:get, :post]
match 'affirm_cancel_auth', :via => [:get, :post]
get 'identity_authentication', :as => 'identity_authentication'
# get 'identity_authentication', :as => 'identity_authentication'
match 'trial_authorization_operation', :as => 'trial_authorization_operation'
get 'reject_authentication'
get 'agree_authentication'
# get 'reject_authentication'
# get 'agree_authentication'
match 'users', :via => [:get, :post]
get 'users_trial'
get 'auto_users_trial'
match 'users_authorization_agree'
match 'users_authorization_cancel'
get 'update_webssh'
get 'professional_authentication', :as => 'professional_authentication'
get 'agree_authentication_pro'
post 'reject_authentication_pro'
# get 'professional_authentication', :as => 'professional_authentication'
# get 'agree_authentication_pro'
# post 'reject_authentication_pro'
get 'update_shixun_hidden'
get 'update_subject_hidden'
post 'course_homepage_show'
@ -2383,9 +2383,9 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'admin/code_work_tests'
post 'admin/select_course_syllabus'
post 'admin/create_syllabus'
get 'admin/identity_authentication'
get 'admin/reject_authentication'
get 'admin/agree_authentication'
# get 'admin/identity_authentication'
# get 'admin/reject_authentication'
# get 'admin/agree_authentication'
resources :auth_sources do
member do

@ -238,11 +238,11 @@ class NewHeader extends Component {
} else {
var uid = false
}
if(!uid){
this.setState({
competitiontype:true
})
}
// if(!uid){
// this.setState({
// competitiontype:true
// })
// }
}
setcompetitionfun=()=>{

@ -13,26 +13,26 @@ class SiderBar extends Component {
}
componentDidMount() {
window._initSider();
var trophy_uid = false;
if (window.localStorage) {
trophy_uid = localStorage.getItem('trophy_uid');
} else {
trophy_uid = false
}
if(trophy_uid==="true"||trophy_uid===true){
this.setState({
trophyreturn:true
})
}
// window._initSider();
// var trophy_uid = false;
// if (window.localStorage) {
// trophy_uid = localStorage.getItem('trophy_uid');
// } else {
// trophy_uid = false
// }
// if(trophy_uid==="true"||trophy_uid===true){
// this.setState({
// trophyreturn:true
// })
// }
}
trophyreturnfun=()=>{
this.setState({
trophyreturn:true
})
localStorage.setItem('trophy_uid', true);
// this.setState({
// trophyreturn:true
// })
// localStorage.setItem('trophy_uid', true);
}
render() {
return (
@ -70,15 +70,15 @@ class SiderBar extends Component {
</div>
</div>
{this.state.trophyreturn===true?"":<div className="-task-sidebars" style={{right: "65x",width: "154px"}}>
<a onClick={this.trophyreturnfun} id="closeIcon"
style={{position: "absolute", right: "12px",top:"10px",color: "#000"}}>
<i className="iconfont icon-shanchudiao"></i>
</a>
<a href="/competitions">
<img src={getImageUrl("images/educoder/competition/lvmeng.png")} width="150px" height="150px" />
</a>
</div>}
{/*{this.state.trophyreturn===true?"":<div className="-task-sidebars" style={{right: "65x",width: "154px"}}>*/}
{/* <a onClick={this.trophyreturnfun} id="closeIcon"*/}
{/* style={{position: "absolute", right: "12px",top:"10px",color: "#000"}}>*/}
{/* <i className="iconfont icon-shanchudiao"></i>*/}
{/* </a>*/}
{/* <a href="/competitions">*/}
{/* <img src={getImageUrl("images/educoder/competition/lvmeng.png")} width="150px" height="150px" />*/}
{/* </a>*/}
{/*</div>}*/}
</div>
);

Loading…
Cancel
Save