From e0785746e63ce5342851ecf476c14c3923524fbb Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 14:51:00 +0800 Subject: [PATCH 001/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 8c227bc..db95cdb 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -17,7 +17,8 @@ class PersonalJournalsController < ApplicationController else fields_to_show = [ "year", - "paper_title" + "paper_title", + "123" ] end journal_paper_list = [] From e4724bebf8a26a3c399e154102f99d9c0f26fb21 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 15:12:22 +0800 Subject: [PATCH 002/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index db95cdb..5410fd8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -18,7 +18,7 @@ class PersonalJournalsController < ApplicationController fields_to_show = [ "year", "paper_title", - "123" + "journal_title" ] end journal_paper_list = [] From d85ba0f4e8e3ef9e13ec7ec8f02fca18350563b3 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 15:25:12 +0800 Subject: [PATCH 003/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 5410fd8..0deb176 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -18,7 +18,7 @@ class PersonalJournalsController < ApplicationController fields_to_show = [ "year", "paper_title", - "journal_title" + "authors" ] end journal_paper_list = [] From 897540e041b673d3a19fc089e7d087257fe995fb Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 15:26:43 +0800 Subject: [PATCH 004/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 0deb176..d2dac98 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -17,8 +17,6 @@ class PersonalJournalsController < ApplicationController else fields_to_show = [ "year", - "paper_title", - "authors" ] end journal_paper_list = [] From 93a3d869fe0d799e3a05b2d400868232d6c301c9 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 15:27:37 +0800 Subject: [PATCH 005/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index d2dac98..0deb176 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -17,6 +17,8 @@ class PersonalJournalsController < ApplicationController else fields_to_show = [ "year", + "paper_title", + "authors" ] end journal_paper_list = [] From 3673d9495a14857950dd4410bcb2f9e6cad9a706 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 15:55:44 +0800 Subject: [PATCH 006/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 0deb176..7e3f452 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -59,7 +59,8 @@ class PersonalJournalsController < ApplicationController "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, - "total_pages" => journal_papers.total_pages + "total_pages" => journal_papers.total_pages, + "123" => journal_papers } end From 460d7fc09f825e80b7dbdd8c2e03ae79b260c67f Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:04:02 +0800 Subject: [PATCH 007/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 7e3f452..b0a6b78 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -60,6 +60,7 @@ class PersonalJournalsController < ApplicationController "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, + "all_choice" => fields_to_show, "123" => journal_papers } end From 1ec3f6ad642ba5cefac99d2852d8334955bd08f0 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:09:58 +0800 Subject: [PATCH 008/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b0a6b78..773f3b6 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -17,8 +17,7 @@ class PersonalJournalsController < ApplicationController else fields_to_show = [ "year", - "paper_title", - "authors" + "paper_title" ] end journal_paper_list = [] @@ -61,7 +60,8 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "all_choice" => fields_to_show, - "123" => journal_papers + "123" => journal_papers, + "default_choice" => "paper_title" } end From 2957170d63782123bfc626d72831fa7201770c57 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:45:23 +0800 Subject: [PATCH 009/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 773f3b6..cb4240f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -53,15 +53,15 @@ class PersonalJournalsController < ApplicationController "col" => col } end - + choice_value = fields_to_show + choice_show = headers { "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, - "all_choice" => fields_to_show, - "123" => journal_papers, - "default_choice" => "paper_title" + "choice" => {"choice_value" => choice_value.prepend "paper_title","choice_show" => choice_show.prepend {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}} + "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], } end From 20e54be7a95b211de5494d787a328aa6e4ee6e22 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:47:25 +0800 Subject: [PATCH 010/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index cb4240f..0b7bbd1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -60,7 +60,7 @@ class PersonalJournalsController < ApplicationController "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, - "choice" => {"choice_value" => choice_value.prepend "paper_title","choice_show" => choice_show.prepend {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}} + "choice" => {"choice_value" => choice_value.unshift "paper_title","choice_show" => choice_show.unshift {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}} "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], } end From 94c53d5013d54e2d9fe6fb2609207fdcf240389d Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:48:33 +0800 Subject: [PATCH 011/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 0b7bbd1..9162c93 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -60,7 +60,7 @@ class PersonalJournalsController < ApplicationController "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, - "choice" => {"choice_value" => choice_value.unshift "paper_title","choice_show" => choice_show.unshift {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}} + "choice" => {"choice_value" => choice_value.unshift "paper_title","choice_show" => choice_show.unshift {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], } end From 95479dcd52b742e03a832cf83b0b3c28243cd02d Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:52:06 +0800 Subject: [PATCH 012/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 9162c93..151e10b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -61,7 +61,7 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value.unshift "paper_title","choice_show" => choice_show.unshift {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}}, - "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], + "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url] } end From 7424582720e8fc63cbc4593f7323621a9f89700d Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 17:55:50 +0800 Subject: [PATCH 013/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 151e10b..016e3e6 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -54,13 +54,15 @@ class PersonalJournalsController < ApplicationController } end choice_value = fields_to_show + choice_value.unshift("paper_title")" choice_show = headers + choice_show.unshift({"head-title" => (OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——")}) { "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, - "choice" => {"choice_value" => choice_value.unshift "paper_title","choice_show" => choice_show.unshift {"head-title"=>OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——"}}, + "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url] } end From 776e296749f5cf665fbae7fd2a2d680db4b8040c Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 18:00:03 +0800 Subject: [PATCH 014/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 016e3e6..c936e2d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -56,7 +56,8 @@ class PersonalJournalsController < ApplicationController choice_value = fields_to_show choice_value.unshift("paper_title")" choice_show = headers - choice_show.unshift({"head-title" => (OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——")}) + choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" + choice_show.unshift({"head-title" => choice_default }) { "journal_papers" => journal_paper_list, "headers" => headers, From 79f8bd8cf91ef863789e78c62fd1fc6975d61c29 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 18:03:02 +0800 Subject: [PATCH 015/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c936e2d..ec6b0cf 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -54,7 +54,7 @@ class PersonalJournalsController < ApplicationController } end choice_value = fields_to_show - choice_value.unshift("paper_title")" + choice_value.unshift("paper_title") choice_show = headers choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift({"head-title" => choice_default }) From 73895bb08fbd4c55a2f8e3a756fb3aaf2c87afd9 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 18:10:49 +0800 Subject: [PATCH 016/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index ec6b0cf..1bb4b5d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -55,9 +55,9 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_show = headers + choice_show = headers.select { |key,value| key == "head-title" } choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" - choice_show.unshift({"head-title" => choice_default }) + choice_show.unshift(choice_default) { "journal_papers" => journal_paper_list, "headers" => headers, From 379df9fd9d72c918796afa37c544029a889e9b27 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 12 Aug 2019 18:17:04 +0800 Subject: [PATCH 017/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 1bb4b5d..03a7470 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -55,7 +55,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_show = headers.select { |key,value| key == "head-title" } + choice_show = headers.select { |array| array["head-title"] } choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) { From 9e40cbb8e9fa5d6794b64217e7ec133f836729de Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:40:16 +0800 Subject: [PATCH 018/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 03a7470..c0d79c5 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -55,7 +55,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_show = headers.select { |array| array["head-title"] } + choice_show = headers.select ( :"head-title" ) choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) { From 8154c75e1fc32c4ecae88f4e89dde27342804d3e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:43:25 +0800 Subject: [PATCH 019/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c0d79c5..a870622 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -45,6 +45,7 @@ class PersonalJournalsController < ApplicationController end headers = [] + choice_show = [] fields_to_show.each do |fs| col = 2 col = 3 if fs == "paper_title" @@ -52,10 +53,10 @@ class PersonalJournalsController < ApplicationController "head-title" => t("personal_journal.#{fs}"), "col" => col } + choice_show << t("personal_journal.#{fs}") end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_show = headers.select ( :"head-title" ) choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) { @@ -65,6 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url] + "all" => journal_papers.first } end From 53b90176df3d5f99c7a3825866cae63f7a3836d9 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:44:08 +0800 Subject: [PATCH 020/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a870622..964c74b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -65,7 +65,7 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url] + "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], "all" => journal_papers.first } end From d7acc8a0ed2395b11f6f24df4589bac015750173 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:47:21 +0800 Subject: [PATCH 021/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 964c74b..8f2831c 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.first + "all" => journal_papers.class } end From 64ef8db9bcbfb7b657f9d2917a72dbbf36f4cdcb Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:49:17 +0800 Subject: [PATCH 022/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 8f2831c..50f1b9b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.class + "all" => journal_papers.methods() } end From a7773e5aad98d5875eddb43f138a08cdeb1fbf9a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:56:43 +0800 Subject: [PATCH 023/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 50f1b9b..e4c2091 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.methods() + "all" => OrbitHelper.params[:select] } end From dc479a58c2cd9e0d3a5b0b7bf01a2dfec22fc10a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:00:38 +0800 Subject: [PATCH 024/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index e4c2091..a9e98c2 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -65,8 +65,8 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => OrbitHelper.params[:select] + "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], + "all" => journal_papers.all } end From cd13879441a1a7562c9a9200ef5c300cdc0fa039 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:01:57 +0800 Subject: [PATCH 025/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a9e98c2..08e2dde 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.all + "all" => journal_papers.find() } end From 61d688c498817b5e382a373c003e5e47104e5d89 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:03:08 +0800 Subject: [PATCH 026/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 08e2dde..185b1e4 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.find() + "all" => journal_papers.all.methods() } end From 52e655ba7f18316e00a768dafb1112eb859d363b Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:05:08 +0800 Subject: [PATCH 027/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 185b1e4..bd0ef4c 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -66,7 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.all.methods() + "all" => journal_papers.all.take(journal_papers.all.count) } end From 1bbca25a7e9069176d560c8cc859d48d9ac27c1a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:24:04 +0800 Subject: [PATCH 028/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index bd0ef4c..0cf42fd 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,30 +20,35 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - journal_paper_list = [] - journal_papers.each do |journal_paper| - t = [] - fields_to_show.each do |fs| - case fs - when "paper_title" - if page.custom_string_field == "table" - t << {"value" => "#{journal_paper.paper_title}"} - else - t << {"value" => "#{journal_paper.create_link}"} + if params.selectbox != nil + journal_papers = Mongoid::Sessions.default[:journal_papers].find() + journal_papers_count = journal_papers.count + journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) + else + journal_paper_list = [] + journal_papers.each do |journal_paper| + t = [] + fields_to_show.each do |fs| + case fs + when "paper_title" + if page.custom_string_field == "table" + t << {"value" => "#{journal_paper.paper_title}"} + else + t << {"value" => "#{journal_paper.create_link}"} + end + when "level_type" + t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} + when "publication_date" + t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} + when "author_type" + t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + else + t << {"value" => journal_paper.send(fs)} + end end - when "level_type" - t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} - when "publication_date" - t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} - when "author_type" - t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} - else - t << {"value" => journal_paper.send(fs)} + journal_paper_list << {"jps" => t} end - end - journal_paper_list << {"jps" => t} end - headers = [] choice_show = [] fields_to_show.each do |fs| @@ -66,7 +71,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], - "all" => journal_papers.all.take(journal_papers.all.count) + "all" => journal_papers_temp } end From 9ce82a25f0a1022c78c26e5b437f306e0ef6d3d4 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:31:52 +0800 Subject: [PATCH 029/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 0cf42fd..729d32d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,7 +20,7 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - if params.selectbox != nil + if params.selectbox == nil journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) @@ -70,7 +70,7 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => "/"+OrbitHelper.params[:locale]+OrbitHelper.params[:url], + "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_temp } end From ad90664fbe362fa8f2b6319668c2f969a45c096e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:33:46 +0800 Subject: [PATCH 030/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 729d32d..ac4782e 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,11 +20,11 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - if params.selectbox == nil + #if params.selectbox.nil? journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - else + #else journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -48,7 +48,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - end + #end headers = [] choice_show = [] fields_to_show.each do |fs| From 2e95361993adfb2f1ddd5bf8e30296ea1fbfc672 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:35:01 +0800 Subject: [PATCH 031/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index ac4782e..93a8318 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -70,8 +70,7 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_temp + "url" => "/"+params[:locale]+params[:url] } end From dbe9f0fbba19b012e6cde220cec1dbd759a2c01a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:36:11 +0800 Subject: [PATCH 032/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 93a8318..06ab60d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,9 +21,9 @@ class PersonalJournalsController < ApplicationController ] end #if params.selectbox.nil? - journal_papers = Mongoid::Sessions.default[:journal_papers].find() - journal_papers_count = journal_papers.count - journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) + # journal_papers = Mongoid::Sessions.default[:journal_papers].find() + # journal_papers_count = journal_papers.count + # journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) #else journal_paper_list = [] journal_papers.each do |journal_paper| From dfcc7bcaa321f105a59d6dbe00e8c4b774a29e0e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:39:13 +0800 Subject: [PATCH 033/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 06ab60d..32b1eac 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -70,7 +70,8 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => "/"+params[:locale]+params[:url] + "url" => "/"+params[:locale]+params[:url], + "all" => Mongoid::Sessions.default[:journal_papers].find() } end From 246fb55db43ef489cdefae1ed44b3f5d343452d9 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:40:23 +0800 Subject: [PATCH 034/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 32b1eac..afd82b1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -71,7 +71,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => Mongoid::Sessions.default[:journal_papers].find() + "all" => Mongoid::Sessions.default[:journal_papers].find().take(2) } end From 17667d189d1ba100d2a8b6d1d02e4210c77048a8 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:42:40 +0800 Subject: [PATCH 035/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index afd82b1..d787ecb 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,11 +20,11 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - #if params.selectbox.nil? + if !params.selectbox.nil? # journal_papers = Mongoid::Sessions.default[:journal_papers].find() # journal_papers_count = journal_papers.count # journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - #else + else journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -48,7 +48,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - #end + end headers = [] choice_show = [] fields_to_show.each do |fs| From ab799420b02004fc5a3ae682d5344fd8e525ac0a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:43:47 +0800 Subject: [PATCH 036/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index d787ecb..a56ccc1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,7 +20,7 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - if !params.selectbox.nil? + if params.selectbox !=nil # journal_papers = Mongoid::Sessions.default[:journal_papers].find() # journal_papers_count = journal_papers.count # journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) From 4687a11645b5c88174995c0aee0a174a0754235e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:45:36 +0800 Subject: [PATCH 037/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a56ccc1..740b98c 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,11 +20,11 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - if params.selectbox !=nil + #if params.selectbox !=nil # journal_papers = Mongoid::Sessions.default[:journal_papers].find() # journal_papers_count = journal_papers.count # journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - else + #else journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -48,7 +48,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - end + #end headers = [] choice_show = [] fields_to_show.each do |fs| @@ -71,7 +71,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => Mongoid::Sessions.default[:journal_papers].find().take(2) + "all" => params.selectbox } end From 1d0de37748b2ee95bc2e380d0489fb1c3fab9eb8 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:47:27 +0800 Subject: [PATCH 038/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 740b98c..613fe13 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -71,7 +71,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => params.selectbox + "all" => params[:selectbox] } end From 09bb492e837040a904ae5f6172078fdab27d0386 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:48:28 +0800 Subject: [PATCH 039/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 613fe13..9cc3847 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -20,11 +20,11 @@ class PersonalJournalsController < ApplicationController "paper_title" ] end - #if params.selectbox !=nil - # journal_papers = Mongoid::Sessions.default[:journal_papers].find() - # journal_papers_count = journal_papers.count - # journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - #else + if params[:selectbox] !=nil + journal_papers = Mongoid::Sessions.default[:journal_papers].find() + journal_papers_count = journal_papers.count + journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) + else journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -48,7 +48,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - #end + end headers = [] choice_show = [] fields_to_show.each do |fs| From d62d9cc9a9f6409ea0ee0297a288377f39352835 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:49:05 +0800 Subject: [PATCH 040/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 9cc3847..efe0d9d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -71,7 +71,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => params[:selectbox] + "all" => journal_papers_temp } end From 25116235bfab162f75dcd3983a6b38e0b2ab7657 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 09:57:06 +0800 Subject: [PATCH 041/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index efe0d9d..a6dc9e8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -24,6 +24,7 @@ class PersonalJournalsController < ApplicationController journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) + journal_papers_show = journal_papers_temp.select (|value| value[params[:selectbox]].include? params[:keywords]) else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -48,7 +49,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - end + headers = [] choice_show = [] fields_to_show.each do |fs| @@ -73,6 +74,10 @@ class PersonalJournalsController < ApplicationController "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_temp } + end + { + "all" => journal_papers_show + } end def show From bdfbb408637d2d4cb1f062bea468a52e84681d70 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:00:33 +0800 Subject: [PATCH 042/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a6dc9e8..50b33e8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -24,7 +24,7 @@ class PersonalJournalsController < ApplicationController journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - journal_papers_show = journal_papers_temp.select (|value| value[params[:selectbox]].include? params[:keywords]) + journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]].include? params[:keywords]} else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -75,9 +75,11 @@ class PersonalJournalsController < ApplicationController "all" => journal_papers_temp } end + if params[:selectbox] !=nil { "all" => journal_papers_show } + end end def show From 1b4f589d419e43f77f3a716af75ed865219a8666 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:03:33 +0800 Subject: [PATCH 043/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 50b33e8..19e5573 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -25,6 +25,9 @@ class PersonalJournalsController < ApplicationController journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]].include? params[:keywords]} + { + "all" => journal_papers_show + } else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -75,11 +78,6 @@ class PersonalJournalsController < ApplicationController "all" => journal_papers_temp } end - if params[:selectbox] !=nil - { - "all" => journal_papers_show - } - end end def show From 978efa48c932ffb25db33cc4bdcc99a4f3d853b5 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:07:15 +0800 Subject: [PATCH 044/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 19e5573..760ec06 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -26,6 +26,11 @@ class PersonalJournalsController < ApplicationController journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]].include? params[:keywords]} { + "journal_papers" => journal_paper_list, + "headers" => "headers", + "extras" => {"widget-title" => "module_name.journal_paper"}, + "total_pages" => 1 + "choice" => 1 "all" => journal_papers_show } else From 43e21a9f5159b7a27cf1a7c8f61c6e2f4dcbfcc5 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:08:08 +0800 Subject: [PATCH 045/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 760ec06..92b7892 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -29,8 +29,8 @@ class PersonalJournalsController < ApplicationController "journal_papers" => journal_paper_list, "headers" => "headers", "extras" => {"widget-title" => "module_name.journal_paper"}, - "total_pages" => 1 - "choice" => 1 + "total_pages" => 1, + "choice" => 1, "all" => journal_papers_show } else From fd8ebb2e1b73752699eacc7a2c74ca55f0fc1ffa Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:10:50 +0800 Subject: [PATCH 046/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 92b7892..32b22b1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -73,6 +73,10 @@ class PersonalJournalsController < ApplicationController choice_value.unshift("paper_title") choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) + journal_papers1 = Mongoid::Sessions.default[:journal_papers].find() + journal_papers_count = journal_papers1.count + journal_papers_temp = journal_papers1.take(journal_papers_count) + journal_papers_show = journal_papers_temp.select {|value| value["paper_title"].include? "1"} { "journal_papers" => journal_paper_list, "headers" => headers, @@ -80,7 +84,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_temp + "all" => journal_papers_show } end end From c3a12a33f1df0d4785884ce227a11d5ccdad89df Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:13:13 +0800 Subject: [PATCH 047/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 32b22b1..6d9700d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -76,7 +76,7 @@ class PersonalJournalsController < ApplicationController journal_papers1 = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers1.count journal_papers_temp = journal_papers1.take(journal_papers_count) - journal_papers_show = journal_papers_temp.select {|value| value["paper_title"].include? "1"} + journal_papers_show = journal_papers_temp.select {|value| value["paper_title"][OrbitHelper.params[:locale]].include? "1"} { "journal_papers" => journal_paper_list, "headers" => headers, From e426d77a039af09d10f47dc77009be0182c8c39c Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:17:09 +0800 Subject: [PATCH 048/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 6d9700d..3dc9331 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -24,10 +24,10 @@ class PersonalJournalsController < ApplicationController journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]].include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][OrbitHelper.params[:locale]].include? params[:keywords]} { - "journal_papers" => journal_paper_list, - "headers" => "headers", + "journal_papers" => [{"jps"=>[{"value"=>"2019"}, {"value"=>"123, 456"}]}], + "headers" => [{"head-title"=>"年度", "col"=>2}, {"head-title"=>"論文名稱", "col"=>3}], "extras" => {"widget-title" => "module_name.journal_paper"}, "total_pages" => 1, "choice" => 1, From 36c34391853a3c99e2e32b37570a8d626c55b352 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:26:47 +0800 Subject: [PATCH 049/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3dc9331..6a937b6 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -31,7 +31,7 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => "module_name.journal_paper"}, "total_pages" => 1, "choice" => 1, - "all" => journal_papers_show + "all" => OrbitHelper.page_data_count } else journal_paper_list = [] From dbea87909cee413821fb76e4c63c8ee41c41874d Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:52:24 +0800 Subject: [PATCH 050/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 6a937b6..a4aca2f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -23,15 +23,21 @@ class PersonalJournalsController < ApplicationController if params[:selectbox] !=nil journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count - journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][OrbitHelper.params[:locale]].include? params[:keywords]} + journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][params[:locale]].include? params[:keywords]} + if params[:page_no].nil? + page_to_show = 1 + else + page_to_show = params[:page_no].to_i + end + journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] { "journal_papers" => [{"jps"=>[{"value"=>"2019"}, {"value"=>"123, 456"}]}], "headers" => [{"head-title"=>"年度", "col"=>2}, {"head-title"=>"論文名稱", "col"=>3}], "extras" => {"widget-title" => "module_name.journal_paper"}, "total_pages" => 1, "choice" => 1, - "all" => OrbitHelper.page_data_count + "all" => journal_papers_show_last } else journal_paper_list = [] From 186d1b2e062ec561d8e493937acc534f82b495ec Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 14:32:39 +0800 Subject: [PATCH 051/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 44 ++++++++++++++----- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a4aca2f..0499ea2 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -23,22 +23,42 @@ class PersonalJournalsController < ApplicationController if params[:selectbox] !=nil journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count - journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][params[:locale]].include? params[:keywords]} + journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil if params[:page_no].nil? page_to_show = 1 else page_to_show = params[:page_no].to_i end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - { - "journal_papers" => [{"jps"=>[{"value"=>"2019"}, {"value"=>"123, 456"}]}], - "headers" => [{"head-title"=>"年度", "col"=>2}, {"head-title"=>"論文名稱", "col"=>3}], - "extras" => {"widget-title" => "module_name.journal_paper"}, - "total_pages" => 1, - "choice" => 1, - "all" => journal_papers_show_last - } + journal_paper_list = [] + journal_papers_show_last.each do |journal_paper| + t = [] + fields_to_show.each do |fs| + case fs + when "paper_title" + if page.custom_string_field == "table" + t << {"value" => "#{journal_paper[fs]}"} + else + if journal_paper[fs]!=nil && journal_paper[fs]!="" + t << {"value" => "#{journal_paper[fs]}, #{journal_paper[:journal_title][params[:locale]]}"} + else + t << {"value" => "#{journal_paper[fs]}"} + end + end + when "level_type" + t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} + when "publication_date" + t << {"value" => (journal_paper[fs].strftime("%Y/%m") rescue "")} + when "author_type" + t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + else + t << {"value" => "#{journal_paper[fs]}"} + end + end + journal_paper_list << {"jps" => t} + end else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -63,7 +83,7 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - + end headers = [] choice_show = [] fields_to_show.each do |fs| @@ -90,9 +110,9 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_show + "all" => journal_papers_show, + "all_n" => JournalPaper.where(:is_hidden=>false).take(2) } - end end def show From f811f12a43edd783df50ff38f1e95ceb03663ce7 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 14:36:51 +0800 Subject: [PATCH 052/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 0499ea2..743edfd 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show, - "all_n" => JournalPaper.where(:is_hidden=>false).take(2) + "all_n" => JournalPaper.where(:is_hidden=>false).take(100) } end From b70f60243e02c295c1134e7717dd858f24dfea32 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:20:31 +0800 Subject: [PATCH 053/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 743edfd..9828ef9 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,7 +21,7 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil - journal_papers = Mongoid::Sessions.default[:journal_papers].find() + journal_papers = JournalPaper.where(:is_hidden=>false)#Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][params[:locale]].include? params[:keywords]} From 282a99ba56f1748563b27ad695b0d96b8d19452b Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:23:16 +0800 Subject: [PATCH 054/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 9828ef9..c5477fe 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show, - "all_n" => JournalPaper.where(:is_hidden=>false).take(100) + "all_n" => JournalPaper.where(:is_hidden=>false).count } end From 7d66f3b766ecd86ca5d8fd3abd343ac3152ba0f3 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:27:51 +0800 Subject: [PATCH 055/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c5477fe..2035e73 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -32,34 +32,9 @@ class PersonalJournalsController < ApplicationController page_to_show = params[:page_no].to_i end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - journal_paper_list = [] - journal_papers_show_last.each do |journal_paper| - t = [] - fields_to_show.each do |fs| - case fs - when "paper_title" - if page.custom_string_field == "table" - t << {"value" => "#{journal_paper[fs]}"} - else - if journal_paper[fs]!=nil && journal_paper[fs]!="" - t << {"value" => "#{journal_paper[fs]}, #{journal_paper[:journal_title][params[:locale]]}"} - else - t << {"value" => "#{journal_paper[fs]}"} - end - end - when "level_type" - t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} - when "publication_date" - t << {"value" => (journal_paper[fs].strftime("%Y/%m") rescue "")} - when "author_type" - t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} - else - t << {"value" => "#{journal_paper[fs]}"} - end - end - journal_paper_list << {"jps" => t} - end + journal_papers = journal_papers_show_last else + end journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -83,7 +58,6 @@ class PersonalJournalsController < ApplicationController end journal_paper_list << {"jps" => t} end - end headers = [] choice_show = [] fields_to_show.each do |fs| From 2cfa88978d3394f7c405ec222413bd6e7660b8d9 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:30:50 +0800 Subject: [PATCH 056/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 2035e73..343e1e2 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -32,7 +32,6 @@ class PersonalJournalsController < ApplicationController page_to_show = params[:page_no].to_i end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - journal_papers = journal_papers_show_last else end journal_paper_list = [] @@ -84,7 +83,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_show, + "all" => journal_papers_show_last, "all_n" => JournalPaper.where(:is_hidden=>false).count } end From 15c6cebd5ee5738f1633c6e6635d6f8729621f23 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:33:35 +0800 Subject: [PATCH 057/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 343e1e2..b0a19c8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -83,7 +83,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_show_last, + "all" => JournalPaper.where(:is_hidden=>false).take(4).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }, "all_n" => JournalPaper.where(:is_hidden=>false).count } end From ebe9772a238406b6f22898d1c8ea00ca46bec76c Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:37:19 +0800 Subject: [PATCH 058/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b0a19c8..e5adfd1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -83,7 +83,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => JournalPaper.where(:is_hidden=>false).take(4).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }, + "all" => JournalPaper.where(:is_hidden=>false).take(4).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }[0].paper_title, "all_n" => JournalPaper.where(:is_hidden=>false).count } end From cdadf32b154d497cde716d8aeb12da8c049e40bc Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 15:58:01 +0800 Subject: [PATCH 059/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index e5adfd1..ad7dd7e 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -24,7 +24,22 @@ class PersonalJournalsController < ApplicationController journal_papers = JournalPaper.where(:is_hidden=>false)#Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } - journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]][params[:locale]].include? params[:keywords]} + case params[:selectbox] + when "paper_title" + if page.custom_string_field == "table" + journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]} + else + journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]} + end + when "level_type" + journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ')}).to_s.include? params[:keywords]} + when "publication_date" + journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ')}).include? params[:keywords]} + when "author_type" + ournal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + else + journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} + end journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil if params[:page_no].nil? page_to_show = 1 @@ -83,7 +98,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => JournalPaper.where(:is_hidden=>false).take(4).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }[0].paper_title, + "all" => journal_papers_show_last, "all_n" => JournalPaper.where(:is_hidden=>false).count } end From db2d0ea772534e7db0ba66c27a1543dae009fda6 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:02:48 +0800 Subject: [PATCH 060/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index ad7dd7e..ec3ee68 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -32,9 +32,9 @@ class PersonalJournalsController < ApplicationController journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]} end when "level_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ')}).to_s.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.include? params[:keywords]} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ')}).include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} when "author_type" ournal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} else From 3c8e66ddbaa840f5e14a6aa7f466e2de632c2400 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:04:57 +0800 Subject: [PATCH 061/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index ec3ee68..606fd25 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -47,6 +47,7 @@ class PersonalJournalsController < ApplicationController page_to_show = params[:page_no].to_i end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] + journal_papers = journal_papers_show_last else end journal_paper_list = [] From b23a4f76ef74a112d2d466b189715621e457795b Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:07:32 +0800 Subject: [PATCH 062/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 606fd25..9c2885b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -36,7 +36,7 @@ class PersonalJournalsController < ApplicationController when "publication_date" journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} when "author_type" - ournal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} end From 037d488a217058c9c77ef55f217e7a398c5d2c1f Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:09:18 +0800 Subject: [PATCH 063/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 9c2885b..f6a667b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -40,7 +40,6 @@ class PersonalJournalsController < ApplicationController else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} end - journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil if params[:page_no].nil? page_to_show = 1 else @@ -48,6 +47,7 @@ class PersonalJournalsController < ApplicationController end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers = journal_papers_show_last + journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil else end journal_paper_list = [] From 9ca1d8b93acebdef945311a9de7fb15e6595a874 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:17:34 +0800 Subject: [PATCH 064/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index f6a667b..f5a7a2a 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -100,7 +100,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last, - "all_n" => JournalPaper.where(:is_hidden=>false).count + "all_n" => JournalPaper.where(:is_hidden=>false).take(100).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }.select {|value| value.paper_title.include? "1"} } end From cbf1c8cdbb90f0087ca26b470d170a81f1410e86 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:24:12 +0800 Subject: [PATCH 065/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index f5a7a2a..52a8476 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -100,7 +100,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last, - "all_n" => JournalPaper.where(:is_hidden=>false).take(100).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] }.select {|value| value.paper_title.include? "1"} + "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.include? "1"} } end From 32ad97cc912b6af7b870101805150b2ae23706f1 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:26:15 +0800 Subject: [PATCH 066/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 52a8476..c7324b4 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -100,7 +100,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last, - "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.include? "1"} + "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.to_s.include? "1"} } end From 9fbfc4641f535a35af7a6ae6b9cf879ba7c50cb1 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:27:59 +0800 Subject: [PATCH 067/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c7324b4..e518e2e 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -100,7 +100,7 @@ class PersonalJournalsController < ApplicationController "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last, - "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.to_s.include? "1"} + "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.to_s.include? "2"} } end From 6ea6e8c3ab04a285e6a7d6be16e1fc3f29bd6e1d Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:34:04 +0800 Subject: [PATCH 068/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index e518e2e..a010014 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -50,6 +50,7 @@ class PersonalJournalsController < ApplicationController journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil else end + journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) journal_paper_list = [] journal_papers.each do |journal_paper| t = [] From 175f05168c7ca6310df0de8ccb6f37315613c8f3 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:46:09 +0800 Subject: [PATCH 069/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a010014..97abfb8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -47,7 +47,6 @@ class PersonalJournalsController < ApplicationController end journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers = journal_papers_show_last - journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil else end journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) From d9459be130cbee58661804bd4591ad1bd4ca9944 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:50:19 +0800 Subject: [PATCH 070/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 97abfb8..3afe4f4 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -49,7 +49,6 @@ class PersonalJournalsController < ApplicationController journal_papers = journal_papers_show_last else end - journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) journal_paper_list = [] journal_papers.each do |journal_paper| t = [] @@ -99,8 +98,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_show_last, - "all_n" => JournalPaper.where(:is_hidden=>false).take(100).select {|value| value.paper_title.to_s.include? "2"} + "all" => journal_papers_show_last } end From e6791c1e7f91800d69bed1f6e116f499cf33f68f Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:51:51 +0800 Subject: [PATCH 071/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3afe4f4..b3ce70c 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -49,6 +49,8 @@ class PersonalJournalsController < ApplicationController journal_papers = journal_papers_show_last else end + journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) + journal_paper_list = [] journal_papers.each do |journal_paper| t = [] From ab5b44aafb997bddbcf7aceb87fb9a002f7ffeea Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 16:53:48 +0800 Subject: [PATCH 072/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b3ce70c..3afe4f4 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -49,8 +49,6 @@ class PersonalJournalsController < ApplicationController journal_papers = journal_papers_show_last else end - journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) - journal_paper_list = [] journal_papers.each do |journal_paper| t = [] From e7880ea2a1821374dd5fce7d70e85ff7aa268122 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 17:16:37 +0800 Subject: [PATCH 073/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3afe4f4..383c6d9 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,33 +21,35 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil - journal_papers = JournalPaper.where(:is_hidden=>false)#Mongoid::Sessions.default[:journal_papers].find() - journal_papers_count = journal_papers.count - journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } - case params[:selectbox] - when "paper_title" - if page.custom_string_field == "table" - journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]} - else - journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]} - end - when "level_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.include? params[:keywords]} - when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} - when "author_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + journal_papers = JournalPaper.where(:is_hidden=>false)#Mongoid::Sessions.default[:journal_papers].find() + journal_papers_count = journal_papers.count + journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + case params[:selectbox] + when "paper_title" + if page.custom_string_field == "table" + journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]} else - journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]} end - if params[:page_no].nil? - page_to_show = 1 - else - page_to_show = params[:page_no].to_i - end - journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - journal_papers = journal_papers_show_last + when "level_type" + journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.include? params[:keywords]} + when "publication_date" + journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} + when "author_type" + journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + else + journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} + end + if params[:page_no].nil? + page_to_show = 1 + else + page_to_show = params[:page_no].to_i + end + journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] + journal_papers = journal_papers_show_last + journal_papers_total_pages = (journal_papers_show.length/OrbitHelper.page_data_count.to_f).ceil else + journal_papers_total_pages = journal_papers.total_pages end journal_paper_list = [] journal_papers.each do |journal_paper| @@ -95,7 +97,7 @@ class PersonalJournalsController < ApplicationController "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, - "total_pages" => journal_papers.total_pages, + "total_pages" => journal_papers_total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last From 779e5c3939631cbe059ade9f6b337b20d754ed7e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 17:26:16 +0800 Subject: [PATCH 074/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 383c6d9..2e4d599 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -51,29 +51,29 @@ class PersonalJournalsController < ApplicationController else journal_papers_total_pages = journal_papers.total_pages end - journal_paper_list = [] - journal_papers.each do |journal_paper| - t = [] - fields_to_show.each do |fs| - case fs - when "paper_title" - if page.custom_string_field == "table" - t << {"value" => "#{journal_paper.paper_title}"} - else - t << {"value" => "#{journal_paper.create_link}"} - end - when "level_type" - t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} - when "publication_date" - t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} - when "author_type" - t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} - else - t << {"value" => journal_paper.send(fs)} - end + journal_paper_list = [] + journal_papers.each do |journal_paper| + t = [] + fields_to_show.each do |fs| + case fs + when "paper_title" + if page.custom_string_field == "table" + t << {"value" => "#{journal_paper.paper_title}"} + else + t << {"value" => "#{journal_paper.create_link}"} end - journal_paper_list << {"jps" => t} + when "level_type" + t << {"value" => ( !journal_paper.journal_levels.blank? ? "(#{journal_paper.journal_levels.collect{|x| x.title}.join(', ')})" : nil)} + when "publication_date" + t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} + when "author_type" + t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + else + t << {"value" => journal_paper.send(fs)} end + end + journal_paper_list << {"jps" => t} + end headers = [] choice_show = [] fields_to_show.each do |fs| @@ -89,15 +89,15 @@ class PersonalJournalsController < ApplicationController choice_value.unshift("paper_title") choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) - journal_papers1 = Mongoid::Sessions.default[:journal_papers].find() - journal_papers_count = journal_papers1.count - journal_papers_temp = journal_papers1.take(journal_papers_count) - journal_papers_show = journal_papers_temp.select {|value| value["paper_title"][OrbitHelper.params[:locale]].include? "1"} + journal_papers_count = journal_papers1.count + journal_papers_temp = journal_papers1.take(journal_papers_count) + journal_papers_show = journal_papers_temp.select {|value| value["paper_title"][OrbitHelper.params[:locale]].include? "1"} { "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers_total_pages, + "search_text" =>{"select" => params[:locale]!='en' ? "搜尋類別:" : "search class:", "search" => params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:"}, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last From b697111931cb9c3621992b61b219a540ce8b241b Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 17:29:07 +0800 Subject: [PATCH 075/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 2e4d599..c4b493f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -92,12 +92,14 @@ class PersonalJournalsController < ApplicationController journal_papers_count = journal_papers1.count journal_papers_temp = journal_papers1.take(journal_papers_count) journal_papers_show = journal_papers_temp.select {|value| value["paper_title"][OrbitHelper.params[:locale]].include? "1"} + select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" + search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" { "journal_papers" => journal_paper_list, "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper")}, "total_pages" => journal_papers_total_pages, - "search_text" =>{"select" => params[:locale]!='en' ? "搜尋類別:" : "search class:", "search" => params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:"}, + "search_text" => {"select" => select_text, "search" => search_text}, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], "all" => journal_papers_show_last From c09617e2dac3b061eb9b5fcb75647b5bc30793a6 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 17:33:00 +0800 Subject: [PATCH 076/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c4b493f..b98c0b4 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -89,9 +89,6 @@ class PersonalJournalsController < ApplicationController choice_value.unshift("paper_title") choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) - journal_papers_count = journal_papers1.count - journal_papers_temp = journal_papers1.take(journal_papers_count) - journal_papers_show = journal_papers_temp.select {|value| value["paper_title"][OrbitHelper.params[:locale]].include? "1"} select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" { From 358ecb9fa5a71aea0c83ddf8b9ae2926073c52be Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 18:16:13 +0800 Subject: [PATCH 077/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b98c0b4..7288d59 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -94,12 +94,10 @@ class PersonalJournalsController < ApplicationController { "journal_papers" => journal_paper_list, "headers" => headers, - "extras" => {"widget-title" => t("module_name.journal_paper")}, + "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url]}, "total_pages" => journal_papers_total_pages, "search_text" => {"select" => select_text, "search" => search_text}, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, - "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_show_last } end From 91d677efd688f8b13c24bda4b3ba85fdc209cab3 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 18:18:28 +0800 Subject: [PATCH 078/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 7288d59..d82804d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -94,9 +94,8 @@ class PersonalJournalsController < ApplicationController { "journal_papers" => journal_paper_list, "headers" => headers, - "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url]}, + "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url], "select_text" => select_text, "search_text" => search_text}, "total_pages" => journal_papers_total_pages, - "search_text" => {"select" => select_text, "search" => search_text}, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, } end From 868280735c02f26e752c8aa4969cf9d9a000f47a Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 18:25:56 +0800 Subject: [PATCH 079/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index d82804d..b9dfe85 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -96,7 +96,7 @@ class PersonalJournalsController < ApplicationController "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url], "select_text" => select_text, "search_text" => search_text}, "total_pages" => journal_papers_total_pages, - "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, + "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show} } end From 71ebbe36aa81e8aef96bbfb8a1c4ef080870f185 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 08:52:46 +0800 Subject: [PATCH 080/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b9dfe85..93058aa 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,8 +87,11 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("paper_title") + choice_value=choice_value.map{|value| {"choice_value":value}} choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) + choice_show=choice_show.map{|value| {"choice_show":value}} + choice=choice_value.zip(choice_show) select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" { @@ -96,7 +99,7 @@ class PersonalJournalsController < ApplicationController "headers" => headers, "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url], "select_text" => select_text, "search_text" => search_text}, "total_pages" => journal_papers_total_pages, - "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show} + "choice" => choice } end From 710a8dcbd72e5f5d34f3ea0ea8b740a4d63d7dab Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 08:55:50 +0800 Subject: [PATCH 081/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 93058aa..3046040 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,10 +87,10 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_value=choice_value.map{|value| {"choice_value":value}} + choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) - choice_show=choice_show.map{|value| {"choice_show":value}} + choice_show=choice_show.map{|value| {"choice_show" => value}} choice=choice_value.zip(choice_show) select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" From 68aa8f8b814e8d4e6be2b23af2767f7959b15466 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 09:09:02 +0800 Subject: [PATCH 082/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3046040..c8d8c3f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -92,6 +92,7 @@ class PersonalJournalsController < ApplicationController choice_show.unshift(choice_default) choice_show=choice_show.map{|value| {"choice_show" => value}} choice=choice_value.zip(choice_show) + choice=choice.map{|value| value[0].merge(value[1])} select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" { From 003d982cffb9019e7af73ee21f890798bace5e36 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 09:20:13 +0800 Subject: [PATCH 083/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c8d8c3f..8c4d976 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -98,7 +98,12 @@ class PersonalJournalsController < ApplicationController { "journal_papers" => journal_paper_list, "headers" => headers, - "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url], "select_text" => select_text, "search_text" => search_text}, + "extras" => {"widget-title" => t("module_name.journal_paper"), + "url" => "/"+params[:locale]+params[:url], + "select_text" => select_text, + "search_text" => search_text, + "selected" => params[:selectbox], + "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, "choice" => choice } From 1295cb50e9e06e980f2b10939886fe5389d080cf Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 09:38:02 +0800 Subject: [PATCH 084/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 8c4d976..8e74986 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -101,11 +101,11 @@ class PersonalJournalsController < ApplicationController "extras" => {"widget-title" => t("module_name.journal_paper"), "url" => "/"+params[:locale]+params[:url], "select_text" => select_text, - "search_text" => search_text, - "selected" => params[:selectbox], + "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice + "choice" => choice, + "selected" => [{"value" => params[:selectbox]}] } end From 60a4dd174377e554069bd495c2e55a17c6eacae1 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 10:48:31 +0800 Subject: [PATCH 085/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 8e74986..8ac6941 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -25,7 +25,7 @@ class PersonalJournalsController < ApplicationController journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } case params[:selectbox] - when "paper_title" + when "paper_title","default" if page.custom_string_field == "table" journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]} else @@ -86,13 +86,14 @@ class PersonalJournalsController < ApplicationController choice_show << t("personal_journal.#{fs}") end choice_value = fields_to_show - choice_value.unshift("paper_title") + choice_value.unshift("default") choice_value=choice_value.map{|value| {"choice_value" => value}} - choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" + choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : "false"} choice_show=choice_show.map{|value| {"choice_show" => value}} - choice=choice_value.zip(choice_show) - choice=choice.map{|value| value[0].merge(value[1])} + choice=choice_value.zip(choice_show,choice_select) + choice=choice.map{|value| value.inject:merge} select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:" search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:" { From a360529e89e646d7d9b94e5a6da9607321fa4c94 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 10:51:01 +0800 Subject: [PATCH 086/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 8ac6941..3271bdb 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,10 +87,10 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("default") + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : "false"} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : "false"} choice_show=choice_show.map{|value| {"choice_show" => value}} choice=choice_value.zip(choice_show,choice_select) choice=choice.map{|value| value.inject:merge} From 100d517edf2de9b669898f073ff3043b853787ae Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 10:53:46 +0800 Subject: [PATCH 087/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3271bdb..842c4b5 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -88,6 +88,7 @@ class PersonalJournalsController < ApplicationController choice_value = fields_to_show choice_value.unshift("default") choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : "false"} + choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) From 7ebd00357d6028de6a24a0d83ebfed126ce226ae Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 10:58:22 +0800 Subject: [PATCH 088/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 842c4b5..a615955 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -106,8 +106,7 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice, - "selected" => [{"value" => params[:selectbox]}] + "choice" => choice } end From 0d33d3b74c757683e88d4a2976d31a3a642096ec Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 11:00:26 +0800 Subject: [PATCH 089/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index a615955..dcc84c3 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,7 +87,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("default") - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : "false"} + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" From 9d69958d75cf93bce335474f11751e56c6430f19 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 11:15:44 +0800 Subject: [PATCH 090/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index dcc84c3..6f1415c 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,7 +87,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("default") - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : " "} choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" From 4588dd7ea4718092eb092f2e3e4faf8bb21c7fae Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 11:45:19 +0800 Subject: [PATCH 091/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 6f1415c..44048ff 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,7 +87,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("default") - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : " "} + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : ""} choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" From 71940517fcff8192cf369e75d059a470647d929e Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 11:50:04 +0800 Subject: [PATCH 092/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 44048ff..dcc84c3 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -87,7 +87,7 @@ class PersonalJournalsController < ApplicationController end choice_value = fields_to_show choice_value.unshift("default") - choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "true" : ""} + choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""} choice_select=choice_select.map{|value| {"choice_select" => value}} choice_value=choice_value.map{|value| {"choice_value" => value}} choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——" From 61d3fe5a52b8720676a3b09c5a24ff61ba80ab78 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 14:48:01 +0800 Subject: [PATCH 093/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index dcc84c3..c4170b6 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,7 +21,7 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil - journal_papers = JournalPaper.where(:is_hidden=>false)#Mongoid::Sessions.default[:journal_papers].find() + journal_papers = JournalPaper.where(:is_hidden=>false) journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } case params[:selectbox] @@ -106,7 +106,8 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice + "choice" => choice, + "trans" => [I18n.t("我me"),I18n,t(nil)] } end From 9553ede2f9f712776d5259dad2e02306adee3e93 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 16:25:45 +0800 Subject: [PATCH 094/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c4170b6..805f9db 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,6 +37,8 @@ class PersonalJournalsController < ApplicationController journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} when "author_type" journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + when "language" + journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").include? params[:keywords]} else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} end @@ -68,6 +70,8 @@ class PersonalJournalsController < ApplicationController t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} when "author_type" t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + when "language" + t << {"value" => (!journal_paper.language.nil? ? t("#{journal_paper.language}") : "")} else t << {"value" => journal_paper.send(fs)} end From e87da0375f1a406b0f90e3dabb2debdf57481c94 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 18:23:33 +0800 Subject: [PATCH 095/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 805f9db..3b1445d 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, "choice" => choice, - "trans" => [I18n.t("我me"),I18n,t(nil)] + "trans" => "我是me".mb_chars.capitalize } end From 79e32a52bfa896d436042b1f9874b03e62cd145d Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 18:25:03 +0800 Subject: [PATCH 096/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 3b1445d..26255fc 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, "choice" => choice, - "trans" => "我是me".mb_chars.capitalize + "trans" => "我是me".mb_chars.capitalize.inspect } end From dc7ff0345bc50e7e9752aff5b022b8b066faafe9 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 18:26:17 +0800 Subject: [PATCH 097/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 26255fc..f230682 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, "choice" => choice, - "trans" => "我是me".mb_chars.capitalize.inspect + "trans" => "我是me".capitalize.inspect } end From 0557338d2009548b5664178c7a15f01f8755552e Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:33:30 +0800 Subject: [PATCH 098/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index f230682..840ed91 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -111,7 +111,7 @@ class PersonalJournalsController < ApplicationController "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, "choice" => choice, - "trans" => "我是me".capitalize.inspect + "trans" => "我是meにっぽんご/にほん".upcase } end From d7862784cddbd9df9a3b3cfa854008406da8f06b Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:36:42 +0800 Subject: [PATCH 099/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 840ed91..b10ebd9 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -27,20 +27,20 @@ class PersonalJournalsController < ApplicationController case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" - journal_papers_show = journal_papers_temp.select {|value| value.paper_title.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.paper_title.upcase.include? params[:keywords].upcase} else - journal_papers_show = journal_papers_temp.select {|value| value.create_link.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.create_link.upcase.include? params[:keywords].upcase} end when "level_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.upcase.include? params[:keywords].upcase} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').upcase.include? params[:keywords].upcase} when "author_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").upcase.include? params[:keywords].upcase} when "language" - journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").upcase.include? params[:keywords].upcase} else - journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} + journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.upcase.include? params[:keywords].upcase} end if params[:page_no].nil? page_to_show = 1 @@ -110,8 +110,7 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice, - "trans" => "我是meにっぽんご/にほん".upcase + "choice" => choice } end From fabd331bdf11b4ef0dbed3dec7d3815f613a1a64 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:46:28 +0800 Subject: [PATCH 100/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b10ebd9..cd3785b 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,6 +21,7 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil + t = Time.now journal_papers = JournalPaper.where(:is_hidden=>false) journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } @@ -50,6 +51,7 @@ class PersonalJournalsController < ApplicationController journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers = journal_papers_show_last journal_papers_total_pages = (journal_papers_show.length/OrbitHelper.page_data_count.to_f).ceil + timer = Time.now-t else journal_papers_total_pages = journal_papers.total_pages end @@ -110,7 +112,8 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice + "choice" => choice, + "timer" => timer } end From dd492dfc9d8d3b127d4b4177afef09e33accee32 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:49:54 +0800 Subject: [PATCH 101/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index cd3785b..7f020ad 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -48,8 +48,7 @@ class PersonalJournalsController < ApplicationController else page_to_show = params[:page_no].to_i end - journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - journal_papers = journal_papers_show_last + journal_papers = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers_total_pages = (journal_papers_show.length/OrbitHelper.page_data_count.to_f).ceil timer = Time.now-t else From f1e57a93aba8bb9c390dadb17417353228a56d47 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 08:51:19 +0800 Subject: [PATCH 102/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 7f020ad..f42fb6f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -21,10 +21,10 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil - t = Time.now journal_papers = JournalPaper.where(:is_hidden=>false) journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + t = Time.now case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" @@ -43,6 +43,7 @@ class PersonalJournalsController < ApplicationController else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.upcase.include? params[:keywords].upcase} end + timer = Time.now-t if params[:page_no].nil? page_to_show = 1 else @@ -50,7 +51,6 @@ class PersonalJournalsController < ApplicationController end journal_papers = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers_total_pages = (journal_papers_show.length/OrbitHelper.page_data_count.to_f).ceil - timer = Time.now-t else journal_papers_total_pages = journal_papers.total_pages end From 93616514bc798d50b234192863d33b35354f1747 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:16:54 +0800 Subject: [PATCH 103/113] Update personal_journals_controller.rb --- .../personal_journals_controller.rb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index f42fb6f..57f7101 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -1,4 +1,8 @@ class PersonalJournalsController < ApplicationController + def search_all_words(target,word) + words=word.split(' ') + return words.select{|value| target.include? value}==words + end def index params = OrbitHelper.params journal_papers = JournalPaper.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) @@ -28,20 +32,20 @@ class PersonalJournalsController < ApplicationController case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" - journal_papers_show = journal_papers_temp.select {|value| value.paper_title.upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title.upcase,params[:keywords].upcase)} else - journal_papers_show = journal_papers_temp.select {|value| value.create_link.upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link.upcase,params[:keywords].upcase)} end when "level_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_levels.collect{|x| x.title}.join(', ').to_s.upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s.upcase,params[:keywords].upcase)} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').upcase,params[:keywords].upcase)} when "author_type" - journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").upcase,params[:keywords].upcase)} when "language" - journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").upcase.include? params[:keywords].upcase} + journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : "").upcase,params[:keywords].upcase)} else - journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.upcase.include? params[:keywords].upcase} + journal_papers_show = jjournal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s.upcase,params[:keywords].upcase)} end timer = Time.now-t if params[:page_no].nil? From f617ef9e8ed809e79580daf06f84348a002e10c8 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:24:32 +0800 Subject: [PATCH 104/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 57f7101..b0269b6 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -28,7 +28,6 @@ class PersonalJournalsController < ApplicationController journal_papers = JournalPaper.where(:is_hidden=>false) journal_papers_count = journal_papers.count journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } - t = Time.now case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" @@ -47,7 +46,6 @@ class PersonalJournalsController < ApplicationController else journal_papers_show = jjournal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s.upcase,params[:keywords].upcase)} end - timer = Time.now-t if params[:page_no].nil? page_to_show = 1 else @@ -115,8 +113,7 @@ class PersonalJournalsController < ApplicationController "search_text" => search_text, "search_value" => params[:keywords]}, "total_pages" => journal_papers_total_pages, - "choice" => choice, - "timer" => timer + "choice" => choice } end From 53c228622f59062c3e32675478817a0d3fc94115 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:26:11 +0800 Subject: [PATCH 105/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index b0269b6..f27e685 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -25,9 +25,9 @@ class PersonalJournalsController < ApplicationController ] end if params[:selectbox] !=nil - journal_papers = JournalPaper.where(:is_hidden=>false) - journal_papers_count = journal_papers.count - journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + journal_papers_temp = JournalPaper.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + #journal_papers_count = journal_papers.count + #journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" From 473ad7d534e5ce5d51e1cea667015ad3ed68858e Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:27:52 +0800 Subject: [PATCH 106/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index f27e685..65e4a42 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -26,8 +26,6 @@ class PersonalJournalsController < ApplicationController end if params[:selectbox] !=nil journal_papers_temp = JournalPaper.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } - #journal_papers_count = journal_papers.count - #journal_papers_temp = journal_papers.take(journal_papers_count).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" From c6a2a6418cba76a2101e68966e03c17636af0410 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:40:33 +0800 Subject: [PATCH 107/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 65e4a42..2158c7f 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -1,6 +1,7 @@ class PersonalJournalsController < ApplicationController def search_all_words(target,word) - words=word.split(' ') + target=target.upcase + words=word.upcase.split(' ') return words.select{|value| target.include? value}==words end def index @@ -29,20 +30,20 @@ class PersonalJournalsController < ApplicationController case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title.upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title,params[:keywords])} else - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link.upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link,params[:keywords])} end when "level_type" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s.upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s,params[:keywords])} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', '),params[:keywords])} when "author_type" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "),params[:keywords])} when "language" - journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : "").upcase,params[:keywords].upcase)} + journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""),params[:keywords])} else - journal_papers_show = jjournal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s.upcase,params[:keywords].upcase)} + journal_papers_show = jjournal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s,params[:keywords])} end if params[:page_no].nil? page_to_show = 1 From b700749a2f18a4c6078210dc30b3b2feec83bbf3 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 09:42:05 +0800 Subject: [PATCH 108/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 2158c7f..dc42a35 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -43,7 +43,7 @@ class PersonalJournalsController < ApplicationController when "language" journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""),params[:keywords])} else - journal_papers_show = jjournal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s,params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s,params[:keywords])} end if params[:page_no].nil? page_to_show = 1 From d7a50ef0fed4647a00b1b7415ef1608c7b9dc8f3 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 10:35:38 +0800 Subject: [PATCH 109/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index dc42a35..59dd7c2 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -30,20 +30,20 @@ class PersonalJournalsController < ApplicationController case params[:selectbox] when "paper_title","default" if page.custom_string_field == "table" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title,params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.paper_title, params[:keywords])} else - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link,params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.create_link, params[:keywords])} end when "level_type" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s,params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s, params[:keywords])} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', '),params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d"), params[:keywords])} when "author_type" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "),params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])} when "language" - journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""),params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])} else - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s,params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords])} end if params[:page_no].nil? page_to_show = 1 From 554407a1f6ee17a3443f0b59fce740ae09203d1a Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 10:41:52 +0800 Subject: [PATCH 111/113] Update personal_journals_controller.rb fix error --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 59dd7c2..e6362c0 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,7 +37,7 @@ class PersonalJournalsController < ApplicationController when "level_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s, params[:keywords])} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d"), params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d") rescue "", params[:keywords])} when "author_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])} when "language" From 68ad3d77706b5f5d5c156c114111f8f0f875a8eb Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 10:42:46 +0800 Subject: [PATCH 112/113] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index e6362c0..60551bc 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,7 +37,7 @@ class PersonalJournalsController < ApplicationController when "level_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s, params[:keywords])} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.send("publication_date").strftime("%Y/%m/%d") rescue "", params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| (search_all_words(value.send("publication_date").strftime("%Y/%m/%d") rescue ""), params[:keywords])} when "author_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])} when "language" From 48526a96a76c4dbd6180b74266e3462d0b9ad537 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 15 Aug 2019 10:44:23 +0800 Subject: [PATCH 113/113] Update personal_journals_controller.rb fix error --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 60551bc..326c8ab 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,7 +37,7 @@ class PersonalJournalsController < ApplicationController when "level_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_levels.collect{|x| x.title}.join(', ').to_s, params[:keywords])} when "publication_date" - journal_papers_show = journal_papers_temp.select {|value| (search_all_words(value.send("publication_date").strftime("%Y/%m/%d") rescue ""), params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words((value.send("publication_date").strftime("%Y/%m/%d") rescue ""), params[:keywords])} when "author_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])} when "language"