diff --git a/app/controllers/libraries_controller.rb b/app/controllers/libraries_controller.rb index 82981e62..16efc0c5 100644 --- a/app/controllers/libraries_controller.rb +++ b/app/controllers/libraries_controller.rb @@ -1,7 +1,7 @@ class LibrariesController < ApplicationController 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] def index @@ -121,7 +121,7 @@ class LibrariesController < ApplicationController end 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 def increment_visit_count diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7192d736..345dfadc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2990,6 +2990,12 @@ module ApplicationHelper title << "项目" elsif @welcome title << "创新源于实践" + elsif params[:controller] == "libraries" + if @library + title << "#{@library.title}" + else + title << "教学案例" + end elsif @course title << (@course.name.nil? ? "课堂" : @course.name) elsif params[:controller] == "homework_bank" || params[:controller] == "question_banks" || params[:controller] == "exercise_bank" diff --git a/app/helpers/libraries_helper.rb b/app/helpers/libraries_helper.rb index 433effd7..4d6956b7 100644 --- a/app/helpers/libraries_helper.rb +++ b/app/helpers/libraries_helper.rb @@ -10,7 +10,7 @@ module LibrariesHelper def library_tag_class(tag) case tag.name - when '优秀案例' then 'edu-activity-red' + when '获奖案例' then 'edu-activity-red' when '入库案例' then 'edu-activity-blue' end end diff --git a/app/views/common/index.html.erb b/app/views/common/index.html.erb index 35c63ca6..74595a07 100644 --- a/app/views/common/index.html.erb +++ b/app/views/common/index.html.erb @@ -1 +1 @@ -
Educoder
+EduCoder
教学案例 - <%= 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' %>
{item.name}
{item.name}
diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index 56ccd3de..17adfbac 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -397,14 +397,14 @@ class PackageIndexNEIBannerConcent extends Component { return } - if(modalCancel===false){ - if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ - this.setState({ - current_userphonetype:true - }) - return - } - } + // if(modalCancel===false){ + // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ + // this.setState({ + // current_userphonetype:true + // }) + // return + // } + // } if(modalCancel===true||this.props.current_user.phone===null){ @@ -618,17 +618,17 @@ class PackageIndexNEIBannerConcent extends Component { onChangeContact_phone=(e)=>{ let {modalCancel}=this.state; - if(modalCancel===false){ - if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ - this.setState({ - current_userphonetype:true - }) - }else{ - this.setState({ - current_userphonetype:false - }) - } - } + // if(modalCancel===false){ + // if(this.props.current_user.phone===undefined||this.props.current_user.phone===null||this.props.current_user.phone===""){ + // this.setState({ + // current_userphonetype:true + // }) + // }else{ + // this.setState({ + // current_userphonetype:false + // }) + // } + // } if(modalCancel===true||this.props.current_user.phone===null){ if(e.target.value===undefined||e.target.value===null||e.target.value===""){ this.setState({ diff --git a/public/react/src/modules/projectPackages/packageconcnet.css b/public/react/src/modules/projectPackages/packageconcnet.css index 6727c95c..0a690822 100644 --- a/public/react/src/modules/projectPackages/packageconcnet.css +++ b/public/react/src/modules/projectPackages/packageconcnet.css @@ -310,8 +310,8 @@ text-align: center; } -.pd35{ - padding-left: 35px; +.ml0{ + margin-left: 0px; } .tabelcli{ overflow: hidden;