Merge branches 'dev_Ysl' and 'dev_Ysm' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_hs
杨树林 6 years ago
commit 8b0a2a2a56

@ -12,7 +12,7 @@ class CoursesController < ApplicationController
end
before_action :require_login, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner]
:left_banner, :top_banner, :informs, :online_learning]
before_action :check_account, only: [:new, :create, :apply_to_join_course, :join_excellent_course]
before_action :check_auth, except: [:index, :show, :students, :teachers, :board_list, :mine, :all_course_groups,
:left_banner, :top_banner, :apply_to_join_course, :exit_course]

@ -1,7 +1,7 @@
class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index, :show]
before_action :require_login, :check_auth, except: [:index, :show, :right_banner]
# before_action :check_auth, except: [:index]
before_action :check_account, except: [:index, :show]
before_action :check_account, except: [:index, :show, :right_banner]
before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
@ -85,17 +85,6 @@ class SubjectsController < ApplicationController
# 合作团队
@shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
shixuns = @subject.shixuns.published.pluck(:id)
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
# 实训路径中的所有实训标签
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
@user_tags = user_shixun_tags challenge_ids, @user.id
@my_subject_progress = @subject.my_subject_progress
# 访问数变更
@subject.increment!(:visits)
end

@ -23,26 +23,4 @@ if @subject.excellent
json.course_identity @user.course_identity(course)
json.course_status subject_course_status course
end
end
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }
json.role member.role
end
# 技能标签
json.tags @tags do |tag|
unless tag.blank?
json.tag_name tag
json.status @user_tags.include?(tag)
end
end
# 我的进展
json.progress do
json.my_score @subject.my_subject_score
json.all_score @subject.all_score
json.learned @subject.my_subject_progress
json.time @subject.my_consume_time
end

@ -1,16 +0,0 @@
defaults: &defaults
access_key_id: 'test'
access_key_secret: 'test'
base_url: 'http://vod.cn-shanghai.aliyuncs.com'
cate_id: '-1'
callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json'
signature_key: 'test12345678'
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults

@ -115,7 +115,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.tag-green{
position: absolute;
left: 10px;
bottom: 95px;}
bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
@ -123,7 +123,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;

File diff suppressed because one or more lines are too long

@ -462,7 +462,7 @@ class CoursesBanner extends Component {
}
</style>
{excellent===true?
<span className="tag-orangces fl"><span className="tag-names mt10 ml15">课程</span></span>
<span className="tag-orangces fl"><span className="tag-names mt10 ml15">课程</span></span>
:""}
<span className={"TabsWarp"}>
<CoursesListType

@ -228,6 +228,11 @@ class ShixunsHome extends Component {
return(
<div className="square-Item" key={key} id={item.id} style={{width:'286px'}}>
{item.excellent === false ? "" :
<div className="tag-orange">
<span className="tag-name">开放课程</span>
</div>}
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
{/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
@ -301,7 +306,11 @@ class ShixunsHome extends Component {
.taglistleft{
position: absolute;
left: 10px;
bottom: 125px;
bottom: 118px;
}
.square-Item:nth-child(4n+0) {
margin-right: 25px;
}
`
}

@ -41,7 +41,7 @@
}
.solidright{
border-right: 1px solid #000;
border-right:1px solid #CDCDCD;
height: 42px;
}
.ant-modal-title {
@ -53,4 +53,8 @@
font-weight: 500!important;
color: #333;
text-align: center;
}
.pd4020{
padding: 0 40px 0 20px !important;
}

@ -31,6 +31,7 @@ class DetailTop extends Component{
}
componentDidMount(){
let courseslist=[]
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(1===key+1){
@ -44,6 +45,27 @@ class DetailTop extends Component{
courseslist:courseslist
})
}
componentDidUpdate=(prevProps)=> {
if(prevProps.courses!=this.props.courses){
let courseslist=[]
if(this.props.courses!=undefined&&this.props.courses.length!=0){
this.props.courses.map((item,key)=>{
if(1===key+1){
return(
courseslist.push(item)
)
}
})
}
this.setState({
courseslist:courseslist
})
}
}
allow_deletepath=()=>{
this.setState({
Modalstype:true,
@ -260,7 +282,7 @@ class DetailTop extends Component{
<style>
{
`
.tag-orange .tag-name{
.pathoranges .tag-name{
display: block;
width: auto;
background-color: #FF6800;
@ -276,8 +298,8 @@ class DetailTop extends Component{
`
}
</style>
{this.props.courses===undefined?"":
<span className="tag-orange">
{detailInfoList===undefined?"":detailInfoList.excellent === false ? "" :
<span className="pathoranges">
<span className="tag-name mt6 ml10">开放课程</span>
</span>}
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
@ -348,7 +370,7 @@ class DetailTop extends Component{
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20">
<li className={"fl"}>
<li className={"fl pd4020"}>
<style>
{
`
@ -444,7 +466,8 @@ class DetailTop extends Component{
}
</li>
<li className={"fr"}>
<li className={"fr mr25"}>
<style>
{
`
@ -454,6 +477,14 @@ class DetailTop extends Component{
background: rgba(191,191,191,1) !important;
color: #fff;
}
.mr51{
margin-right: 51px;
}
.pathbtens{
width: 150px !important;
height: 44px !important;
line-height: 44px !important;
}
`
}
</style>
@ -461,31 +492,31 @@ class DetailTop extends Component{
return(
<div key={key}>
{item.course_status.status===0?<a className="mr30 shixun_detail pointer fl user-colorgrey-green">即将开课</a>:""}
{item.course_status.status===1?<a className="mr30 shixun_detail pointer fl color-orange">{item.course_status.time}</a>:""}
{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green">即将开课</div>:""}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange">{item.course_status.time}</div>:""}
{item.course_status.status===2?
detailInfoList.is_creator===true?<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:item.course_identity<6?
<a className="mr30 shixun_detail pointer fl user-colorgrey-9b">已结束</a>:"":""}
detailInfoList.is_creator===true?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:item.course_identity<6?
<div className="mr51 shixun_detail pointer fl user-colorgrey-9b">已结束</div>:"":""}
{item.course_status.status===0?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28" onClick={()=>this.JoinnowCourse(item.course_id)}>
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""}
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}></a>:""}
{item.course_status.status===2?
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
detailInfoList.is_creator===true?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28" href={item.first_category_url} target="_blank">
</a>:item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank">
进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt28"></div>:""}
</a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens"></div>:""}
</div>
)})}

@ -7,7 +7,7 @@ class OpenCourse extends Component {
constructor(props) {
super(props);
this.state={
value:0
value:1
}
}
@ -68,10 +68,10 @@ class OpenCourse extends Component {
<div className={"tabeltext-alignleft"}>
<p className={"mt20 mb20 font-16"}>
<Radio.Group onChange={this.setpathradioChange} value={this.state.value}>
<Radio style={pathradioStyle} value={0}>
<Radio style={pathradioStyle} value={1}>
开放课堂<span style={pathradioStyles}>所有用户可以随时访问</span>
</Radio>
<Radio style={pathradioStyle} value={1}>
<Radio style={pathradioStyle} value={0}>
私有课堂<span style={pathradioStyles}>仅报名参与的课堂成员可以访问</span>
</Radio>
</Radio.Group>

@ -476,7 +476,7 @@ class PathDetailIndex extends Component{
</div>
}
{
this.props.checkIfLogin()===false?"123213":progress === undefined ? "" : progress === null ? "" :
this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10">
<p className="mb20">
<span className="font-16 mr10">我的进展</span>

@ -97,6 +97,19 @@ export default class TPMFork_listComponent extends Component {
<span className="fl font-16">Fork实训列表</span>
<a href={"/shixuns/"+shixunsID+"/challenges"} className="font-16 color-grey-9 fr">返回</a>
</div>
<style>
{
`
.taglistleft{
position: absolute;
left: 10px;
bottom: 118px;
}
`
}
</style>
{/*<Loading visible={Forkvisible} shape="dot-circle" style={{width:'100%'}}color='#4AC7FF'>*/}
<Spin spinning={Forkvisible} size="large" style={{marginTop:'15%'}}>
<div className="mt30 square-list clearfix mh320">
@ -105,7 +118,7 @@ export default class TPMFork_listComponent extends Component {
return(
<div className="square-Item" key={key} id={item.id}>
<div className="tag-green">
<div className="tag-green taglistleft">
<span className="tag-name"> {item.tag_name}</span>
{/*<img src={require(`./shixunCss/tag2.png`)}/>*/}
</div>

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?6`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?6`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?6`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')

@ -117,7 +117,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.tag-green{
position: absolute;
left: 10px;
bottom: 95px;}
bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
background: #000000;
@ -125,7 +125,7 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
border-radius: 3px;
font-size: 14px;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:20px;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
height: 28px;

Loading…
Cancel
Save