Merge branch 'develop' into dev_aliyun

dev_home
daiao 5 years ago
commit 28a4fa9c66

@ -48,7 +48,6 @@ gem 'rqrcode_png'
gem 'acts-as-taggable-on', '~> 6.0' gem 'acts-as-taggable-on', '~> 6.0'
group :development, :test do group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails', '~> 3.8' gem 'rspec-rails', '~> 3.8'
end end

@ -50,6 +50,13 @@ class Admins::LaboratoriesController < Admins::BaseController
@subjects = paginate(subjects.includes(:user)) @subjects = paginate(subjects.includes(:user))
end end
def synchronize_user
school = current_laboratory.school
users = User.joins(:user_extension).where(user_extensions: {school_id: school.id})
users.update_all(laboratory_id: current_laboratory.id)
end
private private
def current_laboratory def current_laboratory

@ -767,8 +767,9 @@ class GamesController < ApplicationController
# 记录实训花费的时间 # 记录实训花费的时间
# REDO:需要添加详细的说明 # REDO:需要添加详细的说明
def cost_time def cost_time
cost_time = params[:time].to_i return if @game.status >= 2
@game.update_attribute(:cost_time, cost_time) cost_time = Time.now.to_i - @game.close_browse_time.to_i
@game.update_attributes(close_browse_time: Time.now, cost_time: cost_time)
end end
# 同步challenge的更新时间 # 同步challenge的更新时间
@ -938,6 +939,7 @@ class GamesController < ApplicationController
game.update_attributes(status: 0, open_time: Time.now) if game.open_time.blank? || game.status == 3 game.update_attributes(status: 0, open_time: Time.now) if game.open_time.blank? || game.status == 3
# 开启实训更新myshixuns的时间方便跟踪用于的学习进度。 # 开启实训更新myshixuns的时间方便跟踪用于的学习进度。
game.myshixun.update_column(:updated_at, Time.now) game.myshixun.update_column(:updated_at, Time.now)
@game.update_attribute(:close_browse_time, Time.now) if game.status < 2 && @game.close_browse_time.nil?
end end
# vnc连接 # vnc连接

@ -34,7 +34,8 @@
<% if school.present? && laboratory.id != 1 %> <% if school.present? && laboratory.id != 1 %>
<%= javascript_void_link '添加管理员', class: 'action', data: { laboratory_id: laboratory.id, toggle: 'modal', target: '.admin-add-laboratory-user-modal' } %> <%= javascript_void_link '添加管理员', class: 'action', data: { laboratory_id: laboratory.id, toggle: 'modal', target: '.admin-add-laboratory-user-modal' } %>
<% end %> <%= link_to '同步用户', synchronize_user_admins_laboratory_path(laboratory), remote: true, data: { confirm: '确认同步该单位下的所有用户到云上实验室吗?' }, class: 'action' %>
<% end %>
<div class="d-inline"> <div class="d-inline">
<%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %> <%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %>

@ -1074,6 +1074,7 @@ Rails.application.routes.draw do
member do member do
get :shixuns_for_select get :shixuns_for_select
get :subjects_for_select get :subjects_for_select
get :synchronize_user
end end
resource :laboratory_setting, only: [:show, :update] resource :laboratory_setting, only: [:show, :update]

@ -0,0 +1,5 @@
class AddCloseBrowserTimeForGames < ActiveRecord::Migration[5.2]
def change
add_column :games, :close_browse_time, :timestamp
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

@ -119,7 +119,7 @@ class CoursesHome extends Component{
.courses-head{ .courses-head{
width: 100%; width: 100%;
height: 300px; height: 300px;
background-image: url(${getImageUrl(this.props.mygetHelmetapi && this.props.mygetHelmetapi.course_banner_url === null ?`images/educoder/competitions/courses.jpg`:this.props.mygetHelmetapi&&this.props.mygetHelmetapi.course_banner_url)}); background-image: url(${getImageUrl(this.props.mygetHelmetapi && this.props.mygetHelmetapi.course_banner_url === null ?`images/educoder/courses/courses.jpg`:this.props.mygetHelmetapi&&this.props.mygetHelmetapi.course_banner_url)});
background-color: #081C4B; background-color: #081C4B;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;

@ -590,7 +590,7 @@ class LoginDialog extends Component {
if (isRender === undefined) { if (isRender === undefined) {
isRender = false isRender = false
} }
// console.log(this.props)
return ( return (
<Dialog open={true} id="DialogID" <Dialog open={true} id="DialogID"
className="zindextest" className="zindextest"
@ -604,7 +604,19 @@ class LoginDialog extends Component {
setNotcompleteds={()=>{this.setNotcompleteds()}} setNotcompleteds={()=>{this.setNotcompleteds()}}
/> />
{this.state.isphone===false||this.props.user&&this.props.user.main_site===false?<style> {/*{this.state.isphone===false||this.props.user&&this.props.user.main_site===false?<style>*/}
{/*{*/}
{/*`*/}
{/*#DialogID .dialogBox {*/}
{/*width: 405px !important;*/}
{/*}*/}
{/*.dialogBox {*/}
{/*height: 290px !important;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>:""}*/}
<style>
{ {
` `
#DialogID .dialogBox { #DialogID .dialogBox {
@ -615,7 +627,7 @@ class LoginDialog extends Component {
} }
` `
} }
</style>:""} </style>
{isRender===true? {isRender===true?
<div className={dialogBox}> <div className={dialogBox}>
<div id="closeIcon" className={"logincloseIcon"} onClick={()=>{this.handleDialogClose()}}> <div id="closeIcon" className={"logincloseIcon"} onClick={()=>{this.handleDialogClose()}}>

@ -1284,7 +1284,7 @@ submittojoinclass=(value)=>{
<div className="edu-menu-list" style={{top: '60px',width:"240px"}}> <div className="edu-menu-list" style={{top: '60px',width:"240px"}}>
<div className="overPart"></div> <div className="overPart"></div>
<ul className={coursestypes===true&&this.props.user&&this.props.user.main_site===false?"fl headwith100b edu-txt-center pr ul-leftline":"fl with50 edu-txt-center pr ul-leftline"}> <ul className={coursestypes===true&&this.props.user&&this.props.user.main_site===false?"fl headwith100b edu-txt-center pr ul-leftline":"fl with50 edu-txt-center pr ul-leftline"}>
{this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===true?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"翻转课堂"}</a></li>} {this.props.current_user&&this.props.current_user.user_identity==="学生"?"":coursestypes===true?"":<li><a onClick={(url)=>this.getUser("/courses/new")}>{this.props.user&&this.props.user.main_site===false?"新建课堂":"新建翻转课堂"}</a></li>}
{shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>} {shixuntype===true?"":<li><a onClick={(url)=>this.getUser("/shixuns/new")}>新建实训项目</a></li>}
{this.props.Headertop===undefined?"": {this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.main_site===true||this.props.user&&this.props.user.admin===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:"" pathstype===true?"":this.props.user&&this.props.user.main_site===true||this.props.user&&this.props.user.admin===true?<li><a onClick={(url)=>this.getUser("/paths/new")} >新建实践课程</a></li>:""

Loading…
Cancel
Save