Permalink
Browse files

adding coordinates prepared in script

  • Loading branch information...
1 parent a1513ae commit c8751126f984b37f3300820f475aadf315dd6054 @kaaes kaaes committed Jan 12, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 js/build.js
View
@@ -7,8 +7,9 @@
provision : 'Provision',
hours : 'Opening time'
},
- itemTemplate = '<h3>{{name}}, {{address}}</h3><ul>{{#description}}{{{.}}}{{/description}}</ul>',
- description = '<li><strong>{{key}}:</strong> {{value}}</li>';
+ mapLinkTemplate = '<a href="http://maps.google.com/maps?q={{coords}}">See on map</a>',
+ itemTemplate = '<h3>{{name}}, {{address}} {{{mapLink}}}</h3><ul>{{#description}}{{{.}}}{{/description}}</ul>',
+ description = '<li><strong>{{key}}:</strong> {{value}}</li>',
cityHeader = '<h2>{{city}}</h2>';
function renderPage(items) {
@@ -53,6 +54,7 @@
html : Mustache.to_html(itemTemplate, {
name : item.name,
address : item.address,
+ mapLink : item.coordinates ? Mustache.to_html(mapLinkTemplate, {coords : item.coordinates.join(',')}) : '',
description: list
}),
city : item.city,

0 comments on commit c875112

Please sign in to comment.