#421 geo tag moderation
This commit is contained in:
parent
6ecfd8c38a
commit
dfe514c55e
@ -1119,6 +1119,34 @@ else
|
||||
<input type="text" id="geotag@(geoIndex)_latitude" name="geotag@(geoIndex)_latitude" value="@geoTag.SuggestedLatitude" size="12" />
|
||||
<label for="geotag@(geoIndex)_longitude">طول جغرافیایی اصلاحشده:</label>
|
||||
<input type="text" id="geotag@(geoIndex)_longitude" name="geotag@(geoIndex)_longitude" value="@geoTag.SuggestedLongitude" size="12" />
|
||||
@if (geoTag.SuggestedLatitude != null && geoTag.SuggestedLongitude != null)
|
||||
{
|
||||
<!-- read-only-at-a-glance preview of the user's suggested coordinates, same Leaflet
|
||||
setup Editor.cshtml's own geotag picker uses (see _AdminLayout.cshtml for the
|
||||
leaflet.css/js includes added for this) - the marker is left draggable, and the
|
||||
map click-to-move too, so a moderator who spots a small mistake can nudge the
|
||||
coordinates visually instead of rejecting a suggestion that's otherwise fine -->
|
||||
<div id="geotag@(geoIndex)_map" style="height:220px;margin-top:8px;border:1px solid #d8cdb8;border-radius:6px;"></div>
|
||||
<p class="up-hint"><small>برای مشاهدهٔ دقیقتر یا اصلاح مختصات، نشانگر را بکشید یا روی نقشه کلیک کنید.</small></p>
|
||||
<script>
|
||||
(function () {
|
||||
var lat = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(geoTag.SuggestedLatitude));
|
||||
var lng = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(geoTag.SuggestedLongitude));
|
||||
var map = L.map('geotag@(geoIndex)_map').setView([lat, lng], 10);
|
||||
L.tileLayer.provider('OpenStreetMap').addTo(map);
|
||||
var marker = L.marker([lat, lng], { draggable: true }).addTo(map);
|
||||
function syncFieldsFromMarker(latlng) {
|
||||
document.getElementById('geotag@(geoIndex)_latitude').value = latlng.lat;
|
||||
document.getElementById('geotag@(geoIndex)_longitude').value = latlng.lng;
|
||||
}
|
||||
marker.on('dragend', function () { syncFieldsFromMarker(marker.getLatLng()); });
|
||||
map.on('click', function (e) {
|
||||
marker.setLatLng(e.latlng);
|
||||
syncFieldsFromMarker(e.latlng);
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</td>
|
||||
|
||||
@ -14,9 +14,12 @@
|
||||
<link href="/dist/skin/blue.monday/css/jplayer.blue.monday.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="~/css/p8.css" asp-append-version="true" rel="stylesheet" type="text/css" />
|
||||
<link href="~/css/user-panel.css" asp-append-version="true" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" href="/css/leaflet.css?version=2">
|
||||
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/js/leaflet.js"></script>
|
||||
<script src="~/js/leaflet-providers.js"></script>
|
||||
<script src="/lib/diff.js"></script>
|
||||
<script src="/lib/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user