Fix service detail buttons and improve career page benefit cards visibility
Some checks failed
continuous-integration/drone/push Build is failing

- Fixed service detail modal buttons not working on /service/4/ pages
- Updated service request form to use modern Bootstrap modal
- Enhanced service_detail view to handle new form fields properly
- Added beautiful glassmorphism cards for career benefits section
- Improved text visibility with shadows and contrasting backgrounds
- Added hover animations and responsive design for benefit cards
- Updated career page CSS with modern card designs and effects
This commit is contained in:
2025-11-25 17:38:26 +09:00
parent 9839389fc9
commit 614c26edbc
6 changed files with 421 additions and 56 deletions

View File

@@ -29,7 +29,7 @@
<link rel="manifest" href="/static/manifest.json"> <link rel="manifest" href="/static/manifest.json">
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' fill='%236366f1'/><text y='70' font-size='60' fill='white' font-family='Arial,sans-serif' text-anchor='middle' x='50'>S</text></svg>">> <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' fill='%236366f1'/><text y='70' font-size='60' fill='white' font-family='Arial,sans-serif' text-anchor='middle' x='50'>S</text></svg>">
<title>{% block title %}SmartSolTech - Современные IT-решения{% endblock %}</title> <title>{% block title %}SmartSolTech - Современные IT-решения{% endblock %}</title>

View File

@@ -5,33 +5,33 @@
{% block content %} {% block content %}
<!-- Hero Section --> <!-- Hero Section -->
<section class="hero-simple bg-gradient text-white"> <section class="hero-simple bg-dark-gradient text-white">
<div class="container-modern text-center py-5"> <div class="container-modern text-center py-5">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-lg-8"> <div class="col-lg-8">
<h1 class="display-4 fw-bold mb-4">Карьера в SmartSolTech</h1> <h1 class="display-4 fw-bold mb-4 text-white">Карьера в SmartSolTech</h1>
<p class="lead opacity-90"> <p class="lead opacity-90 text-light">
Развивайтесь вместе с нами в мире инновационных технологий Развивайтесь вместе с нами в мире инновационных технологий
</p> </p>
{% if total_positions > 0 %} {% if total_positions > 0 %}
<div class="career-stats mt-4"> <div class="career-stats mt-4">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-auto"> <div class="col-auto">
<div class="stat-item"> <div class="stat-item stat-item-dark">
<div class="stat-number">{{ total_positions }}</div> <div class="stat-number text-white">{{ total_positions }}</div>
<div class="stat-label">Открытых позиций</div> <div class="stat-label text-light">Открытых позиций</div>
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="stat-item"> <div class="stat-item stat-item-dark">
<div class="stat-number">{{ departments|length }}</div> <div class="stat-number text-white">{{ departments|length }}</div>
<div class="stat-label">Отделов</div> <div class="stat-label text-light">Отделов</div>
</div> </div>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="stat-item"> <div class="stat-item stat-item-dark">
<div class="stat-number">{{ featured_careers|length }}</div> <div class="stat-number text-white">{{ featured_careers|length }}</div>
<div class="stat-label">Топ вакансий</div> <div class="stat-label text-light">Топ вакансий</div>
</div> </div>
</div> </div>
</div> </div>
@@ -308,10 +308,33 @@
<style> <style>
/* Career Styles */ /* Career Styles */
.hero-simple { .hero-simple {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
min-height: 350px; min-height: 350px;
display: flex; display: flex;
align-items: center; align-items: center;
position: relative;
overflow: hidden;
}
.bg-dark-gradient {
background: linear-gradient(135deg, #2d3748 0%, #4a5568 50%, #1a202c 100%) !important;
position: relative;
}
.bg-dark-gradient::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(45deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
z-index: 1;
}
.bg-dark-gradient > .container-modern {
position: relative;
z-index: 2;
} }
.career-stats { .career-stats {
@@ -323,17 +346,34 @@
border-radius: 15px; border-radius: 15px;
padding: 20px; padding: 20px;
margin: 0 15px; margin: 0 15px;
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
transition: all 0.3s ease;
}
.stat-item-dark {
background: rgba(45, 55, 72, 0.8) !important;
border: 1px solid rgba(102, 126, 234, 0.3);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.stat-item:hover {
transform: translateY(-5px);
background: rgba(102, 126, 234, 0.2);
border-color: rgba(102, 126, 234, 0.5);
} }
.stat-number { .stat-number {
font-size: 2.5rem; font-size: 2.5rem;
font-weight: bold; font-weight: bold;
color: white; color: white !important;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
} }
.stat-label { .stat-label {
font-size: 0.9rem; font-size: 0.9rem;
opacity: 0.9; opacity: 0.9;
color: #e2e8f0 !important;
} }
.career-card-featured { .career-card-featured {
@@ -538,18 +578,70 @@
} }
.benefit-item { .benefit-item {
padding: 20px; padding: 30px 20px;
background: rgba(255, 255, 255, 0.15);
border-radius: 20px;
backdrop-filter: blur(15px);
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
transition: all 0.4s ease;
text-align: center;
position: relative;
overflow: hidden;
}
.benefit-item::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
border-radius: 20px;
z-index: 1;
}
.benefit-item:hover {
transform: translateY(-10px);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
background: rgba(255, 255, 255, 0.25);
border-color: rgba(255, 255, 255, 0.4);
}
.benefit-item > * {
position: relative;
z-index: 2;
} }
.benefit-item i { .benefit-item i {
font-size: 2.5rem; font-size: 3rem;
margin-bottom: 1rem; margin-bottom: 1.5rem;
color: rgba(255, 255, 255, 0.9); color: #ffffff;
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
transition: all 0.3s ease;
}
.benefit-item:hover i {
transform: scale(1.1);
color: #f8f9fa;
} }
.benefit-item h5 { .benefit-item h5 {
color: white; color: #ffffff;
margin-bottom: 0.5rem; margin-bottom: 1rem;
font-weight: 600;
font-size: 1.25rem;
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
letter-spacing: 0.5px;
}
.benefit-item p {
color: #f8f9fa !important;
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
font-size: 0.9rem;
line-height: 1.5;
margin-bottom: 0;
} }
/* Responsive */ /* Responsive */
@@ -587,6 +679,26 @@
font-size: 0.8rem; font-size: 0.8rem;
padding: 6px 15px; padding: 6px 15px;
} }
/* Mobile styles for benefit items */
.benefit-item {
padding: 25px 15px;
margin-bottom: 20px;
}
.benefit-item i {
font-size: 2.5rem;
margin-bottom: 1rem;
}
.benefit-item h5 {
font-size: 1.1rem;
}
.benefit-item p {
font-size: 0.85rem;
}
}
} }
</style> </style>
{% endblock %} {% endblock %}

View File

@@ -608,7 +608,7 @@ document.addEventListener('DOMContentLoaded', function() {
</div> </div>
<div class="text-center mt-5"> <div class="text-center mt-5">
<a href="{% url 'about' %}#career" class="btn btn-outline-primary btn-lg"> <a href="{% url 'career' %}" class="btn btn-outline-primary btn-lg">
<i class="fas fa-briefcase me-2"></i> <i class="fas fa-briefcase me-2"></i>
Все вакансии Все вакансии
</a> </a>

View File

@@ -163,10 +163,10 @@
<!-- Mobile Preview --> <!-- Mobile Preview -->
<div class="mobile-preview position-absolute bg-white rounded-4 p-3 shadow" <div class="mobile-preview position-absolute bg-white rounded-4 p-3 shadow"
style="transform: rotate(10deg); top: 50px; right: 50px; width: 200px;"> style="transform: rotate(10deg); top: 50px; right: 50px; width: 200px;">
<div class="bg-gradient rounded-3 p-3 text-white text-center"> <div class="bg-light rounded-3 p-3 text-dark text-center" style="background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;">
<i class="fas fa-mobile-alt fa-3x mb-2"></i> <i class="fas fa-mobile-alt fa-3x mb-2 text-primary"></i>
<h6 class="mb-1">Мобильные</h6> <h6 class="mb-1 text-dark fw-bold">Мобильные</h6>
<p class="small mb-0 opacity-75">приложения</p> <p class="small mb-0 text-muted">приложения</p>
</div> </div>
</div> </div>
@@ -353,7 +353,7 @@
<i class="fas fa-comments me-2"></i> <i class="fas fa-comments me-2"></i>
Получить консультацию Получить консультацию
</a> </a>
<a href="tel:+82-10-XXXX-XXXX" class="btn btn-outline-light btn-lg"> <a href="tel:+82-10-XXXX-XXXX" class="btn btn-light btn-lg" style="background: rgba(255,255,255,0.9); color: #2d3748; border: 2px solid rgba(255,255,255,0.3);">
<i class="fas fa-phone me-2"></i> <i class="fas fa-phone me-2"></i>
Позвонить сейчас Позвонить сейчас
</a> </a>

View File

@@ -110,9 +110,11 @@
<!-- Action Buttons --> <!-- Action Buttons -->
<div class="d-flex gap-3"> <div class="d-flex gap-3">
<button id="openModalBtn" <button type="button"
class="btn btn-primary-modern btn-lg" class="btn btn-primary-modern btn-lg"
data-service-id="{{ service.id }}"> data-bs-toggle="modal"
data-bs-target="#serviceModal"
onclick="openServiceModal({{ service.id }}, '{{ service.name|addslashes }}')">
<i class="fas fa-paper-plane me-2"></i> <i class="fas fa-paper-plane me-2"></i>
Заказать услугу Заказать услугу
</button> </button>
@@ -326,9 +328,11 @@
Получите бесплатную консультацию и расчет стоимости Получите бесплатную консультацию и расчет стоимости
</p> </p>
<div class="d-flex flex-wrap gap-3 justify-content-center"> <div class="d-flex flex-wrap gap-3 justify-content-center">
<button class="btn btn-light btn-lg text-primary" <button type="button"
data-service-id="{{ service.id }}" class="btn btn-light btn-lg text-primary"
onclick="document.getElementById('openModalBtn').click()"> data-bs-toggle="modal"
data-bs-target="#serviceModal"
onclick="openServiceModal({{ service.id }}, '{{ service.name|addslashes }}')">
<i class="fas fa-paper-plane me-2"></i> <i class="fas fa-paper-plane me-2"></i>
Заказать {{ service.name }} Заказать {{ service.name }}
</button> </button>
@@ -349,8 +353,101 @@
{% block extra_scripts %} {% block extra_scripts %}
<!-- Service detail scripts --> <!-- Service detail scripts -->
<script src="{% static 'assets/js/get-csrf-token.js' %}"></script> <script src="{% static 'assets/js/get-csrf-token.js' %}"></script>
<script src="{% static 'assets/js/service_request.js' %}"></script>
<script src="{% static 'assets/js/verification_status.js' %}"></script> <script>
// Service modal function - updated for Bootstrap 5
function openServiceModal(serviceId, serviceName) {
console.log("Opening modal for service:", serviceId, serviceName);
// Set service ID in hidden field
const serviceIdInput = document.getElementById('serviceId');
if (serviceIdInput) {
serviceIdInput.value = serviceId;
}
// Update modal title
const modalTitle = document.getElementById('serviceModalLabel');
if (modalTitle) {
modalTitle.innerHTML = '<i class="fas fa-paper-plane me-2"></i>Заказать услугу: ' + serviceName;
}
}
// Enhanced form submission handling
document.addEventListener('DOMContentLoaded', function() {
const form = document.getElementById('serviceRequestForm');
if (form) {
form.addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const submitBtn = document.querySelector('button[type="submit"][form="serviceRequestForm"]');
const originalContent = submitBtn.innerHTML;
// Show loading state
submitBtn.innerHTML = '<i class="fas fa-spinner fa-spin me-2"></i>Отправляем...';
submitBtn.disabled = true;
// Get CSRF token
const csrfToken = document.querySelector('[name=csrfmiddlewaretoken]').value;
// Prepare data for submission
const serviceId = document.getElementById('serviceId').value;
const clientData = {
service_id: serviceId,
first_name: formData.get('first_name'),
last_name: formData.get('last_name'),
email: formData.get('email'),
phone: formData.get('phone'),
description: formData.get('description'),
budget: formData.get('budget'),
timeline: formData.get('timeline')
};
// Submit to server
fetch(`/service/request/${serviceId}/`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfToken
},
body: JSON.stringify(clientData)
})
.then(response => response.json())
.then(data => {
if (data.success) {
// Show success animation
document.querySelector('.modal-body form').style.display = 'none';
document.getElementById('successSection').style.display = 'block';
// Close modal after delay
setTimeout(() => {
const modal = bootstrap.Modal.getInstance(document.getElementById('serviceModal'));
if (modal) {
modal.hide();
}
// Reset form
form.reset();
document.querySelector('.modal-body form').style.display = 'block';
document.getElementById('successSection').style.display = 'none';
}, 3000);
} else {
alert('Ошибка при отправке заявки: ' + (data.message || 'Попробуйте позже'));
}
})
.catch(error => {
console.error('Error:', error);
alert('Ошибка при отправке заявки. Попробуйте позже.');
})
.finally(() => {
// Reset button
submitBtn.innerHTML = originalContent;
submitBtn.disabled = false;
});
});
}
});
</script>
<style> <style>
.timeline-modern { .timeline-modern {
@@ -413,6 +510,134 @@
text-align: center; text-align: center;
} }
/* Success Animation Styles */
.success-checkmark {
width: 80px;
height: 80px;
border-radius: 50%;
display: block;
stroke-width: 2;
stroke: #4CAF50;
stroke-miterlimit: 10;
margin: 0 auto;
box-shadow: inset 0px 0px 0px #4CAF50;
animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
position: relative;
}
.success-checkmark .check-icon {
width: 80px;
height: 80px;
position: absolute;
border-radius: 50%;
box-sizing: content-box;
border: 4px solid #4CAF50;
}
.success-checkmark .check-icon::before {
top: 3px;
left: -2px;
width: 30px;
transform-origin: 100% 50%;
border-radius: 100px 0 0 100px;
}
.success-checkmark .check-icon::after {
top: 0;
left: 30px;
width: 60px;
transform-origin: 0 50%;
border-radius: 0 100px 100px 0;
animation: rotate-circle 4.25s ease-in;
}
.success-checkmark .check-icon::before, .success-checkmark .check-icon::after {
content: '';
height: 100px;
position: absolute;
background: #FFFFFF;
transform: rotate(-45deg);
}
.success-checkmark .icon-line {
height: 5px;
background-color: #4CAF50;
display: block;
border-radius: 2px;
position: absolute;
z-index: 10;
}
.success-checkmark .icon-line.line-tip {
top: 46px;
left: 14px;
width: 25px;
transform: rotate(45deg);
animation: icon-line-tip 0.75s;
}
.success-checkmark .icon-line.line-long {
top: 38px;
right: 8px;
width: 47px;
transform: rotate(-45deg);
animation: icon-line-long 0.75s;
}
.success-checkmark .icon-circle {
top: -4px;
left: -4px;
z-index: 10;
width: 80px;
height: 80px;
border-radius: 50%;
position: absolute;
box-sizing: content-box;
border: 4px solid rgba(76, 175, 80, .5);
}
.success-checkmark .icon-fix {
top: 8px;
width: 5px;
left: 26px;
z-index: 1;
height: 85px;
position: absolute;
transform: rotate(-45deg);
background-color: #FFFFFF;
}
@keyframes rotate-circle {
0% { transform: rotate(-45deg); }
5% { transform: rotate(-45deg); }
12% { transform: rotate(-405deg); }
100% { transform: rotate(-405deg); }
}
@keyframes icon-line-tip {
0% { width: 0; left: 1px; top: 19px; }
54% { width: 0; left: 1px; top: 19px; }
70% { width: 50px; left: -8px; top: 37px; }
84% { width: 17px; left: 21px; top: 48px; }
100% { width: 25px; left: 14px; top: 45px; }
}
@keyframes icon-line-long {
0% { width: 0; right: 46px; top: 54px; }
65% { width: 0; right: 46px; top: 54px; }
84% { width: 55px; right: 0px; top: 35px; }
100% { width: 47px; right: 8px; top: 38px; }
}
@keyframes fill {
100% { box-shadow: inset 0px 0px 0px 60px #4CAF50; }
}
@keyframes scale {
0%, 100% { transform: none; }
50% { transform: scale3d(1.1, 1.1, 1); }
}
@media (max-width: 768px) { @media (max-width: 768px) {
.timeline-modern::before { .timeline-modern::before {
left: 15px; left: 15px;

View File

@@ -123,59 +123,87 @@ def create_service_request(request, service_id):
if request.method == 'POST': if request.method == 'POST':
try: try:
data = json.loads(request.body) data = json.loads(request.body)
client_email = data.get('client_email')
client_phone = data.get('client_phone') # Extract form data from new format
client_name = data.get('client_name') first_name = data.get('first_name', '').strip()
last_name = data.get('last_name', '').strip()
email = data.get('email', '').strip()
phone = data.get('phone', '').strip()
description = data.get('description', '').strip()
budget = data.get('budget', '')
timeline = data.get('timeline', '')
if not all([client_email, client_phone, client_name]): # Validate required fields
return JsonResponse({'status': 'error', 'message': 'Все поля должны быть заполнены'}, status=400) if not all([first_name, email, description]):
return JsonResponse({
'success': False,
'message': 'Пожалуйста, заполните все обязательные поля (имя, email, описание проекта)'
}, status=400)
service = get_object_or_404(Service, pk=service_id) service = get_object_or_404(Service, pk=service_id)
# Проверяем наличие клиента по email (так как email должен быть уникальным) # Create or get client
client, client_created = Client.objects.get_or_create( client, client_created = Client.objects.get_or_create(
email=client_email, email=email,
defaults={ defaults={
'first_name': client_name.split()[0] if client_name else "", 'first_name': first_name,
'last_name': client_name.split()[-1] if len(client_name.split()) > 1 else "", 'last_name': last_name,
'phone_number': client_phone, 'phone_number': phone,
} }
) )
# Обновляем данные клиента, если он уже существовал (например, телефон или имя изменились) # Update client data if already exists
if not client_created: if not client_created:
client.first_name = client_name.split()[0] client.first_name = first_name
client.last_name = client_name.split()[-1] if len(client_name.split()) > 1 else "" client.last_name = last_name
client.phone_number = client_phone if phone: # Only update phone if provided
client.phone_number = phone
client.save() client.save()
# Проверяем наличие заявки на эту же услугу, не завершенной и не подтвержденной # Check for existing pending requests
existing_requests = ServiceRequest.objects.filter(client=client, service=service, is_verified=False) existing_requests = ServiceRequest.objects.filter(
client=client,
service=service,
is_verified=False
)
if existing_requests.exists(): if existing_requests.exists():
return JsonResponse({ return JsonResponse({
'status': 'existing_request', 'success': False,
'message': 'У вас уже есть активная заявка на данную услугу. Пожалуйста, проверьте ваш Telegram для завершения процесса.' 'message': 'У вас уже есть активная заявка на данную услугу. Пожалуйста, проверьте ваш Telegram для завершения процесса.'
}) })
# Создаем новую заявку для клиента # Create service request with additional data
token = uuid.uuid4().hex token = uuid.uuid4().hex
# Prepare full message with all provided information
full_description = f"Описание проекта: {description}"
if budget:
full_description += f"\nБюджет: {budget}"
if timeline:
full_description += f"\nЖелаемые сроки: {timeline}"
service_request = ServiceRequest.objects.create( service_request = ServiceRequest.objects.create(
service=service, service=service,
client=client, client=client,
token=token, token=token,
message=full_description,
is_verified=False is_verified=False
) )
return JsonResponse({ return JsonResponse({
'status': 'success', 'success': True,
'message': 'Заявка успешно создана. Пожалуйста, проверьте ваш Telegram для подтверждения.', 'message': 'Заявка успешно отправлена! Мы свяжемся с вами в ближайшее время.',
'service_request_id': service_request.id, 'service_request_id': service_request.id,
}) })
except json.JSONDecodeError: except json.JSONDecodeError:
logger.error("Invalid JSON format") logger.error("Invalid JSON format")
return JsonResponse({'status': 'error', 'message': 'Неверный формат данных'}, status=400) return JsonResponse({'success': False, 'message': 'Неверный формат данных'}, status=400)
return JsonResponse({'status': 'error', 'message': 'Метод запроса должен быть POST'}, status=405) except Exception as e:
logger.error(f"Error creating service request: {str(e)}")
return JsonResponse({'success': False, 'message': 'Произошла ошибка при создании заявки'}, status=500)
return JsonResponse({'success': False, 'message': 'Метод запроса должен быть POST'}, status=405)
def generate_qr_code(request, service_id): def generate_qr_code(request, service_id):
if request.method == 'POST': if request.method == 'POST':