From f59b93d78fb4abe9bfd19f9831f857088c3ae347 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 15 Aug 2019 10:12:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E9=A2=84=E8=A7=88pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 6f121db5f..8b93c57d1 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1288,7 +1288,8 @@ class ExercisesController < ApplicationController normal_status(0,"正在下载中") else set_export_cookies - render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets + content[:disposition] = "inline" + render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets, disposition: 'inline' end end From 47851a87acedae395f1890fcb9ce35d1ab55dfe3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 15 Aug 2019 10:14:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/get_navigation_info.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/get_navigation_info.json.jbuilder b/app/views/users/get_navigation_info.json.jbuilder index c7ff37e21..ca7f45b45 100644 --- a/app/views/users/get_navigation_info.json.jbuilder +++ b/app/views/users/get_navigation_info.json.jbuilder @@ -17,7 +17,7 @@ json.top do json.crowdsourcing_url "/crowdsourcing" # 客户管理 - json.customer_management_url "#{@old_domain}/cooperates/#{current_user.partner.try(:id)}/partner_list" if current_user.partner + json.customer_management_url current_user.partner ? "#{@old_domain}/cooperates/#{current_user.partner.try(:id)}/partner_list" : nil json.career_url do json.array! @career.to_a do |c| From 9d8ed2f292b188a31c6cd12704759b45c1f0c440 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 15 Aug 2019 10:15:03 +0800 Subject: [PATCH 3/3] fix es search course teacher not exist --- app/models/searchable/course.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/searchable/course.rb b/app/models/searchable/course.rb index 93c69c9e8..0b2b78436 100644 --- a/app/models/searchable/course.rb +++ b/app/models/searchable/course.rb @@ -21,8 +21,8 @@ module Searchable::Course def to_searchable_json { id: id, - author_name: teacher.real_name, - author_school_name: teacher.school_name, + author_name: teacher&.real_name, + author_school_name: teacher&.school_name, visits_count: visits, members_count: members_count, is_public: is_public == 1