diff --git a/NorahUniversity/__pycache__/settings.cpython-313.pyc b/NorahUniversity/__pycache__/settings.cpython-313.pyc index 96515ef..3e35586 100644 Binary files a/NorahUniversity/__pycache__/settings.cpython-313.pyc and b/NorahUniversity/__pycache__/settings.cpython-313.pyc differ diff --git a/NorahUniversity/__pycache__/urls.cpython-313.pyc b/NorahUniversity/__pycache__/urls.cpython-313.pyc index ddb748d..fcd6221 100644 Binary files a/NorahUniversity/__pycache__/urls.cpython-313.pyc and b/NorahUniversity/__pycache__/urls.cpython-313.pyc differ diff --git a/recruitment/__pycache__/admin.cpython-313.pyc b/recruitment/__pycache__/admin.cpython-313.pyc index 697c324..c293cd4 100644 Binary files a/recruitment/__pycache__/admin.cpython-313.pyc and b/recruitment/__pycache__/admin.cpython-313.pyc differ diff --git a/recruitment/__pycache__/forms.cpython-313.pyc b/recruitment/__pycache__/forms.cpython-313.pyc index 59395df..2f0ec5a 100644 Binary files a/recruitment/__pycache__/forms.cpython-313.pyc and b/recruitment/__pycache__/forms.cpython-313.pyc differ diff --git a/recruitment/__pycache__/linkedin_service.cpython-313.pyc b/recruitment/__pycache__/linkedin_service.cpython-313.pyc index 6465a83..fb440f1 100644 Binary files a/recruitment/__pycache__/linkedin_service.cpython-313.pyc and b/recruitment/__pycache__/linkedin_service.cpython-313.pyc differ diff --git a/recruitment/__pycache__/models.cpython-313.pyc b/recruitment/__pycache__/models.cpython-313.pyc index bce3a65..fb8ad71 100644 Binary files a/recruitment/__pycache__/models.cpython-313.pyc and b/recruitment/__pycache__/models.cpython-313.pyc differ diff --git a/recruitment/__pycache__/urls.cpython-313.pyc b/recruitment/__pycache__/urls.cpython-313.pyc index 730e629..ee7b6b5 100644 Binary files a/recruitment/__pycache__/urls.cpython-313.pyc and b/recruitment/__pycache__/urls.cpython-313.pyc differ diff --git a/recruitment/__pycache__/utils.cpython-313.pyc b/recruitment/__pycache__/utils.cpython-313.pyc index 49849c7..98a2eca 100644 Binary files a/recruitment/__pycache__/utils.cpython-313.pyc and b/recruitment/__pycache__/utils.cpython-313.pyc differ diff --git a/recruitment/__pycache__/validators.cpython-313.pyc b/recruitment/__pycache__/validators.cpython-313.pyc index e41b8c1..7126ff0 100644 Binary files a/recruitment/__pycache__/validators.cpython-313.pyc and b/recruitment/__pycache__/validators.cpython-313.pyc differ diff --git a/recruitment/__pycache__/views.cpython-313.pyc b/recruitment/__pycache__/views.cpython-313.pyc index 94b669a..c899de2 100644 Binary files a/recruitment/__pycache__/views.cpython-313.pyc and b/recruitment/__pycache__/views.cpython-313.pyc differ diff --git a/recruitment/__pycache__/views_frontend.cpython-313.pyc b/recruitment/__pycache__/views_frontend.cpython-313.pyc index 82ec3ec..95f2ad6 100644 Binary files a/recruitment/__pycache__/views_frontend.cpython-313.pyc and b/recruitment/__pycache__/views_frontend.cpython-313.pyc differ diff --git a/recruitment/templatetags/__pycache__/form_filters.cpython-313.pyc b/recruitment/templatetags/__pycache__/form_filters.cpython-313.pyc index 0c1a05b..ee7fbd8 100644 Binary files a/recruitment/templatetags/__pycache__/form_filters.cpython-313.pyc and b/recruitment/templatetags/__pycache__/form_filters.cpython-313.pyc differ diff --git a/recruitment/views.py b/recruitment/views.py index 2b5905d..cf030aa 100644 --- a/recruitment/views.py +++ b/recruitment/views.py @@ -2081,4 +2081,95 @@ def set_staff_password(request,pk): else: form=SetPasswordForm(user=user) - return render(request,'user/staff_password_create.html',{'form':form,'user':user}) \ No newline at end of file + return render(request,'user/staff_password_create.html',{'form':form,'user':user}) + + + + +@login_required +def user_detail(requests,pk): + user=get_object_or_404(User,pk=pk) + return render(requests,'user/profile.html') + + +@csrf_exempt +def zoom_webhook_view(request): + print(request.headers) + print(settings.ZOOM_WEBHOOK_API_KEY) + # if api_key != settings.ZOOM_WEBHOOK_API_KEY: + # return HttpResponse(status=405) + if request.method == 'POST': + try: + payload = json.loads(request.body) + async_task("recruitment.tasks.handle_zoom_webhook_event", payload) + return HttpResponse(status=200) + except Exception: + return HttpResponse(status=400) + return HttpResponse(status=405) + + +# Meeting Comments Views +@login_required +def add_meeting_comment(request, slug): + """Add a comment to a meeting""" + meeting = get_object_or_404(ZoomMeeting, slug=slug) + + if request.method == 'POST': + form = MeetingCommentForm(request.POST) + if form.is_valid(): + comment = form.save(commit=False) + comment.meeting = meeting + comment.author = request.user + comment.save() + messages.success(request, 'Comment added successfully!') + + # HTMX response - return just the comment section + if 'HX-Request' in request.headers: + return render(request, 'includes/comment_list.html', { + 'comments': meeting.comments.all().order_by('-created_at'), + 'meeting': meeting + }) + + return redirect('meeting_details', slug=slug) + else: + form = MeetingCommentForm() + + context = { + 'form': form, + 'meeting': meeting, + } + + # HTMX response - return the comment form + if 'HX-Request' in request.headers: + return render(request, 'includes/comment_form.html', context) + + return redirect('meeting_details', slug=slug) + + +@login_required +def edit_meeting_comment(request, slug, comment_id): + """Edit a meeting comment""" + meeting = get_object_or_404(ZoomMeeting, slug=slug) + comment = get_object_or_404(MeetingComment, id=comment_id, meeting=meeting) + + # Check if user is the author + if comment.author != request.user: + messages.error(request, 'You can only edit your own comments.') + return redirect('meeting_details', slug=slug) + + if request.method == 'POST': + form = MeetingCommentForm(request.POST, instance=comment) + if form.is_valid(): + form.save() + messages.success(request, 'Comment updated successfully!') + + # HTMX response - return just the comment section + if 'HX-Request' in request.headers: + return render(request, 'includes/comment_list.html', { + 'comments': meeting.comments.all().order_by('-created_at'), + 'meeting': meeting + }) + + return redirect('meeting_details', slug=slug) + else: + form = MeetingCommentForm(instance=comment)