From 823feb3f6b6cbee5e38befd8be2c5c0527ab983b Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 14:23:57 +0800 Subject: [PATCH 01/22] Update personal_books_controller.rb add rescue --- app/controllers/personal_books_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 85288a2..33b61b5 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -76,7 +76,7 @@ class PersonalBooksController < ApplicationController when "language" t << {"value" => (!book.language.nil? ? t("#{book.language}") : "")} else - t << {"value" => book.send(fs)} + t << {"value" => (book.send(fs) rescue "")} end end book_list << {"books" => t} From 4d4a2dc766d360232dc12176c86827b607f7e3b7 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:05:56 +0800 Subject: [PATCH 02/22] Update personal_books_controller.rb fix error? --- app/controllers/personal_books_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 33b61b5..0ec3f4f 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -134,6 +134,7 @@ class PersonalBooksController < ApplicationController "number_of_authors", "isbn", "url", + "file", "publication_date", "language" ] @@ -157,7 +158,6 @@ class PersonalBooksController < ApplicationController "number_of_authors", "isbn", "url", - "file", "publication_date", "language" ] From 20d35e716283b3552a69c33f93bf9089af89b78f Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:12:47 +0800 Subject: [PATCH 03/22] Update personal_books_controller.rb coding style fix --- app/controllers/personal_books_controller.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 0ec3f4f..e5a01d4 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -1,12 +1,8 @@ class PersonalBooksController < ApplicationController - def search_all_words(target,word) - target=target.upcase - words=word.upcase.split(' ') - return words.select{|value| target.include? value}==words - end def index params = OrbitHelper.params - books = Book.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(OrbitHelper.page_data_count) + page_data_count = OrbitHelper.page_data_count + books = Book.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) page = Page.where(:page_id => params[:page_id]).first rescue nil if page.custom_string_field == "table" @@ -53,8 +49,8 @@ class PersonalBooksController < ApplicationController else page_to_show = params[:page_no].to_i end - books = books_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] - books_total_pages = (books_show.length/OrbitHelper.page_data_count.to_f).ceil + books = books_show[(page_to_show-1)page_data_count...page_to_show*page_data_count] + books_total_pages = (books_show.length/page_data_count.to_f).ceil else books_total_pages = books.total_pages end @@ -179,4 +175,10 @@ class PersonalBooksController < ApplicationController page.save render :json => {"success" => true}.to_json end +private + def search_all_words(target,word) + target=target.upcase + words=word.upcase.split(' ') + return words.select{|value| target.include? value}==words + end end From 7c338ff4bcb1cbc804370fc141e561c576e5d515 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:14:01 +0800 Subject: [PATCH 04/22] Update personal_books_controller.rb fix error --- app/controllers/personal_books_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index e5a01d4..9125dbb 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -49,7 +49,7 @@ class PersonalBooksController < ApplicationController else page_to_show = params[:page_no].to_i end - books = books_show[(page_to_show-1)page_data_count...page_to_show*page_data_count] + books = books_show[(page_to_show-1)*page_data_count...page_to_show*page_data_count] books_total_pages = (books_show.length/page_data_count.to_f).ceil else books_total_pages = books.total_pages From 4bc6962248533db84a69d579fb2d591bb418dd34 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:18:35 +0800 Subject: [PATCH 05/22] Update personal_books_controller.rb fix error --- app/controllers/personal_books_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 9125dbb..8e8925b 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -39,6 +39,8 @@ class PersonalBooksController < ApplicationController books_show = books_temp.select {|value| search_all_words((value.send(params[:selectbox]).strftime("%Y/%m/%d") rescue ""), params[:keywords])} when "author_type" books_show = books_temp.select {|value| search_all_words(value.book_author_types.collect{|bat| bat.title}.join(", "), params[:keywords])} + when "book_paper_type" + books_show = books_temp.select {|value| search_all_words((value.book_type.title rescue ""), params[:keywords])} when "language" books_show = books_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])} else @@ -71,6 +73,8 @@ class PersonalBooksController < ApplicationController t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")} when "language" t << {"value" => (!book.language.nil? ? t("#{book.language}") : "")} + when "book_paper_type" + t << {"value" => (book.book_type.title rescue "")} else t << {"value" => (book.send(fs) rescue "")} end From 868d87886b7e29cd9e8fc601cb98b23ce956815a Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:30:27 +0800 Subject: [PATCH 06/22] Update en.yml add translation --- config/locales/en.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/locales/en.yml b/config/locales/en.yml index f3674e0..17cc397 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -4,6 +4,9 @@ en: book_paper: "Book / Book Chapter" personal_book: "Book / Book Chapter" personal_book: + select_class: "——select class——" + search_class: "search class:" + word_to_search: "word to search:" paper_title : "Paper Title" book_title : "Book Title" extracted_chapters : "Extracted Chapters" From e523087b966b37fd4ee9013e0a4386939a5aae47 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:30:56 +0800 Subject: [PATCH 07/22] Update zh_tw.yml add translation --- config/locales/zh_tw.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index d61cc4d..c51ef1a 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -4,6 +4,9 @@ zh_tw: book_paper: "專書 / 專書章節" personal_book : "專書 / 專書章節" personal_book: + select_class: "——選取分類——" + search_class: "搜尋類別:" + word_to_search: "關鍵字搜尋:" paper_title : "論文名稱" book_title : "書名" extracted_chapters : "部份章節" From 7f4b994670c962867535f8430000d51606025aaf Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:32:10 +0800 Subject: [PATCH 08/22] =?UTF-8?q?Update=20personal=5Fbooks=5Fcontroller.rb?= =?UTF-8?q?=20=E6=90=9C=E5=B0=8B=E6=94=B9=E7=82=BA=E5=A4=9A=E8=AA=9E?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/personal_books_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 8e8925b..c0d2ca9 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -97,13 +97,13 @@ class PersonalBooksController < ApplicationController 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——" + choice_default = t("personal_book.select_class") choice_show.unshift(choice_default) choice_show=choice_show.map{|value| {"choice_show" => value}} 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:" + select_text = t("personal_book.search_class") + search_text = t("personal_book.word_to_search") { "book_list" => book_list, "extras" => {"widget-title" => t("module_name.book"), From ea1be9befa308f033dbcc981e04870635d3f7cf1 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 16:49:50 +0800 Subject: [PATCH 09/22] Update book.rb fix error --- app/models/book.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/book.rb b/app/models/book.rb index 87ff523..b871f30 100644 --- a/app/models/book.rb +++ b/app/models/book.rb @@ -171,8 +171,8 @@ class Book files = [] self.book_files.each do |book_file| url = book_file.member_book_file.url - title = (book_file.title.blank? ? File.basename(book_file.member_book_file.path) : book_file.title) - files << "
  • #{title}
  • " + title = ((book_file.title.blank? ? File.basename(book_file.member_book_file.path) : book_file.title) rescue "") + files << (url.nil? ? "" : "
  • #{title}
  • ") end value = files.join("") else From 8a8fe31ec34d305ddd0d9263ea4a61c19cf4d40f Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 12:17:59 +0800 Subject: [PATCH 10/22] Update personal_books_controller.rb fix coding style --- app/controllers/personal_books_controller.rb | 264 ++++++++++--------- 1 file changed, 134 insertions(+), 130 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index c0d2ca9..1d4fd1e 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -2,57 +2,59 @@ class PersonalBooksController < ApplicationController def index params = OrbitHelper.params page_data_count = OrbitHelper.page_data_count - books = Book.where(:is_hidden=>false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) - page = Page.where(:page_id => params[:page_id]).first rescue nil + books = Book.where(is_hidden: false).sort_for_frontend.page(OrbitHelper.params[:page_no]).per(page_data_count) + page = Page.where(page_id: params[:page_id]).first rescue nil - if page.custom_string_field == "table" + if page.custom_string_field == 'table' fields_to_show = page.custom_array_field rescue [] - fields_to_show = [ - "authors", - "book_title", - "extracted_chapters", - "publisher", - "isbn", - "publish_date" - ] if fields_to_show.blank? + if fields_to_show.blank? + fields_to_show = %w[ + authors + book_title + extracted_chapters + publisher + isbn + publish_date + ] + end else - fields_to_show = [ - "year", - "book_title" + fields_to_show = %w[ + year + book_title ] end - if params[:selectbox] !=nil - books_temp = Book.where(:is_hidden=>false).sort_by{ |tp| [-tp[:year].to_i,-tp[:publication_date].to_i] } + if !params[:selectbox].nil? + books_temp = Book.where(is_hidden: false).sort_by { |tp| [-tp[:year].to_i, -tp[:publication_date].to_i] } case params[:selectbox] - when "book_title", "extracted_chapters", "default" - if params[:selectbox] == "default" - search_temp = "book_title" + when 'book_title', 'extracted_chapters', 'default' + search_temp = if params[:selectbox] == 'default' + 'book_title' + else + params[:selectbox] + end + if page.custom_string_field == 'table' + books_show = books_temp.select { |value| search_all_words(value.send(search_temp), params[:keywords]) } else - search_temp = params[:selectbox] + books_show = books_temp.select { |value| search_all_words(value.create_link, params[:keywords]) } end - if page.custom_string_field == "table" - books_show = books_temp.select {|value| search_all_words(value.send(search_temp), params[:keywords])} - else - books_show = books_temp.select {|value| search_all_words(value.create_link, params[:keywords])} - end - when "publish_date", "publication_date" - books_show = books_temp.select {|value| search_all_words((value.send(params[:selectbox]).strftime("%Y/%m/%d") rescue ""), params[:keywords])} - when "author_type" - books_show = books_temp.select {|value| search_all_words(value.book_author_types.collect{|bat| bat.title}.join(", "), params[:keywords])} - when "book_paper_type" - books_show = books_temp.select {|value| search_all_words((value.book_type.title rescue ""), params[:keywords])} - when "language" - books_show = books_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])} + when 'publish_date', 'publication_date' + books_show = books_temp.select { |value| search_all_words((value.send(params[:selectbox]).strftime('%Y/%m/%d') rescue ''), params[:keywords]) } + when 'author_type' + books_show = books_temp.select { |value| search_all_words(value.book_author_types.collect(&:title).join(', '), params[:keywords]) } + when 'book_paper_type' + books_show = books_temp.select { |value| search_all_words((value.book_type.title rescue ''), params[:keywords]) } + when 'language' + books_show = books_temp.select { |value| search_all_words((!value.language.nil? ? t(value.language.to_s) : ''), params[:keywords]) } else - books_show = books_temp.select {|value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords])} + books_show = books_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end - if params[:page_no].nil? - page_to_show = 1 - else - page_to_show = params[:page_no].to_i - end - books = books_show[(page_to_show-1)*page_data_count...page_to_show*page_data_count] - books_total_pages = (books_show.length/page_data_count.to_f).ceil + page_to_show = if params[:page_no].nil? + 1 + else + params[:page_no].to_i + end + books = books_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] + books_total_pages = (books_show.length / page_data_count.to_f).ceil else books_total_pages = books.total_pages end @@ -61,128 +63,130 @@ class PersonalBooksController < ApplicationController t = [] fields_to_show.each do |fs| case fs - when "book_title", "extracted_chapters" - if page.custom_string_field == "table" - t << {"value" => "#{book.send(fs)}"} - else - t << {"value" => "#{book.create_link}"} - end - when "publish_date", "publication_date" - t << {"value" => (!book.send(fs).nil? ? book.send(fs).strftime('%Y/%m') : "" rescue "")} - when "author_type" - t << {"value" => (book.book_author_types.collect{|bat| bat.title}.join(", ") rescue "")} - when "language" - t << {"value" => (!book.language.nil? ? t("#{book.language}") : "")} - when "book_paper_type" - t << {"value" => (book.book_type.title rescue "")} + when 'book_title', 'extracted_chapters' + t << if page.custom_string_field == 'table' + { 'value' => "#{book.send(fs)}" } + else + { 'value' => "#{book.create_link}" } + end + when 'publish_date', 'publication_date' + t << { 'value' => (!book.send(fs).nil? ? book.send(fs).strftime('%Y/%m') : '' rescue '') } + when 'author_type' + t << { 'value' => (book.book_author_types.collect(&:title).join(', ') rescue '') } + when 'language' + t << { 'value' => (!book.language.nil? ? t(book.language.to_s) : '') } + when 'book_paper_type' + t << { 'value' => (book.book_type.title rescue '') } else - t << {"value" => (book.send(fs) rescue "")} + t << { 'value' => (book.send(fs) rescue '') } end end - book_list << {"books" => t} + book_list << { 'books' => t } end choice_show = [] headers = [] fields_to_show.each do |fs| col = 2 - col = 3 if fs == "paper_title" + col = 3 if fs == 'paper_title' headers << { - "head-title" => t("personal_book.#{fs}"), - "col" => col + 'head-title' => t("personal_book.#{fs}"), + 'col' => col } choice_show << t("personal_book.#{fs}") end choice_value = fields_to_show - choice_value.unshift("default") - 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 = t("personal_book.select_class") + choice_value.unshift('default') + 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 = t('personal_book.select_class') choice_show.unshift(choice_default) - choice_show=choice_show.map{|value| {"choice_show" => value}} - choice=choice_value.zip(choice_show,choice_select) - choice=choice.map{|value| value.inject:merge} - select_text = t("personal_book.search_class") - search_text = t("personal_book.word_to_search") + choice_show = choice_show.map { |value| { 'choice_show' => value } } + choice = choice_value.zip(choice_show, choice_select) + choice = choice.map { |value| value.inject :merge } + select_text = t('personal_book.search_class') + search_text = t('personal_book.word_to_search') { - "book_list" => book_list, - "extras" => {"widget-title" => t("module_name.book"), - "url" => "/"+params[:locale]+params[:url], - "select_text" => select_text, - "search_text" => search_text, - "search_value" => params[:keywords] }, - "headers" => headers, - "total_pages" => books_total_pages, - "choice" => choice + 'book_list' => book_list, + 'extras' => { 'widget-title' => t('module_name.book'), + 'url' => '/' + params[:locale] + params[:url], + 'select_text' => select_text, + 'search_text' => search_text, + 'search_value' => params[:keywords] }, + 'headers' => headers, + 'total_pages' => books_total_pages, + 'choice' => choice } end def show params = OrbitHelper.params - plugin = Book.where(:is_hidden=>false).find_by(uid: params[:uid]) - fields_to_show = [ - "year", - "book_title", - "authors", - "book_paper_type", - "extracted_chapters", - "publisher", - "publish_date", - "pages", - "editor", - "author_type", - "number_of_authors", - "isbn", - "url", - "file", - "publication_date", - "language" + plugin = Book.where(is_hidden: false).find_by(uid: params[:uid]) + fields_to_show = %w[ + year + book_title + authors + book_paper_type + extracted_chapters + publisher + publish_date + pages + editor + author_type + number_of_authors + isbn + url + file + publication_date + language ] - {"plugin_datas"=>plugin.get_plugin_data(fields_to_show)} + { 'plugin_datas' => plugin.get_plugin_data(fields_to_show) } end def get_fields_for_index @page = Page.find(params[:page_id]) rescue nil - @fields_to_show = [ - "year", - "book_title", - "authors", - "book_paper_type", - "extracted_chapters", - "publisher", - "publish_date", - "pages", - "editor", - "author_type", - "number_of_authors", - "isbn", - "url", - "publication_date", - "language" + @fields_to_show = %w[ + year + book_title + authors + book_paper_type + extracted_chapters + publisher + publish_date + pages + editor + author_type + number_of_authors + isbn + url + publication_date + language ] - @fields_to_show = @fields_to_show.map{|fs| [t("personal_book.#{fs}"), fs]} - @default_fields_to_show = [ - "authors", - "book_title", - "extracted_chapters", - "publisher", - "isbn", - "publish_date" + @fields_to_show = @fields_to_show.map { |fs| [t("personal_book.#{fs}"), fs] } + @default_fields_to_show = %w[ + authors + book_title + extracted_chapters + publisher + isbn + publish_date ] - render :layout => false + render layout: false end def save_index_fields page = Page.find(params[:page_id]) rescue nil page.custom_array_field = params[:keys] page.save - render :json => {"success" => true}.to_json + render json: { 'success' => true }.to_json end -private - def search_all_words(target,word) - target=target.upcase - words=word.upcase.split(' ') - return words.select{|value| target.include? value}==words + + private + + def search_all_words(target, word) + target = target.upcase + words = word.upcase.split(' ') + words.select { |value| target.include? value } == words end -end +end \ No newline at end of file From 7c58b3fee64c72b23a58c1b190bd77cfc589bc77 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 20 Aug 2019 14:15:53 +0800 Subject: [PATCH 11/22] Update personal_books_controller.rb fix style --- app/controllers/personal_books_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/personal_books_controller.rb b/app/controllers/personal_books_controller.rb index 1d4fd1e..11964ee 100644 --- a/app/controllers/personal_books_controller.rb +++ b/app/controllers/personal_books_controller.rb @@ -48,11 +48,7 @@ class PersonalBooksController < ApplicationController else books_show = books_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end - page_to_show = if params[:page_no].nil? - 1 - else - params[:page_no].to_i - end + page_to_show = params[:page_no].nil? ? 1 : params[:page_no].to_i books = books_show[(page_to_show - 1) * page_data_count...page_to_show * page_data_count] books_total_pages = (books_show.length / page_data_count.to_f).ceil else From fe636d4aa28f4c1679b7017ec18887552624b4e7 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 14:56:39 +0800 Subject: [PATCH 12/22] Update personal_book.gemspec add update modules feature --- personal_book.gemspec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/personal_book.gemspec b/personal_book.gemspec index 5b97249..089e04e 100644 --- a/personal_book.gemspec +++ b/personal_book.gemspec @@ -2,7 +2,18 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "personal_book/version" - +app_path = File.expand_path(__dir__) +template_path = ENV['PWD'] + '/app/templates' +all_template = Dir.glob(template_path+'/*/') +puts 'copying module' +all_template.each do |folder| + begin + system ('cp -r '+ app_path + '/modules/ ' + folder) + rescue + puts 'error copy' + end +end +system ('rm -r '+app_path + '/modules/') # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "personal_book" From fda398e8a80fb3c188ae126e2be0eee66d5e13ed Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:00:26 +0800 Subject: [PATCH 13/22] Add new directory modules --- modules/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/.gitkeep diff --git a/modules/.gitkeep b/modules/.gitkeep new file mode 100644 index 0000000..e69de29 From 1a373605ef3d7be6f0b8ef264e1a291777c65b31 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:00:50 +0800 Subject: [PATCH 14/22] Add new directory --- modules/personal_book/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_book/.gitkeep diff --git a/modules/personal_book/.gitkeep b/modules/personal_book/.gitkeep new file mode 100644 index 0000000..e69de29 From 6864592244d0b62ca5538abb37d8c4c3d817cee8 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:01:01 +0800 Subject: [PATCH 15/22] Add new directory --- modules/personal_book/thumbs/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_book/thumbs/.gitkeep diff --git a/modules/personal_book/thumbs/.gitkeep b/modules/personal_book/thumbs/.gitkeep new file mode 100644 index 0000000..e69de29 From 05d57635ca4557c989d6e2f4a8b56292a5bce704 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:01:13 +0800 Subject: [PATCH 16/22] Upload new file --- modules/personal_book/thumbs/thumb.png | Bin 0 -> 4075 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 modules/personal_book/thumbs/thumb.png diff --git a/modules/personal_book/thumbs/thumb.png b/modules/personal_book/thumbs/thumb.png new file mode 100644 index 0000000000000000000000000000000000000000..266af5606742714c262a949cd58aedc2b84b1959 GIT binary patch literal 4075 zcmcgvYdBPE`=8Q@or=MZk}-~jIXD}qFebzhVvsZ#jA2HMW=0OFFbKQkR5@2;7{)1- z&=wM+oMYofvU8{uIS&7&UHkuj*w_2v{qU~qTI;!=weH`2-_Lz|o)v3@JtZh0Apin_ z1kKIRw!l~h+!g!w0MC|jUMDb!Q%!MHJBk;Th7Tlwj65ms1cm?>ZoCb zunI6C_z=xP0tt2@SbL8Ul825b)X)H;M@Iny{0US%gzoQ04nooOq2J}A0DAj1918i) zLM7=#|1t_^Wdkvx1QH+`FocQ+LK6wmREHte5jyHR$`Dlq5&=i5!Vy|3NCZkl3xz;J zeq2yMTcD>G$`+0Jp$nMlLw%^!02CZfqtReAH5et(8;;b`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27{yI5x&}n zjGJe_fr|$Pt|~uDnhZ1N{|vMz!Q7S573!lkX`w*`M_tsqp5B&;jQ4iu-%6ZvY&d?S z(Yb!KKCBjcBfE4hloZ^UW{2r=yHy0PzyN)UnCjQ^&}bh?xwb$$BT+V%+b{b zq?WOa<=b6)e-`d$?21O2jFEohz$tKYMmUzXr zv!G#9d=mkj!$T|>;o(^`Q6(9fne#dcS*H7Knqnn^b1|?Q$ Date: Wed, 21 Aug 2019 15:01:39 +0800 Subject: [PATCH 17/22] Upload new file --- modules/personal_book/index.html.erb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules/personal_book/index.html.erb diff --git a/modules/personal_book/index.html.erb b/modules/personal_book/index.html.erb new file mode 100644 index 0000000..50b7c80 --- /dev/null +++ b/modules/personal_book/index.html.erb @@ -0,0 +1,14 @@ + + + + + + + + + + + + +

    {{widget-title}}

    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file From cd9c36c283eea601eb21f95ddcb2ec19f3f1aa44 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:01:51 +0800 Subject: [PATCH 18/22] Upload new file --- modules/personal_book/index_search1.html.erb | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 modules/personal_book/index_search1.html.erb diff --git a/modules/personal_book/index_search1.html.erb b/modules/personal_book/index_search1.html.erb new file mode 100644 index 0000000..6614e78 --- /dev/null +++ b/modules/personal_book/index_search1.html.erb @@ -0,0 +1,37 @@ + +

    {{widget-title}}

    +
    +
    + {{select_text}} + + {{search_text}} + + + Clear +
    +
    + + + + + + + + + + + +
    {{head-title}}
    {{value}}
    +{{pagination_goes_here}} \ No newline at end of file From 6a058ebbab71b631267f70bca454b3c5136215d3 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:02:03 +0800 Subject: [PATCH 19/22] Upload new file --- modules/personal_book/info.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 modules/personal_book/info.json diff --git a/modules/personal_book/info.json b/modules/personal_book/info.json new file mode 100644 index 0000000..bdb0c2c --- /dev/null +++ b/modules/personal_book/info.json @@ -0,0 +1,20 @@ +{ + "frontend": [ + { + "filename" : "index", + "name" : { + "zh_tw" : "1. 列表", + "en" : "1. List" + }, + "thumbnail" : "thumb.png" + }, + { + "filename" : "index_search1", + "name" : { + "zh_tw" : "2. 列表(含搜尋)", + "en" : "2. List which includes search" + }, + "thumbnail" : "thumb.png" + } + ] +} \ No newline at end of file From cf3b7ebc2b0d930245793a1965691f6e4b552b6e Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 15:02:16 +0800 Subject: [PATCH 20/22] Upload new file --- modules/personal_book/show.html.erb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 modules/personal_book/show.html.erb diff --git a/modules/personal_book/show.html.erb b/modules/personal_book/show.html.erb new file mode 100644 index 0000000..b183818 --- /dev/null +++ b/modules/personal_book/show.html.erb @@ -0,0 +1,8 @@ + + + + + + + +
    {{title}}{{value}}
    From 46bf1679b2c56e4bfcd22e19103927988703e2a2 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 17:12:12 +0800 Subject: [PATCH 21/22] Update personal_book.gemspec --- personal_book.gemspec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/personal_book.gemspec b/personal_book.gemspec index 089e04e..20f61cd 100644 --- a/personal_book.gemspec +++ b/personal_book.gemspec @@ -7,10 +7,12 @@ template_path = ENV['PWD'] + '/app/templates' all_template = Dir.glob(template_path+'/*/') puts 'copying module' all_template.each do |folder| - begin - system ('cp -r '+ app_path + '/modules/ ' + folder) - rescue - puts 'error copy' + if folder[0...-1] != 'mobile' + begin + system ('cp -r '+ app_path + '/modules/ ' + folder) + rescue + puts 'error copy' + end end end system ('rm -r '+app_path + '/modules/') From 52413762a3869c337e66eb70b4f688d4e503f659 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 21 Aug 2019 17:21:46 +0800 Subject: [PATCH 22/22] Update personal_book.gemspec --- personal_book.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personal_book.gemspec b/personal_book.gemspec index 20f61cd..4d02244 100644 --- a/personal_book.gemspec +++ b/personal_book.gemspec @@ -7,7 +7,7 @@ template_path = ENV['PWD'] + '/app/templates' all_template = Dir.glob(template_path+'/*/') puts 'copying module' all_template.each do |folder| - if folder[0...-1] != 'mobile' + if folder.split('/')[-1] != 'mobile' begin system ('cp -r '+ app_path + '/modules/ ' + folder) rescue