From 1815e7190b65e03f2f9124668cffc60f5c023a62 Mon Sep 17 00:00:00 2001 From: Brian Stoner Date: Thu, 14 Jan 2016 11:49:35 -0500 Subject: [PATCH] handle the image differently because the text template floats it to the right --- lib/DDG/Goodie/DuckDuckGo.pm | 2 +- .../duck_duck_go/subtitle_content.handlebars | 3 +++ t/DuckDuckGo.t | 16 ++++++++-------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/DDG/Goodie/DuckDuckGo.pm b/lib/DDG/Goodie/DuckDuckGo.pm index b5c3f2405..162be20ab 100644 --- a/lib/DDG/Goodie/DuckDuckGo.pm +++ b/lib/DDG/Goodie/DuckDuckGo.pm @@ -59,7 +59,7 @@ handle remainder => sub { id => 'duck_duck_go', data => { title => $response->{title}, - image => $response->{image}, + subtitle_image => $response->{image}, subtitle_text => $response->{subtitle}, subtitle_url => $response->{url} }, diff --git a/share/goodie/duck_duck_go/subtitle_content.handlebars b/share/goodie/duck_duck_go/subtitle_content.handlebars index 79c8a2960..869841854 100644 --- a/share/goodie/duck_duck_go/subtitle_content.handlebars +++ b/share/goodie/duck_duck_go/subtitle_content.handlebars @@ -4,3 +4,6 @@ {{subtitle_text}} {{/if}} +{{#if subtitle_image}} + +{{/if}} diff --git a/t/DuckDuckGo.t b/t/DuckDuckGo.t index 454083429..6f38ed86c 100644 --- a/t/DuckDuckGo.t +++ b/t/DuckDuckGo.t @@ -17,7 +17,7 @@ my @about_result = ( id => $id, data => { title => 'Want to know more about us?', - image => undef, + subtitle_image => undef, subtitle_text => 'Visit our About page', subtitle_url => 'https://duckduckgo.com/about' }, @@ -34,7 +34,7 @@ my @blog_result = ( id => $id, data => { title => 'Want to stay up to date with DuckDuckGo?', - image => undef, + subtitle_image => undef, subtitle_text => 'Visit the official DuckDuckGo blog', subtitle_url => 'https://duck.co/blog' }, @@ -51,7 +51,7 @@ my @help_result = ( id => $id, data => { title => 'Need some help?', - image => undef, + subtitle_image => undef, subtitle_text => 'Visit our help page', subtitle_url => 'https://duck.co/help' }, @@ -68,7 +68,7 @@ my @irc_result = ( id => $id, data => { title => 'Want to chat with us on IRC?', - image => undef, + subtitle_image => undef, subtitle_text => 'Visit #duckduckgo on irc.freenode.net', subtitle_url => 'http://webchat.freenode.net/?channels=duckduckgo' }, @@ -85,7 +85,7 @@ my @merch_result = ( id => $id, data => { title => 'Looking for some swag? (Thanks for the support!)', - image => undef, + subtitle_image => undef, subtitle_text => 'Check out the DuckDuckGo store for t-shirts, stickers, and other items', subtitle_url => 'https://duck.co/help/community/swag' }, @@ -102,7 +102,7 @@ my @tor_result = ( id => $id, data => { title => 'DuckDuckGo is available on Tor', - image => undef, + subtitle_image => undef, subtitle_text => 'Visit our onion address', subtitle_url => 'http://3g2upl4pq6kufc4m.onion' }, @@ -119,7 +119,7 @@ my @shorturl_result = ( id => $id, data => { title => 'Need a quicker way to visit DuckDuckGo?', - image => undef, + subtitle_image => undef, subtitle_text => 'You can also find us at https://ddg.gg', subtitle_url => 'https://ddg.gg' }, @@ -136,7 +136,7 @@ my @zci_result = ( id => $id, data => { title => 'Zero Click Info is another term for our Instant Answers that show above the search results', - image => undef, + subtitle_image => undef, subtitle_text => 'Learn more about Instant Answers', subtitle_url => 'http://duckduckhack.com' },