Permalink
Browse files

Open external links in a new tab

  • Loading branch information...
1 parent 6ae8832 commit 86eac093b0dc0d0efdd654a70cdf41fdbe2d5ea8 Alex Bredariol Grilo committed Nov 24, 2011
Showing with 4 additions and 2 deletions.
  1. +2 −1 app/views/search_results/_search_result.html.haml
  2. +2 −1 app/views/welcome/_news_item.html.haml
@@ -7,7 +7,8 @@
- title = search_result.title
- if title.blank? || title == search_result.url
- title = shorten_url(search_result.url, :length => 45)
- = link_to(title, trackable_search_result_url(search_result, Umamao::PAGE_MAPPING['questions#show']))
+ = link_to(title, trackable_search_result_url(search_result, Umamao::PAGE_MAPPING['questions#show']),
+ :target => "_blank")
.url
%p
= shorten_url(search_result.url)
@@ -15,7 +15,8 @@
%li.entry.item
-# News_item Summary
.summary
- %h3= link_to title, link, :title => truncate(entry.body, :length => 200)
+ %h3= link_to title, link, :title => truncate(entry.body, :length => 200),
+ :target => entry_type == "searchresult" ? "_blank" : ""
- if entry_type == "searchresult"
.search_result_url
%p

0 comments on commit 86eac09

Please sign in to comment.