From 9e5d0af3bddba73ceb408b3c2578e14771e451db Mon Sep 17 00:00:00 2001 From: manson Date: Fri, 4 Jul 2014 11:50:08 +0800 Subject: [PATCH] Add personal patent plugin --- app/controllers/members_controller.rb | 2 +- app/helpers/orbit_helper.rb | 2 +- .../modules/personal_patent/index.html.erb | 22 ++++++++++++++++ .../modules/personal_patent/show.html.erb | 26 +++++++++++++++++++ built_in_extensions.rb | 1 + 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 app/templates/orbit_bootstrap/modules/personal_patent/index.html.erb create mode 100644 app/templates/orbit_bootstrap/modules/personal_patent/show.html.erb diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 56a3b8d..7ede19e 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -66,7 +66,7 @@ class MembersController < ApplicationController pd = plugin_data.collect do |p| { "data_title" => p.slug_title, - "link_to_show" => OrbitHelper.url_to_plugin_show(p.to_param,plugin.module_app_name) + "link_to_show" => OrbitHelper.url_to_plugin_show(p.to_param,plugin.module_app_name.underscore) } end { diff --git a/app/helpers/orbit_helper.rb b/app/helpers/orbit_helper.rb index 7a207b4..68cbbe5 100644 --- a/app/helpers/orbit_helper.rb +++ b/app/helpers/orbit_helper.rb @@ -77,7 +77,7 @@ module OrbitHelper def self.url_to_plugin_show(slug,module_app) page = Page.find_by(:module => module_app) rescue "" - @url_to_plugin_show = "/#{@site_locale}#{page.url}/#{slug}" rescue "#" + @url_to_plugin_show = "#{page.url}/#{slug}" rescue "#" end def self.set_widget_item_url(widget) diff --git a/app/templates/orbit_bootstrap/modules/personal_patent/index.html.erb b/app/templates/orbit_bootstrap/modules/personal_patent/index.html.erb new file mode 100644 index 0000000..0fd78b8 --- /dev/null +++ b/app/templates/orbit_bootstrap/modules/personal_patent/index.html.erb @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + +

{{widget-title}}

{{th_publication_date}}{{th_patent_title}}{{th_patent_no}}{{th_patent_country}}{{th_authors}}
{{publication_date}}{{patent_title}}{{patent_no}}{{patent_country}}{{authors}}
+{{pagination_goes_here}} \ No newline at end of file diff --git a/app/templates/orbit_bootstrap/modules/personal_patent/show.html.erb b/app/templates/orbit_bootstrap/modules/personal_patent/show.html.erb new file mode 100644 index 0000000..2d58c29 --- /dev/null +++ b/app/templates/orbit_bootstrap/modules/personal_patent/show.html.erb @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + +
{{th_patent_title}}{{patent_title}}
{{th_authors}}{{authors}}
{{th_patent_type}}{{patent_type}}
{{th_year}}{{year}}
{{th_patent_no}}{{patent_no}}
{{th_patent_country}}{{patent_country}}
{{th_publish_date}}{{publish_date}}
{{th_keywords}}{{keywords}}
{{th_url}}{{url}}
{{th_note}}{{note}}
{{th_files}} +
+
+ + {{file_title}} + {{file_ext}} - {{file_description}} +
+
+
diff --git a/built_in_extensions.rb b/built_in_extensions.rb index 94e4dca..dae97e4 100644 --- a/built_in_extensions.rb +++ b/built_in_extensions.rb @@ -13,6 +13,7 @@ gem 'personal_experience', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-ex gem 'personal_honor', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-honor.git' gem 'personal_book', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-book.git' gem 'personal_lab', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-lab.git' +gem 'personal_patent', git: 'git@gitlab.tp.rulingcom.com:saurabh/personal-patent.git' #widgets gem "site_menu_widget", git: 'git@gitlab.tp.rulingcom.com:saurabh/site-menu-widget.git'