added the small ui fix

This commit is contained in:
Faheed 2025-11-25 15:52:58 +03:00
parent 5b114b630e
commit 45c6d2c1a5
8 changed files with 41 additions and 37 deletions

6
.env
View File

@ -1,3 +1,3 @@
DB_NAME=norahuniversity
DB_USER=norahuniversity
DB_PASSWORD=norahuniversity
DB_NAME=haikal_db
DB_USER=faheed
DB_PASSWORD=Faheed@215

View File

@ -0,0 +1,18 @@
# Generated by Django 5.2.7 on 2025-11-25 12:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recruitment', '0006_alter_customuser_email'),
]
operations = [
migrations.AlterField(
model_name='person',
name='email',
field=models.EmailField(db_index=True, max_length=254, unique=True, verbose_name='Email'),
),
]

View File

@ -187,6 +187,7 @@ class PersonCreateView(CreateView):
template_name = "people/create_person.html"
form_class = PersonForm
success_url = reverse_lazy("person_list")
print("from agency")
def form_valid(self, form):
if "HX-Request" in self.request.headers:
instance = form.save()
@ -195,6 +196,7 @@ class PersonCreateView(CreateView):
slug = self.request.POST.get("agency")
if slug:
agency = HiringAgency.objects.get(slug=slug)
print(agency)
instance.agency = agency
instance.save()
return redirect("agency_portal_persons_list")
@ -228,8 +230,6 @@ class PersonDeleteView(StaffRequiredMixin, DeleteView):
success_url = reverse_lazy("person_list")
class JobPostingViewSet(viewsets.ModelViewSet):
queryset = JobPosting.objects.all()
serializer_class = JobPostingSerializer
@ -824,11 +824,11 @@ def kaauh_career(request):
selected_job_type = request.GET.get("employment_type", "")
job_type_keys = active_jobs.order_by("job_type").distinct("job_type").values_list("job_type", flat=True)
workplace_type_keys = active_jobs.order_by("workplace_type").distinct("workplace_type").values_list(
"workplace_type", flat=True
).distinct()
if selected_job_type and selected_job_type in job_type_keys:
active_jobs = active_jobs.filter(job_type=selected_job_type)
if selected_workplace_type and selected_workplace_type in workplace_type_keys:
@ -865,10 +865,7 @@ def kaauh_career(request):
# job detail facing the candidate:
def application_detail(request, slug):
job = get_object_or_404(JobPosting, slug=slug)
already_applied = False
if request.user.is_authenticated:
already_applied = Application.objects.filter(job=job,person=request.user.person_profile).exists()
return render(request, "applicant/application_detail.html", {"job": job,"already_applied":already_applied})
return render(request, "applicant/application_detail.html", {"job": job})
@login_required
@ -1203,13 +1200,7 @@ def application_submit_form(request, template_slug):
"""Display the form as a step-by-step wizard"""
if not request.user.is_authenticated:
return redirect("candidate_signup",slug=template_slug)
template = get_object_or_404(FormTemplate, slug=template_slug, is_active=True)
if Application.objects.filter(job=template.job,person=request.user.person_profile).exists():
messages.error(request, _("You have already submitted an application for this job."))
return redirect("application_detail",slug=template.job.slug)
stage = template.stages.filter(name="Contact Information")

View File

@ -184,8 +184,8 @@
background-color: var(--kaauh-gray-light);
}
.empty-state i {
font-size: 3.5rem;
margin-bottom: 1rem;
font-size: 1rem;
margin-bottom: 0.5rem;
color: var(--kaauh-teal-dark);
}
.empty-state .btn-main-action .fas {

View File

@ -154,8 +154,8 @@
background-color: var(--kaauh-gray-light);
}
.empty-state i {
font-size: 3.5rem;
margin-bottom: 1rem;
font-size: 1rem;
margin-bottom: 0.5rem;
color: var(--kaauh-teal-dark);
}
.empty-state .btn-main-action .fas {
@ -331,7 +331,7 @@
<p class="text-muted mb-4">
{% trans "There are no submissions for this form template yet." %}
</p>
<a href="{% url 'form_templates_list' %}" class="btn btn-main-action btn-sm">
<a href="{% url 'form_templates_list' %}" class="btn btn-main-action">
<i class="fas fa-arrow-left me-1"></i> {% trans "Back to Templates" %}
</a>
</div>

View File

@ -5,9 +5,8 @@
{% block content %}
<div class="container-fluid">
<h1>{% trans "Message Detail" %}</h1>
<div class="row" id="message-{{ message.id }}">
<div class="col-12" >
<div class="row">
<div class="col-12">
<!-- Message Header -->
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
@ -29,13 +28,10 @@
</a>
{% endif %}
<a href="{% url 'message_delete' message.id %}"
class="btn btn-sm btn-outline-danger"
hx-post="{% url 'message_delete' message.id %}"
hx-confirm="{% trans 'Are you sure you want to delete this message?' %}"
hx-target="#message-{{ message.id }}"
hx-swap="outerHTML"
title="{% trans 'Delete' %}">
<i class="fas fa-trash"></i>
class="btn btn-outline-danger"
hx-get="{% url 'message_delete' message.id %}"
hx-confirm="{% trans 'Are you sure you want to delete this message?' %}">
<i class="fas fa-trash"></i> {% trans "Delete" %}
</a>
<a href="{% url 'message_list' %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left"></i> {% trans "Back to Messages" %}

View File

@ -93,7 +93,7 @@
</thead>
<tbody>
{% for message in page_obj %}
<tr class="{% if not message.is_read %}table-secondary{% endif %}" id="message-{{ message.id }}">
<tr class="{% if not message.is_read %}table-secondary{% endif %}">
<td>
<a href="{% url 'message_detail' message.id %}"
class="{% if not message.is_read %}fw-bold {% endif %}">
@ -136,12 +136,10 @@
class="btn btn-sm btn-outline-primary" title="{% trans 'Reply' %}">
<i class="fas fa-reply"></i>
</a>
<a href="{% url 'message_delete' message.id %}"
<a href="{% url 'message_delete' message.id %}"
class="btn btn-sm btn-outline-danger"
hx-post="{% url 'message_delete' message.id %}"
hx-get="{% url 'message_delete' message.id %}"
hx-confirm="{% trans 'Are you sure you want to delete this message?' %}"
hx-target="#message-{{ message.id }}"
hx-swap="outerHTML"
title="{% trans 'Delete' %}">
<i class="fas fa-trash"></i>
</a>

View File

@ -0,0 +1 @@
skjkas