Compare commits

..

No commits in common. "f22849878b38795e72c4bec73d151401e587a31a" and "78f1c20124d40c7feddd4fc6e8990e99672c3f48" have entirely different histories.

15 changed files with 214 additions and 398 deletions

View File

@ -93,7 +93,6 @@ INSTALLED_APPS = [
'taggit', 'taggit',
'django_ckeditor_5', 'django_ckeditor_5',
'captcha', 'captcha',
'turnstile',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -286,5 +285,4 @@ CAPTCHA_LENGTH = 6
CAPTCHA_FONT_SIZE = 30 CAPTCHA_FONT_SIZE = 30
CAPTCHA_IMAGE_SIZE = (150, 50) CAPTCHA_IMAGE_SIZE = (150, 50)
TURNSTILE_SITEKEY = '0x4AAAAAAC12NGPpc4TutFWA'
TURNSTILE_SECRET = '0x4AAAAAAC12NCpzKHKE09JaXRDv0smrSAU'

View File

@ -1,8 +1,7 @@
# from captcha.fields import CaptchaField from captcha.fields import CaptchaField
from django import forms from django import forms
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.forms import UserCreationForm
from turnstile.fields import TurnstileField
from .models import CallbackRequest, Profile from .models import CallbackRequest, Profile
@ -10,9 +9,8 @@ from .models import CallbackRequest, Profile
User = get_user_model() User = get_user_model()
class CallbackForm(forms.ModelForm): class CallbackForm(forms.ModelForm):
# captcha = CaptchaField(label='Введите текст с картинки', required=True) captcha = CaptchaField(label='Введите текст с картинки', required=True)
captcha = TurnstileField(label='', theme='light', size='normal')
class Meta: class Meta:
model = CallbackRequest model = CallbackRequest
fields = ['name', 'phone', 'email', 'question'] fields = ['name', 'phone', 'email', 'question']

View File

@ -1695,61 +1695,4 @@ body {
padding: 0.75rem; padding: 0.75rem;
font-size: 1rem; font-size: 1rem;
border-radius: 8px; border-radius: 8px;
}
.floating-btn {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 10000;
animation: fadeInUp 0.5s ease;
}
.floating-btn .btn {
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
border-radius: 50px;
padding: 12px 24px;
font-size: 1.1rem;
background: #ff7300;
color: white;
border: none;
cursor: pointer;
transition: transform 0.2s;
}
.floating-btn .btn:hover {
transform: scale(1.05);
background: #0056b3;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Пульсация для кнопки */
@keyframes pulse {
0% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.7);
}
70% {
transform: scale(1.1);
box-shadow: 0 0 0 15px rgba(255, 107, 0, 0);
}
100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(255, 107, 0, 0);
}
}
.floating-btn .btn.pulse {
animation: pulse 1.5s infinite;
will-change: transform;
} }

View File

@ -1,63 +0,0 @@
// static/programmer/js/floating-button.js
const CallbackModal = {
shown: false,
modalId: 'callbackModal',
floatingBtnId: 'floatingButton',
init() {
setTimeout(() => {
const btn = document.getElementById(this.floatingBtnId);
if (btn) {
btn.style.display = 'block';
this.shown = true;
const button = btn.querySelector('.btn');
if (button) button.classList.add('pulse');
}
}, 5000);
},
open() {
const modal = document.getElementById(this.modalId);
if (modal) {
modal.style.display = 'block';
const floatingBtn = document.getElementById(this.floatingBtnId);
if (floatingBtn && this.shown) {
floatingBtn.style.display = 'none';
}
}
},
close() {
const modal = document.getElementById(this.modalId);
if (modal) {
modal.style.display = 'none';
const floatingBtn = document.getElementById(this.floatingBtnId);
if (floatingBtn && this.shown) {
floatingBtn.style.display = 'block';
const button = floatingBtn.querySelector('.btn.pulse');
if (button) {
button.style.animation = 'none';
setTimeout(() => button.style.animation = '', 10);
}
}
}
}
};
// Инициализация и глобальные обработчики
document.addEventListener('DOMContentLoaded', () => {
CallbackModal.init();
// Закрытие по клику вне модального окна
const modal = document.getElementById(CallbackModal.modalId);
if (modal) {
modal.addEventListener('click', (event) => {
if (event.target === modal) CallbackModal.close();
});
}
// Закрытие по ESC
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') CallbackModal.close();
});
});

View File

@ -1,41 +1,74 @@
// static/programmer/js/recall.js // recall.js - Скрипты для страницы отзывов
const ImageModal = { function openModal(imageUrl, title) {
modalId: 'imageModal', console.log('Opening modal with:', imageUrl);
imageId: 'modalImage', const modal = document.getElementById('imageModal');
titleId: 'modalTitle', const modalImg = document.getElementById('modalImage');
const modalTitle = document.getElementById('modalTitle');
open(imageUrl, title) { if (modal && modalImg) {
const modal = document.getElementById(this.modalId); modal.style.display = "block";
const img = document.getElementById(this.imageId); modalImg.src = imageUrl;
const titleEl = document.getElementById(this.titleId); if (title && modalTitle) {
if (modal && img && titleEl) { modalTitle.textContent = title;
img.src = imageUrl;
img.alt = title || 'Просмотр изображения';
titleEl.textContent = title || 'Просмотр изображения';
modal.style.display = 'block';
} }
},
close() { // Добавляем класс для анимации
const modal = document.getElementById(this.modalId); setTimeout(() => {
if (modal) { modal.classList.add('active');
modal.style.display = 'none'; }, 10);
const img = document.getElementById(this.imageId);
if (img) img.src = ''; // Подстраиваем размер изображения
} adjustModalImageSize();
} }
}; }
// Обработчики для модального окна изображений function closeModal() {
document.addEventListener('DOMContentLoaded', () => { const modal = document.getElementById('imageModal');
const modal = document.getElementById(ImageModal.modalId);
if (modal) { if (modal) {
modal.addEventListener('click', (event) => { modal.classList.remove('active');
if (event.target === modal) ImageModal.close(); setTimeout(() => {
}); modal.style.display = "none";
}, 300);
} }
}
document.addEventListener('keydown', (event) => { function adjustModalImageSize() {
if (event.key === 'Escape') ImageModal.close(); const modalImg = document.getElementById('modalImage');
const modalContent = document.querySelector('.modal-content');
if (modalImg && modalContent) {
const maxWidth = window.innerWidth * 0.9;
const maxHeight = window.innerHeight * 0.8;
modalImg.style.maxWidth = `${maxWidth}px`;
modalImg.style.maxHeight = `${maxHeight}px`;
}
}
// Инициализация после загрузки DOM
document.addEventListener('DOMContentLoaded', function() {
// Закрытие модального окна при клике вне изображения
document.addEventListener('click', function(event) {
const modal = document.getElementById('imageModal');
if (event.target === modal) {
closeModal();
}
}); });
// Закрытие по ESC
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape') {
closeModal();
}
});
// Адаптация размера изображения при изменении размера окна
window.addEventListener('resize', function() {
const modalImg = document.getElementById('modalImage');
if (modalImg && modalImg.src) {
adjustModalImageSize();
}
});
console.log('Recall page scripts initialized');
}); });

View File

@ -1,5 +1,4 @@
{% extends 'programmer/base.html' %} {% extends 'programmer/base.html' %}
{% load static %}
{% load django_bootstrap5 %} {% load django_bootstrap5 %}
{% block content %} {% block content %}
@ -152,7 +151,4 @@
} }
</script> </script>
<script src="{% static 'programmer/js/floating-button.js' %}"></script> {% endblock %}
{% endblock %}

View File

@ -322,59 +322,6 @@
</div> </div>
</footer> </footer>
<!-- Модальное окно формы -->
<div id="callbackModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>📞 Заявка на консультацию</h3>
<button class="modal-close" onclick="CallbackModal.close()">&times;</button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'callback' %}" id="callbackForm">
{% csrf_token %}
<div class="form-group">
<label for="id_name">Имя *</label>
{{ form.name }}
</div>
<div class="form-group">
<label for="id_phone">Телефон *</label>
{{ form.phone }}
</div>
<div class="form-group">
<label for="id_email">Электронная почта</label>
{{ form.email }}
</div>
<div class="form-group">
<label for="id_question">Ваш вопрос</label>
{{ form.question }}
</div>
{% if form.captcha %}
<div class="form-group">
<label for="id_captcha">Защитный код *</label>
{{ form.captcha }}
</div>
{% endif %}
<div class="form-actions">
<button type="submit" class="btn btn-primary" style="width: 100%;">
📨 Отправить заявку
</button>
</div>
</form>
</div>
</div>
</div>
<!-- Плавающая кнопка -->
<div id="floatingButton" class="floating-btn" style="position: fixed; bottom: 30px; right: 30px; z-index: 10000; display: none;">
<button onclick="CallbackModal.open()" class="btn btn-primary pulse">🎯 Получить консультацию</button>
</div>
{% bootstrap_javascript %} {% bootstrap_javascript %}
<script src="{% static 'programmer/js/theme-switcher.js' %}"></script> <script src="{% static 'programmer/js/theme-switcher.js' %}"></script>
<script src="{% static 'programmer/js/mobile-menu.js' %}"></script> <script src="{% static 'programmer/js/mobile-menu.js' %}"></script>

View File

@ -1,5 +1,4 @@
{% extends 'programmer/base.html' %} {% extends 'programmer/base.html' %}
{% load static %}
{% load django_bootstrap5 %} {% load django_bootstrap5 %}
{% block content %} {% block content %}
@ -18,28 +17,94 @@
<div class="card-content"> <div class="card-content">
{{p.content}} {{p.content}}
</div> </div>
<!-- <div class="card-actions"> <div class="card-actions">
<button onclick="openModal()" class="btn btn-primary">🎯 Получить консультацию</button> <button onclick="openModal()" class="btn btn-primary">🎯 Получить консультацию</button>
</div> --> </div>
</div> </div>
{% endfor %} {% endfor %}
{% endautoescape %} {% endautoescape %}
</div> </div>
<!-- Модальное окно формы -->
<div id="callbackModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h3>📞 Заявка на консультацию</h3>
<button class="modal-close" onclick="closeModal()">&times;</button>
</div>
<div class="modal-body">
<form method="post" action="{% url 'callback' %}" id="callbackForm">
{% csrf_token %}
<div class="form-group">
<label for="id_name">Имя *</label>
{{ form.name }}
</div>
<div class="form-group">
<label for="id_phone">Телефон *</label>
{{ form.phone }}
</div>
<div class="form-group">
<label for="id_email">Электронная почта</label>
{{ form.email }}
</div>
<div class="form-group">
<label for="id_question">Ваш вопрос</label>
{{ form.question }}
</div>
{% if form.captcha %}
<div class="form-group">
<label for="id_captcha">Защитный код *</label>
{{ form.captcha }}
</div>
{% endif %}
<div class="form-actions">
<button type="submit" class="btn btn-primary" style="width: 100%;">
📨 Отправить заявку
</button>
</div>
</form>
</div>
</div>
</div>
{% if not posts %} {% if not posts %}
<div class="modern-card text-center fade-in"> <div class="modern-card text-center fade-in">
<h3>🚀 Контент скоро появится</h3> <h3>🚀 Контент скоро появится</h3>
<p class="card-subtitle">Мы готовим для вас интересные материалы и кейсы</p> <p class="card-subtitle">Мы готовим для вас интересные материалы и кейсы</p>
<!-- <div class="card-actions justify-center"> <div class="card-actions justify-center">
<button onclick="openModal()" class="btn btn-primary">🎯 Получить консультацию</button> <button onclick="openModal()" class="btn btn-primary">🎯 Получить консультацию</button>
</div> --> </div>
</div> </div>
{% endif %} {% endif %}
<script src="{% static 'programmer/js/floating-button.js' %}"></script> <script>
function openModal() {
document.getElementById('callbackModal').style.display = 'block';
}
{% block extra_js %} function closeModal() {
document.getElementById('callbackModal').style.display = 'none';
}
{% endblock %} // Закрытие модального окна при клике вне его
window.onclick = function(event) {
const modal = document.getElementById('callbackModal');
if (event.target === modal) {
closeModal();
}
}
// Закрытие по ESC
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape') {
closeModal();
}
});
</script>
{% endblock %} {% endblock %}

View File

@ -2,7 +2,6 @@
{% load django_bootstrap5 %} {% load django_bootstrap5 %}
{% load static %} {% load static %}
{% load seo_tags %} {% load seo_tags %}
{% load programmer_tags %}
{% block extra_css %} {% block extra_css %}
<link rel="stylesheet" href="{% static 'programmer/css/recall.css' %}"> <link rel="stylesheet" href="{% static 'programmer/css/recall.css' %}">
@ -60,7 +59,7 @@
<img src="{{ p.scan.url }}" <img src="{{ p.scan.url }}"
alt="Отзыв от {{ p.title }}" alt="Отзыв от {{ p.title }}"
class="recall-scan" class="recall-scan"
onclick="ImageModal.open('{{ p.scan.url }}', '{{ p.title }}')"> onclick="openModal('{{ p.scan.url }}', '{{ p.title }}')">
<div class="scan-hint"> <div class="scan-hint">
<span class="scan-zoom-icon">🔍</span> <span class="scan-zoom-icon">🔍</span>
<span class="scan-text">Нажмите для увеличения</span> <span class="scan-text">Нажмите для увеличения</span>
@ -89,12 +88,15 @@
</div> </div>
{% endif %} {% endif %}
<!-- Скрипт для модального окна -->
<script src="{% static 'programmer/js/recall.js' %}"></script>
<!-- Модальное окно для увеличения изображений --> <!-- Модальное окно для увеличения изображений -->
<div id="imageModal" class="modal"> <div id="imageModal" class="modal">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h3 id="modalTitle">Просмотр изображения</h3> <h3 id="modalTitle">Просмотр изображения</h3>
<button class="modal-close" onclick="ImageModal.close()">&times;</button> <button class="modal-close" onclick="closeModal()">&times;</button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<img class="modal-image" id="modalImage" alt=""> <img class="modal-image" id="modalImage" alt="">
@ -102,12 +104,4 @@
</div> </div>
</div> </div>
<script src="{% static 'programmer/js/floating-button.js' %}"></script>
<script src="{% static 'programmer/js/recall.js' %}"></script>
{% block extra_js %}
{% endblock %}
{% endblock %} {% endblock %}

View File

@ -46,10 +46,9 @@
window.totalPages = {{ paginator.num_pages }}; window.totalPages = {{ paginator.num_pages }};
</script> </script>
<script src="{% static 'programmer/js/solution-accordion.js' %}"></script>
{% endblock %} {% endblock %}
{% block extra_js %} {% block extra_js %}
<script src="{% static 'programmer/js/solution-accordion.js' %}"></script> <script src="{% static 'programmer/js/infinite_scroll.js' %}"></script>
<script src="{% static 'programmer/js/infinite_scroll.js' %}"></script>
<script src="{% static 'programmer/js/floating-button.js' %}"></script>
{% endblock %} {% endblock %}

View File

@ -102,10 +102,8 @@ class AboutPageView(BasePageView, BreadcrumbMixin):
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
form = CallbackForm()
context.update({ context.update({
'form': form,
'title': "Программист 1С Николай Сердюк - 10+ лет опыта | Услуги 1С", 'title': "Программист 1С Николай Сердюк - 10+ лет опыта | Услуги 1С",
'meta_description': ( 'meta_description': (
"Николай Сердюк - сертифицированный программист 1С с 10+ лет опыта. " "Николай Сердюк - сертифицированный программист 1С с 10+ лет опыта. "
@ -137,10 +135,8 @@ class SolutionListView(BaseListView, BreadcrumbMixin):
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
form = CallbackForm()
context.update({ context.update({
'form': form,
'title': "Проекты автоматизации 1С | Реализованные кейсы и решения", 'title': "Проекты автоматизации 1С | Реализованные кейсы и решения",
'meta_description': ( 'meta_description': (
"Реализованные проекты по автоматизации 1С: складской учет с ТСД, " "Реализованные проекты по автоматизации 1С: складской учет с ТСД, "
@ -171,10 +167,8 @@ class RecallListView(BaseListView, BreadcrumbMixin):
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]: def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)
form = CallbackForm()
context.update({ context.update({
'form': form,
'title': "Отзывы клиентов о работе программиста 1С | Реальные кейсы", 'title': "Отзывы клиентов о работе программиста 1С | Реальные кейсы",
'meta_description': ( 'meta_description': (
"Реальные отзывы клиентов о работе программиста 1С Николая Сердюка. " "Реальные отзывы клиентов о работе программиста 1С Николая Сердюка. "

View File

@ -9,5 +9,4 @@ python-dotenv>=1.0.0
django-taggit django-taggit
django_ckeditor_5 django_ckeditor_5
django-allauth django-allauth
django-simple-captcha django-simple-captcha
django-turnstile

View File

@ -1695,61 +1695,4 @@ body {
padding: 0.75rem; padding: 0.75rem;
font-size: 1rem; font-size: 1rem;
border-radius: 8px; border-radius: 8px;
}
.floating-btn {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 10000;
animation: fadeInUp 0.5s ease;
}
.floating-btn .btn {
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
border-radius: 50px;
padding: 12px 24px;
font-size: 1.1rem;
background: #ff7300;
color: white;
border: none;
cursor: pointer;
transition: transform 0.2s;
}
.floating-btn .btn:hover {
transform: scale(1.05);
background: #0056b3;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Пульсация для кнопки */
@keyframes pulse {
0% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.7);
}
70% {
transform: scale(1.1);
box-shadow: 0 0 0 15px rgba(255, 107, 0, 0);
}
100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(255, 107, 0, 0);
}
}
.floating-btn .btn.pulse {
animation: pulse 1.5s infinite;
will-change: transform;
} }

View File

@ -1,63 +0,0 @@
// static/programmer/js/floating-button.js
const CallbackModal = {
shown: false,
modalId: 'callbackModal',
floatingBtnId: 'floatingButton',
init() {
setTimeout(() => {
const btn = document.getElementById(this.floatingBtnId);
if (btn) {
btn.style.display = 'block';
this.shown = true;
const button = btn.querySelector('.btn');
if (button) button.classList.add('pulse');
}
}, 5000);
},
open() {
const modal = document.getElementById(this.modalId);
if (modal) {
modal.style.display = 'block';
const floatingBtn = document.getElementById(this.floatingBtnId);
if (floatingBtn && this.shown) {
floatingBtn.style.display = 'none';
}
}
},
close() {
const modal = document.getElementById(this.modalId);
if (modal) {
modal.style.display = 'none';
const floatingBtn = document.getElementById(this.floatingBtnId);
if (floatingBtn && this.shown) {
floatingBtn.style.display = 'block';
const button = floatingBtn.querySelector('.btn.pulse');
if (button) {
button.style.animation = 'none';
setTimeout(() => button.style.animation = '', 10);
}
}
}
}
};
// Инициализация и глобальные обработчики
document.addEventListener('DOMContentLoaded', () => {
CallbackModal.init();
// Закрытие по клику вне модального окна
const modal = document.getElementById(CallbackModal.modalId);
if (modal) {
modal.addEventListener('click', (event) => {
if (event.target === modal) CallbackModal.close();
});
}
// Закрытие по ESC
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') CallbackModal.close();
});
});

View File

@ -1,41 +1,74 @@
// static/programmer/js/recall.js // recall.js - Скрипты для страницы отзывов
const ImageModal = { function openModal(imageUrl, title) {
modalId: 'imageModal', console.log('Opening modal with:', imageUrl);
imageId: 'modalImage', const modal = document.getElementById('imageModal');
titleId: 'modalTitle', const modalImg = document.getElementById('modalImage');
const modalTitle = document.getElementById('modalTitle');
open(imageUrl, title) { if (modal && modalImg) {
const modal = document.getElementById(this.modalId); modal.style.display = "block";
const img = document.getElementById(this.imageId); modalImg.src = imageUrl;
const titleEl = document.getElementById(this.titleId); if (title && modalTitle) {
if (modal && img && titleEl) { modalTitle.textContent = title;
img.src = imageUrl;
img.alt = title || 'Просмотр изображения';
titleEl.textContent = title || 'Просмотр изображения';
modal.style.display = 'block';
} }
},
close() { // Добавляем класс для анимации
const modal = document.getElementById(this.modalId); setTimeout(() => {
if (modal) { modal.classList.add('active');
modal.style.display = 'none'; }, 10);
const img = document.getElementById(this.imageId);
if (img) img.src = ''; // Подстраиваем размер изображения
} adjustModalImageSize();
} }
}; }
// Обработчики для модального окна изображений function closeModal() {
document.addEventListener('DOMContentLoaded', () => { const modal = document.getElementById('imageModal');
const modal = document.getElementById(ImageModal.modalId);
if (modal) { if (modal) {
modal.addEventListener('click', (event) => { modal.classList.remove('active');
if (event.target === modal) ImageModal.close(); setTimeout(() => {
}); modal.style.display = "none";
}, 300);
} }
}
document.addEventListener('keydown', (event) => { function adjustModalImageSize() {
if (event.key === 'Escape') ImageModal.close(); const modalImg = document.getElementById('modalImage');
const modalContent = document.querySelector('.modal-content');
if (modalImg && modalContent) {
const maxWidth = window.innerWidth * 0.9;
const maxHeight = window.innerHeight * 0.8;
modalImg.style.maxWidth = `${maxWidth}px`;
modalImg.style.maxHeight = `${maxHeight}px`;
}
}
// Инициализация после загрузки DOM
document.addEventListener('DOMContentLoaded', function() {
// Закрытие модального окна при клике вне изображения
document.addEventListener('click', function(event) {
const modal = document.getElementById('imageModal');
if (event.target === modal) {
closeModal();
}
}); });
// Закрытие по ESC
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape') {
closeModal();
}
});
// Адаптация размера изображения при изменении размера окна
window.addEventListener('resize', function() {
const modalImg = document.getElementById('modalImage');
if (modalImg && modalImg.src) {
adjustModalImageSize();
}
});
console.log('Recall page scripts initialized');
}); });