diff options
author | Go MAEDA <maeda@farend.jp> | 2018-01-01 06:18:01 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-01-01 06:18:01 +0000 |
commit | c35433ad01ab79b1dd4573efcb1f9038a3729917 (patch) | |
tree | 6cb21ed630d0186248611d38d66ad6107ac0c463 /lib | |
parent | 14e0a6bdba5a6b49741cc131021fcf5c0b873c98 (diff) | |
download | redmine-c35433ad01ab79b1dd4573efcb1f9038a3729917.tar.gz redmine-c35433ad01ab79b1dd4573efcb1f9038a3729917.zip |
Links for custom field value don't have "external" class (#27024).
Patch by Go MAEDA.
git-svn-id: http://svn.redmine.org/redmine/trunk@17138 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/field_format.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index b59760674..bcf6ccc3d 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -248,7 +248,10 @@ module Redmine url = url_from_pattern(custom_field, single_value, customized) [text, url] end - links = texts_and_urls.sort_by(&:first).map {|text, url| view.link_to_if uri_with_safe_scheme?(url), text, url} + links = texts_and_urls.sort_by(&:first).map do |text, url| + css_class = (url =~ /^https?:\/\//) ? 'external' : nil + view.link_to_if uri_with_safe_scheme?(url), text, url, :class => css_class + end links.join(', ').html_safe else casted @@ -442,7 +445,8 @@ module Redmine url = "http://" + url end end - view.link_to value.to_s.truncate(40), url + css_class = (url =~ /^https?:\/\//) ? 'external' : nil + view.link_to value.to_s.truncate(40), url, :class => css_class else value.to_s end |