From a96e618a6a54c23125323a25f74006caa3212f52 Mon Sep 17 00:00:00 2001 From: ismail Date: Mon, 24 Nov 2025 23:03:56 +0300 Subject: [PATCH 1/4] add delete --- recruitment/models.py | 4 +- requirements.txt | 335 +++++---- templates/people/delete_person.html | 372 ++++++++++ templates/people/person_confirm_delete.html | 60 ++ templates/people/person_list.html | 10 +- templates/people/update_person.html | 3 + templates/recruitment/agency_form.html | 649 ++++++++++++------ templates/recruitment/application_update.html | 394 ++++++++--- templates/recruitment/applications_list.html | 4 +- templates/recruitment/candidate_delete.html | 386 +++++++++++ templates/recruitment/source_form.html | 604 +++++++++++----- 11 files changed, 2222 insertions(+), 599 deletions(-) create mode 100644 templates/people/delete_person.html create mode 100644 templates/people/person_confirm_delete.html create mode 100644 templates/recruitment/candidate_delete.html diff --git a/recruitment/models.py b/recruitment/models.py index 1441182..991c205 100644 --- a/recruitment/models.py +++ b/recruitment/models.py @@ -295,10 +295,10 @@ class JobPosting(Base): next_num = 1 self.internal_job_id = f"{prefix}-{year}-{next_num:06d}" - + if self.department: self.department = self.department.title() - + super().save(*args, **kwargs) def get_location_display(self): diff --git a/requirements.txt b/requirements.txt index 5fee9fe..36e09c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,146 +1,191 @@ -annotated-types -appdirs -asgiref -asteval -astunparse -attrs -blinker -blis -boto3 -botocore -bw-migrations -bw2parameters -bw_processing -cached-property -catalogue -certifi -channels -chardet -charset-normalizer -click -cloudpathlib -confection -constructive_geometries -country_converter -cymem -dataflows-tabulator -datapackage -deepdiff -Deprecated -Django -django-allauth -django-cors-headers -django-filter -django-unfold -djangorestframework -docopt +amqp==5.3.1 +annotated-types==0.7.0 +anthropic==0.63.0 +anyio==4.11.0 +appdirs==1.4.4 +arrow==1.3.0 +asgiref==3.9.2 +asteval==1.0.6 +astunparse==1.6.3 +attrs==25.3.0 +billiard==4.2.2 +bleach==6.2.0 +blessed==1.22.0 +blinker==1.9.0 +blis==1.3.0 +boto3==1.40.37 +botocore==1.40.37 +bw-migrations==0.2 +bw2data==4.5 +bw2parameters==1.1.0 +bw_processing==1.0 +cached-property==2.0.1 +catalogue==2.0.10 +celery==5.5.3 +certifi==2025.8.3 +channels==4.3.1 +chardet==5.2.0 +charset-normalizer==3.4.3 +click==8.3.0 +click-didyoumean==0.3.1 +click-plugins==1.1.1.2 +click-repl==0.3.0 +cloudpathlib==0.22.0 +confection==0.1.5 +constructive_geometries==1.0 +country_converter==1.3.1 +crispy-bootstrap5==2025.6 +cymem==2.0.11 +dataflows-tabulator==1.54.3 +datapackage==1.15.4 +datastar-py==0.6.5 +deepdiff==7.0.1 +Deprecated==1.2.18 +distro==1.9.0 +Django==5.2.6 +django-allauth==65.11.2 +django-ckeditor-5==0.2.18 +django-cors-headers==4.9.0 +django-countries==7.6.1 +django-crispy-forms==2.4 +django-easy-audit==1.3.7 +django-extensions==4.1 +django-filter==25.1 +django-picklefield==3.3 +django-q2==1.8.0 +django-summernote==0.8.20.0 +django-template-partials==25.2 +django-unfold==0.66.0 +django-widget-tweaks==1.5.0 +django_celery_results==2.6.0 +djangorestframework==3.16.1 +docopt==0.6.2 en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl#sha256=1932429db727d4bff3deed6b34cfc05df17794f4a52eeb26cf8928f7c1a0fb85 -et_xmlfile -Faker -flexcache -flexparser -fsspec -idna -ijson -isodate -Jinja2 -jmespath -jsonlines -jsonpointer -jsonschema -jsonschema-specifications -langcodes -language_data -linear-tsv -llvmlite -loguru -lxml -marisa-trie -markdown-it-py -MarkupSafe -matrix_utils -mdurl -morefs -mrio-common-metadata -murmurhash -numba -numpy -openpyxl -ordered-set -packaging -pandas -peewee -Pint -platformdirs -preshed -prettytable -pydantic -pydantic-settings -pydantic_core -pyecospold -Pygments -PyJWT -PyMuPDF -pyparsing -PyPrind -python-dateutil -python-dotenv -python-json-logger -pytz -pyxlsb -PyYAML -randonneur -randonneur_data -RapidFuzz -rdflib -referencing -requests -rfc3986 -rich -rpds-py -s3transfer -scipy -shellingham -six -smart-open -snowflake-id -spacy -spacy-legacy -spacy-loggers -SPARQLWrapper -sparse -SQLAlchemy -sqlparse -srsly -stats_arrays -structlog -tableschema -thinc -toolz -tqdm -typer -typing-inspection -typing_extensions -tzdata -unicodecsv -urllib3 -voluptuous -wasabi -wcwidth -weasel -wrapt -wurst -xlrd -XlsxWriter -celery[redis] -redis -sentence-transformers -torch -pdfplumber -python-docx -PyMuPDF -pytesseract -Pillow -python-dotenv -django-countries -django-q2 \ No newline at end of file +et_xmlfile==2.0.0 +Faker==37.8.0 +flexcache==0.3 +flexparser==0.4 +fsspec==2025.9.0 +gpt-po-translator==1.3.2 +greenlet==3.2.4 +h11==0.16.0 +httpcore==1.0.9 +httpx==0.28.1 +idna==3.10 +ijson==3.4.0 +iniconfig==2.1.0 +isodate==0.7.2 +isort==5.13.2 +Jinja2==3.1.6 +jiter==0.11.1 +jmespath==1.0.1 +jsonlines==4.0.0 +jsonpointer==3.0.0 +jsonschema==4.25.1 +jsonschema-specifications==2025.9.1 +kombu==5.5.4 +langcodes==3.5.0 +language_data==1.3.0 +linear-tsv==1.1.0 +llvmlite==0.45.0 +loguru==0.7.3 +lxml==6.0.2 +marisa-trie==1.3.1 +markdown-it-py==4.0.0 +MarkupSafe==3.0.2 +matrix_utils==0.6.2 +mdurl==0.1.2 +morefs==0.2.2 +mrio-common-metadata==0.2.1 +murmurhash==1.0.13 +numba==0.62.0 +numpy==2.3.3 +openai==1.99.9 +openpyxl==3.1.5 +ordered-set==4.1.0 +packaging==25.0 +pandas==2.3.2 +peewee==3.18.2 +pillow==11.3.0 +Pint==0.25 +platformdirs==4.4.0 +pluggy==1.6.0 +polib==1.2.0 +preshed==3.0.10 +prettytable==3.16.0 +prompt_toolkit==3.0.52 +psycopg2-binary==2.9.11 +pycountry==24.6.1 +pydantic==2.11.9 +pydantic-settings==2.10.1 +pydantic_core==2.33.2 +pyecospold==4.0.0 +Pygments==2.19.2 +PyJWT==2.10.1 +PyMuPDF==1.26.4 +pyparsing==3.2.5 +PyPDF2==3.0.1 +PyPrind==2.11.3 +pytest==8.3.4 +pytest-django==4.11.1 +python-dateutil==2.9.0.post0 +python-docx==1.2.0 +python-dotenv==1.0.1 +python-json-logger==3.3.0 +pytz==2025.2 +pyxlsb==1.0.10 +PyYAML==6.0.2 +randonneur==0.6.2 +randonneur_data==0.6 +RapidFuzz==3.14.1 +rdflib==7.2.1 +redis==3.5.3 +referencing==0.36.2 +requests==2.32.3 +responses==0.25.8 +rfc3986==2.0.0 +rich==14.1.0 +rpds-py==0.27.1 +s3transfer==0.14.0 +scipy==1.16.2 +setuptools==80.9.0 +setuptools-scm==8.1.0 +shellingham==1.5.4 +six==1.17.0 +smart_open==7.3.1 +sniffio==1.3.1 +snowflake-id==1.0.2 +spacy==3.8.7 +spacy-legacy==3.0.12 +spacy-loggers==1.0.5 +SPARQLWrapper==2.0.0 +sparse==0.17.0 +SQLAlchemy==2.0.43 +sqlparse==0.5.3 +srsly==2.5.1 +stats_arrays==0.7 +structlog==25.4.0 +tableschema==1.21.0 +tenacity==9.0.0 +thinc==8.3.6 +tomli==2.2.1 +toolz==1.0.0 +tqdm==4.67.1 +typer==0.19.2 +types-python-dateutil==2.9.0.20251008 +typing-inspection==0.4.1 +typing_extensions==4.15.0 +tzdata==2025.2 +unicodecsv==0.14.1 +urllib3==2.5.0 +vine==5.1.0 +voluptuous==0.15.2 +wasabi==1.1.3 +wcwidth==0.2.14 +weasel==0.4.1 +webencodings==0.5.1 +wheel==0.45.1 +wrapt==1.17.3 +wurst==0.4 +xlrd==2.0.2 +xlsxwriter==3.2.9 diff --git a/templates/people/delete_person.html b/templates/people/delete_person.html new file mode 100644 index 0000000..0f79a9d --- /dev/null +++ b/templates/people/delete_person.html @@ -0,0 +1,372 @@ +{% extends "base.html" %} +{% load static i18n %} + +{% block title %}{% trans "Delete Person" %} - {{ block.super }}{% endblock %} + +{% block customCSS %} + +{% endblock %} + +{% block content %} +
+ +
+
+

+ + {% trans "Delete Person" %} +

+

+ {% trans "You are about to delete a person record. This action cannot be undone." %} +

+
+ + {% trans "Back to Person" %} + +
+ +
+
+ +
+
+ +
+

{% trans "Warning: This action cannot be undone!" %}

+

+ {% trans "Deleting this person will permanently remove all associated data. Please review the information below carefully before proceeding." %} +

+
+ + +
+
+
+ + {% trans "Person to be Deleted" %} +
+
+
+
+
+ {% if object.profile_image %} + {{ object.get_full_name }} + {% else %} +
+ +
+ {% endif %} +
+

{{ object.get_full_name }}

+ {% if object.email %} +

{{ object.email }}

+ {% endif %} +
+
+ + {% if object.phone %} +
+
+ +
+
+
{% trans "Phone" %}
+
{{ object.phone }}
+
+
+ {% endif %} + +
+
+ +
+
+
{% trans "Created On" %}
+
{{ object.created_at|date:"F d, Y" }}
+
+
+ + {% if object.nationality %} +
+
+ +
+
+
{% trans "Nationality" %}
+
{{ object.nationality }}
+
+
+ {% endif %} + + {% if object.gender %} +
+
+ +
+
+
{% trans "Gender" %}
+
{{ object.get_gender_display }}
+
+
+ {% endif %} +
+
+
+ + +
+
+
+ + {% trans "What will happen when you delete this person?" %} +
+
+
+
    +
  • + + {% trans "The person profile and all personal information will be permanently deleted" %} +
  • +
  • + + {% trans "All associated applications and documents will be removed" %} +
  • +
  • + + {% trans "Any interview schedules and history will be deleted" %} +
  • +
  • + + {% trans "All related data and records will be lost" %} +
  • +
  • + + {% trans "This action cannot be undone under any circumstances" %} +
  • +
+
+
+ + +
+
+
+ {% csrf_token %} + +
+
+ + +
+
+ +
+ + + {% trans "Cancel" %} + + +
+
+
+
+
+
+
+ + +{% endblock %} diff --git a/templates/people/person_confirm_delete.html b/templates/people/person_confirm_delete.html new file mode 100644 index 0000000..e8711d1 --- /dev/null +++ b/templates/people/person_confirm_delete.html @@ -0,0 +1,60 @@ +{% extends "base.html" %} +{% load static i18n %} + +{% block title %}{% trans "Delete Person" %} - {{ block.super }}{% endblock %} + +{% block content %} +
+
+
+
+
+

+ + {% trans "Confirm Deletion" %} +

+
+
+ + +
+ {% if person.profile_image %} + {{ person.get_full_name }} + {% else %} +
+ +
+ {% endif %} +
{{ person.get_full_name }}
+ {% if person.email %} +

{{ person.email }}

+ {% endif %} +
+ +
+ {% csrf_token %} +
+ + {% trans "Cancel" %} + + +
+
+
+
+
+
+
+{% endblock %} diff --git a/templates/people/person_list.html b/templates/people/person_list.html index af8a475..375169e 100644 --- a/templates/people/person_list.html +++ b/templates/people/person_list.html @@ -163,7 +163,7 @@
- +
@@ -213,8 +213,8 @@
- - + + {% if people_list %}
@@ -287,13 +287,13 @@ class="btn btn-outline-secondary" title="{% trans 'Edit' %}"> - + {% endcomment %} {% endif %}
diff --git a/templates/people/update_person.html b/templates/people/update_person.html index f23d075..33d35ec 100644 --- a/templates/people/update_person.html +++ b/templates/people/update_person.html @@ -194,6 +194,9 @@ {% trans "View Details" %} + + {% trans "Delete" %} + {% trans "Back to List" %} diff --git a/templates/recruitment/agency_form.html b/templates/recruitment/agency_form.html index c03d06b..4f72f50 100644 --- a/templates/recruitment/agency_form.html +++ b/templates/recruitment/agency_form.html @@ -1,217 +1,478 @@ -{% extends 'base.html' %} -{% load static i18n %} +{% extends "base.html" %} +{% load static i18n widget_tweaks %} -{% block title %}{{ title }} - ATS{% endblock %} +{% block title %}{{ title }} - {{ block.super }}{% endblock %} + +{% block customCSS %} + +{% endblock %} {% block content %} -
- -
-
-

{{ title }}

-

+

+
+ + + + + - - {% trans "Back to Agencies" %} - -
- -
-
-
-
- {% if form.non_field_errors %} - +{% endblock %} +{% block customJS %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/templates/recruitment/application_update.html b/templates/recruitment/application_update.html index dd38079..d5af670 100644 --- a/templates/recruitment/application_update.html +++ b/templates/recruitment/application_update.html @@ -1,43 +1,51 @@ {% extends "base.html" %} {% load static i18n crispy_forms_tags %} -{% block title %}Update Candidate - {{ block.super }}{% endblock %} +{% block title %}Update {{ object.name }} - {{ block.super }}{% endblock %} {% block customCSS %} {% endblock %} {% block content %}
- -
-
-
-
-

- - {% trans "Update Candidate:" %} {{ object.name }} -

-

{% trans "Edit candidate information and details" %}

-
-
- - - {% trans "Back to List" %} +
+ + + + + + + +
+
+
+
{% trans "Currently Editing" %}
+
+ {% if object.profile_image %} + {{ object.name }} + {% else %} +
+ +
+ {% endif %} +
+
{{ object.name }}
+ {% if object.email %} +

{{ object.email }}

+ {% endif %} + + {% trans "Created" %}: {{ object.created_at|date:"d M Y" }} • + {% trans "Last Updated" %}: {{ object.updated_at|date:"d M Y" }} + +
+
-
-
-
-

- - {% trans "Candidate Form" %} -

-
-
-
- {% csrf_token %} - - {# Use Crispy Forms to render fields. The two-column layout is applied to the main form content #} -
- {% for field in form %} -
- {{ field|as_crispy_field }} + +
+
+ {% if form.non_field_errors %} + + {% endif %} + + {% if messages %} + {% for message in messages %} + {% endfor %} -
- -
- - + {% endif %} + +
+ {% csrf_token %} + {{form|crispy}} +
+
+ +
+
-{% endblock %} \ No newline at end of file +{% endblock %} + +{% block customJS %} + +{% endblock %} diff --git a/templates/recruitment/applications_list.html b/templates/recruitment/applications_list.html index c95c2bc..2d93ac9 100644 --- a/templates/recruitment/applications_list.html +++ b/templates/recruitment/applications_list.html @@ -332,12 +332,12 @@ - + {% endcomment %} {% endif %}
diff --git a/templates/recruitment/candidate_delete.html b/templates/recruitment/candidate_delete.html new file mode 100644 index 0000000..9ce959d --- /dev/null +++ b/templates/recruitment/candidate_delete.html @@ -0,0 +1,386 @@ +{% extends "base.html" %} +{% load static i18n %} + +{% block title %}{% trans "Delete Candidate" %} - {{ block.super }}{% endblock %} + +{% block customCSS %} + +{% endblock %} + +{% block content %} +
+ +
+
+

+ + {% trans "Delete Candidate" %} +

+

+ {% trans "You are about to delete a candidate application. This action cannot be undone." %} +

+
+ + {% trans "Back to Candidate" %} + +
+ +
+
+ +
+
+ +
+

{% trans "Warning: This action cannot be undone!" %}

+

+ {% trans "Deleting this candidate will permanently remove all associated data. Please review the information below carefully before proceeding." %} +

+
+ + +
+
+
+ + {% trans "Candidate to be Deleted" %} +
+
+
+
+
+ {% if object.profile_image %} + {{ object.name }} + {% else %} +
+ +
+ {% endif %} +
+

{{ object.name }}

+ {% if object.email %} +

{{ object.email }}

+ {% endif %} +
+
+ +
+
+ +
+
+
{% trans "Position Applied" %}
+
+ {% if object.job_posting %} + {{ object.job_posting.title }} + {% else %} + {% trans "Not specified" %} + {% endif %} +
+
+
+ + {% if object.phone %} +
+
+ +
+
+
{% trans "Phone" %}
+
{{ object.phone }}
+
+
+ {% endif %} + +
+
+ +
+
+
{% trans "Applied On" %}
+
{{ object.created_at|date:"F d, Y" }}
+
+
+ +
+
+ +
+
+
{% trans "Status" %}
+
+ {% if object.status %} + {{ object.get_status_display }} + {% else %} + {% trans "Not specified" %} + {% endif %} +
+
+
+
+
+
+ + +
+
+
+ + {% trans "What will happen when you delete this candidate?" %} +
+
+
+
    +
  • + + {% trans "The candidate profile and all personal information will be permanently deleted" %} +
  • +
  • + + {% trans "All application data and documents will be removed" %} +
  • +
  • + + {% trans "Interview schedules and history will be deleted" %} +
  • +
  • + + {% trans "Any associated notes and communications will be lost" %} +
  • +
  • + + {% trans "This action cannot be undone under any circumstances" %} +
  • +
+
+
+ + +
+
+
+ {% csrf_token %} + +
+
+ + +
+
+ +
+ + + {% trans "Cancel" %} + + +
+
+
+
+
+
+
+ + +{% endblock %} diff --git a/templates/recruitment/source_form.html b/templates/recruitment/source_form.html index 0d76739..e2b0d07 100644 --- a/templates/recruitment/source_form.html +++ b/templates/recruitment/source_form.html @@ -2,196 +2,409 @@ {% load static i18n %} {% load widget_tweaks %} -{% block title %}{{ title }}{% endblock %} +{% block title %}{{ title }} - {{ block.super }}{% endblock %} + +{% block customCSS %} + +{% endblock %} {% block content %} -
-
-
-
-

{{ title }}

+
+
+ + + + + -
-
-
- {% csrf_token %} + {% if source %} + +
+
+
+
{% trans "Currently Editing" %}
+
+
+ +
+
+
{{ source.name }}
+ {% if source.source_type %} +

{% trans "Type" %}: {{ source.get_source_type_display }}

+ {% endif %} + {% if source.ip_address %} +

{% trans "IP Address" %}: {{ source.ip_address }}

+ {% endif %} + + {% trans "Created" %}: {{ source.created_at|date:"d M Y" }} • + {% trans "Last Updated" %}: {{ source.updated_at|date:"d M Y" }} + +
+
+
+
+
+ {% endif %} - {% if form.non_field_errors %} -
- {% for error in form.non_field_errors %} + +
+
+ {% if form.non_field_errors %} + + {% endif %} + + {% if messages %} + {% for message in messages %} + + {% endfor %} + {% endif %} + + + {% csrf_token %} + +
+
+
+ + {{ form.name|add_class:"form-control" }} + {% if form.name.errors %} +
+ {% for error in form.name.errors %} + {{ error }} + {% endfor %} +
+ {% endif %} +
{{ form.name.help_text }}
+
+
+
+
+ + {{ form.source_type|add_class:"form-select" }} + {% if form.source_type.errors %} +
+ {% for error in form.source_type.errors %} + {{ error }} + {% endfor %} +
+ {% endif %} +
{{ form.source_type.help_text }}
+
+
+
+ +
+
+
+ + {{ form.ip_address|add_class:"form-control" }} + {% if form.ip_address.errors %} +
+ {% for error in form.ip_address.errors %} + {{ error }} + {% endfor %} +
+ {% endif %} +
{{ form.ip_address.help_text }}
+
+
+
+
+ + {{ form.trusted_ips|add_class:"form-control" }} + {% if form.trusted_ips.errors %} +
+ {% for error in form.trusted_ips.errors %} + {{ error }} + {% endfor %} +
+ {% endif %} +
{{ form.trusted_ips.help_text }}
+
+
+
+ +
+ + {{ form.description|add_class:"form-control" }} + {% if form.description.errors %} +
+ {% for error in form.description.errors %} {{ error }} {% endfor %}
{% endif %} +
{{ form.description.help_text }}
+
-
-
-
-