dev_aliyun
杨树明 5 years ago
commit b9bc532ab3

@ -1,7 +1,7 @@
class LibrariesController < ApplicationController class LibrariesController < ApplicationController
layout 'base_library' layout 'base_library'
before_filter :require_login, :except => [:index] before_filter :require_login, :except => [:index, :show]
after_filter :increment_visit_count, only: [:show, :create, :edit, :update] after_filter :increment_visit_count, only: [:show, :create, :edit, :update]
def index def index
@ -121,7 +121,7 @@ class LibrariesController < ApplicationController
end end
def admin_or_self? def admin_or_self?
current_library.user_id == current_user.id || admin_or_business? current_library.try(:user_id) == current_user.try(:id) || admin_or_business?
end end
def increment_visit_count def increment_visit_count

@ -2990,6 +2990,12 @@ module ApplicationHelper
title << "项目" title << "项目"
elsif @welcome elsif @welcome
title << "创新源于实践" title << "创新源于实践"
elsif params[:controller] == "libraries"
if @library
title << "#{@library.title}"
else
title << "教学案例"
end
elsif @course elsif @course
title << (@course.name.nil? ? "课堂" : @course.name) title << (@course.name.nil? ? "课堂" : @course.name)
elsif params[:controller] == "homework_bank" || params[:controller] == "question_banks" || params[:controller] == "exercise_bank" elsif params[:controller] == "homework_bank" || params[:controller] == "question_banks" || params[:controller] == "exercise_bank"

@ -10,7 +10,7 @@ module LibrariesHelper
def library_tag_class(tag) def library_tag_class(tag)
case tag.name case tag.name
when '优秀案例' then 'edu-activity-red' when '获奖案例' then 'edu-activity-red'
when '入库案例' then 'edu-activity-blue' when '入库案例' then 'edu-activity-blue'
end end
end end

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.e1b0d6a5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.85df3a28.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>EduCoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.e1b0d6a5.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.85df3a28.js"></script></body></html>

@ -22,7 +22,7 @@
</div> </div>
<%= render :partial => 'layouts/footer' %> <%= render :partial => 'layouts/footer' %>
<% elsif @login %> <% elsif @login %>
<p class="new_login_header">Educoder</p> <p class="new_login_header">EduCoder</p>
<div class="newMain clearfix"> <!-- 主提部分 --> <div class="newMain clearfix"> <!-- 主提部分 -->
<%= yield %> <%= yield %>
</div> </div>

@ -3,7 +3,7 @@
<div class="edu-back-white mb30 mt30"> <div class="edu-back-white mb30 mt30">
<p class="padding20-30 clearfix bor-bottom-greyE"> <p class="padding20-30 clearfix bor-bottom-greyE">
<span class="font-18 fl color-grey-3">教学案例</span> <span class="font-18 fl color-grey-3">教学案例</span>
<%= link_to '新建', new_library_path, class: 'fr color-blue font-16 mt3' %> <%= link_to '发布案例', new_library_path, class: 'white-btn edu-filter-btn-blue fr mr10 mt8', style: 'color: #4CACFF' %>
</p> </p>
<div class="clearfix pl30 pr30"> <div class="clearfix pl30 pr30">
<ul class="fl library_nav mt20"> <ul class="fl library_nav mt20">

@ -39,7 +39,6 @@
</li> </li>
<li class="clearfix"> <li class="clearfix">
<span class="fl color-grey-9 mr20"><%= @library.user.school_name %></span> <span class="fl color-grey-9 mr20"><%= @library.user.school_name %></span>
<span class="fl color-grey-9"><%= @library.user.identity %></span>
<span class="fr"> <span class="fr">
<span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span> <span class="fl color-grey-9 mr30">编码:<span class="color-grey-6"><%= @library.uuid %></span></span>
<% if @library.published? %> <% if @library.published? %>

@ -253,7 +253,7 @@ class PackageConcent extends Component {
<span className=" item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span> <span className=" item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span>
</div> </div>
<div className=" item-group item-other-bidding pd35"> <div className=" item-group item-other-bidding ml0">
<span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span> <span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span>
<span className=" item-group-text">{item.bidding_users_count}人竞标</span> <span className=" item-group-text">{item.bidding_users_count}人竞标</span>

@ -119,7 +119,11 @@ class PackageIndexNEITaskDetails extends Component {
}).then((response) => { }).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
this.props.showSnackbar("提交成功"); this.props.showSnackbar("提交成功");
}else{ this.setState({
setbiddingmantype:false
})
this.getdatas()
}else if(response.data.status===-1){
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
} }
}).catch((error) => { }).catch((error) => {
@ -215,7 +219,7 @@ class PackageIndexNEITaskDetails extends Component {
if(response.data.status===0){ if(response.data.status===0){
this.props.showSnackbar("报名成功"); this.props.showSnackbar("报名成功");
this.getdatas() this.getdatas()
}else{ }else if(response.data.status===-1){
this.props.showSnackbar(response.data.message); this.props.showSnackbar(response.data.message);
} }
}).catch((error) => { }).catch((error) => {
@ -395,7 +399,8 @@ class PackageIndexNEITaskDetails extends Component {
{data&&data.bidding_users.map((item,key)=>{ {data&&data.bidding_users.map((item,key)=>{
return( return(
<div className="ysldivhomediv1 homehove"> <div className="ysldivhomediv1 homehove" key={key}>
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a> <a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div> <div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" href={`/users/${this.props.current_user.login}/private_messages`}> {this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" href={`/users/${this.props.current_user.login}/private_messages`}>
@ -442,7 +447,7 @@ class PackageIndexNEITaskDetails extends Component {
<div style={{height: "20px"}}> </div> <div style={{height: "20px"}}> </div>
{data&&data.bidding_users.map((item,key)=>{ {data&&data.bidding_users.map((item,key)=>{
return( return(
<div className="ysldivhomediv1" onClick={()=>this.Clickteacher2(item.id)}> <div className="ysldivhomediv1" onClick={()=>this.Clickteacher2(item.id)} key={key}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>} {item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>}
<a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a> <a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a>
<span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span> <span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span>

@ -397,14 +397,14 @@ class PackageIndexNEIBannerConcent extends Component {
return return
} }
if(modalCancel===false){ // if(modalCancel===false){
if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){
this.setState({ // this.setState({
current_userphonetype:true // current_userphonetype:true
}) // })
return // return
} // }
} // }
if(modalCancel===true||this.props.current_user.phone===null){ if(modalCancel===true||this.props.current_user.phone===null){
@ -618,17 +618,17 @@ class PackageIndexNEIBannerConcent extends Component {
onChangeContact_phone=(e)=>{ onChangeContact_phone=(e)=>{
let {modalCancel}=this.state; let {modalCancel}=this.state;
if(modalCancel===false){ // if(modalCancel===false){
if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){
this.setState({ // this.setState({
current_userphonetype:true // current_userphonetype:true
}) // })
}else{ // }else{
this.setState({ // this.setState({
current_userphonetype:false // current_userphonetype:false
}) // })
} // }
} // }
if(modalCancel===true||this.props.current_user.phone===null){ if(modalCancel===true||this.props.current_user.phone===null){
if(e.target.value===undefined||e.target.value===null||e.target.value===""){ if(e.target.value===undefined||e.target.value===null||e.target.value===""){
this.setState({ this.setState({

@ -310,8 +310,8 @@
text-align: center; text-align: center;
} }
.pd35{ .ml0{
padding-left: 35px; margin-left: 0px;
} }
.tabelcli{ .tabelcli{
overflow: hidden; overflow: hidden;

Loading…
Cancel
Save