|
|
@ -2,153 +2,189 @@ from django.core.management.base import BaseCommand |
|
|
from apps.account.models import NotificationTemplate |
|
|
from apps.account.models import NotificationTemplate |
|
|
|
|
|
|
|
|
class Command(BaseCommand): |
|
|
class Command(BaseCommand): |
|
|
help = 'Seeds default NotificationTemplate records in the database.' |
|
|
|
|
|
|
|
|
help = 'Seeds default NotificationTemplate records in the database with RU and EN translations.' |
|
|
|
|
|
|
|
|
def handle(self, *args, **options): |
|
|
def handle(self, *args, **options): |
|
|
default_templates = [ |
|
|
default_templates = [ |
|
|
{ |
|
|
{ |
|
|
"notification_type": "course_access_granted", |
|
|
"notification_type": "course_access_granted", |
|
|
"name": "دسترسی به دوره فعال شد", |
|
|
|
|
|
"title_fa": "دسترسی به دوره فعال شد", |
|
|
|
|
|
|
|
|
"name": "Доступ к курсу активирован", |
|
|
|
|
|
"title_ru": "Доступ к курсу активирован", |
|
|
"title_en": "Course Access Granted", |
|
|
"title_en": "Course Access Granted", |
|
|
"body_fa": "دسترسی شما به دوره «{course_title}» فعال شد.", |
|
|
|
|
|
|
|
|
"body_ru": "Ваш доступ к курсу «{course_title}» успешно активирован.", |
|
|
"body_en": "Your access to the course '{course_title}' has been activated.", |
|
|
"body_en": "Your access to the course '{course_title}' has been activated.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "course_registered", |
|
|
"notification_type": "course_registered", |
|
|
"name": "ثبتنام دوره جدید", |
|
|
|
|
|
"title_fa": "ثبتنام دوره موفقیتآمیز بود", |
|
|
|
|
|
|
|
|
"name": "Регистрация на курс", |
|
|
|
|
|
"title_ru": "Успешная регистрация на курс", |
|
|
"title_en": "Course Registration Successful", |
|
|
"title_en": "Course Registration Successful", |
|
|
"body_fa": "ثبتنام شما در دوره «{course_title}» با موفقیت انجام شد.", |
|
|
|
|
|
|
|
|
"body_ru": "Вы успешно зарегистрировались на курс «{course_title}».", |
|
|
"body_en": "You have successfully registered for the course '{course_title}'.", |
|
|
"body_en": "You have successfully registered for the course '{course_title}'.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "lesson_completed", |
|
|
"notification_type": "lesson_completed", |
|
|
"name": "اتمام درس", |
|
|
|
|
|
"title_fa": "درس به اتمام رسید", |
|
|
|
|
|
|
|
|
"name": "Урок завершен", |
|
|
|
|
|
"title_ru": "Урок завершен", |
|
|
"title_en": "Lesson Completed", |
|
|
"title_en": "Lesson Completed", |
|
|
"body_fa": "تبریک! شما درس «{lesson_title}» را به پایان رساندید.", |
|
|
|
|
|
|
|
|
"body_ru": "Поздравляем! Вы завершили изучение урока «{lesson_title}».", |
|
|
"body_en": "Congratulations! You completed the lesson '{lesson_title}'.", |
|
|
"body_en": "Congratulations! You completed the lesson '{lesson_title}'.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {lesson_title}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {lesson_title}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "course_completed", |
|
|
"notification_type": "course_completed", |
|
|
"name": "اتمام دوره", |
|
|
|
|
|
"title_fa": "دوره به اتمام رسید", |
|
|
|
|
|
|
|
|
"name": "Курс завершен", |
|
|
|
|
|
"title_ru": "Курс завершен", |
|
|
"title_en": "Course Completed", |
|
|
"title_en": "Course Completed", |
|
|
"body_fa": "آفرین! شما دوره «{course_title}» را با موفقیت به پایان رساندید.", |
|
|
|
|
|
|
|
|
"body_ru": "Отличная работа! Вы успешно завершили курс «{course_title}».", |
|
|
"body_en": "Well done! You have completed the course '{course_title}'.", |
|
|
"body_en": "Well done! You have completed the course '{course_title}'.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "new_course_weekly", |
|
|
"notification_type": "new_course_weekly", |
|
|
"name": "معرفی دوره جدید هفتگی", |
|
|
|
|
|
"title_fa": "دوره جدید ثبت شد", |
|
|
|
|
|
|
|
|
"name": "Новый курс за неделю", |
|
|
|
|
|
"title_ru": "Добавлен новый курс", |
|
|
"title_en": "New Course Registered", |
|
|
"title_en": "New Course Registered", |
|
|
"body_fa": "دوره جدید «{course_title}» ثبت شده است. همین حالا میتوانید ثبتنام کنید.", |
|
|
|
|
|
|
|
|
"body_ru": "Зарегистрирован новый курс «{course_title}». Вы можете записаться прямо сейчас.", |
|
|
"body_en": "A new course '{course_title}' has been registered. You can enroll now.", |
|
|
"body_en": "A new course '{course_title}' has been registered. You can enroll now.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {course_slug}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "low_quiz_result", |
|
|
"notification_type": "low_quiz_result", |
|
|
"name": "پیشنهاد شرکت مجدد در آزمون", |
|
|
|
|
|
"title_fa": "پیشنهاد شرکت مجدد در آزمون", |
|
|
|
|
|
|
|
|
"name": "Предложение пересдать тест", |
|
|
|
|
|
"title_ru": "Предложение пересдать тест", |
|
|
"title_en": "Quiz Retake Suggestion", |
|
|
"title_en": "Quiz Retake Suggestion", |
|
|
"body_fa": "امتیاز شما در آزمون «{quiz_title}» کمتر از حد نصاب شده است. پیشنهاد میکنیم مجدداً در این آزمون شرکت کنید.", |
|
|
|
|
|
|
|
|
"body_ru": "Вы набрали балл ниже проходного в тесте «{quiz_title}». Рекомендуем пройти его повторно.", |
|
|
"body_en": "You scored below the passing threshold on quiz '{quiz_title}'. We suggest taking it again.", |
|
|
"body_en": "You scored below the passing threshold on quiz '{quiz_title}'. We suggest taking it again.", |
|
|
"placeholders_info": "{quiz_title}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{quiz_title}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "live_class_rescheduled", |
|
|
"notification_type": "live_class_rescheduled", |
|
|
"name": "تغییر زمان کلاس زنده", |
|
|
|
|
|
"title_fa": "زمان کلاس زنده تغییر کرد", |
|
|
|
|
|
|
|
|
"name": "Время живого урока изменено", |
|
|
|
|
|
"title_ru": "Время живого урока изменено", |
|
|
"title_en": "Live Class Rescheduled", |
|
|
"title_en": "Live Class Rescheduled", |
|
|
"body_fa": "زمان کلاس زنده برای دوره «{course_title}» تغییر یافته است.", |
|
|
|
|
|
|
|
|
"body_ru": "Время проведения живого урока по курсу «{course_title}» было изменено.", |
|
|
"body_en": "The live class for '{course_title}' has been rescheduled.", |
|
|
"body_en": "The live class for '{course_title}' has been rescheduled.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {session_subject}, {session_start_time}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {session_subject}, {session_start_time}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "live_class_cancelled", |
|
|
"notification_type": "live_class_cancelled", |
|
|
"name": "لغو کلاس زنده", |
|
|
|
|
|
"title_fa": "کلاس زنده لغو شد", |
|
|
|
|
|
|
|
|
"name": "Живой урок отменен", |
|
|
|
|
|
"title_ru": "Живой урок отменен", |
|
|
"title_en": "Live Class Cancelled", |
|
|
"title_en": "Live Class Cancelled", |
|
|
"body_fa": "کلاس زنده برای دوره «{course_title}» لغو شده است.", |
|
|
|
|
|
|
|
|
"body_ru": "Живой урок по курсу «{course_title}» был отменен.", |
|
|
"body_en": "The live class for '{course_title}' has been cancelled.", |
|
|
"body_en": "The live class for '{course_title}' has been cancelled.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {session_subject}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {session_subject}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "live_recording_available", |
|
|
"notification_type": "live_recording_available", |
|
|
"name": "ویدئو ضبط شده کلاس آماده است", |
|
|
|
|
|
"title_fa": "ویدئو ضبط شده کلاس آماده است", |
|
|
|
|
|
|
|
|
"name": "Доступна запись живого урока", |
|
|
|
|
|
"title_ru": "Доступна запись урока", |
|
|
"title_en": "Live Recording Available", |
|
|
"title_en": "Live Recording Available", |
|
|
"body_fa": "ویدئو ضبط شده کلاس زنده برای دوره «{course_title}» آماده مشاهده است.", |
|
|
|
|
|
|
|
|
"body_ru": "Запись живого урока по курсу «{course_title}» уже доступна для просмотра.", |
|
|
"body_en": "The recorded video of the live class for '{course_title}' is now available.", |
|
|
"body_en": "The recorded video of the live class for '{course_title}' is now available.", |
|
|
"placeholders_info": "{course_title}, {course_name}" |
|
|
"placeholders_info": "{course_title}, {course_name}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "missed_live_sessions", |
|
|
"notification_type": "missed_live_sessions", |
|
|
"name": "غیبت متوالی کلاس زنده", |
|
|
|
|
|
"title_fa": "غیبت متوالی در کلاسهای زنده", |
|
|
|
|
|
|
|
|
"name": "Пропуск живых уроков", |
|
|
|
|
|
"title_ru": "Пропуск живых уроков", |
|
|
"title_en": "Missed Live Sessions", |
|
|
"title_en": "Missed Live Sessions", |
|
|
"body_fa": "شما ۲ جلسه زنده متوالی را در دوره «{course_title}» غایب بودهاید. توصیه میکنیم ویدئوهای ضبط شده را مشاهده کنید.", |
|
|
|
|
|
|
|
|
"body_ru": "Вы пропустили 2 живых урока подряд по курсу «{course_title}». Рекомендуем посмотреть их в записи.", |
|
|
"body_en": "You have missed 2 consecutive live sessions in the course '{course_title}'. We recommend watching the recordings.", |
|
|
"body_en": "You have missed 2 consecutive live sessions in the course '{course_title}'. We recommend watching the recordings.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "payment_successful", |
|
|
"notification_type": "payment_successful", |
|
|
"name": "تراکنش موفق مالی", |
|
|
|
|
|
"title_fa": "پرداخت موفقیتآمیز", |
|
|
|
|
|
|
|
|
"name": "Оплата успешна", |
|
|
|
|
|
"title_ru": "Оплата успешна", |
|
|
"title_en": "Payment Successful", |
|
|
"title_en": "Payment Successful", |
|
|
"body_fa": "پرداخت شما برای دوره «{course_title}» با موفقیت انجام شد.", |
|
|
|
|
|
|
|
|
"body_ru": "Ваша оплата за курс «{course_title}» успешно проведена.", |
|
|
"body_en": "Your payment for course '{course_title}' was successful.", |
|
|
"body_en": "Your payment for course '{course_title}' was successful.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "payment_failed", |
|
|
"notification_type": "payment_failed", |
|
|
"name": "تراکنش ناموفق مالی", |
|
|
|
|
|
"title_fa": "خطا در پرداخت", |
|
|
|
|
|
|
|
|
"name": "Ошибка оплаты", |
|
|
|
|
|
"title_ru": "Ошибка оплаты", |
|
|
"title_en": "Payment Failed", |
|
|
"title_en": "Payment Failed", |
|
|
"body_fa": "در پردازش پرداخت شما برای دوره «{course_title}» مشکلی رخ داد.", |
|
|
|
|
|
|
|
|
"body_ru": "Произошла ошибка при обработке вашей оплаты за курс «{course_title}».", |
|
|
"body_en": "We encountered an issue processing your payment for '{course_title}'.", |
|
|
"body_en": "We encountered an issue processing your payment for '{course_title}'.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "refund_completed", |
|
|
"notification_type": "refund_completed", |
|
|
"name": "بازگشت وجه مالی", |
|
|
|
|
|
"title_fa": "بازگشت وجه انجام شد", |
|
|
|
|
|
|
|
|
"name": "Возврат средств", |
|
|
|
|
|
"title_ru": "Возврат средств выполнен", |
|
|
"title_en": "Refund Completed", |
|
|
"title_en": "Refund Completed", |
|
|
"body_fa": "بازگشت وجه برای دوره «{course_title}» انجام شد.", |
|
|
|
|
|
|
|
|
"body_ru": "Возврат средств за курс «{course_title}» успешно завершен.", |
|
|
"body_en": "A refund has been successfully completed for the course '{course_title}'.", |
|
|
"body_en": "A refund has been successfully completed for the course '{course_title}'.", |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "student_inactivity", |
|
|
"notification_type": "student_inactivity", |
|
|
"name": "عدم فعالیت کاربر", |
|
|
|
|
|
"title_fa": "دلمان برایتان تنگ شده!", |
|
|
|
|
|
|
|
|
"name": "Мы скучаем по вам", |
|
|
|
|
|
"title_ru": "Мы скучаем по вам!", |
|
|
"title_en": "We Miss You!", |
|
|
"title_en": "We Miss You!", |
|
|
"body_fa": "در یک هفته گذشته هیچ درسی را مطالعه نکردهاید. منتظرتان هستیم تا مسیر یادگیری خود را ادامه دهید.", |
|
|
|
|
|
|
|
|
"body_ru": "Вы не изучали уроки за последнюю неделю. Ждем вас для продолжения обучения!", |
|
|
"body_en": "You haven't taken any lessons in the last week. Come back and continue your learning journey!", |
|
|
"body_en": "You haven't taken any lessons in the last week. Come back and continue your learning journey!", |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "teacher_reply", |
|
|
"notification_type": "teacher_reply", |
|
|
"name": "پاسخ پیام استاد در چت", |
|
|
|
|
|
"title_fa": "پاسخ جدید از استاد", |
|
|
|
|
|
|
|
|
"name": "Ответ преподавателя", |
|
|
|
|
|
"title_ru": "Новое сообщение от преподавателя", |
|
|
"title_en": "New Message from Teacher", |
|
|
"title_en": "New Message from Teacher", |
|
|
"body_fa": "استاد به پیام شما پاسخ داده است.", |
|
|
|
|
|
|
|
|
"body_ru": "Преподаватель ответил на ваше сообщение.", |
|
|
"body_en": "The teacher has replied to your message.", |
|
|
"body_en": "The teacher has replied to your message.", |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"notification_type": "teacher_reply_private", |
|
|
|
|
|
"name": "Личное сообщение от преподавателя", |
|
|
|
|
|
"title_ru": "Новое сообщение от преподавателя", |
|
|
|
|
|
"title_en": "New Message from Teacher", |
|
|
|
|
|
"body_ru": "Преподаватель ответил на ваше сообщение.", |
|
|
|
|
|
"body_en": "The teacher has replied to your message.", |
|
|
|
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"notification_type": "teacher_reply_course", |
|
|
|
|
|
"name": "Сообщение от преподавателя в чате курса", |
|
|
|
|
|
"title_ru": "Сообщение от преподавателя в чате курса", |
|
|
|
|
|
"title_en": "Teacher Post in Course Chat", |
|
|
|
|
|
"body_ru": "Преподаватель опубликовал новое сообщение в чате курса.", |
|
|
|
|
|
"body_en": "The teacher posted in the course chat.", |
|
|
|
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
|
|
|
}, |
|
|
{ |
|
|
{ |
|
|
"notification_type": "support_reply", |
|
|
"notification_type": "support_reply", |
|
|
"name": "پاسخ پیام پشتیبان در چت", |
|
|
|
|
|
"title_fa": "پاسخ جدید از پشتیبان", |
|
|
|
|
|
|
|
|
"name": "Ответ поддержки", |
|
|
|
|
|
"title_ru": "Новое сообщение от поддержки", |
|
|
"title_en": "New Message from Support", |
|
|
"title_en": "New Message from Support", |
|
|
"body_fa": "پشتیبان به پیام شما پاسخ داده است.", |
|
|
|
|
|
|
|
|
"body_ru": "Служба поддержки ответила на ваше сообщение.", |
|
|
"body_en": "The support agent has replied to your message.", |
|
|
"body_en": "The support agent has replied to your message.", |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
"placeholders_info": "{student_name}, {fullname}" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"notification_type": "certificate_issued", |
|
|
|
|
|
"name": "Сертификат выдан", |
|
|
|
|
|
"title_ru": "Сертификат выдан", |
|
|
|
|
|
"title_en": "Certificate Issued", |
|
|
|
|
|
"body_ru": "Ваш сертификат по курсу «{course_title}» успешно выпущен.", |
|
|
|
|
|
"body_en": "Your certificate for the course '{course_title}' has been issued.", |
|
|
|
|
|
"placeholders_info": "{course_title}, {course_name}, {student_name}, {fullname}" |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
"notification_type": "live_class_reminder", |
|
|
|
|
|
"name": "Напоминание о живом уроке", |
|
|
|
|
|
"title_ru": "Напоминание о живом уроке", |
|
|
|
|
|
"title_en": "Live Class Reminder", |
|
|
|
|
|
"body_ru": "Напоминаем, что живой урок «{session_subject}» начнется в {session_start_time}.", |
|
|
|
|
|
"body_en": "Reminder: The live class '{session_subject}' will start at {session_start_time}.", |
|
|
|
|
|
"placeholders_info": "{session_subject}, {session_start_time}, {student_name}, {fullname}" |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
@ -158,9 +194,9 @@ class Command(BaseCommand): |
|
|
notification_type=item['notification_type'], |
|
|
notification_type=item['notification_type'], |
|
|
defaults={ |
|
|
defaults={ |
|
|
'name': item['name'], |
|
|
'name': item['name'], |
|
|
'title_fa': item['title_fa'], |
|
|
|
|
|
|
|
|
'title_ru': item['title_ru'], |
|
|
'title_en': item['title_en'], |
|
|
'title_en': item['title_en'], |
|
|
'body_fa': item['body_fa'], |
|
|
|
|
|
|
|
|
'body_ru': item['body_ru'], |
|
|
'body_en': item['body_en'], |
|
|
'body_en': item['body_en'], |
|
|
'placeholders_info': item['placeholders_info'], |
|
|
'placeholders_info': item['placeholders_info'], |
|
|
'is_active': True |
|
|
'is_active': True |
|
|
|