From b623bc74568c3ccca7714433b9df7fd3b894fc66 Mon Sep 17 00:00:00 2001 From: Kavalar Date: Fri, 20 Mar 2026 19:36:26 +0300 Subject: [PATCH] vacancy detail SEO --- templates/vacancy_detail.html | 411 ++++++++-------------------------- 1 file changed, 90 insertions(+), 321 deletions(-) diff --git a/templates/vacancy_detail.html b/templates/vacancy_detail.html index 4dadbff..abbda72 100644 --- a/templates/vacancy_detail.html +++ b/templates/vacancy_detail.html @@ -4,10 +4,10 @@ - + Вакансия | Rabota.Today - + @@ -33,46 +33,17 @@ - + - - - + QR-код вакансии + +

${escapeHtml(decodedTitle)}

${escapeHtml(decodedCompany)}

${window.location.origin}/vacancy/${vacancyId}
- - + `); printWindow.document.close(); printWindow.focus(); @@ -1442,60 +1240,31 @@ const url = window.location.origin + '/vacancy/' + vacancyId; const decodedTitle = decodeHtmlEntities(currentVacancy.title); const text = `Вакансия: ${decodedTitle} на Rabota.Today`; - let shareUrl = ''; - switch(platform) { - case 'whatsapp': shareUrl = `https://wa.me/?text=${encodeURIComponent(text + ' ' + url)}`; break; - case 'telegram': shareUrl = `https://t.me/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; break; - case 'email': shareUrl = `mailto:?subject=${encodeURIComponent('Вакансия ' + decodedTitle)}&body=${encodeURIComponent(text + '\n\n' + url)}`; break; - } + if (platform === 'whatsapp') shareUrl = `https://wa.me/?text=${encodeURIComponent(text + ' ' + url)}`; + else if (platform === 'telegram') shareUrl = `https://t.me/share/url?url=${encodeURIComponent(url)}&text=${encodeURIComponent(text)}`; + else if (platform === 'email') shareUrl = `mailto:?subject=${encodeURIComponent('Вакансия ' + decodedTitle)}&body=${encodeURIComponent(text + '\n\n' + url)}`; if (shareUrl) window.open(shareUrl, '_blank'); } async function applyForVacancy() { const token = localStorage.getItem('accessToken'); if (!token) { redirectToLogin(); return; } - try { - const response = await fetch(`${API_BASE_URL}/vacancies/${vacancyId}/apply`, { - method: 'POST', - headers: { 'Authorization': `Bearer ${token}` } - }); - if (response.ok) { - showNotification('Отклик отправлен! Работодатель свяжется с вами.', 'success'); - loadVacancy(); - } else { - const error = await response.json(); - throw new Error(error.detail || 'Ошибка отправки'); - } - } catch (error) { - showNotification(error.message, 'error'); - } + const response = await fetch(`${API_BASE_URL}/vacancies/${vacancyId}/apply`, { method: 'POST', headers: { 'Authorization': `Bearer ${token}` } }); + if (response.ok) { showNotification('Отклик отправлен! Работодатель свяжется с вами.', 'success'); loadVacancy(); } + else { const error = await response.json(); throw new Error(error.detail || 'Ошибка отправки'); } + } catch (error) { showNotification(error.message, 'error'); } } function saveToFavorites() { const token = localStorage.getItem('accessToken'); - if (!token) { - if (confirm('Для добавления в избранное нужно войти в систему. Перейти на страницу входа?')) { - window.location.href = '/login'; - } - return; - } + if (!token) { if (confirm('Для добавления в избранное нужно войти в систему. Перейти на страницу входа?')) { window.location.href = '/login'; } return; } showNotification('Вакансия добавлена в избранное', 'success'); } function redirectToLogin() { - if (confirm('Для отклика нужно войти в систему. Перейти на страницу входа?')) { - window.location.href = '/login'; - } - } - - function showNotification(message, type = 'info') { - const notification = document.getElementById('notification'); - notification.className = `notification ${type}`; - notification.innerHTML = message; - notification.style.display = 'block'; - setTimeout(() => { notification.style.display = 'none'; }, 3000); + if (confirm('Для отклика нужно войти в систему. Перейти на страницу входа?')) { window.location.href = '/login'; } } window.onclick = function(event) {