From 8bb7cdb75a050a436c4669b813e21a4594a16d72 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 6 May 2013 10:47:49 +0100 Subject: [PATCH] Style the "view details" link in search results --- app/assets/stylesheets/common.css.scss | 7 ++++++- app/helpers/geocoder_helper.rb | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index 93547a207..54db78fbf 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -692,7 +692,12 @@ table { } .search_results_entry { - margin-bottom: 0 ; + margin-bottom: 0; + + .search_details { + display: block; + text-align: right; + } } .search_results_entry .search_searching { diff --git a/app/helpers/geocoder_helper.rb b/app/helpers/geocoder_helper.rb index 70bb43846..c74cba28e 100644 --- a/app/helpers/geocoder_helper.rb +++ b/app/helpers/geocoder_helper.rb @@ -16,9 +16,14 @@ module GeocoderHelper html << result[:prefix] if result[:prefix] html << " " if result[:prefix] and result[:name] html << link_to(result[:name], url, html_options) if result[:name] - html << (" [" + link_to(t("browse.#{result[:type]}_history.view_details"), :controller => :browse, :action => result[:type], :id => result[:id]) + "]") if (result[:type] && result[:id]) html << result[:suffix] if result[:suffix] + if result[:type] and result[:id] + html << content_tag(:small, :class => ["deemphasize", "search_details"]) do + link_to(t("browse.#{result[:type]}_history.view_details"), :controller => :browse, :action => result[:type], :id => result[:id]) + end + end + return raw(html) end -- 2.43.2