mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge pull request #502 from openclassify/dia
#1285 lokasyon çalışmıyor
This commit is contained in:
commit
9f764f8260
@ -18,6 +18,8 @@ return [
|
|||||||
'title' => 'visiosoft.module.advs::section.ads',
|
'title' => 'visiosoft.module.advs::section.ads',
|
||||||
'fields' => [
|
'fields' => [
|
||||||
'latest-limit',
|
'latest-limit',
|
||||||
|
'default_view_type',
|
||||||
|
'hide_zero_price',
|
||||||
'auto_approve',
|
'auto_approve',
|
||||||
'estimated_pending_time',
|
'estimated_pending_time',
|
||||||
'default_published_time',
|
'default_published_time',
|
||||||
|
|||||||
@ -14,6 +14,19 @@ return [
|
|||||||
'default_value' => 5,
|
'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' => [
|
'auto_approve' => [
|
||||||
'type' => 'anomaly.field_type.boolean',
|
'type' => 'anomaly.field_type.boolean',
|
||||||
'bind' => 'adv.auto_approve',
|
'bind' => 'adv.auto_approve',
|
||||||
|
|||||||
@ -211,8 +211,9 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".priceField, .priceDecimalField").on('change', function () {
|
$(".priceField, .priceDecimalField").on('change', function () {
|
||||||
var price = parseInt($(".priceField").val().replace(/\./g, ''));
|
let price = $(".priceField").val() === "" ? '0' : $(".priceField").val();
|
||||||
var decimal = parseInt($(".priceDecimalField").val());
|
price = parseInt(price.replace(/\./g, ''));
|
||||||
|
let decimal = parseInt($(".priceDecimalField").val());
|
||||||
$('.priceHidden').find('input').val(parseFloat(price + "." + decimal));
|
$('.priceHidden').find('input').val(parseFloat(price + "." + decimal));
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
@ -278,4 +278,7 @@ return [
|
|||||||
'part_2' => 'If not, click the "Edit" button.',
|
'part_2' => 'If not, click the "Edit" button.',
|
||||||
],
|
],
|
||||||
'views' => 'Views',
|
'views' => 'Views',
|
||||||
|
|
||||||
|
// Detail page
|
||||||
|
"no_street_view" => "No street view image in this location"
|
||||||
];
|
];
|
||||||
|
|||||||
@ -4,6 +4,13 @@ return [
|
|||||||
'auto_approve' => [
|
'auto_approve' => [
|
||||||
'name' => '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' => [
|
'estimated_pending_time' => [
|
||||||
'name' => 'Estimated Pending Time',
|
'name' => 'Estimated Pending Time',
|
||||||
'instructions' => 'In Hours',
|
'instructions' => 'In Hours',
|
||||||
|
|||||||
@ -3,27 +3,33 @@
|
|||||||
{{ trans('visiosoft.module.advs::field.no_location') }}
|
{{ trans('visiosoft.module.advs::field.no_location') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set map_arr = adv.map_Val|split(',') %}
|
{% 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>
|
<script>
|
||||||
$(document).ready(function () {
|
$(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=" + lat + "," + lng +
|
||||||
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;
|
||||||
"&fov=90&heading=235&pitch=10&key=" + google_map_key;
|
$.getJSON(ifAnyImg, function (data) {
|
||||||
$.getJSON(ifAnyImg, function (data) {
|
if (data.status === "OK") {
|
||||||
if (data.status === "OK") {
|
loadScript('https://maps.googleapis.com/maps/api/js?key={{ setting_value('visiosoft.module.location::google_map_key') }}&callback=initMap');
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
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>
|
||||||
<script>
|
<script>
|
||||||
var lat = parseFloat({{ map_arr[0] }});
|
var lat = parseFloat({{ map_arr[0] }});
|
||||||
|
|||||||
@ -288,6 +288,9 @@ class AdvsController extends PublicController
|
|||||||
|
|
||||||
public function viewTypeBasedRedirect($viewType, $compact)
|
public function viewTypeBasedRedirect($viewType, $compact)
|
||||||
{
|
{
|
||||||
|
if (!$viewType) {
|
||||||
|
$viewType = setting_value('visiosoft.module.advs::default_view_type');
|
||||||
|
}
|
||||||
if (isset($viewType) and $viewType == 'table') {
|
if (isset($viewType) and $viewType == 'table') {
|
||||||
return $this->view->make('visiosoft.module.advs::list/table', $compact);
|
return $this->view->make('visiosoft.module.advs::list/table', $compact);
|
||||||
} elseif (isset($viewType) and $viewType == 'map') {
|
} elseif (isset($viewType) and $viewType == 'map') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user