';
+ container.innerHTML = html;
+ }
+
+ function removeGeoDateTagSuggestion(index) {
+ geoDateTagSuggestions.splice(index, 1);
+ renderPendingGeoDateTags();
+ }
+
+ function requestDeleteExistingGeoDateTag(existingTagId, el) {
+ geoDateTagSuggestions.push({
+ markForDelete: true,
+ existingTagId: existingTagId
+ });
+ $(el).closest('tr').hide();
+ renderPendingGeoDateTags();
+ }
+
+ function addGeoDateTagSuggestion() {
+ var locationId = $('#geotag-location-select').val();
+ var newLocationName = $('#geotag-new-location-name').val();
+ var newLocationLat = $('#geotag-new-location-lat').val();
+ var newLocationLng = $('#geotag-new-location-lng').val();
+ var year = $('#geotag-year').val();
+ var month = $('#geotag-month').val();
+ var day = $('#geotag-day').val();
+
+ var hasLocation = (locationId && locationId != '') || (newLocationName && newLocationLat && newLocationLng);
+ var hasDate = year && year != '';
+
+ if (!hasLocation && !hasDate) {
+ upToast('لطفاً حداقل یک مکان یا سال وارد کنید.', 'error');
+ return;
+ }
+
+ geoDateTagSuggestions.push({
+ markForDelete: false,
+ locationId: (locationId && locationId != '') ? parseInt(locationId) : null,
+ suggestedLocationName: (!locationId || locationId == '') ? (newLocationName || null) : null,
+ suggestedLatitude: (!locationId || locationId == '') && newLocationLat ? parseFloat(newLocationLat) : null,
+ suggestedLongitude: (!locationId || locationId == '') && newLocationLng ? parseFloat(newLocationLng) : null,
+ lunarYear: year ? parseInt(year) : null,
+ lunarMonth: month ? parseInt(month) : null,
+ lunarDay: day ? parseInt(day) : null,
+ ignoreInCategory: $('#geotag-ignore-in-category').is(':checked'),
+ suggestionNote: $('#geotag-note').val() || null
+ });
+
+ // reset the form for the next entry
+ $('#geotag-location-select').val('');
+ $('#geotag-new-location-name').val('');
+ $('#geotag-new-location-lat').val('');
+ $('#geotag-new-location-lng').val('');
+ $('#geotag-year').val('');
+ $('#geotag-month').val('');
+ $('#geotag-day').val('');
+ $('#geotag-ignore-in-category').prop('checked', false);
+ $('#geotag-note').val('');
+ if (geoDateTagMarker != null && geoDateTagMap != null) {
+ geoDateTagMap.removeLayer(geoDateTagMarker);
+ geoDateTagMarker = null;
+ }
+
+ renderPendingGeoDateTags();
+ upToast('به فهرست پیشنهادها افزوده شد. برای ثبت نهایی، دکمهٔ «ذخیره» را بزنید.');
+ }
+
function savePoemCorrections(id, verseCount) {
var verseOrderText = [];
var verseOrderMarkedForDelete = [];
@@ -173,7 +282,7 @@
section_format = null;
}
- if (verseOrderText.length == 0 && verseOrderSummaries.length == 0) {
+ if (verseOrderText.length == 0 && verseOrderSummaries.length == 0 && geoDateTagSuggestions.length == 0) {
if (rhythm_new == null && rhythm_new2 == null && rhyme_letters == null && section_format == null) {
upToast('شما هیچ تغییری در اطلاعات ندادهاید!', 'error');
return;
@@ -196,6 +305,7 @@
pcs.verseLanguages = verseLanguages;
pcs.note = $('#note').val();
pcs.hideMyName = $('#hide-my-name').is(":checked");
+ pcs.geoDateTags = geoDateTagSuggestions;
var url = '?handler=SendPoemCorrections';
@@ -1526,6 +1636,156 @@ else
+
+
🗺️ برچسبهای زمان و مکان (پیشنهادی)
+
میتوانید پیشنهاد دهید که این شعر به مکان یا تاریخ خاصی اشاره دارد. پیشنهادهای شما پس از بررسی ناظران اعمال خواهد شد. با دکمهٔ «ذخیره» بالا همراه با بقیهٔ تغییرات ثبت میشود.