X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fdirections.html;h=f23b7eb7f70cf4cb8e9e80587154fc7079e5de57;hp=a07df403bfae2f4fa970b5f8b41c9fcbf482ea1b;hb=83dd6450b06d2cf06a7a0ad91aa7d7a18062c9ff;hpb=e7451be44db0d8244f85059169ac6239b2440687 diff --git a/httemplate/view/directions.html b/httemplate/view/directions.html index a07df403b..f23b7eb7f 100644 --- a/httemplate/view/directions.html +++ b/httemplate/view/directions.html @@ -1,3 +1,5 @@ +% if ( $apikey ) { + %# the actual page <& /elements/header-popup.html, { title => '',#$name, @@ -10,6 +12,11 @@
+% } else { +<& /elements/header-popup.html &> +<& /elements/google_maps_api_key.html &> +% } + <%def .head> % my $lat = $cgi->param('lat'); % my $lon = $cgi->param('lon'); @@ -38,8 +45,6 @@ body { height: 100%; margin: 0px; padding: 0px } } -% my $conf = new FS::Conf; -% my $apikey = $conf->config('google_maps_api_key'); @@ -69,6 +74,12 @@ function show_route() { }); } +// function name specified by google maps api, special hook for auth errors +function gm_authFailure () { + document.body.innerHTML = +<% include('/elements/google_maps_api_key.html', autherror => 1) |js_string%>; +} + function initialize() { var myOptions = { zoom: 14, @@ -88,6 +99,8 @@ function initialize() { <%shared> my ($lat, $lon, $name, $origin); +my $conf = new FS::Conf; +my $apikey = $conf->config('google_maps_api_key'); <%init>