Merge branch 'develop' into dev_aliyun

dev_home
cxt 5 years ago
commit 6acb714846

@ -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

@ -34,6 +34,7 @@
<% 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' } %>
<%= link_to '同步用户', synchronize_user_admins_laboratory_path(laboratory), remote: true, data: { confirm: '确认同步该单位下的所有用户到云上实验室吗?' }, class: 'action' %>
<% end %> <% end %>
<div class="d-inline"> <div class="d-inline">

@ -1052,6 +1052,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]

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