Revert "get share path rather than constructing from version"

master
Zaahir Moolla 2015-10-30 13:44:42 -04:00
parent c4cf09dd0e
commit 331865a49e
3 changed files with 12 additions and 11 deletions

View File

@ -20,6 +20,9 @@ topics 'special_interest';
attribution github => ["MrChrisW", "Chris Wilson"],
web => ["http://chrisjwilson.com", "Chris Wilson"];
# Get Goodie version for use with image paths
my $goodieVersion = $DDG::GoodieBundle::OpenSourceDuckDuckGo::VERSION // 999;
my @attributesArray = ( 'size', 'radius', 'volume', 'mass', 'surface area', 'area');
my $attributesString = join('|', @attributesArray);
@ -96,9 +99,6 @@ handle query_lc => sub {
#$saturn var is provided to handlebars template to set size of image
$saturn = ($objectName eq "saturn") ? 1 : 0;
my $share = share();
$share =~ s{.+(/share/.+$)}{$1};
my $image_path = "$share/img/$objectName";
#Return result and html
return $operation." is ".$result,
structured_answer => {
@ -107,8 +107,9 @@ handle query_lc => sub {
data => {
attributes => $result,
operation => $operation,
imagePath => $image_path,
saturn => $saturn
imageName => $objectName,
saturn => $saturn,
goodie_version => $goodieVersion
},
meta => {
sourceUrl => "https://solarsystem.nasa.gov/planets/index.cfm",

View File

@ -1,9 +1,9 @@
<div class="objects--body">
<span class="objects--objectImage">
{{#if saturn}}
<img width="45px" height="28px" src="{{imagePath}}.png">
<img width="45px" height="28px" src="share/goodie/solar_system/{{goodie_version}}/img/{{imageName}}.png">
{{else}}
<img width="40px" height="40px" src="{{imagePath}}.png">
<img width="40px" height="40px" src="share/goodie/solar_system/{{goodie_version}}/img/{{imageName}}.png">
{{/if}}
</span>
@ -16,4 +16,4 @@
{{operation}}
</span>
</span>
</div>
</div>

View File

@ -2,9 +2,9 @@
<div class="objects--body">
<span class="objects--objectImage">
{{#if saturn}}
<img width="45px" height="28px" src="{{imagePath}}@2x.png">
<img width="45px" height="28px" src="share/goodie/solar_system/{{goodie_version}}/img/{{imageName}}@2x.png">
{{else}}
<img width="40px" height="40px" src="{{imagePath}}@2x.png">
<img width="40px" height="40px" src="share/goodie/solar_system/{{goodie_version}}/img/{{imageName}}@2x.png">
{{/if}}
</span>
@ -18,4 +18,4 @@
</span>
</span>
</div>
</div>
</div>