Skip to content

Commit

Permalink
feat: Add IP address link in resume_clicks.html
Browse files Browse the repository at this point in the history
The resume_clicks.html template has been updated to include a clickable link for the IP address. This change enhances the user experience by allowing users to easily access additional information about the IP address, such as its domain information.
  • Loading branch information
QA2A committed Sep 5, 2024
1 parent 781969b commit f04e19e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
11 changes: 7 additions & 4 deletions website/templates/resume_clicks.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<!-- templates/resume_clicks.html -->
{% extends "base.html" %}

{% block content %}
{% include 'sidebar.html' %}
<h1>Resume Clicks for {{ company.name }}</h1>

{% if resume_clicks %}
<table>
<thead>
<tr>

<th>IP Address</th>
<th>User Agent</th>
<th>Referer</th>
Expand All @@ -18,7 +17,11 @@ <h1>Resume Clicks for {{ company.name }}</h1>
<tbody>
{% for click in resume_clicks %}
<tr>
<td>{{ click.ip_address }}</td>
<td>
<a href="https://whois.domaintools.com/{{ click.ip_address }}" target="_blank">
{{ click.ip_address }}
</a>
</td>
<td>{{ click.user_agent }}</td>
<td>{{ click.referer }}</td>
<td nowrap>{{ click.created|date:"m/d/Y H:i T" }}</td>
Expand All @@ -29,4 +32,4 @@ <h1>Resume Clicks for {{ company.name }}</h1>
{% else %}
<p>No resume clicks recorded for this company.</p>
{% endif %}
{% endblock %}
{% endblock %}
5 changes: 1 addition & 4 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,10 @@ def job_detail_htmx(request, slug):
@login_required
def view_resume_clicks(request, company_id):
company = get_object_or_404(Company, id=company_id)

# Check if the user has applied to this company
user_applications = Application.objects.filter(user=request.user, company=company)

if not user_applications.exists():
# Redirect or return an error if the user hasn't applied to this company
return redirect('dashboard') # Redirect to the dashboard or any other page
return redirect('dashboard')

resume_clicks = RequestLog.objects.filter(company=company).order_by('-created')

Expand Down

0 comments on commit f04e19e

Please sign in to comment.