few issue resolved
This commit is contained in:
parent
d2a86f12c3
commit
1ee1f0f1ae
@ -62,7 +62,7 @@ INSTALLED_APPS = [
|
|||||||
"django_q",
|
"django_q",
|
||||||
"widget_tweaks",
|
"widget_tweaks",
|
||||||
"easyaudit",
|
"easyaudit",
|
||||||
"mathfilters"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1679,6 +1679,7 @@ class CandidateEmailForm(forms.Form):
|
|||||||
email_addresses = []
|
email_addresses = []
|
||||||
|
|
||||||
candidates=self.cleaned_data.get('to',[])
|
candidates=self.cleaned_data.get('to',[])
|
||||||
|
print(f"candidates are {candidates}")
|
||||||
|
|
||||||
if candidates:
|
if candidates:
|
||||||
for candidate in candidates:
|
for candidate in candidates:
|
||||||
|
|||||||
@ -1246,8 +1246,7 @@ def delete_form_template(request, template_id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
|
||||||
@staff_or_candidate_required
|
|
||||||
def application_submit_form(request, template_slug):
|
def application_submit_form(request, template_slug):
|
||||||
"""Display the form as a step-by-step wizard"""
|
"""Display the form as a step-by-step wizard"""
|
||||||
if not request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
@ -4813,7 +4812,7 @@ def message_detail(request, message_id):
|
|||||||
"message": message,
|
"message": message,
|
||||||
}
|
}
|
||||||
if request.user.user_type != "staff":
|
if request.user.user_type != "staff":
|
||||||
return render(request, "messages/candidate_message_detail.html", context)
|
return render(request, "messages/application_message_detail.html", context)
|
||||||
return render(request, "messages/message_detail.html", context)
|
return render(request, "messages/message_detail.html", context)
|
||||||
|
|
||||||
|
|
||||||
@ -4832,13 +4831,13 @@ def message_create(request):
|
|||||||
|
|
||||||
if message.recipient and message.recipient.email:
|
if message.recipient and message.recipient.email:
|
||||||
if request.user.user_type != "staff":
|
if request.user.user_type != "staff":
|
||||||
message=message.content
|
body=message.content
|
||||||
else:
|
else:
|
||||||
message=message.content.append(f"\n\n Sent by: {request.user.get_full_name()} ({request.user.email})")
|
body=message.content+f"\n\n Sent by: {request.user.get_full_name()} ({request.user.email})"
|
||||||
try:
|
try:
|
||||||
email_result = async_task('recruitment.tasks._task_send_individual_email',
|
email_result = async_task('recruitment.tasks._task_send_individual_email',
|
||||||
subject=message.subject,
|
subject=message.subject,
|
||||||
body_message=message,
|
body_message=body,
|
||||||
recipient=message.recipient.email,
|
recipient=message.recipient.email,
|
||||||
attachments=None,
|
attachments=None,
|
||||||
sender=False,
|
sender=False,
|
||||||
@ -5665,7 +5664,7 @@ def compose_application_email(request, job_slug):
|
|||||||
candidate_ids=request.GET.getlist('candidate_ids')
|
candidate_ids=request.GET.getlist('candidate_ids')
|
||||||
candidates=Application.objects.filter(id__in=candidate_ids)
|
candidates=Application.objects.filter(id__in=candidate_ids)
|
||||||
|
|
||||||
|
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
|
||||||
candidate_ids = request.POST.getlist('candidate_ids')
|
candidate_ids = request.POST.getlist('candidate_ids')
|
||||||
@ -5673,6 +5672,8 @@ def compose_application_email(request, job_slug):
|
|||||||
|
|
||||||
applications=Application.objects.filter(id__in=candidate_ids)
|
applications=Application.objects.filter(id__in=candidate_ids)
|
||||||
form = CandidateEmailForm(job, applications, request.POST)
|
form = CandidateEmailForm(job, applications, request.POST)
|
||||||
|
|
||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
print("form is valid ...")
|
print("form is valid ...")
|
||||||
# Get email addresses
|
# Get email addresses
|
||||||
@ -5695,7 +5696,7 @@ def compose_application_email(request, job_slug):
|
|||||||
subject = form.cleaned_data.get('subject')
|
subject = form.cleaned_data.get('subject')
|
||||||
|
|
||||||
# Send emails using email service (no attachments, synchronous to avoid pickle issues)
|
# Send emails using email service (no attachments, synchronous to avoid pickle issues)
|
||||||
|
print(email_addresses)
|
||||||
email_result = send_bulk_email( #
|
email_result = send_bulk_email( #
|
||||||
subject=subject,
|
subject=subject,
|
||||||
message=message,
|
message=message,
|
||||||
@ -5786,7 +5787,7 @@ def compose_application_email(request, job_slug):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# GET request - show the form
|
# GET request - show the form
|
||||||
form = CandidateEmailForm(job, candidates,request)
|
form = CandidateEmailForm(job, candidates)
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
@ -5996,11 +5997,11 @@ def application_signup(request, slug):
|
|||||||
# gpa = form.cleaned_data["gpa"]
|
# gpa = form.cleaned_data["gpa"]
|
||||||
password = form.cleaned_data["password"]
|
password = form.cleaned_data["password"]
|
||||||
gpa=form.cleaned_data["gpa"]
|
gpa=form.cleaned_data["gpa"]
|
||||||
natiional_id=form.cleaned_data["national_id"]
|
national_id=form.cleaned_data["national_id"]
|
||||||
|
|
||||||
user = User.objects.create_user(
|
user = User.objects.create_user(
|
||||||
username = email,email=email,first_name=first_name,last_name=last_name,phone=phone,user_type="candidate",
|
username = email,email=email,first_name=first_name,last_name=last_name,phone=phone,user_type="candidate",
|
||||||
gpa=gpa,natiional_id=natiional_id
|
|
||||||
)
|
)
|
||||||
user.set_password(password)
|
user.set_password(password)
|
||||||
user.save()
|
user.save()
|
||||||
@ -6011,7 +6012,8 @@ def application_signup(request, slug):
|
|||||||
phone=phone,
|
phone=phone,
|
||||||
gender=gender,
|
gender=gender,
|
||||||
nationality=nationality,
|
nationality=nationality,
|
||||||
# gpa=gpa,
|
gpa=gpa,
|
||||||
|
national_id=national_id,
|
||||||
address=address,
|
address=address,
|
||||||
user = user
|
user = user
|
||||||
)
|
)
|
||||||
|
|||||||
@ -27,23 +27,45 @@
|
|||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<!-- Recipients Field -->
|
<!-- Recipients Field -->
|
||||||
<!-- Recipients Field -->
|
<!-- Recipients Field -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label fw-bold">
|
<label class="form-label fw-bold">
|
||||||
{% trans "To" %}
|
{% trans "To" %}
|
||||||
</label>
|
</label>
|
||||||
<div class="border rounded p-3 bg-light" style="max-height: 200px; overflow-y: auto;">
|
<div class="border rounded p-3 bg-light" style="max-height: 200px; overflow-y: auto;">
|
||||||
|
|
||||||
|
{# --- 1. DATA LAYER: Render Hidden Inputs for ALL recipients --- #}
|
||||||
|
{# This ensures the backend receives every selected user, not just the visible one #}
|
||||||
|
{% for choice in form.to %}
|
||||||
|
<input type="hidden" name="{{ form.to.name }}" value="{{ choice.data.value }}">
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{# --- 2. VISUAL LAYER: Show only the first one --- #}
|
||||||
|
{# We make it disabled so the user knows they can't deselect it here #}
|
||||||
{% for choice in form.to|slice:":1" %}
|
{% for choice in form.to|slice:":1" %}
|
||||||
<div class="form-check mb-2">
|
<div class="form-check mb-2">
|
||||||
{{ choice }}
|
<input class="form-check-input" type="checkbox" checked disabled>
|
||||||
|
<label class="form-check-label">
|
||||||
|
{{ choice.choice_label }}
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if form.to|length > 0 %}
|
|
||||||
|
{# --- 3. SUMMARY: Show count of hidden recipients --- #}
|
||||||
|
{% if form.to|length > 1 %}
|
||||||
<div class="text-muted small mt-2">
|
<div class="text-muted small mt-2">
|
||||||
<i class="fas fa-info-circle me-1"></i>
|
<i class="fas fa-info-circle me-1"></i>
|
||||||
{% blocktrans count total=form.to|length %}{{ total }} recipient selected{% plural %}{{ total }} recipients selected{% endblocktrans %}
|
{# Use simple math to show remaining count #}
|
||||||
|
{% with remaining=form.to|length|add:"-1" %}
|
||||||
|
{% blocktrans count total=remaining %}
|
||||||
|
And {{ total }} other recipient
|
||||||
|
{% plural %}
|
||||||
|
And {{ total }} other recipients
|
||||||
|
{% endblocktrans %}
|
||||||
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if form.to.errors %}
|
{% if form.to.errors %}
|
||||||
<div class="text-danger small mt-1">
|
<div class="text-danger small mt-1">
|
||||||
{% for error in form.to.errors %}
|
{% for error in form.to.errors %}
|
||||||
@ -53,7 +75,6 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Subject Field -->
|
<!-- Subject Field -->
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="{{ form.subject.id_for_label }}" class="form-label fw-bold">
|
<label for="{{ form.subject.id_for_label }}" class="form-label fw-bold">
|
||||||
|
|||||||
@ -1,106 +1,105 @@
|
|||||||
{% extends "portal_base.html" %}
|
{% extends "portal_base.html" %}
|
||||||
{% load static %}
|
{% load static i18n %}
|
||||||
|
|
||||||
{% block title %}Messages{% endblock %}
|
{% block title %}{% trans "Messages" %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||||
<h4 class="mb-0">Messages</h4>
|
<h4 class="mb-0 text-primary-theme">{% trans "Messages" %}</h4>
|
||||||
<a href="{% url 'message_create' %}" class="btn btn-main-action">
|
<a href="{% url 'message_create' %}" class="btn btn-main-action">
|
||||||
<i class="fas fa-plus"></i> Compose Message
|
<i class="fas fa-plus"></i> {% trans "Compose Message" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Filters -->
|
<div class="card mb-4 border-primary-theme-subtle">
|
||||||
<div class="card mb-4">
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form method="get" class="row g-3">
|
<form method="get" class="row g-3">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="status" class="form-label">Status</label>
|
<label for="status" class="form-label">{% trans "Status" %}</label>
|
||||||
<select name="status" id="status" class="form-select">
|
<select name="status" id="status" class="form-select">
|
||||||
<option value="">All Status</option>
|
<option value="">{% trans "All Status" %}</option>
|
||||||
<option value="read" {% if status_filter == 'read' %}selected{% endif %}>Read</option>
|
<option value="read" {% if status_filter == 'read' %}selected{% endif %}>{% trans "Read" %}</option>
|
||||||
<option value="unread" {% if status_filter == 'unread' %}selected{% endif %}>Unread</option>
|
<option value="unread" {% if status_filter == 'unread' %}selected{% endif %}>{% trans "Unread" %}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="type" class="form-label">Type</label>
|
<label for="type" class="form-label">{% trans "Type" %}</label>
|
||||||
<select name="type" id="type" class="form-select">
|
<select name="type" id="type" class="form-select">
|
||||||
<option value="">All Types</option>
|
<option value="">{% trans "All Types" %}</option>
|
||||||
<option value="GENERAL" {% if type_filter == 'GENERAL' %}selected{% endif %}>General</option>
|
<option value="GENERAL" {% if type_filter == 'GENERAL' %}selected{% endif %}>{% trans "General" %}</option>
|
||||||
<option value="JOB_RELATED" {% if type_filter == 'JOB_RELATED' %}selected{% endif %}>Job Related</option>
|
<option value="JOB_RELATED" {% if type_filter == 'JOB_RELATED' %}selected{% endif %}>{% trans "Job Related" %}</option>
|
||||||
<option value="INTERVIEW" {% if type_filter == 'INTERVIEW' %}selected{% endif %}>Interview</option>
|
<option value="INTERVIEW" {% if type_filter == 'INTERVIEW' %}selected{% endif %}>{% trans "Interview" %}</option>
|
||||||
<option value="OFFER" {% if type_filter == 'OFFER' %}selected{% endif %}>Offer</option>
|
<option value="OFFER" {% if type_filter == 'OFFER' %}selected{% endif %}>{% trans "Offer" %}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label for="q" class="form-label">Search</label>
|
<label for="q" class="form-label">{% trans "Search" %}</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" name="q" id="q" class="form-control"
|
<input type="text" name="q" id="q" class="form-control"
|
||||||
value="{{ search_query }}" placeholder="Search messages...">
|
value="{{ search_query }}" placeholder="{% trans 'Search messages...' %}">
|
||||||
<button class="btn btn-outline-secondary" type="submit">
|
<button class="btn btn-outline-primary-theme" type="submit">
|
||||||
<i class="fas fa-search"></i>
|
<i class="fas fa-search"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
<label class="form-label"> </label>
|
<label class="form-label"> </label>
|
||||||
<button type="submit" class="btn btn-secondary w-100">Filter</button>
|
<button type="submit" class="btn btn-main-action w-100">
|
||||||
|
<i class="fa-solid fa-filter me-1"></i>{% trans "Filter" %}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Statistics -->
|
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="card bg-light">
|
<div class="card bg-primary-theme-subtle border-primary-theme-subtle">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h6 class="card-title">Total Messages</h6>
|
<h6 class="card-title text-primary-theme">{% trans "Total Messages" %}</h6>
|
||||||
<h3 class="text-primary">{{ total_messages }}</h3>
|
<h3 class="text-primary-theme">{{ total_messages }}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="card bg-light">
|
<div class="card bg-warning-subtle border-warning-subtle">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h6 class="card-title">Unread Messages</h6>
|
<h6 class="card-title text-warning">{% trans "Unread Messages" %}</h6>
|
||||||
<h3 class="text-warning">{{ unread_messages }}</h3>
|
<h3 class="text-warning">{{ unread_messages }}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Messages List -->
|
<div class="card border-primary-theme-subtle">
|
||||||
<div class="card">
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{% if page_obj %}
|
{% if page_obj %}
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Subject</th>
|
<th>{% trans "Subject" %}</th>
|
||||||
<th>Sender</th>
|
<th>{% trans "Sender" %}</th>
|
||||||
<th>Recipient</th>
|
<th>{% trans "Recipient" %}</th>
|
||||||
<th>Type</th>
|
<th>{% trans "Type" %}</th>
|
||||||
<th>Status</th>
|
<th>{% trans "Status" %}</th>
|
||||||
<th>Created</th>
|
<th>{% trans "Created" %}</th>
|
||||||
<th>Actions</th>
|
<th>{% trans "Actions" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for message in page_obj %}
|
{% for message in page_obj %}
|
||||||
<tr class="{% if not message.is_read %}table-secondary{% endif %}">
|
<tr class="{% if not message.is_read %}table-secondary-theme-light{% endif %}">
|
||||||
<td>
|
<td>
|
||||||
<a href="{% url 'message_detail' message.id %}"
|
<a href="{% url 'message_detail' message.id %}"
|
||||||
class="{% if not message.is_read %}fw-bold{% endif %}">
|
class="fw-bold text-primary-theme text-decoration-none">
|
||||||
{{ message.subject }}
|
{{ message.subject|truncatechars:50 }}
|
||||||
</a>
|
</a>
|
||||||
{% if message.parent_message %}
|
{% if message.parent_message %}
|
||||||
<span class="badge bg-secondary ms-2">Reply</span>
|
<span class="badge bg-secondary-theme ms-2 text-decoration-none">{% trans "Reply" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ message.sender.get_full_name|default:message.sender.username }}</td>
|
<td>{{ message.sender.get_full_name|default:message.sender.username }}</td>
|
||||||
@ -112,35 +111,35 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if message.is_read %}
|
{% if message.is_read %}
|
||||||
<span class="badge bg-primary-theme">Read</span>
|
<span class="badge bg-primary-theme">{% trans "Read" %}</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-warning">Unread</span>
|
<span class="badge bg-warning">{% trans "Unread" %}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ message.created_at|date:"M d, Y H:i" }}</td>
|
<td>{{ message.created_at|date:"M d, Y H:i" }}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<a href="{% url 'message_detail' message.id %}"
|
<a href="{% url 'message_detail' message.id %}"
|
||||||
class="btn btn-sm btn-outline-primary" title="View">
|
class="btn btn-sm btn-outline-primary" title="{% trans 'View' %}">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
</a>
|
</a>
|
||||||
{% if not message.is_read and message.recipient == request.user %}
|
{% if not message.is_read and message.recipient == request.user %}
|
||||||
<a href="{% url 'message_mark_read' message.id %}"
|
<a href="{% url 'message_mark_read' message.id %}"
|
||||||
class="btn btn-sm btn-outline-success"
|
class="btn btn-sm btn-outline-primary"
|
||||||
hx-post="{% url 'message_mark_read' message.id %}"
|
hx-post="{% url 'message_mark_read' message.id %}"
|
||||||
title="Mark as Read">
|
title="{% trans 'Mark as Read' %}">
|
||||||
<i class="fas fa-check"></i>
|
<i class="fas fa-check"></i>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<a href="{% url 'message_reply' message.id %}"
|
<a href="{% url 'message_reply' message.id %}"
|
||||||
class="btn btn-sm btn-outline-primary" title="Reply">
|
class="btn btn-sm btn-outline-primary" title="{% trans 'Reply' %}">
|
||||||
<i class="fas fa-reply"></i>
|
<i class="fas fa-reply"></i>
|
||||||
</a>
|
</a>
|
||||||
<a href="{% url 'message_delete' message.id %}"
|
<a href="{% url 'message_delete' message.id %}"
|
||||||
class="btn btn-sm btn-outline-danger"
|
class="btn btn-sm btn-outline-danger"
|
||||||
hx-get="{% url 'message_delete' message.id %}"
|
hx-post="{% url 'message_delete' message.id %}"
|
||||||
hx-confirm="Are you sure you want to delete this message?"
|
hx-confirm="{% trans 'Are you sure you want to delete this message?' %}"
|
||||||
title="Delete">
|
title="{% trans 'Delete' %}">
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -149,9 +148,9 @@
|
|||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" class="text-center text-muted">
|
<td colspan="7" class="text-center text-muted">
|
||||||
<i class="fas fa-inbox fa-3x mb-3"></i>
|
<i class="fas fa-inbox fa-3x mb-3 text-primary-theme"></i>
|
||||||
<p class="mb-0">No messages found.</p>
|
<p class="mb-0">{% trans "No messages found." %}</p>
|
||||||
<p class="small">Try adjusting your filters or compose a new message.</p>
|
<p class="small">{% trans "Try adjusting your filters or compose a new message." %}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -159,13 +158,12 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Pagination -->
|
|
||||||
{% if page_obj.has_other_pages %}
|
{% if page_obj.has_other_pages %}
|
||||||
<nav aria-label="Message pagination">
|
<nav aria-label="Message pagination">
|
||||||
<ul class="pagination justify-content-center">
|
<ul class="pagination justify-content-center">
|
||||||
{% if page_obj.has_previous %}
|
{% if page_obj.has_previous %}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="?page={{ page_obj.previous_page_number }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">
|
<a class="page-link text-primary-theme" href="?page={{ page_obj.previous_page_number }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">
|
||||||
<i class="fas fa-chevron-left"></i>
|
<i class="fas fa-chevron-left"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -174,18 +172,18 @@
|
|||||||
{% for num in page_obj.paginator.page_range %}
|
{% for num in page_obj.paginator.page_range %}
|
||||||
{% if page_obj.number == num %}
|
{% if page_obj.number == num %}
|
||||||
<li class="page-item active">
|
<li class="page-item active">
|
||||||
<span class="page-link">{{ num }}</span>
|
<span class="page-link bg-primary-theme border-primary-theme">{{ num }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="?page={{ num }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">{{ num }}</a>
|
<a class="page-link text-primary-theme" href="?page={{ num }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">{{ num }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if page_obj.has_next %}
|
{% if page_obj.has_next %}
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="?page={{ page_obj.next_page_number }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">
|
<a class="page-link text-primary-theme" href="?page={{ page_obj.next_page_number }}&status={{ status_filter }}&type={{ type_filter }}&q={{ search_query }}">
|
||||||
<i class="fas fa-chevron-right"></i>
|
<i class="fas fa-chevron-right"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -195,11 +193,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="text-center text-muted py-5">
|
<div class="text-center text-muted py-5">
|
||||||
<i class="fas fa-inbox fa-3x mb-3"></i>
|
<i class="fas fa-inbox fa-3x mb-3 text-primary-theme"></i>
|
||||||
<p class="mb-0">No messages found.</p>
|
<p class="mb-0">{% trans "No messages found." %}</p>
|
||||||
<p class="small">Try adjusting your filters or compose a new message.</p>
|
<p class="small">{% trans "Try adjusting your filters or compose a new message." %}</p>
|
||||||
<a href="{% url 'message_create' %}" class="btn btn-main-action">
|
<a href="{% url 'message_create' %}" class="btn btn-main-action">
|
||||||
<i class="fas fa-plus"></i> Compose Message
|
<i class="fas fa-plus"></i> {% trans "Compose Message" %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -210,7 +208,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extra_js %}
|
{% block customJS %}
|
||||||
<script>
|
<script>
|
||||||
// Auto-refresh unread count every 30 seconds
|
// Auto-refresh unread count every 30 seconds
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
@ -227,4 +225,4 @@ setInterval(() => {
|
|||||||
.catch(error => console.error('Error fetching unread count:', error));
|
.catch(error => console.error('Error fetching unread count:', error));
|
||||||
}, 30000);
|
}, 30000);
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Loading…
x
Reference in New Issue
Block a user