Add option to disable map #1223

This commit is contained in:
Hillel Coren 2016-12-25 09:57:33 +02:00
parent 183592e551
commit 5f39ec1162
5 changed files with 23 additions and 6 deletions

View File

@ -46,6 +46,7 @@ API_SECRET=password
#GOOGLE_CLIENT_SECRET=
#GOOGLE_OAUTH_REDIRECT=http://ninja.dev/auth/google
GOOGLE_MAPS_ENABLED=true
#GOOGLE_MAPS_API_KEY=
#S3_KEY=

View File

@ -379,6 +379,14 @@ class Client extends EntityModel
return ENTITY_CLIENT;
}
/**
* @return bool
*/
public function showMap()
{
return $this->hasAddress() && env('GOOGLE_MAPS_ENABLED') !== false;
}
/**
* @return bool
*/

View File

@ -267,6 +267,14 @@ class Vendor extends EntityModel
return 'vendor';
}
/**
* @return bool
*/
public function showMap()
{
return $this->hasAddress() && env('GOOGLE_MAPS_ENABLED') !== false;
}
/**
* @return bool
*/

View File

@ -6,7 +6,7 @@
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
@if ($client->hasAddress())
@if ($client->showMap())
<style>
#map {
width: 100%;
@ -186,7 +186,7 @@
</div>
</div>
@if ($client->hasAddress())
@if ($client->showMap())
<div id="map"></div>
<br/>
@endif
@ -332,7 +332,7 @@
});
}
@if ($client->hasAddress())
@if ($client->showMap())
function initialize() {
var mapCanvas = document.getElementById('map');
var mapOptions = {

View File

@ -6,7 +6,7 @@
<script src="{{ asset('js/select2.min.js') }}" type="text/javascript"></script>
<link href="{{ asset('css/select2.css') }}" rel="stylesheet" type="text/css"/>
@if ($vendor->hasAddress())
@if ($vendor->showMap())
<style>
#map {
width: 100%;
@ -167,7 +167,7 @@
</div>
</div>
@if ($vendor->hasAddress())
@if ($vendor->showMap())
<div id="map"></div>
<br/>
@endif
@ -219,7 +219,7 @@
}
}
@if ($vendor->hasAddress())
@if ($vendor->showMap())
function initialize() {
var mapCanvas = document.getElementById('map');
var mapOptions = {