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

issues25489
cxt 5 years ago
commit 960d2674c8

@ -63,16 +63,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 };
},
processResults: function(data){
return { results: data.shixuns }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.shixuns,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -85,16 +85,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 }
},
processResults: function(data){
return { results: data.subjects }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.subjects,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -26,10 +26,12 @@ class Admins::LaboratoriesController < Admins::BaseController
keyword = params[:keyword].to_s.strip
if keyword.present?
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword'
shixuns = shixuns.joins(:user).where(like_sql, keyword: "%#{keyword}%")
like_sql = 'shixuns.name LIKE :keyword OR CONCAT(users.lastname, users.firstname) LIKE :keyword '\
'OR mirror_repositories.name LIKE :keyword'
shixuns = shixuns.joins(:user, :mirror_repositories).where(like_sql, keyword: "%#{keyword}%")
end
@count = shixuns.count
@shixuns = paginate(shixuns.includes(:user))
end
@ -44,6 +46,7 @@ class Admins::LaboratoriesController < Admins::BaseController
subjects = subjects.joins(:user).where(like_sql, keyword: "%#{keyword}%")
end
@count = subjects.count
@subjects = paginate(subjects.includes(:user))
end

@ -1,3 +1,4 @@
json.count @count
json.shixuns do
json.array! @shixuns do |shixun|
json.extract! shixun, :id, :name, :status

@ -1,3 +1,4 @@
json.count @count
json.subjects do
json.array! @subjects do |subject|
json.extract! subject, :id, :name, :status

@ -1,10 +1,10 @@
<% sidebar_collapse = request.cookies['admin_sidebar_collapse'].to_s == 'true' %>
<nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>">
<div class="sidebar-header">
<div class="sidebar-header-logo">
<a href="/" class="sidebar-header-logo" data-toggle="tooltip" data-title="返回主站" >
<img class="rounded-circle" src="/images/<%= url_to_avatar(current_user) %>" />
<span class="logo-label">后台管理</span>
</div>
</a>
<div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>">
<i class="fa fa-chevron-left fold" data-toggle="tooltip" data-placement="right" data-boundary="window" title="收起"></i>
<i class="fa fa-bars unfold" data-toggle="tooltip" data-placement="right" data-boundary="window" title="展开"></i>

@ -2,6 +2,7 @@ admins-mirror_scripts: 'admins-mirror_repositories'
admins-laboratory_settings: 'admins-laboratories'
admins-carousels: 'admins-laboratories'
admins-laboratory_shixuns: 'admins-laboratories'
admins-laboratory_subjects: 'admins-laboratories'
admins-competition_settings: 'admins-competitions'
admins-enroll_lists: 'admins-competitions'
admins-competition_prize_users: 'admins-competitions'

File diff suppressed because one or more lines are too long

@ -137758,16 +137758,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 };
},
processResults: function(data){
return { results: data.shixuns }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.shixuns,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {
@ -137900,16 +137907,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索',
multiple: true,
minimumInputLength: 1,
closeOnSelect: false,
ajax: {
delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json',
data: function(params){
return { keyword: params.term };
return { keyword: params.term, page: params.page || 1, per_page: 20 }
},
processResults: function(data){
return { results: data.subjects }
processResults: function(data, params){
params.page = params.page || 1;
return {
results: data.subjects,
pagination: {
more: (params.page * 20) < data.count
}
};
}
},
templateResult: function (item) {

@ -3,7 +3,7 @@ import React,{ Component } from "react";
import {
Form, Input, InputNumber, Switch, Radio,
Slider, Button, Upload, Icon, Rate, Checkbox, message,
Row, Col, Select, Modal, Divider
Row, Col, Select, Modal, Divider,Tooltip
} from 'antd';
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
@ -29,7 +29,8 @@ class BoardsNew extends Component{
fileList: [],
boards: [],
title_num: 0,
email_notify:false
email_notify:false,
isemail_notify:false
}
}
addSuccess = () => {
@ -98,7 +99,7 @@ class BoardsNew extends Component{
}
})
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) ,isemail_notify:response.data.data.email_notify})
}
}
})
@ -136,6 +137,7 @@ class BoardsNew extends Component{
select_board_id: values.select_board_id,
content: values.content,
sticky: values.sticky,
email_notify:this.state.isemail_notify,
attachment_ids,
})
.then((response) => {
@ -160,7 +162,7 @@ class BoardsNew extends Component{
axios.post(url, {
...values,
email_notify:this.state.email_notify,
email_notify:this.state.isemail_notify,
course_id: cid,
attachment_ids,
})
@ -253,7 +255,7 @@ class BoardsNew extends Component{
setemailchange=(e)=>{
this.setState({
email_notify:e.target.checked
isemail_notify:e.target.checked
})
}
render() {
@ -299,6 +301,7 @@ class BoardsNew extends Component{
const isCourseEnd = this.props.isCourseEnd();
document.title=this.props.coursedata&&this.props.coursedata.name;
// console.log(this.state)
return(
<div className="newMain ">
<AddDirModal {...this.props}
@ -338,13 +341,17 @@ class BoardsNew extends Component{
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}>
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?<Tooltip placement="bottom" title={this.state.isemail_notify?"邮件只能发送一次":""}><span className={"setemail fr mr70 setemailposition"}>
<Checkbox onChange={this.setemailchange} checked={this.state.isemail_notify} disabled={this.state.isemail_notify}>发送邮件提醒</Checkbox>
</span></Tooltip>:"":""}
{ isAdmin &&
<React.Fragment>
{getFieldDecorator('sticky', {
valuePropName: 'checked',
})(
isAdmin && <Checkbox style={{ right: '22px',
top: '28px',
top: '17px',
position: 'absolute'
}}>置顶</Checkbox>
)}
@ -411,9 +418,7 @@ class BoardsNew extends Component{
</Select>
)}
</Form.Item>
{this.state.boardsdata&&this.state.boardsdata.email_notify===true?this.props.isAdminOrTeacher()===true?this.isEdit ?"":<span className={"setemail"}>
<Checkbox onChange={this.setemailchange} checked={this.state.email_notify}>发送邮件提醒</Checkbox>
</span>:"":""}
{/* { isAdmin && <Form.Item

@ -728,7 +728,7 @@ class CommonWorkSetting extends Component{
course_id ,
unified_setting: unified_setting, // 统一设置
group_settings: group_settings_param,
publish_time: temp_end_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_end_time, // 发布
publish_time: temp_publish_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_publish_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time.replace(/-/g, '/')) : temp_end_time, // 截止
late_penalty: late_penalty, // 迟交扣分
allow_late: allow_late, // 是否允许补交

@ -50,3 +50,9 @@
margin-left: 10px;
}
/* errorInline ----------- */
.setemailposition{
position: absolute;
right: 40px;
top: 10px;
}

@ -26,6 +26,7 @@ import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
import moment from 'moment';
// http://danilowoz.com/create-react-content-loader/
const MyLoader = () => (
<ContentLoader
@ -283,7 +284,9 @@ class LeftView extends Component {
}
.multiLevelAnswer .status{
color: #CDCDCD;
flex: 0 0 45px;
}
.multiLevelAnswer .lock-time{
margin-right: 15px;
}
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
@ -292,13 +295,17 @@ class LeftView extends Component {
<div className="multiLevelAnswer">
{ unlockedAnswers && unlockedAnswers.map((item, index) => {
const {name, contents, view_time} = item;
return <div className="anwserSection">
<div className="df">
<div className="level">级别{index + 1}</div>
<div className="name">{item.name}</div>
<div className="status">已解锁</div>
<div className="name">{name}</div>
<div className="status">
<span className="lock-time">{view_time ? moment(view_time).format('YYYY-MM-DD HH:mm') : ''}</span>
已解锁
</div>
</div>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(contents)}}>
</div>
</div>
})}

@ -89,4 +89,35 @@
.rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second {
color: #FFA800;
}
.tip-info-wrap{
background-color: #111C24;
padding: 20px 0px;
}
.tip-info-wrap .tip-info{
display: flex;
background: #707070;
border: 1px solid rgba(112,112,112,1);
border-radius: 100px;
width: 375px;
height: 52px;
font-size: 12px;
align-items: center;
align-items: space-around;
margin: 0 auto;
padding: 0 20px;
}
.finish-wrap{
display: flex;
padding: 0 0px 0 20px;
margin-top: 10px;
}
.finish-wrap .finish-time{
flex: 1;
}
.finish-time .time-title{
color: #747A7F;
margin-right: 5px;
}
/*------------------------------- TaskList End */

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { CircularProgress } from 'material-ui/Progress';
import moment from 'moment';
import Rate from 'rc-rate';
import 'rc-rate/assets/index.css';
@ -21,7 +21,7 @@ class TaskList extends Component {
challenge.experience = challenge.get_experience
challenge.gold = challenge.get_gold
challenge.subject = challenge.name
const {finished_time, view_answer_time} = challenge;
const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience
const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold
return (
@ -70,6 +70,15 @@ class TaskList extends Component {
</span>
</div>
<div className="finish-wrap">
<p class="finish-time font-12">
<span class="time-title">完成时间</span>
{ finished_time ? moment(finished_time).format('YYYY-MM-DD HH:mm') : '--' }
</p>
<p class="finish-time font-12">
<span class="time-title">查看答案时间</span>
{ view_answer_time ? moment(view_answer_time).format('YYYY-MM-DD HH:mm') : '--' } </p>
</div>
{ shixun.status >= 2 && <div className="rateRow">
{/* 已完成、未评分 */}
{challenge.status === 2 && challenge.star === 0?
@ -103,8 +112,15 @@ class TaskList extends Component {
render() {
const { taskListLoading } = this.props;
return (
<div className="page--over">
<div className="col-width-3 -scroll" style={{height: '100%'}} id="all_task_index">
<div className="page--over" style={{ width: '420px'}}>
{/** 增加提示信息 */}
<div className="tip-info-wrap">
<p className="tip-info">
<span><span style={{ color: '#FFBD4C'}}>温馨提示: </span> </span>
</p>
</div>
<div className="col-width-3 -scroll" style={{height: 'calc( 100% - 100px )', width: '420px'}} id="all_task_index">
{ taskListLoading ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
this.renderTasks()

Loading…
Cancel
Save