Skip to content

Commit

Permalink
Merge pull request #137 from muskie9/bugfix/templateConfig#136
Browse files Browse the repository at this point in the history
BUGFIX html template config incorrect reference
  • Loading branch information
muskie9 authored Dec 16, 2016
2 parents f0bfad7 + 3971e12 commit 2694c42
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/objects/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ public function fieldLabels($includerelations = true)
$labels['Email'] = 'Email';
$labels['Featured.NiceAsBoolean'] = 'Featured';
$labels['Coords'] = 'Coords';
$labels['Import_ID'] = 'Import_ID';

return $labels;
}
Expand Down
4 changes: 2 additions & 2 deletions code/pages/Locator.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ public function init()
$load = 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';
}

$listTemplatePath = Config::inst()->get('Locator', 'list_template_path');
$infowindowTemplatePath = Config::inst()->get('Locator', 'info_window_template_path');
$listTemplatePath = Config::inst()->get('Locator_Controller', 'list_template_path');
$infowindowTemplatePath = Config::inst()->get('Locator_Controller', 'info_window_template_path');

// in page or modal
$modal = ($this->data()->ModalWindow) ? 'modalWindow: true' : 'modalWindow: false';
Expand Down
1 change: 1 addition & 0 deletions tests/LocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function testFieldLabels()
'Featured.NiceAsBoolean' => 'Featured',
'Coords' => 'Coords',
'Import_ID' => 'Import_ID',
'LatLngOverride' => 'Lat Lng Override',
);
$this->assertEquals($expected, $labels);
}
Expand Down
9 changes: 9 additions & 0 deletions tests/LocatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ public function testLocationSearch()
$this->assertInstanceOf('FieldList', $fields);
}

/**
*
*/
public function testLocationInfoTemplates()
{
$this->assertEquals('locator/templates/location-list-description.html', Config::inst()->get('Locator_Controller', 'list_template_path'));
$this->assertEquals('locator/templates/infowindow-description.html', Config::inst()->get('Locator_Controller', 'info_window_template_path'));
}

}

0 comments on commit 2694c42

Please sign in to comment.