From 3849176055b3fc0ebe4ce50b44f1865f0258c31b Mon Sep 17 00:00:00 2001 From: Faheed Date: Tue, 23 Dec 2025 18:35:02 +0300 Subject: [PATCH] applicant portal singup and application submission and title translation --- NorahUniversity/urls.py | 4 +- recruitment/urls.py | 12 +- recruitment/views.py | 37 +- templates/account/email.html | 2 +- templates/account/login.html | 2 +- templates/account/logout.html | 22 +- templates/account/password_reset.html | 2 +- templates/account/verification_sent.html | 2 +- .../applicant/application_submit_form.html | 6 +- .../applicant/job_application_detail.html | 2 +- .../partials/candidate_facing_base.html | 5 + templates/base.html | 10 + templates/forms/form_builder.html | 2 +- templates/forms/form_submission_details.html | 2 +- templates/forms/form_submissions.html | 428 --------------- .../forms/form_template_all_submissions.html | 2 +- .../forms/form_template_submissions_list.html | 2 +- templates/forms/form_templates_list.html | 2 +- templates/includes/_list_view_switcher.html | 5 +- templates/includes/comment_form.html | 4 +- templates/includes/comment_list.html | 8 +- templates/includes/delete_comment_form.html | 8 +- templates/includes/edit_comment_form.html | 6 +- .../includes/schedule_interview_div.html | 30 +- templates/interviews/delete_interview.html | 0 templates/interviews/detail_interview.html | 499 ------------------ .../interviews/interview_create_onsite.html | 6 +- .../interviews/interview_create_remote.html | 6 +- .../interview_create_type_selection.html | 6 +- templates/interviews/interview_list.html | 2 +- .../interviews/onsite_location_form.html | 6 +- .../interviews/partials/interview_list.html | 2 +- templates/interviews/preview_schedule.html | 30 +- templates/interviews/schedule_interviews.html | 2 +- templates/interviews/update_interview.html | 0 templates/jobs/apply_form.html | 68 +-- templates/jobs/base_public.html | 0 templates/jobs/create_job.html | 2 +- templates/jobs/edit_job.html | 4 +- templates/jobs/job_applicants.html | 2 +- templates/jobs/job_applications_list.html | 2 +- templates/jobs/job_bank.html | 2 +- templates/jobs/job_list.html | 2 +- templates/jobs/partials/delete_modal.html | 14 +- templates/jobs/partials/image_upload.html | 9 +- .../jobs/partials/linkedin_content_form.html | 7 +- .../messages/application_message_detail.html | 2 +- .../messages/application_message_list.html | 2 +- .../participants/participants_create.html | 2 +- .../participants/participants_detail.html | 2 +- templates/participants/participants_list.html | 2 +- templates/people/create_person.html | 2 +- templates/people/person_confirm_delete.html | 4 +- templates/people/person_list.html | 6 +- templates/people/update_person.html | 2 +- templates/portal_base.html | 5 + .../agency_access_link_confirm.html | 16 +- .../agency_portal_assignment_detail.html | 2 +- .../recruitment/agency_portal_dashboard.html | 2 +- .../agency_portal_persons_list.html | 2 +- .../agency_portal_submit_application.html | 2 +- templates/recruitment/applicant_profile.html | 2 +- templates/recruitment/application_create.html | 2 +- .../application_resume_template.html | 2 +- templates/recruitment/application_update.html | 2 +- .../applications_document_review_view.html | 2 +- .../recruitment/applications_exam_view.html | 2 +- .../recruitment/applications_hired_view.html | 2 +- .../applications_interview_view.html | 2 +- templates/recruitment/applications_list.html | 2 +- .../recruitment/applications_offer_view.html | 2 +- .../applications_screening_view.html | 2 +- templates/recruitment/candidate_delete.html | 20 +- .../candidate_document_management.html | 60 +-- .../candidate_portal_dashboard.html | 2 +- templates/recruitment/interview_calendar.html | 38 +- templates/recruitment/interview_detail.html | 40 +- .../recruitment/partials/stage_display.html | 3 +- .../partials/stage_update_form.html | 7 +- .../partials/stage_update_success.html | 2 +- .../recruitment/partials/stats_cards.html | 2 +- .../recruitment/settings_confirm_delete.html | 45 +- templates/recruitment/settings_form.html | 17 +- .../recruitment/source_confirm_delete.html | 38 +- templates/recruitment/training_create.html | 143 ----- templates/recruitment/training_delete.html | 33 -- templates/recruitment/training_list.html | 285 ---------- templates/recruitment/training_update.html | 191 ------- templates/user/portal_profile.html | 14 +- templates/user/profile.html | 12 +- templates/user/settings.html | 4 +- 91 files changed, 376 insertions(+), 1931 deletions(-) delete mode 100644 templates/forms/form_submissions.html delete mode 100644 templates/interviews/delete_interview.html delete mode 100644 templates/interviews/detail_interview.html delete mode 100644 templates/interviews/update_interview.html delete mode 100644 templates/jobs/base_public.html delete mode 100644 templates/recruitment/training_create.html delete mode 100644 templates/recruitment/training_delete.html delete mode 100644 templates/recruitment/training_list.html delete mode 100644 templates/recruitment/training_update.html diff --git a/NorahUniversity/urls.py b/NorahUniversity/urls.py index 59170ce..8c21eee 100644 --- a/NorahUniversity/urls.py +++ b/NorahUniversity/urls.py @@ -23,7 +23,7 @@ urlpatterns = [ path("ckeditor5/", include('django_ckeditor_5.urls')), path('application//', views.application_submit_form, name='application_submit_form'), - path('application//submit/', views.application_submit, name='application_submit'), + path('application//submit/', views.application_submit, name='application_submit'), path('application//apply/', views.job_application_detail, name='job_application_detail'), path('application//signup/', views.application_signup, name='application_signup'), path('application//success/', views.application_success, name='application_success'), @@ -31,7 +31,7 @@ urlpatterns = [ path('api/v1/templates/', views.list_form_templates, name='list_form_templates'), path('api/v1/templates/save/', views.save_form_template, name='save_form_template'), - path('api/v1/templates//', views.load_form_template, name='load_form_template'), + path('api/v1/templates//', views.load_form_template, name='load_form_template'), path('api/v1/templates//delete/', views.delete_form_template, name='delete_form_template'), path('api/v1/sync/task//status/', views.sync_task_status, name='sync_task_status'), diff --git a/recruitment/urls.py b/recruitment/urls.py index e49764c..890dec5 100644 --- a/recruitment/urls.py +++ b/recruitment/urls.py @@ -119,12 +119,12 @@ urlpatterns = [ path("forms/template//submissions/", views.form_template_submissions_list, name="form_template_submissions_list"), path("forms/template//all-submissions/", views.form_template_all_submissions, name="form_template_all_submissions"), - # Application Forms (Public) - path("application/signup//", views.application_signup, name="application_signup"), - path("application//", views.application_submit_form, name="application_submit_form"), - path("application//submit/", views.application_submit, name="application_submit"), - path("application//apply/", views.job_application_detail, name="job_application_detail"), - path("application//success/", views.application_success, name="application_success"), + # # Application Forms (Public) + # path("application/signup//", views.application_signup, name="application_signup"), + # path("application//", views.application_submit_form, name="application_submit_form"), + # path("application//submit/", views.application_submit, name="application_submit"), + # path("application//apply/", views.job_application_detail, name="job_application_detail"), + # path("application//success/", views.application_success, name="application_success"), # ======================================================================== # INTEGRATION & EXTERNAL SERVICES diff --git a/recruitment/views.py b/recruitment/views.py index 8bafd63..5100fb0 100644 --- a/recruitment/views.py +++ b/recruitment/views.py @@ -1142,10 +1142,11 @@ def save_form_template(request): # ) -def load_form_template(request, template_slug): +def load_form_template(request, slug): """Load an existing form template""" try: - template = get_object_or_404(FormTemplate, slug=template_slug) + job = get_object_or_404(JobPosting, slug=slug) + template = job.form_template # Get stages with fields stages = [] @@ -1308,9 +1309,9 @@ def delete_form_template(request, template_id): def application_submit_form(request, slug): """Display the form as a step-by-step wizard""" job = get_object_or_404(JobPosting, slug=slug) - template_slug=job.form_template.slug + if not request.user.is_authenticated: - return redirect("application_signup", slug=template_slug) + return redirect("application_signup", slug=slug) if request.user.user_type == "candidate": person = request.user.person_profile @@ -1343,7 +1344,7 @@ def application_submit_form(request, slug): return render( request, "applicant/application_submit_form.html", - {"template_slug": job.form_template.slug, "job_id": job.internal_job_id}, + {"template_slug": job.form_template.slug,"job_slug": job.slug, "job_id": job.internal_job_id}, ) @@ -1351,24 +1352,19 @@ def application_submit_form(request, slug): @require_POST @login_required @candidate_user_required -def application_submit(request, template_slug): - import re - +def application_submit(request, slug): """Handle form submission""" - if not request.user.is_authenticated or request.user.user_type != "candidate": - return JsonResponse({"success": False, "message": "Unauthorized access."}) + # if not request.user.is_authenticated or request.user.user_type != "candidate": + # return JsonResponse({"success": False, "message": "Unauthorized access."}) - template = get_object_or_404(FormTemplate, slug=template_slug) - job = template.job + job = get_object_or_404(JobPosting, slug=slug) + template = job.form_template + if request.method == "POST": try: - with transaction.atomic(): - job_posting = JobPosting.objects.select_for_update().get( - form_template=template - ) - - current_count = job_posting.applications.count() - if current_count >= job_posting.max_applications: + with transaction.atomic(): + current_count = job.applications.count() + if current_count >= job.max_applications: template.is_active = False template.save() return JsonResponse( @@ -4700,8 +4696,7 @@ def source_toggle_status(request, slug): def application_signup(request, slug): from .forms import ApplicantSignupForm - form_template = get_object_or_404(FormTemplate, slug=slug) - job = form_template.job + job = get_object_or_404(JobPosting, slug=slug) if request.method == "POST": form = ApplicantSignupForm(request.POST) diff --git a/templates/account/email.html b/templates/account/email.html index 5979a19..57f7372 100644 --- a/templates/account/email.html +++ b/templates/account/email.html @@ -3,7 +3,7 @@ {% load account %} {% load crispy_forms_tags %} -{% block title %}{% translate "Email Addresses" %}{% endblock %} +{% block title %}{% trans "Email Addresses" %}{% endblock %} {% block content %}
diff --git a/templates/account/login.html b/templates/account/login.html index ba7a332..8d408ac 100644 --- a/templates/account/login.html +++ b/templates/account/login.html @@ -6,7 +6,7 @@ - KAAUH ATS - Sign In (Bootstrap) + {% trans "KAAUH ATS - Sign In" %} diff --git a/templates/account/logout.html b/templates/account/logout.html index 4af2a35..539f669 100644 --- a/templates/account/logout.html +++ b/templates/account/logout.html @@ -2,15 +2,15 @@ {% load i18n %} {% load account %} -{% block title %}{% translate "Sign Out" %}{% endblock %} +{% block title %}{% trans "Sign Out" %}{% endblock %} {% block content %}
-

{% translate "Account Settings" %}

-

{% translate "Manage your personal details and security." %}

+

{% trans "Account Settings" %}

+

{% trans "Manage your personal details and security." %}

@@ -23,18 +23,18 @@
@@ -47,9 +47,9 @@
-

{% translate "Confirm Sign Out" %}

+

{% trans "Confirm Sign Out" %}

-

{% translate "Are you sure you want to sign out of your account?" %}

+

{% trans "Are you sure you want to sign out of your account?" %}

{% csrf_token %} @@ -63,12 +63,12 @@
{# Sign Out button in danger color #} {# Cancel/Go Back button with outline #} - {% translate "Cancel" %} + {% trans "Cancel" %}
diff --git a/templates/account/password_reset.html b/templates/account/password_reset.html index 98ae130..3a75efc 100644 --- a/templates/account/password_reset.html +++ b/templates/account/password_reset.html @@ -4,7 +4,7 @@ - KAAUH ATS - Sign In (Bootstrap) + {% trans Reset Password %}-KAAUH ATS diff --git a/templates/account/verification_sent.html b/templates/account/verification_sent.html index 0718199..e0039cb 100644 --- a/templates/account/verification_sent.html +++ b/templates/account/verification_sent.html @@ -7,7 +7,7 @@ - KAAUH ATS - Verify Email + {% trans "Verify Email" %}-KAAUH ATS diff --git a/templates/applicant/application_submit_form.html b/templates/applicant/application_submit_form.html index cbb8b5c..e794788 100644 --- a/templates/applicant/application_submit_form.html +++ b/templates/applicant/application_submit_form.html @@ -1,4 +1,5 @@ {% extends 'applicant/partials/candidate_facing_base.html'%} + {% load static i18n %} {% block content %} -{% endblock %} - -{% block content %} -
- - {# --- TOP BAR --- #} -
- - {% trans "Back to Meetings" %} - -
- - {% trans "Edit Meeting" %} - -
- {% csrf_token %} - -
-
-
- - {# --- MAIN TITLE --- #} -
-

- - {{ meeting.topic|default:"[Meeting Topic]" }} - - {{ interview.get_status_display|default:"Scheduled" }} - -

-
- - {# --- INTERVIEW & CONNECTION CARDS --- #} -
- {# Interview Detail #} -
-
-

{% trans "Interview Detail" %}

-
-
-
{% trans "Job Title" %}:
-
{{ job.title|default:"N/A" }}
-
-
-
{% trans "Candidate Name" %}:
-
{{ candidate.full_name|default:"N/A" }}
-
-
-
{% trans "Candidate Email" %}:
-
{{ candidate.email|default:"N/A" }}
-
-
-
{% trans "Job Type" %}:
-
{{ job.job_type|default:"N/A" }}
-
- {% if candidate.belong_to_agency %} -
-
{% trans "Agency" %}:
-
{{ candidate.hiring_agency.name|default:"N/A" }}
-
- {% endif %} -
-
-
- - {# Connection Details #} -
-
-

{% trans "Connection Details" %}

-
-
-
{% trans "Date & Time" %}:
-
- {{ interview.interview_date }} {{ interview.interview_time }} ({{ meeting.timezone }}) -
-
-
-
{% trans "Duration" %}:
-
- {% if meeting.location_type == "Remote" %} - {{ meeting.zoommeetingdetails.duration|default:"N/A" }} - {% elif meeting.location_type == "Onsite" %} - {{ meeting.onsitelocationdetails.duration|default:"N/A" }} - {% else %} - N/A - {% endif %} - {% trans "minutes" %} -
-
- - {% if meeting.location_type == "Remote" %} - {% with zoom=meeting.zoommeetingdetails %} -
-
{% trans "Meeting ID" %}:
-
{{ zoom.meeting_id|default:"N/A" }}
-
-
-
{% trans "Host Email" %}:
-
{{ zoom.host_email|default:"N/A" }}
-
- {% if meeting.details_url %} -
-
- {% trans "Copied!" %} -
-
-
- {% trans "Join URL" %}: - {{ meeting.details_url }} -
- -
-
- {% endif %} - {% endwith %} - {% elif meeting.location_type == "Onsite" %} - {% with onsite=meeting.onsitelocationdetails %} -
-
{% trans "Address" %}:
-
{{ onsite.physical_address|default:"N/A" }}
-
-
-
{% trans "Room" %}:
-
{{ onsite.room_number|default:"TBD" }}
-
- {% endwith %} - {% endif %} -
-
-
-
- - {# --- PARTICIPANTS --- #} - {% comment %}
-
-
-
-

{% trans "Assigned Participants" %}

-
- - -
-
- - - - - - - - - - - - - {% for participant in external_participants %} - - - - - - - - {% endfor %} - {% for user in system_participants %} - - - - - - - - {% endfor %} - -
{% trans "Name" %}{% trans "Role" %}{% trans "Email" %}{% trans "Phone" %}{% trans "Type" %}
{{ participant.name }}{{ participant.designation|default:"Participant" }}{{ participant.email|default:"N/A" }}{{ participant.phone|default:"N/A" }}{% trans "External" %}
{{ user.get_full_name|default:user.username }}Admin{{ user.email|default:"N/A" }}{{ user.phone|default:"N/A" }}{% trans "System User" %}
-
-
-
{% endcomment %} - - {# --- COMMENTS --- #} -
-
-
-
-
- - {% trans "Comments" %} ({{ interview.notes.count }}) -
-
-
-
- {% for note in interview.notes.all|dictsortreversed:"created_at" %} -
-
-
- - {% if note.author == user or user.is_staff %} -
- -
- {% csrf_token %} - -
-
- {% endif %} -
-

{{ note.content|linebreaksbr }}

-
- - -
- {% empty %} -

{% trans "No comments yet. Be the first to comment!" %}

- {% endfor %} -
- -
-
{% trans "Add a New Comment" %}
-
- {% csrf_token %} -
- - -
- -
-
-
-
-
-
- -{# MODALS #} - - - - - - -{% endblock %} - -{% block customJS %} - -{% endblock %} \ No newline at end of file diff --git a/templates/interviews/interview_create_onsite.html b/templates/interviews/interview_create_onsite.html index 17a8410..384f9b1 100644 --- a/templates/interviews/interview_create_onsite.html +++ b/templates/interviews/interview_create_onsite.html @@ -11,7 +11,7 @@

- Create Onsite Interview for {{ application.name }} + {% trans "Create Onsite Interview for" %} {{ application.name }}

@@ -21,8 +21,8 @@

- Schedule an onsite interview for {{ application.name }} - for the position of {{ job.title }}. + {% trans "Schedule an onsite interview for" %} {{ application.name }} + {% trans "for the position of" %} {{ job.title }}.

{% if messages %} diff --git a/templates/interviews/interview_create_remote.html b/templates/interviews/interview_create_remote.html index 9bf7c9d..d65e19a 100644 --- a/templates/interviews/interview_create_remote.html +++ b/templates/interviews/interview_create_remote.html @@ -11,7 +11,7 @@

- Schedule a remote interview for {{ application.name }} - for the position of {{ job.title }}. + {% trans "Schedule a remote interview for" %} {{ application.name }} + {% trans "for the position of" %} {{ job.title }}.

{% if messages %} diff --git a/templates/interviews/interview_create_type_selection.html b/templates/interviews/interview_create_type_selection.html index 72ea9d6..9ae0409 100644 --- a/templates/interviews/interview_create_type_selection.html +++ b/templates/interviews/interview_create_type_selection.html @@ -11,13 +11,13 @@

- Create Interview for {{ application.name }} + {% trans "Create Interview for" %} {{ application.name }}

- Select the type of interview you want to schedule for {{ application.name }} - for the position of {{ job.title }}. + {% trans "Select the type of interview you want to schedule for" %} {{ application.name }} + {% trans "for the position of" %} {{ job.title }}.

diff --git a/templates/interviews/interview_list.html b/templates/interviews/interview_list.html index 34ff2e5..9b4c6a3 100644 --- a/templates/interviews/interview_list.html +++ b/templates/interviews/interview_list.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% load static i18n %} -{% block title %}{% trans "Interview Management" %} - ATS{% endblock %} +{% block title %}{% trans "Interviews" %} - ATS{% endblock %} {% block customCSS %} -{% endblock %} - -{% block content %} - - - -{% endblock %} \ No newline at end of file diff --git a/templates/recruitment/training_delete.html b/templates/recruitment/training_delete.html deleted file mode 100644 index dd23c7a..0000000 --- a/templates/recruitment/training_delete.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base.html" %} -{% load static %} - -{% block title %}Delete Training Material - {{ block.super }}{% endblock %} - -{% block content %} -
- -

Are you sure you want to delete the training material "{{ object.title }}" created on {{ object.created_at|date:"M d, Y" }}? This action cannot be undone.

- {% if object.file %} -

File: {{ object.file.name }}

- {% endif %} - {% if object.video_link %} -

Video Link: {{ object.video_link }}

- {% endif %} -
- {% csrf_token %} - - - - Yes, Delete Material - -
-
-{% endblock %} diff --git a/templates/recruitment/training_list.html b/templates/recruitment/training_list.html deleted file mode 100644 index 70e968a..0000000 --- a/templates/recruitment/training_list.html +++ /dev/null @@ -1,285 +0,0 @@ -{% extends "base.html" %} -{% load static i18n %} - -{% block title %}{% trans "Training Materials" %} - {{ block.super }}{% endblock %} - -{% block customCSS %} - -{% endblock %} - -{% block content %} -
-
-

- {% trans "Training Materials" %} -

- {% if user.is_authenticated %} - - {% trans "Add New Material" %} - - {% endif %} -
- -
-
-
-
- -
-
- {% include "includes/search_form.html" with search_query=search_query %} -
-
-
-
- {# Additional Filters can go here if needed #} -
-
-
-
- {% if materials %} -
- {# View Switcher - list_id must match the container ID #} - {% include "includes/_list_view_switcher.html" with list_id="training-materials-list" %} - - {# Card View (Default) - Must have 'row' class for grid layout #} -
- {% for material in materials %} -
-
-
-
-
{{ material.title }}
-
- -

- {% trans "Created By" %}: {{ material.created_by.username|default:"Anonymous" }}
- {% trans "Created On" %}: {{ material.created_at|date:"M d, Y" }} -

- -
-
- - {% trans "View" %} - - {% if user.is_authenticated and material.created_by == user %} - - {% trans "Edit" %} - - - {% endif %} -
-
-
-
-
- {% endfor %} -
- - {# Table View #} -
-
- - - - - - - - - - - {% for material in materials %} - - - - - - - {% endfor %} - -
{% trans "Title" %}{% trans "Created By" %}{% trans "Created" %}{% trans "Actions" %}
{{ material.title }}{{ material.created_by.username|default:"Anonymous" }}{{ material.created_at|date:"M d, Y" }} -
- - - - {% if user.is_authenticated and material.created_by == user %} - - - - - {% endif %} -
-
-
-
-
- - {# Pagination (Standardized to Reference) #} - {% if is_paginated %} - - {% endif %} - {% else %} -
-
- -

{% trans "No training materials found" %}

-

{% trans "It looks like there are no materials yet. Start by adding one!" %}

- {% if user.is_authenticated %} - - {% trans "Create Your First Material" %} - - {% endif %} -
-
- {% endif %} -
-{% endblock %} \ No newline at end of file diff --git a/templates/recruitment/training_update.html b/templates/recruitment/training_update.html deleted file mode 100644 index 0b29493..0000000 --- a/templates/recruitment/training_update.html +++ /dev/null @@ -1,191 +0,0 @@ -{% extends "base.html" %} -{% load static i18n crispy_forms_tags %} - -{% block title %}Update Training Material - {{ block.super }}{% endblock %} - -{% block customCSS %} - -{% endblock %} - -{% block content %} -
- -
-
-
-
-

- - {% trans "Update Training Material:" %} {{ object.title }} -

-

{% trans "Edit the details of this training document or guide." %}

-
-
- - - {% trans "Back to List" %} - - {% if object.pk %} - - - {% trans "View" %} - - {% endif %} -
-
-
-
- -
-
-

- - {% trans "Material Details" %} -

-
- -
- {% csrf_token %} -
- -
- - {# Title and Video Link on a single row #} -
-
- - {{ form.title|attr:"class:form-control" }} -
-
-
-
- - {{ form.video_link|attr:"class:form-control" }} -
-
- - {# Content (Full width) #} -
-
- - {{ form.content|attr:"class:form-control"|attr:"rows:6" }} -
-
- - {# File Upload (Full width as it's often complex) #} -
-
- - {{ form.file }} - {% if form.file.help_text %} -
{{ form.file.help_text }}
- {% endif %} -
-
-
-
- - -
-
-
-{% endblock %} \ No newline at end of file diff --git a/templates/user/portal_profile.html b/templates/user/portal_profile.html index 80ca43e..a02a110 100644 --- a/templates/user/portal_profile.html +++ b/templates/user/portal_profile.html @@ -180,7 +180,7 @@
{% trans "Last Login" %}
- {% if user.last_login %}{{ user.last_login|date:"F d, Y P" }}{% else %}N/A{% endif %} + {% if user.last_login %}{{ user.last_login|date:"F d, Y P" }}{% else %}{% endif %}
@@ -221,7 +221,7 @@