From 9922b5342588202788d788cba33db61569d6960f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 15 Aug 2019 09:42:57 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E5=93=81=E5=A2=9E=E5=8A=A0=E7=BB=84=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E7=9B=B8=E5=85=B3=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 2 +- .../homework_commons_controller.rb | 8 +++++ app/controllers/student_works_controller.rb | 35 +++++++++++-------- .../homework_commons/works_list.json.jbuilder | 2 ++ app/views/student_works/edit.json.jbuilder | 3 ++ app/views/student_works/show.json.jbuilder | 9 +++-- 6 files changed, 41 insertions(+), 18 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d17059231..e7b4bdac6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -239,7 +239,7 @@ class ApplicationController < ActionController::Base uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous")) if !User.current.logged? && Rails.env.development? - User.current = User.find 8686 + User.current = User.find 1 end diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index ff1ee4e96..5d1733983 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -171,6 +171,14 @@ class HomeworkCommonsController < ApplicationController @student_works = @student_works.where(user_id: group_user_ids) end + if @homework.homework_type == "group" && !params[:member_work].blank? + if params[:member_work].to_i == 1 + @student_works = @student_works.where("user_id = commit_user_id") + elsif params[:member_work].to_i == 0 + @student_works = @student_works.where("user_id != commit_user_id") + end + end + # 输入姓名和学号搜索 # TODO user_extension 如果修改 请调整 unless params[:search].blank? diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 93f0fc586..92e60a71c 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -61,16 +61,21 @@ class StudentWorksController < ApplicationController end def delete_work - begin - work = @homework.student_works.find_by!(user_id: params[:user_id]) - work.update_attributes(description: nil, project_id: 0, - late_penalty: 0, work_status: 0, - commit_time: nil, update_time: nil, group_id: 0, - commit_user_id: nil, final_score: nil, work_score: nil, teacher_score: nil, teaching_asistant_score: nil) - normal_status("删除成功") - rescue Exception => e - uid_logger(e.message) - tip_exception(e.message) + ActiveRecord::Base.transaction do + begin + work = @homework.student_works.find_by!(user_id: params[:user_id]) + tip_exception("只有组长才能删除组员") if work.commit_user_id != current_user.id + work.update_attributes(description: nil, project_id: 0, + late_penalty: 0, work_status: 0, + commit_time: nil, update_time: nil, group_id: 0, + commit_user_id: nil, final_score: nil, work_score: nil, teacher_score: nil, teaching_asistant_score: nil) + work.attachments.destroy_all + work.tidings.destroy_all + normal_status("删除成功") + rescue Exception => e + uid_logger(e.message) + tip_exception(e.message) + end end end @@ -137,8 +142,9 @@ class StudentWorksController < ApplicationController @current_user = current_user if @homework.homework_type == "group" # todo user_extension + @commit_user_id = @work.commit_user_id @work_members = @course.students.where(user_id: @homework.student_works.where(group_id: @work.group_id).pluck(:user_id)). - order("course_members.id=#{@work.user_id} desc").includes(:course_group, user: :user_extension) + order("course_members.user_id=#{@work.commit_user_id} desc").includes(:course_group, user: :user_extension) end end @@ -150,7 +156,7 @@ class StudentWorksController < ApplicationController begin @work.description = params[:description] @work.update_time = Time.now - @work.commit_user_id = current_user.id + # @work.commit_user_id = current_user.id if @work.save! Attachment.associate_container(params[:attachment_ids], @work.id, @work.class) @@ -165,7 +171,8 @@ class StudentWorksController < ApplicationController # 原成员更新描述、更新时间以及附件 @homework.student_works.where(group_id: @work.group_id, user_id: (work_user_ids & params_user_ids)).each do |work| - work.update_attributes(update_time: Time.now, description: @work.description, commit_user_id: current_user.id) + # work.update_attributes(update_time: Time.now, description: @work.description, commit_user_id: current_user.id) + work.update_attributes(update_time: Time.now, description: @work.description) work.attachments.destroy_all @work.attachments.each do |attachment| att = attachment.copy @@ -193,7 +200,7 @@ class StudentWorksController < ApplicationController stu_work.update_attributes(user_id: user_id, description: @work.description, homework_common_id: @homework.id, project_id: @work.project_id, late_penalty: @work.late_penalty, work_status: @work.work_status, commit_time: Time.now, update_time: Time.now, - group_id: @work.group_id, commit_user_id: current_user.id) + group_id: @work.group_id, commit_user_id: @work.commit_user_id) @work.attachments.each do |attachment| att = attachment.copy att.author_id = attachment.author_id diff --git a/app/views/homework_commons/works_list.json.jbuilder b/app/views/homework_commons/works_list.json.jbuilder index bbe71661a..08c269670 100644 --- a/app/views/homework_commons/works_list.json.jbuilder +++ b/app/views/homework_commons/works_list.json.jbuilder @@ -69,6 +69,7 @@ elsif @user_course_identity == Course::STUDENT json.project_info project_info @work, @current_user, @user_course_identity end json.work_group @work.work_group_name + json.is_leader @work.user_id == @work.commit_user_id end end @@ -140,6 +141,7 @@ elsif @homework.homework_type == "group" || @homework.homework_type == "normal" if @homework.homework_detail_group.base_on_project json.project_info project_info work, @current_user, @user_course_identity end + json.is_leader work.user_id == work.commit_user_id json.work_group work.work_group_name end diff --git a/app/views/student_works/edit.json.jbuilder b/app/views/student_works/edit.json.jbuilder index ce9d9ff72..88e5354e4 100644 --- a/app/views/student_works/edit.json.jbuilder +++ b/app/views/student_works/edit.json.jbuilder @@ -1,12 +1,14 @@ json.partial! "homework_commons/homework_public_navigation", locals: {homework: @homework, course: @course, user: @current_user} json.work_id @work.id json.description @work.description +json. json.attachments @work.attachments do |atta| json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: @work.delete_atta(atta)} end if @homework.homework_type == "group" + json.is_leader_work @work.user_id == @commit_user_id json.min_num @homework.homework_detail_group.try(:min_num) json.max_num @homework.homework_detail_group.try(:max_num) @@ -15,5 +17,6 @@ if @homework.homework_type == "group" json.user_name member.user.real_name json.group_name member.course_group_name json.student_id member.user.student_id + json.is_leader member.user_id == @commit_user_id end end \ No newline at end of file diff --git a/app/views/student_works/show.json.jbuilder b/app/views/student_works/show.json.jbuilder index 653ed6450..5756ac9cb 100644 --- a/app/views/student_works/show.json.jbuilder +++ b/app/views/student_works/show.json.jbuilder @@ -3,6 +3,7 @@ json.(@work, :description, :commit_time, :update_time) json.is_evaluation @is_evaluation json.author_name @is_evaluation ? "匿名" : @work.user.real_name +json.is_leader_work @work.user_id == @work.commit_user_id if @homework.homework_type == "group" json.is_author @is_author json.update_user_name @is_evaluation ? "匿名" : @work.commit_user.try(:real_name) @@ -17,8 +18,10 @@ unless @is_evaluation json.project_info project_info @work, @current_user, @user_course_identity end - json.work_members @work_members.each do |member| - json.user_name member.user.real_name - json.user_login member.user.login + json.work_members @work_members.each do |work| + json.user_name work.user.real_name + json.user_login work.user.login + json.work_id work.id + json.is_leader work.user_id == work.commit_user_id end end From f7a3ceb966da04d0f3c1e0542df8007bd31fc7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 10:09:56 +0800 Subject: [PATCH 2/9] b --- public/react/src/modules/paths/PathDetail/PathDetailIndex.js | 4 ++-- public/react/src/modules/tpm/NewHeader.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js index fd45f13e6..53eb566e6 100644 --- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js +++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js @@ -500,8 +500,8 @@ class PathDetailIndex extends Component{ </div> { detailInfoList===undefined?"":detailInfoList.allow_add_member===true? <div> - <div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div> - <div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div> + {key!=0?<div className="fr ml15 flex1"><a onClick={()=>this.moveup(item)}><Tooltip title="上移"><i className="color-green font-18 iconfont icon-xiangshangyi"></i></Tooltip></a></div>:""} + {key+1!=detailInfoList.members.length?<div className="fr ml15 flex1 "><a onClick={()=>this.movedown(item)}><Tooltip title="下移"><i className="color-green font-18 iconfont icon-xiangxiayi"></i></Tooltip></a></div>:""} </div> :"" } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index b816448e0..3e0468a71 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -826,6 +826,9 @@ submittojoinclass=(value)=>{ {/* p 老师 l 学生 */} <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li> + <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null|| this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> + <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> + </li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li> <li><a href={`/account/profile`}>账号管理</a></li> From 35f53bc9d0298003eb2dd830358bb87e23b82d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 10:21:55 +0800 Subject: [PATCH 3/9] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- public/react/src/modules/tpm/TPMIndexHOC.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 3e0468a71..a6a849183 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -826,7 +826,7 @@ submittojoinclass=(value)=>{ {/* p 老师 l 学生 */} <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li> - <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null|| this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> + <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> </li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li> diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index b18b2b1c7..ac4ba458a 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -362,6 +362,7 @@ export function TPMIndexHOC(WrappedComponent) { overflow: hidden; } .newHeaders{ + position: fixed; max-width: unset; background: #24292D !important; width: 100%; From 2de30bc91f8f72e273a1fef3cc6f4e178cc75444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 11:38:03 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index ac4ba458a..f87f128a1 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -362,7 +362,7 @@ export function TPMIndexHOC(WrappedComponent) { overflow: hidden; } .newHeaders{ - position: fixed; + // position: fixed; max-width: unset; background: #24292D !important; width: 100%; From 14acd39a07d10c70d601c59b610286d6ee5f445c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 14:51:22 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/coursesDetail/CoursesLeftNav.js | 5 +++-- .../graduation/tasks/GraduationTasksSubmitnew.js | 3 +++ .../src/modules/courses/graduation/tasks/index.js | 12 +++++++++--- .../src/modules/courses/graduation/topics/index.js | 8 ++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 849621259..cb33256fb 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -837,7 +837,7 @@ class Coursesleftnav extends Component{ .droppableul{ max-height: 500px; overflow-y:auto; - overflow:hidden auto; + overflow-x:hidden; } .mr13{ @@ -928,8 +928,9 @@ class Coursesleftnav extends Component{ <a className="fl pl46 pd0 Draggablelichild"> <span className={this.props.location.pathname===iem.second_category_url?"color-blue fl ml38 maxwidth155 task-hide Draggablelichild":"fl ml38 maxwidth155 task-hide Draggablelichild"}>{iem.category_name}</span> - <span className={twosandiantype===undefined?this.props.location.pathname===iem.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14":item.type===twosandiantypes&&twosandiantype===index?"none":this.props.location.pathname===iem.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14"} >{iem.category_count===0?"":iem.category_count}</span> + <span className={twosandiantype===undefined?this.props.location.pathname===iem.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14":item.type===twosandiantypes&&twosandiantype===index&&iem.category_name!="未分班"?"none":this.props.location.pathname===iem.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14"} >{iem.category_count===0?"":iem.category_count}</span> {item.type===twosandiantypes&&twosandiantype===index? + iem.category_name==="未分班"?"": iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"? <span className={"fr mr20 color999 Draggablelichild font-14"} >{iem.category_count===0?"":iem.category_count}</span> :<Popover placement="right" content={this.content(item,iem,index)} trigger="hover" key={index}> diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index a9dd5bc13..dadc621b2 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -472,6 +472,9 @@ class GraduationTasksSubmitnew extends Component{ // } // } }).catch((error) => { + this.setState({ + spinnings:false + }); console.log(error) }) diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js index 80dceb562..b54815b2f 100644 --- a/public/react/src/modules/courses/graduation/tasks/index.js +++ b/public/react/src/modules/courses/graduation/tasks/index.js @@ -179,8 +179,13 @@ class GraduationTasks extends Component{ }) .then((result)=>{ if(result.data.status==0){ + this.setState({ + checkBoxValues:[], + checkAllValue:false + }) + this.fetchAll(search,page,order,15) this.props.showNotification(`${result.data.message}`); - this.fetchAll(search,page,order,15) + } }).catch((error)=>{ console.log(error); @@ -554,9 +559,10 @@ class GraduationTasks extends Component{ } // 题库选用成功后刷新页面 useBankSuccess=(checkBoxValues,object_ids)=>{ - // debugger + //debugger let {search,page,order,all_count} = this.state; this.fetchAll(search,page,order,all_count) + } getcourse_groupslist=(id)=>{ this.setState({ @@ -651,7 +657,7 @@ class GraduationTasks extends Component{ </Link> </WordsBtn> : ""} - {this.props.isAdmin() ?<UseBank {...this.props} {...this.state} object_type={"gtask"} useBankSuccess={(checkBoxValues,object_ids)=>this.useBankSuccess=(checkBoxValues,object_ids)}></UseBank>:""} + {this.props.isAdmin() ?<UseBank {...this.props} {...this.state} object_type={"gtask"} useBankSuccess={(checkBoxValues,object_ids)=>this.useBankSuccess(checkBoxValues,object_ids)}></UseBank>:""} </React.Fragment> } diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index 6587ed0c6..2d47cabf0 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -355,6 +355,14 @@ onBoardsNew=()=>{ DownloadMessageval:undefined }) } + + // 题库选用成功后刷新页面 + useBankSuccess=(checkBoxValues,object_ids)=>{ + //debugger + let {search,page,order,all_count} = this.state; + this.fetchAll(search,page,order,all_count) + + } render(){ let { searchValue, From 58c56d632429a7ab70c0cdb7166b7c226be88e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 15:16:23 +0800 Subject: [PATCH 6/9] b --- public/react/src/modules/courses/graduation/topics/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index 2d47cabf0..61a9bea67 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -359,9 +359,8 @@ onBoardsNew=()=>{ // 题库选用成功后刷新页面 useBankSuccess=(checkBoxValues,object_ids)=>{ //debugger - let {search,page,order,all_count} = this.state; - this.fetchAll(search,page,order,all_count) - + let {searchValue,page,status} =this.state + this.fetchAll(searchValue,page,status); } render(){ let { From 81ff73e5e44d75adfd63a1eb580c05dc53f52221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 15 Aug 2019 16:14:07 +0800 Subject: [PATCH 7/9] b --- public/react/src/AppConfig.js | 4 +++- .../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c09a2cbe7..95be3a8a5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -10,6 +10,7 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list){ + debugger if (window.location.port === "3007") { } else { @@ -158,7 +159,8 @@ export function initAxiosInterceptors(props) { // console.log("401401401") // } if (response.data.status === 403||response.data.status === "403") { - locationurl('/403'); + + locationurl('/403'); } if (response.data.status === 404) { diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index cb33256fb..cb911c4dc 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -683,7 +683,7 @@ class Coursesleftnav extends Component{ }else if(result.source.droppableId==="course_group"){ let url ="/course_groups/"+result.draggableId+"/move_category.json" - this.droppablepost(url,result.destination.index) + this.droppablepost(url,result.destination.index+1) } From 83579170523762f0f8536c59d48447ecef62ff05 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 16:54:28 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E8=AF=84=E6=B5=8B?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E5=AD=A6=E9=99=A2=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E5=A4=AA=E9=95=BF=E5=90=8E=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190815085136_modify_path_for_challenges.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20190815085136_modify_path_for_challenges.rb diff --git a/db/migrate/20190815085136_modify_path_for_challenges.rb b/db/migrate/20190815085136_modify_path_for_challenges.rb new file mode 100644 index 000000000..a17fdbd04 --- /dev/null +++ b/db/migrate/20190815085136_modify_path_for_challenges.rb @@ -0,0 +1,5 @@ +class ModifyPathForChallenges < ActiveRecord::Migration[5.2] + def change + change_column :challenges, :path, :text + end +end From 2463d3343a54c644d09d9f0a41632cb87fdd5176 Mon Sep 17 00:00:00 2001 From: p31729568 <winse.wang@foxmail.com> Date: Thu, 15 Aug 2019 17:29:12 +0800 Subject: [PATCH 9/9] add first_category_url to es search api --- app/models/searchable/course.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/searchable/course.rb b/app/models/searchable/course.rb index 0b2b78436..5060d9ddd 100644 --- a/app/models/searchable/course.rb +++ b/app/models/searchable/course.rb @@ -25,7 +25,8 @@ module Searchable::Course author_school_name: teacher&.school_name, visits_count: visits, members_count: members_count, - is_public: is_public == 1 + is_public: is_public == 1, + first_category_url: ApplicationController.helpers.module_url(none_hidden_course_modules.first, self) } end