Compare commits
No commits in common. "2153de3446eb244834e02d3221774298f4f1645d" and "2211c5f3b276800cd6071d6182de68a37b510b5a" have entirely different histories.
2153de3446
...
2211c5f3b2
@ -206,9 +206,7 @@ ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True
|
||||
ACCOUNT_FORMS = {"signup": "recruitment.forms.StaffSignupForm"}
|
||||
|
||||
|
||||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
||||
EMAIL_HOST = "10.10.1.110"
|
||||
EMAIL_PORT = 2225
|
||||
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
|
||||
|
||||
# Crispy Forms Configuration
|
||||
CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
|
||||
|
||||
@ -27,8 +27,7 @@ from .models import (
|
||||
Participants,
|
||||
Message,
|
||||
Person,
|
||||
Document,
|
||||
CustomUser
|
||||
Document
|
||||
)
|
||||
|
||||
# from django_summernote.widgets import SummernoteWidget
|
||||
@ -1029,20 +1028,17 @@ class HiringAgencyForm(forms.ModelForm):
|
||||
raise ValidationError("Please enter a valid email address.")
|
||||
|
||||
# Check uniqueness (optional - remove if multiple agencies can have same email)
|
||||
# instance = self.instance
|
||||
email = email.lower().strip()
|
||||
if CustomUser.objects.filter(email=email).exists():
|
||||
raise ValidationError("This email is already associated with a user account.")
|
||||
# if not instance.pk: # Creating new instance
|
||||
# if HiringAgency.objects.filter(email=email).exists():
|
||||
# raise ValidationError("An agency with this email already exists.")
|
||||
# else: # Editing existing instance
|
||||
# if (
|
||||
# HiringAgency.objects.filter(email=email)
|
||||
# .exclude(pk=instance.pk)
|
||||
# .exists()
|
||||
# ):
|
||||
# raise ValidationError("An agency with this email already exists.")
|
||||
instance = self.instance
|
||||
if not instance.pk: # Creating new instance
|
||||
if HiringAgency.objects.filter(email=email).exists():
|
||||
raise ValidationError("An agency with this email already exists.")
|
||||
else: # Editing existing instance
|
||||
if (
|
||||
HiringAgency.objects.filter(email=email)
|
||||
.exclude(pk=instance.pk)
|
||||
.exists()
|
||||
):
|
||||
raise ValidationError("An agency with this email already exists.")
|
||||
return email.lower().strip() if email else email
|
||||
|
||||
def clean_phone(self):
|
||||
@ -2112,7 +2108,6 @@ class MessageForm(forms.ModelForm):
|
||||
"rows": 6,
|
||||
"placeholder": "Enter your message here...",
|
||||
"required": True,
|
||||
'spellcheck': 'true',
|
||||
}
|
||||
),
|
||||
"message_type": forms.Select(attrs={"class": "form-select"}),
|
||||
@ -2157,21 +2152,12 @@ class MessageForm(forms.ModelForm):
|
||||
"""Filter job options based on user type"""
|
||||
|
||||
if self.user.user_type == "agency":
|
||||
# # Agency users can only see jobs assigned to their agency
|
||||
# self.fields["job"].queryset = JobPosting.objects.filter(
|
||||
# hiring_agency__user=self.user,
|
||||
# status="ACTIVE"
|
||||
# ).order_by("-created_at")
|
||||
#
|
||||
job_assignments =AgencyJobAssignment.objects.filter(
|
||||
agency__user=self.user,
|
||||
job__status="ACTIVE"
|
||||
)
|
||||
job_ids = job_assignments.values_list('job__id', flat=True)
|
||||
# Agency users can only see jobs assigned to their agency
|
||||
self.fields["job"].queryset = JobPosting.objects.filter(
|
||||
id__in=job_ids
|
||||
hiring_agency__user=self.user,
|
||||
status="ACTIVE"
|
||||
).order_by("-created_at")
|
||||
|
||||
print(self.user)
|
||||
print("Agency user job queryset:", self.fields["job"].queryset)
|
||||
elif self.user.user_type == "candidate":
|
||||
# Candidates can only see jobs they applied for
|
||||
|
||||
@ -22,18 +22,6 @@ from django.db.models import F, Value, IntegerField, CharField
|
||||
from django.db.models.functions import Coalesce, Cast
|
||||
from django.db.models.fields.json import KeyTransform, KeyTextTransform
|
||||
|
||||
class EmailContent(models.Model):
|
||||
subject = models.CharField(max_length=255, verbose_name=_("Subject"))
|
||||
message = CKEditor5Field(verbose_name=_("Message Body"))
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Email Content")
|
||||
verbose_name_plural = _("Email Contents")
|
||||
|
||||
def __str__(self):
|
||||
return self.subject
|
||||
|
||||
|
||||
class CustomUser(AbstractUser):
|
||||
"""Custom user model extending AbstractUser"""
|
||||
|
||||
|
||||
@ -3313,7 +3313,6 @@ def agency_create(request):
|
||||
if request.method == "POST":
|
||||
form = HiringAgencyForm(request.POST)
|
||||
if form.is_valid():
|
||||
|
||||
agency = form.save()
|
||||
messages.success(request, f'Agency "{agency.name}" created successfully!')
|
||||
return redirect("agency_detail", slug=agency.slug)
|
||||
|
||||
@ -732,6 +732,3 @@ html[dir="rtl"] .me-auto { margin-right: 0 !important; margin-left: auto !import
|
||||
content: ">";
|
||||
color: var(--kaauh-teal);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -50,7 +50,10 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-dark sticky-top">
|
||||
<div class="container-fluid max-width-1600">
|
||||
|
||||
|
||||
{# --- MOBILE BRAND LOGIC: Show small logo on mobile, large on desktop (lg) --- #}
|
||||
<a class="navbar-brand text-white d-block d-lg-none" href="{% url 'dashboard' %}" aria-label="Home">
|
||||
<img src="{% static 'image/kaauh_green1.png' %}" alt="{% trans 'kaauh logo green bg' %}" class="navbar-brand-mobile">
|
||||
</a>
|
||||
|
||||
<a class="navbar-brand text-white d-none d-lg-block me-4 pe-4" href="{% url 'dashboard' %}" aria-label="Home">
|
||||
<img src="{% static 'image/kaauh_green1.png' %}" alt="{% trans 'kaauh logo green bg' %}" style="width: 60px; height: 60px;">
|
||||
@ -115,7 +118,7 @@
|
||||
<i class="fas fa-envelope"></i>
|
||||
</a>
|
||||
</li> {% endcomment %}
|
||||
<li class="nav-item me-2 d-none d-lg-block">
|
||||
<li class="nav-item me-2">
|
||||
{% if LANGUAGE_CODE == 'en' %}
|
||||
<form action="{% url 'set_language' %}" method="post" class="d-inline">
|
||||
{% csrf_token %}
|
||||
@ -134,11 +137,11 @@
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li class="nav-item me-2 d-none d-lg-block">
|
||||
<li class="nav-item me-2">
|
||||
<a class="nav-link text-white" href="{% url 'message_list' %}">
|
||||
<i class="fas fa-envelope"></i> <span>{% trans "Messages" %}</span>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<button
|
||||
@ -186,28 +189,6 @@
|
||||
</div>
|
||||
</li>
|
||||
<li><hr class="dropdown-divider my-1"></li>
|
||||
<div>
|
||||
<li class="nav-item me-3 dropdown-item py-2 px-4 d-flex align-items-center text-decoration-none text-teal d-lg-none">
|
||||
{% if LANGUAGE_CODE == 'en' %}
|
||||
<form action="{% url 'set_language' %}" method="post" class="d-inline">
|
||||
{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ request.get_full_path }}">
|
||||
<button name="language" value="ar" class="btn bg-primary-theme text-white" type="submit">
|
||||
<span class="me-2">🇸🇦</span> العربية
|
||||
</button>
|
||||
</form>
|
||||
{% elif LANGUAGE_CODE == 'ar' %}
|
||||
<form action="{% url 'set_language' %}" method="post" class="d-inline">
|
||||
{% csrf_token %}
|
||||
<input name="next" type="hidden" value="{{ request.get_full_path }}">
|
||||
<button name="language" value="en" class="btn bg-primary-theme text-white" type="submit">
|
||||
<span class="me-2">🇺🇸</span> English
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</li>
|
||||
|
||||
<li class="d-lg-none"><a class="dropdown-item py-2 px-4 d-flex align-items-center text-decoration-none text-teal" href="{% url 'message_list' %}"> <i class="fas fa-envelope fs-5 me-3"></i> <span>{% trans "Messages" %}</span></a></li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li><a class="dropdown-item py-2 px-4 d-flex align-items-center text-decoration-none text-teal" href="{% url 'user_detail' request.user.pk %}"><i class="fas fa-user-circle me-3 fs-5"></i> <span>{% trans "My Profile" %}</span></a></li>
|
||||
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
<div style="max-width: 600px; margin: 0 auto; padding: 20px; box-sizing: border-box; background-color: #ffffff;">
|
||||
|
||||
<p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.5; color: #333333; margin-bottom: 20px;">
|
||||
Dear {{ applicant_name }},
|
||||
</p>
|
||||
|
||||
<p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #333333; margin-bottom: 15px;">
|
||||
Thank you very much for your interest in the **{{ job_title }}** position at **{{ company_name }}** and for taking the time to complete the initial screening process.
|
||||
</p>
|
||||
|
||||
<p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #333333; margin-bottom: 20px;">
|
||||
We carefully reviewed your qualifications and application materials. While your background is certainly impressive, we have decided to move forward with other candidates whose experience was a closer match for the specific requirements of this role at this time.
|
||||
</p>
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="border: 1px solid #e0f2f1; background-color: #f0fdfa; border-radius: 8px; margin-bottom: 20px;">
|
||||
<tr>
|
||||
<td style="padding: 15px; font-family: Arial, sans-serif;">
|
||||
<p style="font-size: 16px; line-height: 1.5; color: #008080; margin: 0;">
|
||||
We truly appreciate you sharing your professional journey with us and encourage you to keep an eye on our <a href="{{ careers_page_link }}" style="color: #008080; text-decoration: underline;">careers page</a> for future opportunities that may be a better fit.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #333333; margin-top: 20px; margin-bottom: 5px;">
|
||||
We wish you the very best of luck in your job search and professional endeavors.
|
||||
</p>
|
||||
|
||||
<p style="font-family: Arial, sans-serif; font-size: 16px; line-height: 1.6; color: #333333; margin: 0;">
|
||||
Sincerely,<br>
|
||||
**{{ sender_name }}**<br>
|
||||
**{{ sender_title }}** | **{{ company_name }}**
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@ -1,6 +1,6 @@
|
||||
{% load i18n %}
|
||||
{{ form.media }}
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
@ -126,7 +126,6 @@
|
||||
</div>
|
||||
|
||||
<style>
|
||||
{{ form.media.css }}
|
||||
.card {
|
||||
border: none;
|
||||
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
||||
@ -174,12 +173,9 @@
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const form = document.getElementById('email-compose-form1');
|
||||
const sendBtn = document.getElementById('send-email-btn1');
|
||||
@ -495,4 +491,3 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
console.log('Email compose form initialized');
|
||||
});
|
||||
</script>
|
||||
@ -267,7 +267,7 @@
|
||||
<div class="table-view d-none d-lg-block active">
|
||||
<div class="card shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0 d-none d-lg-block">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
|
||||
{# --- Corrected Multi-Row Header Structure --- #}
|
||||
<thead>
|
||||
|
||||
@ -222,8 +222,8 @@
|
||||
|
||||
<!-- Table View (Default) -->
|
||||
<div class="table-view">
|
||||
<div class="table-responsive d-none d-lg-block">
|
||||
<table class="table table-hover align-middle mb-0 ">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Photo" %}</th>
|
||||
|
||||
@ -172,8 +172,8 @@
|
||||
|
||||
<!-- Table View -->
|
||||
<div class="table-view">
|
||||
<div class="table-responsive d-none d-lg-block">
|
||||
<table class="table table-hover align-middle mb-0 ">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{% trans "Agency Name" %}</th>
|
||||
|
||||
@ -269,8 +269,8 @@
|
||||
|
||||
{# Table View (Default for Desktop) #}
|
||||
<div class="table-view active d-none d-lg-block">
|
||||
<div class="table-responsive d-none d-lg-block">
|
||||
<table class="table table-hover align-middle mb-0 ">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" >{% trans "Name" %}</th>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user