diff --git a/NorahUniversity/__pycache__/settings.cpython-312.pyc b/NorahUniversity/__pycache__/settings.cpython-312.pyc index ee8b9a6..9a36850 100644 Binary files a/NorahUniversity/__pycache__/settings.cpython-312.pyc and b/NorahUniversity/__pycache__/settings.cpython-312.pyc differ diff --git a/db.sqlite3 b/db.sqlite3 index 1d79938..591f60d 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/recruitment/__pycache__/admin.cpython-312.pyc b/recruitment/__pycache__/admin.cpython-312.pyc index 7e73a6f..b454784 100644 Binary files a/recruitment/__pycache__/admin.cpython-312.pyc and b/recruitment/__pycache__/admin.cpython-312.pyc differ diff --git a/recruitment/__pycache__/forms.cpython-312.pyc b/recruitment/__pycache__/forms.cpython-312.pyc index a421df6..6f80a04 100644 Binary files a/recruitment/__pycache__/forms.cpython-312.pyc and b/recruitment/__pycache__/forms.cpython-312.pyc differ diff --git a/recruitment/__pycache__/linkedin_service.cpython-312.pyc b/recruitment/__pycache__/linkedin_service.cpython-312.pyc index 8350c01..56e8775 100644 Binary files a/recruitment/__pycache__/linkedin_service.cpython-312.pyc and b/recruitment/__pycache__/linkedin_service.cpython-312.pyc differ diff --git a/recruitment/__pycache__/models.cpython-312.pyc b/recruitment/__pycache__/models.cpython-312.pyc index f67832d..4d11b5e 100644 Binary files a/recruitment/__pycache__/models.cpython-312.pyc and b/recruitment/__pycache__/models.cpython-312.pyc differ diff --git a/recruitment/__pycache__/signals.cpython-312.pyc b/recruitment/__pycache__/signals.cpython-312.pyc index 0af7a5b..e8303fa 100644 Binary files a/recruitment/__pycache__/signals.cpython-312.pyc and b/recruitment/__pycache__/signals.cpython-312.pyc differ diff --git a/recruitment/__pycache__/urls.cpython-312.pyc b/recruitment/__pycache__/urls.cpython-312.pyc index 8fd07cf..76969dc 100644 Binary files a/recruitment/__pycache__/urls.cpython-312.pyc and b/recruitment/__pycache__/urls.cpython-312.pyc differ diff --git a/recruitment/__pycache__/utils.cpython-312.pyc b/recruitment/__pycache__/utils.cpython-312.pyc index fc89d14..d2f9cb2 100644 Binary files a/recruitment/__pycache__/utils.cpython-312.pyc and b/recruitment/__pycache__/utils.cpython-312.pyc differ diff --git a/recruitment/__pycache__/views.cpython-312.pyc b/recruitment/__pycache__/views.cpython-312.pyc index cb165ec..ccaa5c1 100644 Binary files a/recruitment/__pycache__/views.cpython-312.pyc and b/recruitment/__pycache__/views.cpython-312.pyc differ diff --git a/recruitment/decorators.py b/recruitment/decorators.py new file mode 100644 index 0000000..b929bf2 --- /dev/null +++ b/recruitment/decorators.py @@ -0,0 +1,17 @@ +from functools import wraps +from datetime import date +from django.shortcuts import redirect, get_object_or_404 +from django.http import HttpResponseNotFound + +def job_not_expired(view_func): + @wraps(view_func) + def _wrapped_view(request, job_id, *args, **kwargs): + + from .models import JobPosting + job = get_object_or_404(JobPosting, pk=job_id) + + if job.expiration_date and job.application_deadline< date.today(): + return redirect('expired_job_page') + + return view_func(request, job_id, *args, **kwargs) + return _wrapped_view \ No newline at end of file diff --git a/recruitment/templatetags/__pycache__/form_filters.cpython-312.pyc b/recruitment/templatetags/__pycache__/form_filters.cpython-312.pyc index dc240d2..6c22f61 100644 Binary files a/recruitment/templatetags/__pycache__/form_filters.cpython-312.pyc and b/recruitment/templatetags/__pycache__/form_filters.cpython-312.pyc differ diff --git a/recruitment/urls.py b/recruitment/urls.py index d0c9b05..4f24bbb 100644 --- a/recruitment/urls.py +++ b/recruitment/urls.py @@ -12,6 +12,7 @@ urlpatterns = [ path('jobs//update/', views.edit_job, name='job_update'), # path('jobs//delete/', views., name='job_delete'), path('jobs//', views.job_detail, name='job_detail'), + path('jobs//candidate/', views.job_detail_candidate, name='job_detail_candidate'), # LinkedIn Integration URLs path('jobs//post-to-linkedin/', views.post_to_linkedin, name='post_to_linkedin'), diff --git a/recruitment/views.py b/recruitment/views.py index 8b70168..2b8b7fb 100644 --- a/recruitment/views.py +++ b/recruitment/views.py @@ -242,7 +242,12 @@ def job_detail(request, slug): 'offer_count': offer_count, } return render(request, 'jobs/job_detail.html', context) -\ + + +# job detail facing the candidate: +def job_detail_candidate(request,slug): + job=get_object_or_404(JobPosting,slug=slug) + return render(request,'jobs/job_detail_candidate.html',{'job':job}) def post_to_linkedin(request,slug): """Post a job to LinkedIn""" diff --git a/templates/jobs/job_detail_candidate.html b/templates/jobs/job_detail_candidate.html new file mode 100644 index 0000000..a10bdb3 --- /dev/null +++ b/templates/jobs/job_detail_candidate.html @@ -0,0 +1,230 @@ +{% extends "base.html" %} + +{% block title %}{{ job.title }} - University ATS{% endblock %} +{% block customCSS %} + + +{% endblock %} + +{% block content %} +
+ +
+
+
+
Ready to Apply?
+
+
+

Review the job details, then apply below.

+ + {% if job.form_template %} + + Apply for this Position + + {% endif %} + + {% comment %}

+ Application ID: **{{ job.pk }}** +

{% endcomment %} +
+
+
+ +
+
+
+

{{ job.title }}

+ + {% with status_class=job.status|lower %} + + {{ job.get_status_display }} + + {% endwith %} +
+ +
+ +

Job Overview

+
+ + {% if job.salary_range %} +
+ + Salary: + {{ job.salary_range }} +
+ {% endif %} + +
+ + Deadline: + {% if job.application_deadline %} + {{ job.application_deadline|date:"M d, Y" }} + {% if job.is_expired %} + EXPIRED + {% endif %} + {% else %} + Not specified + {% endif %} +
+ +
+ + Job Type: {{ job.get_job_type_display }} +
+ +
+ + Location: {{ job.get_location_display }} +
+ +
+ + Department: {{ job.department|default:"Not specified" }} +
+ +
+ + JOB ID: {{ job.internal_job_id|default:"N/A" }} +
+ +
+ + Workplace: {{ job.get_workplace_type_display }} +
+ +
+ + Created By: {{ job.created_by|default:"N/A" }} +
+
+ + {% if job.description %} +
+
+
+ Job Description +
+
{{ job.description|linebreaks }}
+
+ {% endif %} + + {% if job.qualifications %} +
+
+
+ Qualifications +
+
{{ job.qualifications|linebreaks }}
+
+ {% endif %} + + {% if job.benefits %} +
+
+
+ Benefits +
+
{{ job.benefits|linebreaks }}
+
+ {% endif %} + + {% if job.application_instructions %} +
+
+
+ Application Instructions +
+
{{ job.application_instructions|linebreaks }}
+
+ {% endif %} + +
+
+
+
+ +
+ {% if job.form_template %} + + Apply for this Position + + {% endif %} +
+{% endblock %} \ No newline at end of file