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

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

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

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

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

@ -1,10 +1,10 @@
<% sidebar_collapse = request.cookies['admin_sidebar_collapse'].to_s == 'true' %> <% sidebar_collapse = request.cookies['admin_sidebar_collapse'].to_s == 'true' %>
<nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>"> <nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>">
<div class="sidebar-header"> <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) %>" /> <img class="rounded-circle" src="/images/<%= url_to_avatar(current_user) %>" />
<span class="logo-label">后台管理</span> <span class="logo-label">后台管理</span>
</div> </a>
<div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>"> <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-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> <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-laboratory_settings: 'admins-laboratories'
admins-carousels: 'admins-laboratories' admins-carousels: 'admins-laboratories'
admins-laboratory_shixuns: 'admins-laboratories' admins-laboratory_shixuns: 'admins-laboratories'
admins-laboratory_subjects: 'admins-laboratories'
admins-competition_settings: 'admins-competitions' admins-competition_settings: 'admins-competitions'
admins-enroll_lists: 'admins-competitions' admins-enroll_lists: 'admins-competitions'
admins-competition_prize_users: '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', theme: 'bootstrap4',
placeholder: '请输入实训名称/创建者检索', placeholder: '请输入实训名称/创建者检索',
multiple: true, multiple: true,
minimumInputLength: 1, closeOnSelect: false,
ajax: { ajax: {
delay: 500, delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select', url: '/admins/laboratories/' + laboratoryId + '/shixuns_for_select',
dataType: 'json', dataType: 'json',
data: function(params){ data: function(params){
return { keyword: params.term }; return { keyword: params.term, page: params.page || 1, per_page: 20 };
}, },
processResults: function(data){ processResults: function(data, params){
return { results: data.shixuns } params.page = params.page || 1;
return {
results: data.shixuns,
pagination: {
more: (params.page * 20) < data.count
}
};
} }
}, },
templateResult: function (item) { templateResult: function (item) {
@ -137900,16 +137907,23 @@ $(document).on('turbolinks:load', function() {
theme: 'bootstrap4', theme: 'bootstrap4',
placeholder: '请输入课程名称/创建者检索', placeholder: '请输入课程名称/创建者检索',
multiple: true, multiple: true,
minimumInputLength: 1, closeOnSelect: false,
ajax: { ajax: {
delay: 500, delay: 500,
url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select', url: '/admins/laboratories/' + laboratoryId + '/subjects_for_select',
dataType: 'json', dataType: 'json',
data: function(params){ data: function(params){
return { keyword: params.term }; return { keyword: params.term, page: params.page || 1, per_page: 20 }
}, },
processResults: function(data){ processResults: function(data, params){
return { results: data.subjects } params.page = params.page || 1;
return {
results: data.subjects,
pagination: {
more: (params.page * 20) < data.count
}
};
} }
}, },
templateResult: function (item) { templateResult: function (item) {

@ -3,7 +3,7 @@ import React,{ Component } from "react";
import { import {
Form, Input, InputNumber, Switch, Radio, Form, Input, InputNumber, Switch, Radio,
Slider, Button, Upload, Icon, Rate, Checkbox, message, Slider, Button, Upload, Icon, Rate, Checkbox, message,
Row, Col, Select, Modal, Divider Row, Col, Select, Modal, Divider,Tooltip
} from 'antd'; } from 'antd';
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
@ -29,7 +29,8 @@ class BoardsNew extends Component{
fileList: [], fileList: [],
boards: [], boards: [],
title_num: 0, title_num: 0,
email_notify:false email_notify:false,
isemail_notify:false
} }
} }
addSuccess = () => { 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, select_board_id: values.select_board_id,
content: values.content, content: values.content,
sticky: values.sticky, sticky: values.sticky,
email_notify:this.state.isemail_notify,
attachment_ids, attachment_ids,
}) })
.then((response) => { .then((response) => {
@ -160,7 +162,7 @@ class BoardsNew extends Component{
axios.post(url, { axios.post(url, {
...values, ...values,
email_notify:this.state.email_notify, email_notify:this.state.isemail_notify,
course_id: cid, course_id: cid,
attachment_ids, attachment_ids,
}) })
@ -253,7 +255,7 @@ class BoardsNew extends Component{
setemailchange=(e)=>{ setemailchange=(e)=>{
this.setState({ this.setState({
email_notify:e.target.checked isemail_notify:e.target.checked
}) })
} }
render() { render() {
@ -299,6 +301,7 @@ class BoardsNew extends Component{
const isCourseEnd = this.props.isCourseEnd(); const isCourseEnd = this.props.isCourseEnd();
document.title=this.props.coursedata&&this.props.coursedata.name; document.title=this.props.coursedata&&this.props.coursedata.name;
// console.log(this.state)
return( return(
<div className="newMain "> <div className="newMain ">
<AddDirModal {...this.props} <AddDirModal {...this.props}
@ -338,13 +341,17 @@ class BoardsNew extends Component{
{/* notRequired */} {/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}> <Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}> <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 && { isAdmin &&
<React.Fragment> <React.Fragment>
{getFieldDecorator('sticky', { {getFieldDecorator('sticky', {
valuePropName: 'checked', valuePropName: 'checked',
})( })(
isAdmin && <Checkbox style={{ right: '22px', isAdmin && <Checkbox style={{ right: '22px',
top: '28px', top: '17px',
position: 'absolute' position: 'absolute'
}}>置顶</Checkbox> }}>置顶</Checkbox>
)} )}
@ -411,9 +418,7 @@ class BoardsNew extends Component{
</Select> </Select>
)} )}
</Form.Item> </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 {/* { isAdmin && <Form.Item

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

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

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

@ -89,4 +89,35 @@
.rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second { .rateRow .rc-rate-star-half .rc-rate-star-first, .rateRow .rc-rate-star-full .rc-rate-star-second {
color: #FFA800; 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 */ /*------------------------------- TaskList End */

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { CircularProgress } from 'material-ui/Progress'; import { CircularProgress } from 'material-ui/Progress';
import moment from 'moment';
import Rate from 'rc-rate'; import Rate from 'rc-rate';
import 'rc-rate/assets/index.css'; import 'rc-rate/assets/index.css';
@ -21,7 +21,7 @@ class TaskList extends Component {
challenge.experience = challenge.get_experience challenge.experience = challenge.get_experience
challenge.gold = challenge.get_gold challenge.gold = challenge.get_gold
challenge.subject = challenge.name challenge.subject = challenge.name
const {finished_time, view_answer_time} = challenge;
const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience const showExp = (challenge.experience > 0 && challenge.status === 2) ? '+' + challenge.experience : challenge.experience
const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold const showGold = (challenge.gold > 0 && challenge.status === 2) ? '+' + challenge.gold : challenge.gold
return ( return (
@ -70,6 +70,15 @@ class TaskList extends Component {
</span> </span>
</div> </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"> { shixun.status >= 2 && <div className="rateRow">
{/* 已完成、未评分 */} {/* 已完成、未评分 */}
{challenge.status === 2 && challenge.star === 0? {challenge.status === 2 && challenge.star === 0?
@ -103,8 +112,15 @@ class TaskList extends Component {
render() { render() {
const { taskListLoading } = this.props; const { taskListLoading } = this.props;
return ( return (
<div className="page--over"> <div className="page--over" style={{ width: '420px'}}>
<div className="col-width-3 -scroll" style={{height: '100%'}} id="all_task_index"> {/** 增加提示信息 */}
<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 ? { taskListLoading ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> : <CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
this.renderTasks() this.renderTasks()

Loading…
Cancel
Save