From 889955cf6aa2fcb3fb7ea2646ef884796045a19b Mon Sep 17 00:00:00 2001 From: uu59 Date: Tue, 10 Jun 2014 15:02:44 +0900 Subject: [PATCH] Add rubygems.org link on recommended plugins page --- app/models/plugin.rb | 4 ++++ app/views/plugins/recommended.html.haml | 3 +++ config/locales/translation_en.yml | 1 + config/locales/translation_ja.yml | 1 + 4 files changed, 9 insertions(+) diff --git a/app/models/plugin.rb b/app/models/plugin.rb index a414fee..9ca8aa8 100644 --- a/app/models/plugin.rb +++ b/app/models/plugin.rb @@ -96,6 +96,10 @@ class Plugin JSON.parse(gem_versions).find {|ver| ver["number"] == target_version }.try(:[], "authors") end + def rubygems_org_page + "https://rubygems.org/gems/#{gem_name}" + end + def self.gemfile_changed? # if true, rails server needs to restart. new installed/removed gems are. @initial_gemfile_content != File.read(gemfile_path) diff --git a/app/views/plugins/recommended.html.haml b/app/views/plugins/recommended.html.haml index 4152e6b..af9f23f 100644 --- a/app/views/plugins/recommended.html.haml +++ b/app/views/plugins/recommended.html.haml @@ -7,6 +7,7 @@ %th= t('.name') %th= t('.category') %th= t('.status') + %th %tbody - @plugins.each do |plugin| %tr @@ -23,6 +24,8 @@ = t(".installed") - else = t(".not_installed") + %td + = link_to t('plugins.view_on_rubygems_org'), plugin.rubygems_org_page, target: "_blank" :javascript diff --git a/config/locales/translation_en.yml b/config/locales/translation_en.yml index 72d2cac..5413cd0 100644 --- a/config/locales/translation_en.yml +++ b/config/locales/translation_en.yml @@ -35,6 +35,7 @@ en: plugins: notice_restart_for_config_edit: "NOTICE: fluentd will restart after update config" + view_on_rubygems_org: View on rubygems.org common: &plugin_common <<: *terms name: Plugin Name diff --git a/config/locales/translation_ja.yml b/config/locales/translation_ja.yml index 6b7f4c4..78aa21f 100644 --- a/config/locales/translation_ja.yml +++ b/config/locales/translation_ja.yml @@ -35,6 +35,7 @@ ja: plugins: notice_restart_for_config_edit: ※更新するとfluentdが再起動されます + view_on_rubygems_org: rubygems.orgで見る common: &plugin_common <<: *terms name: プラグイン名