From 3057707b70eb2e476209248a1fb8fbd875cf76a9 Mon Sep 17 00:00:00 2001 From: Payam Date: Mon, 6 Apr 2026 11:41:50 +0400 Subject: [PATCH] feat: #331 show message for enrollment verification --- django_email_learning/public/views.py | 10 ++- frontend/public/course/Course.jsx | 71 +++++++++---------- frontend/public/organization/Organization.jsx | 21 +++--- 3 files changed, 53 insertions(+), 49 deletions(-) diff --git a/django_email_learning/public/views.py b/django_email_learning/public/views.py index a78dba1..fff1340 100644 --- a/django_email_learning/public/views.py +++ b/django_email_learning/public/views.py @@ -150,7 +150,10 @@ def get_context_data(self, **kwargs) -> dict: # type: ignore[no-untyped-def] "email": _("email"), "cancel": _("Cancel"), "submit": _("Submit"), - "enrollment_success": _("You are enrolled in this course."), + "enrollment_success": _( + "We've sent a confirmation email to verify your enrollment. Please check your inbox and follow the link to complete the process. \ + Don't see it? Check your Spam or Junk folder." + ), "enrollment_failed": _("Enrollment failed. Please try again."), "no_courses_available": _("No courses available."), "email_required": _("Email is required"), @@ -245,7 +248,10 @@ def get_context_data(self, **kwargs) -> dict: # type: ignore[no-untyped-def] "email": _("email"), "cancel": _("Cancel"), "submit": _("Submit"), - "enrollment_success": _("You are enrolled in this course."), + "enrollment_success": _( + "We've sent a confirmation email to verify your enrollment. Please check your inbox and follow the link to complete the process. \ + Don't see it? Check your Spam or Junk folder." + ), "enrollment_failed": _("Enrollment failed. Please try again."), "email_required": _("Email is required"), "email_invalid": _("Please enter a valid email address"), diff --git a/frontend/public/course/Course.jsx b/frontend/public/course/Course.jsx index c713f41..7b5703a 100644 --- a/frontend/public/course/Course.jsx +++ b/frontend/public/course/Course.jsx @@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react' import render from '../../src/render.jsx'; import Layout from '../components/Layout.jsx'; import EnrollmentForm from '../components/EnrollmentForm.jsx'; -import { Box, Button, Card, Chip, Container, Dialog, Grid, Link, List, ListItem, ListItemIcon, ListItemText, Stack, Typography } from '@mui/material'; +import { Alert, Box, Button, Card, Chip, Container, Dialog, Grid, Link, List, ListItem, ListItemIcon, ListItemText, Stack, Typography } from '@mui/material'; import CheckCircleIcon from '@mui/icons-material/CheckCircle'; import { alpha, ThemeProvider } from '@mui/material/styles'; import { useAppContext } from '../../src/render.jsx'; @@ -14,6 +14,7 @@ function Course() { const [displayModal, setDisplayModal] = useState(false); const [modalContent, setModalContent] = useState(null); const [enrolled, setEnrolled] = useState(false); + const [showEnrollmentAlert, setShowEnrollmentAlert] = useState(false); const [showFixedEnrollBar, setShowFixedEnrollBar] = useState(false); const topEnrollButtonRef = useRef(null); @@ -61,6 +62,8 @@ function Course() { setDisplayModal(false); setModalContent(null); setEnrolled(true); + setShowEnrollmentAlert(true); + scrollTo({ top: 0, behavior: 'smooth' }); } return @@ -143,17 +146,7 @@ function Course() { mx: { xs: 'auto', md: 0 }, }} > - {enrolled ? ( - ({ - backgroundColor: alpha(theme.palette.success.main, 0.18), - color: theme.palette.common.white, - fontWeight: 600, - backdropFilter: 'blur(8px)', - })} - /> - ) : ( + {!enrolled && (