benjamin5607 commited on
Commit
1b01ba6
Β·
verified Β·
1 Parent(s): cf54277

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -81,7 +81,7 @@ db_json_str = json.dumps(PLACE_DB, ensure_ascii=False)
81
  db_base64 = base64.b64encode(db_json_str.encode('utf-8')).decode('utf-8')
82
 
83
  # ==========================================
84
- # πŸ–₯️ 3. 톡합 ν”„λ‘ νŠΈμ—”λ“œ (리뷰 ν”„λ‘¬ν”„νŠΈ λŒ€ν­ κ°•ν™”)
85
  # ==========================================
86
  html_template = """
87
  <!DOCTYPE html>
@@ -131,7 +131,7 @@ html_template = """
131
  .review-content-box { flex: 1; overflow-y: auto; padding: 20px; }
132
  .review-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
133
  .review-title { font-size: 24px; font-weight: bold; color: var(--gold); margin-bottom: 5px; }
134
- .review-body { font-size: 15px; line-height: 1.8; color: #e0e0e0; font-family: 'Segoe UI', sans-serif; text-align: left; }
135
  .review-signature { text-align: right; margin-top: 20px; color: var(--gold); font-weight: bold; }
136
  .detail-actions { display: flex; gap: 10px; margin-top: 20px; }
137
  .detail-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; text-transform: uppercase; }
@@ -387,7 +387,8 @@ html_template = """
387
  }
388
  if(found) {
389
  const mapUrl = getMapUrl(found, fCountry);
390
- finalHtml += `<br><button class="reco-btn" onclick="markVisited('${found.name}'); window.open('${mapUrl}', '_blank')">πŸ“ ${TRANSLATIONS[currentLang].mapBtn}: ${pName}</button>`;
 
391
  }
392
  }
393
  addChatMessage(finalHtml, 'bot', true);
@@ -510,7 +511,6 @@ html_template = """
510
  const contextDesc = placeData ? (placeData['desc_'+currentLang.toLowerCase()] || placeData.desc_ko) : "";
511
  const addressInfo = placeData.address || "Address not available";
512
 
513
- // --- [NEW LOGIC] Dual Strategy: Korea (Internal) vs World (External Simulation) ---
514
  let searchStrategy = "";
515
  if (c.includes("Korea") || c.includes("ν•œκ΅­")) {
516
  searchStrategy = "SOURCE: Strictly base your review on the provided [CONTEXT] and your general knowledge of Korean geography. Do not hallucinate.";
@@ -547,7 +547,6 @@ html_template = """
547
  </html>
548
  """
549
 
550
- # μ—¬κΈ°κ°€ μ€‘μš”ν•©λ‹ˆλ‹€! μœ„μ—μ„œ """둜 λ‹«μ•„μ€˜μ•Ό 파이썬 μ½”λ“œκ°€ μ΄μ–΄μ§‘λ‹ˆλ‹€.
551
  html_code = html_template.replace("IMAGE_DATA", f"data:image/jpeg;base64,{emily_base64}")
552
  html_code = html_code.replace("DB_DATA_BASE64", db_base64)
553
  html_code = html_code.replace("GROQ_KEY_INJECTED", GROQ_API_KEY)
 
81
  db_base64 = base64.b64encode(db_json_str.encode('utf-8')).decode('utf-8')
82
 
83
  # ==========================================
84
+ # πŸ–₯️ 3. 톡합 ν”„λ‘ νŠΈμ—”λ“œ (λ²„νŠΌ 클릭 μ—λŸ¬ ν•€ν¬μΈνŠΈ μˆ˜μ •)
85
  # ==========================================
86
  html_template = """
87
  <!DOCTYPE html>
 
131
  .review-content-box { flex: 1; overflow-y: auto; padding: 20px; }
132
  .review-header { text-align: center; margin-bottom: 20px; border-bottom: 1px solid #333; padding-bottom: 15px; }
133
  .review-title { font-size: 24px; font-weight: bold; color: var(--gold); margin-bottom: 5px; }
134
+ .review-body { font-size: 16px; line-height: 1.8; color: #e0e0e0; font-family: 'Georgia', serif; font-style: italic; text-align: justify; }
135
  .review-signature { text-align: right; margin-top: 20px; color: var(--gold); font-weight: bold; }
136
  .detail-actions { display: flex; gap: 10px; margin-top: 20px; }
137
  .detail-btn { flex: 1; padding: 12px; border-radius: 10px; border: none; font-weight: bold; cursor: pointer; font-size: 14px; text-transform: uppercase; }
 
387
  }
388
  if(found) {
389
  const mapUrl = getMapUrl(found, fCountry);
390
+ // [μˆ˜μ •] μ±—λ΄‡μ˜ μΆ”μ²œ λ²„νŠΌμ—μ„œλ„ markVisited κΈ°λŠ₯ 제거 (일관성 μœ μ§€)
391
+ finalHtml += `<br><button class="reco-btn" onclick="openReview('${found.name.replace(/'/g, "\\\\'")}', '${fCountry}')">πŸ“ ${TRANSLATIONS[currentLang].mapBtn}: ${pName}</button>`;
392
  }
393
  }
394
  addChatMessage(finalHtml, 'bot', true);
 
511
  const contextDesc = placeData ? (placeData['desc_'+currentLang.toLowerCase()] || placeData.desc_ko) : "";
512
  const addressInfo = placeData.address || "Address not available";
513
 
 
514
  let searchStrategy = "";
515
  if (c.includes("Korea") || c.includes("ν•œκ΅­")) {
516
  searchStrategy = "SOURCE: Strictly base your review on the provided [CONTEXT] and your general knowledge of Korean geography. Do not hallucinate.";
 
547
  </html>
548
  """
549
 
 
550
  html_code = html_template.replace("IMAGE_DATA", f"data:image/jpeg;base64,{emily_base64}")
551
  html_code = html_code.replace("DB_DATA_BASE64", db_base64)
552
  html_code = html_code.replace("GROQ_KEY_INJECTED", GROQ_API_KEY)