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

dev_hjm
daiao 6 years ago
commit ff3f42d31f

@ -360,7 +360,7 @@ class StudentWorksController < ApplicationController
Tiding.create(user_id: @work.user_id, trigger_user_id: User.current.id, container_id: new_score.id, Tiding.create(user_id: @work.user_id, trigger_user_id: User.current.id, container_id: new_score.id,
container_type: "StudentWorksScore", parent_container_id: @work.id, container_type: "StudentWorksScore", parent_container_id: @work.id,
parent_container_type: "HomeworkCommon", belong_container_id: @homework.course_id, parent_container_type: "HomeworkCommon", belong_container_id: @homework.course_id,
belong_container_type: "Course", viewed: 0, tiding_type: "HomeworkCommon", extra: new_score.reviewer_role) belong_container_type: "Course", viewed: 0, tiding_type: new_score.reviewer_role == 3 ? "System" : "HomeworkCommon", extra: new_score.reviewer_role)
case new_score.reviewer_role case new_score.reviewer_role
when 1 #教师评分:最后一个教师评分为最终评分 when 1 #教师评分:最后一个教师评分为最终评分

@ -19,11 +19,20 @@ class StudentWorkScoreAppealNotifyJob < ApplicationJob
belong_container_id: course.id, belong_container_type: 'Course', belong_container_id: course.id, belong_container_type: 'Course',
tiding_type: 'HomeworkCommon', viewed: 0, status: 0 tiding_type: 'HomeworkCommon', viewed: 0, status: 0
} }
student_same_attrs = {
trigger_user_id: 0,
container_id: appeal.id, container_type: 'StudentWorksScoresAppeal',
parent_container_id: score.student_work_id, parent_container_type: 'StudentWork',
belong_container_id: course.id, belong_container_type: 'Course',
tiding_type: 'System', viewed: 0, status: 0
}
Tiding.bulk_insert(*attrs) do |worker| Tiding.bulk_insert(*attrs) do |worker|
course.course_member(user).member_teachers.each do |teacher| course.course_member(user).member_teachers.each do |teacher|
worker.add same_attrs.merge(user_id: teacher.user_id) worker.add same_attrs.merge(user_id: teacher.user_id)
end end
worker.add same_attrs.merge(user_id: score.user_id) worker.add student_same_attrs.merge(user_id: score.user_id)
end end
end end
end end

@ -18,7 +18,14 @@ json.time tiding.how_long_time
json.new_tiding tiding.unread?(@onclick_time) json.new_tiding tiding.unread?(@onclick_time)
json.trigger_user do json.trigger_user do
json.partial! 'users/user_simple', user: tiding.trigger_user_id.zero? ? User.find(1) : tiding.trigger_user if tiding.trigger_user_id.zero?
json.id 0
json.name "系统"
json.login ""
json.image_url "educoder/systemLogo.png"
else
json.partial! 'users/user_simple', user: tiding.trigger_user
end
end end
json.attachments tiding.attachments, partial: 'attachments/attachment_small', as: :attachment json.attachments tiding.attachments, partial: 'attachments/attachment_small', as: :attachment

@ -202,7 +202,7 @@
2_end: "别人对你的匿评发起的申诉申请:%s审核未通过" 2_end: "别人对你的匿评发起的申诉申请:%s审核未通过"
StudentWork: StudentWork:
Apply_end: "发起了匿评申诉申请:%s" Apply_end: "发起了匿评申诉申请:%s"
HomeworkCommon_end: "有人对你的匿评发起了申诉:%s" System_end: "有人对你的匿评发起了申诉:%s"
Department_end: "你选填的二级单位:%s%s因不符合规范,已被系统删除.请重新选择" Department_end: "你选填的二级单位:%s%s因不符合规范,已被系统删除.请重新选择"
Library: Library:
Apply_end: "申请发布教学案例:%s" Apply_end: "申请发布教学案例:%s"

@ -1,7 +0,0 @@
class AddIndexToUser < ActiveRecord::Migration[5.2]
def change
# add_index :users, :login, unique: true
# add_index :users, :mail, unique: true
# add_index :users, :phone, unique: true
end
end

@ -0,0 +1,7 @@
class SyncIndexToUsers < ActiveRecord::Migration[5.2]
def change
# add_index :users, :login, unique: true
add_index :users, :mail, unique: true
add_index :users, :phone, unique: true
end
end

@ -0,0 +1,6 @@
class MigrateAnonymousTidingType < ActiveRecord::Migration[5.2]
def change
Tiding.where(container_type: "StudentWorksScore", extra: "3").update_all(tiding_type: "System", trigger_user_id: 0)
Tiding.where(container_type: "StudentWorksScoresAppeal", parent_container_type: "StudentWork", tiding_type: "HomeworkCommon").update_all(tiding_type: "System", trigger_user_id: 0)
end
end

@ -54,5 +54,8 @@ html, body {
/* md多空格 */ /* md多空格 */
.markdown-body p { .markdown-body p {
white-space: pre-wrap; white-space: pre-wrap;
margin-bottom: 0px !important; }
/* resize */
.editormd .CodeMirror {
border-right: none !important;
} }

@ -9,6 +9,7 @@ import Dialog, {
import Button from 'material-ui/Button'; import Button from 'material-ui/Button';
import { FormControl, FormHelperText } from 'material-ui/Form'; import { FormControl, FormHelperText } from 'material-ui/Form';
import Input, { InputLabel } from 'material-ui/Input'; import Input, { InputLabel } from 'material-ui/Input';
import { InputNumber } from 'antd'
@ -38,8 +39,9 @@ class RewardDialog extends Component {
onGoldRewardDialogOkBtnClick() { onGoldRewardDialogOkBtnClick() {
console.log('onGoldRewardDialogOkBtnClick') console.log('onGoldRewardDialogOkBtnClick')
const { goldRewardInput } = this.state; const { goldRewardInput } = this.state;
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput.indexOf('-') !== -1) { if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput < 0) {
this.setState({ goldRewardInputError: true}) this.props.showNotification('奖励金币不能为空或负数')
// this.setState({ goldRewardInputError: true})
return; return;
} else { } else {
this.props.setRewardDialogVisible( false ) this.props.setRewardDialogVisible( false )
@ -47,7 +49,8 @@ class RewardDialog extends Component {
} }
} }
onGoldRewardInputChange(event) { onGoldRewardInputChange(event) {
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false }); // || event.target.value
this.setState({ goldRewardInput: event , goldRewardInputError: false });
} }
render() { render() {
@ -60,15 +63,24 @@ class RewardDialog extends Component {
open={goldRewardDialogOpen} open={goldRewardDialogOpen}
disableEscapeKeyDown={true} disableEscapeKeyDown={true}
onClose={this.handleGoldRewardDialogClose} onClose={this.handleGoldRewardDialogClose}
className={'rewardDialog'}
> >
<style>{`
.rewardDialog>div:last-child {
width: 280px;
}
`}</style>
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle> <DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>
<DialogContent> <DialogContent>
<FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text"> {/* <FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text"> */}
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel> {/* <InputLabel htmlFor="goldReward"></InputLabel>
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} /> <Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''} { goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''} */}
</FormControl>
<InputNumber placeholder="请输入奖励的金币数量" id="goldReward" type="number" value={this.state.goldRewardInput}
onChange={(e) => this.onGoldRewardInputChange(e)} width={228} style={{ width: '228px'}} />
{/* </FormControl> */}
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/} {/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
</DialogContent> </DialogContent>

@ -154,6 +154,9 @@ class Exercisetablesmubus extends Component {
} }
.Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{ .Exermubu .ant-table-tbody > tr:nth-last-child(1) > td{
border:1px solid transparent; border:1px solid transparent;
}
.Exermubu .editormd-html-preview, .Exermubu .editormd-preview-container {
background: transparent;
} }
`} `}
</style> </style>

@ -105,7 +105,7 @@ class ForumsIndex extends Component {
componentDidMount() { componentDidMount() {
window.document.title = '讨论区' window.document.title = '交流问答'
} }

@ -685,6 +685,7 @@ class MemoDetail extends Component {
<RewardDialog goldRewardDialogOpen={goldRewardDialogOpen} <RewardDialog goldRewardDialogOpen={goldRewardDialogOpen}
setRewardDialogVisible={this.setRewardDialogVisible} setRewardDialogVisible={this.setRewardDialogVisible}
rewardCode={this.rewardCodeMemo} rewardCode={this.rewardCodeMemo}
{...this.props}
></RewardDialog> ></RewardDialog>
<div className="clearfix"> <div className="clearfix">
<div id="forum_list" className="forum_table mh650"> <div id="forum_list" className="forum_table mh650">
@ -694,7 +695,8 @@ class MemoDetail extends Component {
{ memo.sticky && <span className="btn-cir btn-cir-red ml10 " style={{ height: '20px' }}>置顶</span>} { memo.sticky && <span className="btn-cir btn-cir-red ml10 " style={{ height: '20px' }}>置顶</span>}
{ !!memo.reward && <span className="color-orange font-14 ml15" { !!memo.reward && <span className="color-orange font-14 ml15"
data-tip-down={`获得平台奖励金币:${memo.reward}`} > data-tip-down={`获得平台奖励金币:${memo.reward}`} >
<i className="iconfont icon-gift mr5"></i>{memo.reward} <i className="iconfont icon-gift mr5"></i>
<span style={{ 'vertical-align': 'sub' }}>{memo.reward}</span>
</span> } </span> }
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>

@ -323,7 +323,7 @@ class Challenges extends Component {
</Tooltip> </Tooltip>
</p> </p>
<div className="justify break_full_word new_li markdown-body" <div className="justify break_full_word new_li "
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":

@ -13,7 +13,7 @@ class AccountNav extends Component {
this.props.history.push(`/account/secure`) this.props.history.push(`/account/secure`)
} }
render() { render() {
let { basicInfo } = this.props let { basicInfo, current_user } = this.props
// console.log(this.props); // console.log(this.props);
const path = window.location.pathname const path = window.location.pathname
const isBasic = path.indexOf('profile') != -1 || path == "/account" const isBasic = path.indexOf('profile') != -1 || path == "/account"
@ -78,7 +78,7 @@ class AccountNav extends Component {
<React.Fragment> <React.Fragment>
<div className="accountInfo"> <div className="accountInfo">
<AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg> <AccountImg src={basicInfo.avatar_url} {...this.props}></AccountImg>
<span className="name">{basicInfo.name}</span> <span className="name">{basicInfo.name || (current_user ? current_user.login : '')}</span>
<span className="role">{basicInfo.technical_title}</span> <span className="role">{basicInfo.technical_title}</span>
</div> </div>

Loading…
Cancel
Save