From 794c9558bb80c5b67ff9f56a43ff70d8abb5b8f5 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 2 Jul 2015 16:14:52 +1000 Subject: [PATCH] Show name matches only when at least one is present. Show accurate closest-to target. --- app/views/home/_hubs.html.haml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/views/home/_hubs.html.haml b/app/views/home/_hubs.html.haml index dec5d6392b..3dbd1c775d 100644 --- a/app/views/home/_hubs.html.haml +++ b/app/views/home/_hubs.html.haml @@ -10,8 +10,14 @@ .row{bindonce: true} .small-12.columns - %h2 Did you mean? - = render "home/hubs_table", enterprises: "nameMatches" + .name-matches{"ng-show" => "nameMatches.length > 0"} + %h2 Did you mean? + = render "home/hubs_table", enterprises: "nameMatches" + + %h2 + Closest to + %span{"ng-show" => "nameMatches.length > 0"} {{ nameMatches[0].name }} + %span{"ng-hide" => "nameMatches.length > 0"} {{ query }} + \... - %h2 Closest to {{ query }}... = render "home/hubs_table", enterprises: "distanceMatches"