Merge pull request #502 from openclassify/dia

#1285 lokasyon çalışmıyor
This commit is contained in:
Ozcan Durak 2020-04-20 19:06:45 +03:00 committed by GitHub
commit 9f764f8260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 18 deletions

View File

@ -18,6 +18,8 @@ return [
'title' => 'visiosoft.module.advs::section.ads',
'fields' => [
'latest-limit',
'default_view_type',
'hide_zero_price',
'auto_approve',
'estimated_pending_time',
'default_published_time',

View File

@ -14,6 +14,19 @@ return [
'default_value' => 5,
],
],
'default_view_type' => [
'type' => 'anomaly.field_type.select',
'config' => [
'options' => ['list' => 'List', 'table' => 'Table', 'map' => 'Map', 'gallery' => 'Gallery'],
'default_value' => 'list',
]
],
'hide_zero_price' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
],
],
'auto_approve' => [
'type' => 'anomaly.field_type.boolean',
'bind' => 'adv.auto_approve',

View File

@ -211,8 +211,9 @@ $(document).ready(function () {
});
$(".priceField, .priceDecimalField").on('change', function () {
var price = parseInt($(".priceField").val().replace(/\./g, ''));
var decimal = parseInt($(".priceDecimalField").val());
let price = $(".priceField").val() === "" ? '0' : $(".priceField").val();
price = parseInt(price.replace(/\./g, ''));
let decimal = parseInt($(".priceDecimalField").val());
$('.priceHidden').find('input').val(parseFloat(price + "." + decimal));
})
});

View File

@ -278,4 +278,7 @@ return [
'part_2' => 'If not, click the "Edit" button.',
],
'views' => 'Views',
// Detail page
"no_street_view" => "No street view image in this location"
];

View File

@ -4,6 +4,13 @@ return [
'auto_approve' => [
'name' => 'Auto Approve',
],
'default_view_type' => [
'name' => 'Default View Type',
],
'hide_zero_price' => [
'name' => 'Hide Price if Zero',
'instructions' => 'Hide the price if the ad price is 0',
],
'estimated_pending_time' => [
'name' => 'Estimated Pending Time',
'instructions' => 'In Hours',

View File

@ -3,27 +3,33 @@
{{ trans('visiosoft.module.advs::field.no_location') }}
{% else %}
{% set map_arr = adv.map_Val|split(',') %}
<div id="mapDiv" style="height: 500px; width: 100%; "></div>
<div id="mapDiv" style="height: 500px; width: 100%;"></div>
<script>
$(document).ready(function () {
var no_image_text = "{{ trans('visiosoft.module.streetview::field.no_location') }}";
var no_image_text = "{{ trans('visiosoft.module.advs::field.no_street_view') }}";
if (typeof coord !== 'undefined') {
var ifAnyImg = "https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=" + coord[0] + "," + coord[1] +
"&fov=90&heading=235&pitch=10&key=" + google_map_key;
$.getJSON(ifAnyImg, function (data) {
if (data.status === "OK") {
loadScript('https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap');
}
if (data.status === "ZERO_RESULTS") {
$("#mapDiv").html(no_image_text);
} else {
$("#mapDiv").html("Google Error : " + data.error_message);
}
var ifAnyImg = "https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=" + lat + "," + lng +
"&fov=90&heading=235&pitch=10&key=" + google_map_key;
$.getJSON(ifAnyImg, function (data) {
if (data.status === "OK") {
loadScript('https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap');
}
)
}
if (data.status === "ZERO_RESULTS") {
$("#mapDiv").html(no_image_text);
} else {
$("#mapDiv").html("Google Error : " + data.error_message);
}
}
)
});
function loadScript(src, callback) {
var script = document.createElement("script");
script.type = "text/javascript";
if (callback) script.onload = callback;
document.getElementsByTagName("head")[0].appendChild(script);
script.src = src;
}
</script>
<script>
var lat = parseFloat({{ map_arr[0] }});

View File

@ -288,6 +288,9 @@ class AdvsController extends PublicController
public function viewTypeBasedRedirect($viewType, $compact)
{
if (!$viewType) {
$viewType = setting_value('visiosoft.module.advs::default_view_type');
}
if (isset($viewType) and $viewType == 'table') {
return $this->view->make('visiosoft.module.advs::list/table', $compact);
} elseif (isset($viewType) and $viewType == 'map') {