Aleksmorshen commited on
Commit
93455ab
·
verified ·
1 Parent(s): e03e6ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -250,11 +250,8 @@ html_template = '''
250
  const button = document.createElement('button');
251
  button.textContent = 'Добавить метку';
252
  button.onclick = function() {
253
- const markerName = inputName.value;
254
- const markerDescription = inputDescription.value;
255
- const markerTelegram = inputTelegram.value;
256
- if (markerName && markerTelegram) {
257
- addMarker(markerName, markerDescription, markerTelegram, e.latlng);
258
  map.closePopup(); // Закрыть всплывающее окно после добавления
259
  } else {
260
  alert('Пожалуйста, заполните все обязательные поля.');
@@ -369,7 +366,7 @@ def search_markers():
369
  conn = sqlite3.connect('markers.db')
370
  cursor = conn.cursor()
371
  cursor.execute('''SELECT id, name, description, telegram_link, latitude, longitude FROM markers
372
- WHERE LOWER(name) LIKE ? OR LOWER(description) LIKE ?''',
373
  (f'%{query}%', f'%{query}%'))
374
  markers = cursor.fetchall()
375
  conn.close()
 
250
  const button = document.createElement('button');
251
  button.textContent = 'Добавить метку';
252
  button.onclick = function() {
253
+ if (inputName.value && inputDescription.value && inputTelegram.value) {
254
+ addMarker(inputName.value, inputDescription.value, inputTelegram.value, e.latlng);
 
 
 
255
  map.closePopup(); // Закрыть всплывающее окно после добавления
256
  } else {
257
  alert('Пожалуйста, заполните все обязательные поля.');
 
366
  conn = sqlite3.connect('markers.db')
367
  cursor = conn.cursor()
368
  cursor.execute('''SELECT id, name, description, telegram_link, latitude, longitude FROM markers
369
+ WHERE LOWER(name) LIKE ? COLLATE NOCASE OR LOWER(description) LIKE ? COLLATE NOCASE''',
370
  (f'%{query}%', f'%{query}%'))
371
  markers = cursor.fetchall()
372
  conn.close()