diff --git a/media/resume/.gitkeep b/media/resumes/.gitkeep similarity index 100% rename from media/resume/.gitkeep rename to media/resumes/.gitkeep diff --git a/media/resumes/ML_Submission_Final_Submission.pdf b/media/resumes/ML_Submission_Final_Submission.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7c4d813632b1b367cf2f48f2188261c437455599 Binary files /dev/null and b/media/resumes/ML_Submission_Final_Submission.pdf differ diff --git a/templates/accounts/archived_candidates.html b/templates/accounts/archived_candidates.html index 4f62aeb766b10aecb6272dc2ad6de87e0ab982ec..4f9995b6933b8469ebc16a356f873c3f7351f7df 100644 --- a/templates/accounts/archived_candidates.html +++ b/templates/accounts/archived_candidates.html @@ -1,112 +1,112 @@ -{% extends 'base.html' %} -{% block title %}Archived Candidates{% endblock title %} - -{% block content %} -<div class="container mt-5"> - <h1>Archived Candidates</h1> - <div class="d-flex justify-content-between mb-3"> - <!-- Search Form --> - <form method="get" action="" class="input-group"> - <input type="text" name="query" class="form-control" placeholder="Search by username, first name, or last name" value="{{ query }}"> - <button class="btn btn-primary" type="submit">Search</button> - </form> - - <div> - <a href="{% url 'message_box' %}" class="btn btn-secondary">Back to Message Box</a> - <form method="post" action="{% url 'delete_all_archived' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-danger">Unarchive All</button> - </form> - </div> - </div> - - <!-- Archived Candidates Table --> - <table class="table table-bordered table-hover"> - <thead> - <tr> - <th>#</th> - <th>Username</th> - <th>First Name</th> - <th>Last Name</th> - <th>Email</th> - <th>Skills</th> - <th>Resume</th> - <th>Actions</th> <!-- Only one Actions column --> - </tr> - </thead> - <tbody> - {% for candidate in archived_candidates %} - <tr> - <td>{{ forloop.counter }}</td> - <td>{{ candidate.user.username }}</td> - <td>{{ candidate.first_name }}</td> - <td>{{ candidate.last_name }}</td> - <td> - {% if request.user in candidate.allowed_employers.all or candidate.cv_visibility %} - {{ candidate.user.email }} - {% else %} - <span style="color: red;">Restricted</span> - {% endif %} - </td> - <td>{{ candidate.skills }}</td> - <td> - {% if request.user in candidate.allowed_employers.all or candidate.cv_visibility %} - <a href="{{ candidate.resume.url }}" target="_blank" class="btn btn-sm btn-success">View Resume</a> - {% else %} - <span style="color: red;">Restricted</span> - {% endif %} - </td> - <td> - {% if request.user not in candidate.allowed_employers.all and not candidate.cv_visibility %} - <form method="post" action="{% url 'send_notification' candidate.user.id %}" style="display: inline-block;"> - {% csrf_token %} - <input type="hidden" name="source" value="archived_candidates"> - <button class="btn btn-warning">Request Details</button> - </form> - {% else %} - <span style="color: green;">Details Available</span> - {% endif %} - - <!-- Unarchive button --> - <form method="post" action="{% url 'delete_archived' candidate.id %}" style="display:inline-block; margin-left: 5px;"> - {% csrf_token %} - <button type="submit" class="btn btn-danger">Unarchive</button> - </form> - </td> - </tr> - {% empty %} - <tr> - <td colspan="8" class="text-center">No archived candidates available.</td> - </tr> - {% endfor %} - </tbody> - </table> - - <!-- Pagination Links --> - <nav aria-label="Page navigation"> - <ul class="pagination"> - {% if archived_candidates.has_previous %} - <li class="page-item"> - <a class="page-link" href="?page=1&query={{ query }}">First</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ archived_candidates.previous_page_number }}&query={{ query }}">Previous</a> - </li> - {% endif %} - {% for num in archived_candidates.paginator.page_range %} - <li class="page-item {% if archived_candidates.number == num %}active{% endif %}"> - <a class="page-link" href="?page={{ num }}&query={{ query }}">{{ num }}</a> - </li> - {% endfor %} - {% if archived_candidates.has_next %} - <li class="page-item"> - <a class="page-link" href="?page={{ archived_candidates.next_page_number }}&query={{ query }}">Next</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ archived_candidates.paginator.num_pages }}&query={{ query }}">Last</a> - </li> - {% endif %} - </ul> - </nav> -</div> -{% endblock content %} +{% extends 'base.html' %} +{% block title %}Archived Candidates{% endblock title %} + +{% block content %} +<div class="container mt-5"> + <h1>Archived Candidates</h1> + <div class="d-flex justify-content-between mb-3"> + <!-- Search Form to filter through the archived candidates --> + <form method="get" action="" class="input-group"> + <input type="text" name="query" class="form-control" placeholder="Search by username, first name, or last name" value="{{ query }}"> + <button class="btn btn-primary" type="submit">Search</button> + </form> + + <div> + <a href="{% url 'message_box' %}" class="btn btn-secondary">Back to Message Box</a> + <form method="post" action="{% url 'delete_all_archived' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-danger">Unarchive All</button> + </form> + </div> + </div> + + <!-- Archived Candidates Table --> + <table class="table table-bordered table-hover"> + <thead> + <tr> + <th>#</th> + <th>Username</th> + <th>First Name</th> + <th>Last Name</th> + <th>Email</th> + <th>Skills</th> + <th>Resume</th> + <th>Actions</th> + </tr> + </thead> + <tbody> + {% for candidate in archived_candidates %} + <tr> + <td>{{ forloop.counter }}</td> + <td>{{ candidate.user.username }}</td> + <td>{{ candidate.first_name }}</td> + <td>{{ candidate.last_name }}</td> + <td> + {% if request.user in candidate.allowed_employers.all or candidate.cv_visibility %} + {{ candidate.user.email }} + {% else %} + <span style="color: rgb(233, 45, 45);">Restricted</span> + {% endif %} + </td> + <td>{{ candidate.skills }}</td> + <td> + {% if request.user in candidate.allowed_employers.all or candidate.cv_visibility %} + <a href="{{ candidate.resume.url }}" target="_blank" class="btn btn-sm btn-success">View Resume</a> + {% else %} + <span style="color: rgb(247, 47, 47);">Restricted</span> + {% endif %} + </td> + <td> + {% if request.user not in candidate.allowed_employers.all and not candidate.cv_visibility %} + <form method="post" action="{% url 'send_notification' candidate.user.id %}" style="display: inline-block;"> + {% csrf_token %} + <input type="hidden" name="source" value="archived_candidates"> + <button class="btn btn-warning">Request Details</button> + </form> + {% else %} + <span style="color: rgb(105, 221, 105);">Details Available</span> + {% endif %} + + <!-- Unarchive button --> + <form method="post" action="{% url 'delete_archived' candidate.id %}" style="display:inline-block; margin-left: 5px;"> + {% csrf_token %} + <button type="submit" class="btn btn-danger">Unarchive</button> + </form> + </td> + </tr> + {% empty %} + <tr> + <td colspan="8" class="text-center">No archived candidates available.</td> + </tr> + {% endfor %} + </tbody> + </table> + + <!-- Pagination Links --> + <nav aria-label="Page navigation"> + <ul class="pagination"> + {% if archived_candidates.has_previous %} + <li class="page-item"> + <a class="page-link" href="?page=1&query={{ query }}">First</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ archived_candidates.previous_page_number }}&query={{ query }}">Previous</a> + </li> + {% endif %} + {% for num in archived_candidates.paginator.page_range %} + <li class="page-item {% if archived_candidates.number == num %}active{% endif %}"> + <a class="page-link" href="?page={{ num }}&query={{ query }}">{{ num }}</a> + </li> + {% endfor %} + {% if archived_candidates.has_next %} + <li class="page-item"> + <a class="page-link" href="?page={{ archived_candidates.next_page_number }}&query={{ query }}">Next</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ archived_candidates.paginator.num_pages }}&query={{ query }}">Last</a> + </li> + {% endif %} + </ul> + </nav> +</div> +{% endblock content %} diff --git a/templates/accounts/employer_profile_edit.html b/templates/accounts/employer_profile_edit.html index 7d88cdf770a073daf5845dafb4fdeea89006f265..8abbdf70a03ffcd2ab99950efcd137d8427258be 100644 --- a/templates/accounts/employer_profile_edit.html +++ b/templates/accounts/employer_profile_edit.html @@ -1,20 +1,21 @@ -{% extends 'base.html' %} -{% block title %}Edit Employer Profile{% endblock title %} -{% block content %} -<div class="container mt-5"> - <h2>Edit Employer Profile</h2> - <form method="post"> - {% csrf_token %} - <div class="form-group"> - <label for="username">Username:</label> - <input type="text" name="username" value="{{ user.username }}" class="form-control" required> - </div> - <div class="form-group"> - <label for="email">Email:</label> - <input type="email" name="email" value="{{ user.email }}" class="form-control" required> - </div> - {{ form.as_p }} - <button type="submit" class="btn btn-primary">Save Changes</button> - </form> -</div> -{% endblock %} +{% extends 'base.html' %} +{% block title %}Edit Employer Profile{% endblock title %} +{% block content %} +<!--Edit Profile Page--> +<div class="container mt-5"> + <h2>Edit Employer Profile</h2> + <form method="post"> + {% csrf_token %} + <div class="form-group"> + <label for="username">Username:</label> + <input type="text" name="username" value="{{ user.username }}" class="form-control" required> + </div> + <div class="form-group"> + <label for="email">Email:</label> + <input type="email" name="email" value="{{ user.email }}" class="form-control" required> + </div> + {{ form.as_p }} + <button type="submit" class="btn btn-primary">Save Changes</button> + </form> +</div> +{% endblock %} diff --git a/templates/accounts/job_seeker_profile_edit.html b/templates/accounts/job_seeker_profile_edit.html index 033a9d6c3e0ba6d96cda9b0936fb3b8f0797f1bc..8b85c9d5a2f6a75fb183898dd16dbb9cc3347cf7 100644 --- a/templates/accounts/job_seeker_profile_edit.html +++ b/templates/accounts/job_seeker_profile_edit.html @@ -1,20 +1,21 @@ -{% extends 'base.html' %} -{% block title %}Edit Job Seeker Profile{% endblock title %} -{% block content %} -<div class="container mt-5"> - <h2>Edit Job Seeker Profile</h2> - <form method="post" enctype="multipart/form-data"> - {% csrf_token %} - <div class="form-group"> - <label for="username">Username:</label> - <input type="text" name="username" value="{{ user.username }}" class="form-control" required> - </div> - <div class="form-group"> - <label for="email">Email:</label> - <input type="email" name="email" value="{{ user.email }}" class="form-control" required> - </div> - {{ form.as_p }} - <button type="submit" class="btn btn-primary">Save Changes</button> - </form> -</div> -{% endblock %} +{% extends 'base.html' %} +{% block title %}Edit Job Seeker Profile{% endblock title %} +{% block content %} +<!-- Used to edit the profile details such as the resume file and others, if there was no resume file it would do an error--> +<div class="container mt-5"> + <h2>Edit Job Seeker Profile</h2> + <form method="post" enctype="multipart/form-data"> + {% csrf_token %} + <div class="form-group"> + <label for="username">Username:</label> + <input type="text" name="username" value="{{ user.username }}" class="form-control" required> + </div> + <div class="form-group"> + <label for="email">Email:</label> + <input type="email" name="email" value="{{ user.email }}" class="form-control" required> + </div> + {{ form.as_p }} + <button type="submit" class="btn btn-primary">Save Changes</button> + </form> +</div> +{% endblock %} diff --git a/templates/accounts/login.html b/templates/accounts/login.html index e2c5b251d343426f9a8e143b326528ad2c36c707..b134de5f28c8bc6b31e2c3a60ba3731c2288e59f 100644 --- a/templates/accounts/login.html +++ b/templates/accounts/login.html @@ -1,75 +1,74 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Login{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/login.css' %}" rel="stylesheet"> -{% endblock styles %} - -<body class="bg-light"> - <div class="container mt-5"> - <div class="row justify-content-center"> - <div class="col-md-6"> - <div class="card"> - <!-- Card Header --> - <h5 class="card-header text-center">Login</h5> - <div class="card-body"> - {% if user.is_authenticated %} - <!-- If user is logged in --> - <p class="text-success text-center">You are already logged in.</p> - <!-- Logout button --> - <a href="{% url 'logout' %}" class="btn btn-warning btn-block">Logout</a> - <!-- Delete account button --> - <form action="{% url 'delete_account' %}" method="post" onsubmit="return confirm('Are you sure you want to delete your account? This action cannot be undone.');"> - {% csrf_token %} - <input type="hidden" name="confirm_delete" value="yes" /> - <button type="submit" class="btn btn-danger btn-block mt-3">Delete Account</button> - </form> - {% else %} - <!-- If user is not logged in --> - <form method="post" action="{% url 'login' %}"> - {% csrf_token %} - <!-- Username Field --> - <div class="form-group"> - <label for="username">Username</label> - <input type="text" class="form-control" id="username" name="username" placeholder="Enter username" required> - </div> - <!-- Password Field --> - <div class="form-group"> - <label for="password">Password</label> - <input type="password" class="form-control" id="password" name="password" placeholder="Enter password" required> - </div> - <!-- Hidden Next Field --> - <input type="hidden" name="next" value="{{ request.GET.next }}"> - <a href="{% url 'password_reset' %}">Forgot your password?</a> - <!-- Login Button --> - <button type="submit" class="btn btn-primary btn-block">Login</button> - </form> - <hr> - <!-- Register Button --> - <a href="{% url 'register' %}" class="btn btn-secondary btn-block">Register</a> - {% endif %} - </div> - </div> - <!-- Display Messages --> - {% if messages %} - <div class="mt-4"> - {% for message in messages %} - <div class="alert {{ message.tags }} alert-dismissible fade show" role="alert"> - {{ message }} - <button type="button" class="close" data-dismiss="alert" aria-label="Close"> - <span aria-hidden="true">×</span> - </button> - </div> - {% endfor %} - </div> - {% endif %} - </div> - </div> - </div> - - <!-- Bootstrap and jQuery JS CDN for functionality --> - <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> - <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script> -</body> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Login{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/login.css' %}" rel="stylesheet"> +{% endblock styles %} +<!--Login Page for both --> +<body class="bg-light"> + <div class="container mt-5"> + <div class="row justify-content-center"> + <div class="col-md-6"> + <div class="card"> + <!-- Card for login header --> + <h5 class="card-header text-center">Login</h5> + <div class="card-body"> + {% if user.is_authenticated %} + <!-- If user is logged in --> + <p class="text-success text-center">You are already logged in.</p> + <!-- Logout button --> + <a href="{% url 'logout' %}" class="btn btn-warning btn-block">Logout</a> + <!-- Delete account button --> + <form action="{% url 'delete_account' %}" method="post" onsubmit="return confirm('Are you sure you want to delete your account? This action cannot be undone.');"> + {% csrf_token %} + <input type="hidden" name="confirm_delete" value="yes" /> + <button type="submit" class="btn btn-danger btn-block mt-3">Delete Account</button> + </form> + {% else %} + <!-- If user is not logged in --> + <form method="post" action="{% url 'login' %}"> + {% csrf_token %} + <!-- Username Field --> + <div class="form-group"> + <label for="username">Username</label> + <input type="text" class="form-control" id="username" name="username" placeholder="Enter username" required> + </div> + <!-- Password Field --> + <div class="form-group"> + <label for="password">Password</label> + <input type="password" class="form-control" id="password" name="password" placeholder="Enter password" required> + </div> + <input type="hidden" name="next" value="{{ request.GET.next }}"> + <a href="{% url 'password_reset' %}">Forgot your password?</a> + <!-- Login Button --> + <button type="submit" class="btn btn-primary btn-block">Login</button> + </form> + <hr> + <!-- Register Button --> + <a href="{% url 'register' %}" class="btn btn-secondary btn-block">Register</a> + {% endif %} + </div> + </div> + <!-- Display Messages --> + {% if messages %} + <div class="mt-4"> + {% for message in messages %} + <div class="alert {{ message.tags }} alert-dismissible fade show" role="alert"> + {{ message }} + <button type="button" class="close" data-dismiss="alert" aria-label="Close"> + <span aria-hidden="true">×</span> + </button> + </div> + {% endfor %} + </div> + {% endif %} + </div> + </div> + </div> + + <!-- Bootstrap and jQuery JS CDN for functionality --> + <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script> +</body> +{% endblock content %} diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html index 1bb70249c1635f08f92ccd9d19877ca75b9a9735..dc40566085e5e03f79ef832b6a70f0ea378a8a98 100644 --- a/templates/accounts/profile.html +++ b/templates/accounts/profile.html @@ -1,66 +1,66 @@ -{% extends 'base.html' %} - -{% block title %}Profile{% endblock title %} - -{% block content %} -<div class="container mt-5"> - <div class="row justify-content-center"> - <div class="col-md-8"> - <div class="card"> - <h5 class="card-header text-center">Profile</h5> - <div class="card-body"> - <p><strong>Username:</strong> {{ user.username }}</p> - <p><strong>Role:</strong> {{ role }}</p> - - {% if role == 'Job Seeker' %} - <h5>Job Seeker Information</h5> - <p><strong>Contact Email:</strong> {{ user.email }}</p> - <p><strong>Resume:</strong> {{ resume }}</p> - <p><strong>Skills:</strong> {{ skills }}</p> - <form method="post" action="{% url 'toggle_full_details_visibility' %}"> - {% csrf_token %} - <button type="submit" class="btn btn-info"> - {% if cv_visibility %} - Hide email and CV from Employers - {% else %} - Show email and CV to Employers - {% endif %} - </button> - </form> - {% elif role == 'Employer' %} - <h5>Employer Information</h5> - <p><strong>Business Name:</strong> {{ business_name }}</p> - <p><strong>Business Type:</strong> {{ business_type }}</p> - <p><strong>Business Category:</strong> {{ business_category }}</p> - <p><strong>Location:</strong> {{ location }}</p> - <p><strong>Region:</strong> {{ region }}</p> - <p><strong>Business Email:</strong> {{ user.email }}</p> - <p><strong>Job Offered:</strong> {{ fields_for_jobs }}</p> - <p><strong>Status:</strong> {{ status }}</p> - {% else %} - <p>No additional information available.</p> - {% endif %} - - - {% if user.user_type == "job_seeker" %} - <a href="{% url 'job_seeker_profile_edit' %}" class="btn btn-primary">Edit Profile</a> - {% elif user.user_type == "employer" %} - <a href="{% url 'employer_profile_edit' %}" class="btn btn-primary">Edit Profile</a> - {% endif %} - - <!-- If user is logged in --> - <p class="text-success text-center">You are already logged in.</p> - <!-- Logout button --> - <a href="{% url 'logout' %}" class="btn btn-warning btn-block">Logout</a> - <!-- Delete account button --> - <form action="{% url 'delete_account' %}" method="post" onsubmit="return confirm('Are you sure you want to delete your account? This action cannot be undone.');"> - {% csrf_token %} - <input type="hidden" name="confirm_delete" value="yes" /> - <button type="submit" class="btn btn-danger btn-block mt-3">Delete Account</button> - </form> - </div> - </div> - </div> - </div> -</div> -{% endblock content %} +{% extends 'base.html' %} + +{% block title %}Profile{% endblock title %} + +{% block content %} +<div class="container mt-5"> + <div class="row justify-content-center"> + <div class="col-md-8"> + <div class="card"> + <h5 class="card-header text-center">Profile</h5> + <div class="card-body"> + <p><strong>Username:</strong> {{ user.username }}</p> + <p><strong>Role:</strong> {{ role }}</p> + <!--Seperate View for Job Seeker than the Employer in the profile page --> + {% if role == 'Job Seeker' %} + <h5>Job Seeker Information</h5> + <p><strong>Contact Email:</strong> {{ user.email }}</p> + <p><strong>Resume:</strong> {{ resume }}</p> + <p><strong>Skills:</strong> {{ skills }}</p> + <form method="post" action="{% url 'toggle_full_details_visibility' %}"> + {% csrf_token %} + <button type="submit" class="btn btn-info"> + {% if cv_visibility %} + Hide email and CV from Employers + {% else %} + Show email and CV to Employers + {% endif %} + </button> + </form> + {% elif role == 'Employer' %} + <h5>Employer Information</h5> + <p><strong>Business Name:</strong> {{ business_name }}</p> + <p><strong>Business Type:</strong> {{ business_type }}</p> + <p><strong>Business Category:</strong> {{ business_category }}</p> + <p><strong>Location:</strong> {{ location }}</p> + <p><strong>Region:</strong> {{ region }}</p> + <p><strong>Business Email:</strong> {{ user.email }}</p> + <p><strong>Job Offered:</strong> {{ fields_for_jobs }}</p> + <p><strong>Status:</strong> {{ status }}</p> + {% else %} + <p>No additional information available.</p> + {% endif %} + + + {% if user.user_type == "job_seeker" %} + <a href="{% url 'job_seeker_profile_edit' %}" class="btn btn-primary">Edit Profile</a> + {% elif user.user_type == "employer" %} + <a href="{% url 'employer_profile_edit' %}" class="btn btn-primary">Edit Profile</a> + {% endif %} + + <!-- If user is logged in --> + <p class="text-success text-center">You are already logged in.</p> + <!-- Logout button --> + <a href="{% url 'logout' %}" class="btn btn-warning btn-block">Logout</a> + <!-- Delete account button --> + <form action="{% url 'delete_account' %}" method="post" onsubmit="return confirm('Are you sure you want to delete your account? This action cannot be undone.');"> + {% csrf_token %} + <input type="hidden" name="confirm_delete" value="yes" /> + <button type="submit" class="btn btn-danger btn-block mt-3">Delete Account</button> + </form> + </div> + </div> + </div> + </div> +</div> +{% endblock content %} diff --git a/templates/accounts/register.html b/templates/accounts/register.html index ce47fdeca1df225ab2ad4467aa6ba994a6a15e6a..57b693c3202d66b61c06868e95c2a48ed821888f 100644 --- a/templates/accounts/register.html +++ b/templates/accounts/register.html @@ -1,64 +1,64 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Register{% endblock title %} - -{% block content %} -{% block styles %} -<link href="{% static 'css/register.css' %}" rel="stylesheet"> -{% endblock styles %} - -<div class="container mt-5"> - <div class="row justify-content-center"> - <div class="col-md-8"> - <div class="card"> - <!-- Dynamic Title --> - <h5 class="card-header text-center" id="register-title">Candidate Registration</h5> - <div class="card-body"> - <!-- Candidate Registration Form --> - <form action="{% url 'register' %}" method="post" enctype="multipart/form-data" id="jobseeker-form" {% if form_type != 'jobseeker' %}style="display: none;"{% endif %}> - {% csrf_token %} - {{ jobseeker_form.as_p }} - <input type="hidden" name="is_jobseeker" value="1"> - <button type="submit" class="btn btn-primary btn-block">Register as Candidate</button> - </form> - - <!-- Employer Registration Form --> - <form action="{% url 'register' %}" method="post" id="employer-form" {% if form_type != 'employer' %}style="display: none;"{% endif %}> - {% csrf_token %} - {{ employer_form.as_p }} - <input type="hidden" name="is_employer" value="1"> - <button type="submit" class="btn btn-primary btn-block">Register as Employer</button> - </form> - </div> - </div> - - <!-- Toggle Button --> - <div class="text-center mt-3"> - <button id="toggle-register" class="btn btn-secondary">Switch to Employer Registration</button> - </div> - </div> - </div> -</div> - -<!-- JavaScript to Toggle Forms --> -<script> - document.getElementById('toggle-register').addEventListener('click', function () { - const jobSeekerForm = document.getElementById('jobseeker-form'); - const employerForm = document.getElementById('employer-form'); - const registerTitle = document.getElementById('register-title'); - const toggleButton = document.getElementById('toggle-register'); - - if (jobSeekerForm.style.display === 'none') { - jobSeekerForm.style.display = 'block'; - employerForm.style.display = 'none'; - registerTitle.textContent = 'Candidate Registration'; - toggleButton.textContent = 'Switch to Employer Registration'; - } else { - jobSeekerForm.style.display = 'none'; - employerForm.style.display = 'block'; - registerTitle.textContent = 'Employer Registration'; - toggleButton.textContent = 'Switch to Candidate Registration'; - } - }); -</script> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Register{% endblock title %} + +{% block content %} +{% block styles %} +<link href="{% static 'css/register.css' %}" rel="stylesheet"> +{% endblock styles %} +<!--New Employer or Candidate registration--> +<div class="container mt-5"> + <div class="row justify-content-center"> + <div class="col-md-8"> + <div class="card"> + <!-- Dynamic Title --> + <h5 class="card-header text-center" id="register-title">Candidate Registration</h5> + <div class="card-body"> + <!-- Candidate Registration Form --> + <form action="{% url 'register' %}" method="post" enctype="multipart/form-data" id="jobseeker-form" {% if form_type != 'jobseeker' %}style="display: none;"{% endif %}> + {% csrf_token %} + {{ jobseeker_form.as_p }} + <input type="hidden" name="is_jobseeker" value="1"> + <button type="submit" class="btn btn-primary btn-block">Register as Candidate</button> + </form> + + <!-- Employer Registration Form --> + <form action="{% url 'register' %}" method="post" id="employer-form" {% if form_type != 'employer' %}style="display: none;"{% endif %}> + {% csrf_token %} + {{ employer_form.as_p }} + <input type="hidden" name="is_employer" value="1"> + <button type="submit" class="btn btn-primary btn-block">Register as Employer</button> + </form> + </div> + </div> + + <!-- Toggle Button --> + <div class="text-center mt-3"> + <button id="toggle-register" class="btn btn-secondary">Switch to Employer Registration</button> + </div> + </div> + </div> +</div> + +<!-- JavaScript to Toggle Forms --> +<script> + document.getElementById('toggle-register').addEventListener('click', function () { + const jobSeekerForm = document.getElementById('jobseeker-form'); + const employerForm = document.getElementById('employer-form'); + const registerTitle = document.getElementById('register-title'); + const toggleButton = document.getElementById('toggle-register'); + + if (jobSeekerForm.style.display === 'none') { + jobSeekerForm.style.display = 'block'; + employerForm.style.display = 'none'; + registerTitle.textContent = 'Candidate Registration'; + toggleButton.textContent = 'Switch to Employer Registration'; + } else { + jobSeekerForm.style.display = 'none'; + employerForm.style.display = 'block'; + registerTitle.textContent = 'Employer Registration'; + toggleButton.textContent = 'Switch to Candidate Registration'; + } + }); +</script> +{% endblock content %} diff --git a/templates/base.html b/templates/base.html index 0d705ce1a6415dbfde1e4d4ff6175c568370449b..4b708b93b054351a9e72250bce72cd7b05eb06e9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,17 +16,12 @@ <!-- Title block that allows page-specific titles --> <title>{% block title %}Chilly Business{% endblock %}</title> - <!-- Stylesheets (Bootstrap, Google Fonts, and Custom Styles) --> + <!-- Stylesheets --> <link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}" /> <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap" rel="stylesheet"> <link href="{% static 'css/font-awesome.min.css' %}" rel="stylesheet" /> <link href="{% static 'css/style.css' %}" rel="stylesheet" /> - - - - - </head> <body class="sub_page"> @@ -60,7 +55,7 @@ {% if user.is_authenticated %} <button id="notification-bell" class="notification-bell" aria-label="Notifications"> <i class="fa fa-bell"></i> - {% if unread_count > 0 %} + {% if unread_count > 0 %}<!--Supposed to be a small icon to display unread new notifications, but doesn't work-->> <span class="notification-count">{{ unread_count }}</span> {% endif %} </button> @@ -115,21 +110,13 @@ </div> <div class="onboarding-content"> {% block content %} - <div class="onboarding-step"> - <h4>Step 1: Complete Your Profile</h4> - <p>Please provide all the necessary personal information to complete your profile.</p> - </div> - <div class="onboarding-step"> - <h4>Step 2: Review Company Policies</h4> - <p>Make sure to go through the company policies to understand our code of conduct.</p> - </div> - <a href="#" class="btn-next">Proceed to the Next Step</a> + {% endblock content %} </div> </div> </div> - <!-- Footer --> + <!-- Footer, Admin Login (the superuser), example company email and phone --> <footer style="text-align: center; margin-top: 20px;"> <p> © 2024 Chilly Business. All rights reserved. diff --git a/templates/candidate_details.html b/templates/candidate_details.html index aea286f7a14ec5de8279516a6fed54585470afb4..e27dbff1137bbee289d6f223ca7651b8b20241ae 100644 --- a/templates/candidate_details.html +++ b/templates/candidate_details.html @@ -1,47 +1,47 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Candidate Details{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/candidate_details.css' %}" rel="stylesheet"> -{% endblock styles %} - -<div class="container mt-5"> - <h1 class="mb-4">Candidate Details</h1> - {% if restricted %} - <div class="alert alert-warning" role="alert"> - The details for this candidate are currently restricted. - </div> - <p>To view their details and CV, please request access.</p> - <form method="post" action="{% url 'send_notification' candidate.user.id %}" class="mt-3"> - {% csrf_token %} - <button type="submit" class="btn btn-warning">Request CV Access</button> - </form> - {% else %} - <div class="row"> - <div class="col-md-6 mb-3"> - <p><strong>First Name:</strong> {{ candidate.user.first_name }}</p> - </div> - <div class="col-md-6 mb-3"> - <p><strong>Last Name:</strong> {{ candidate.user.last_name }}</p> - </div> - </div> - - <div class="row"> - <div class="col-md-6 mb-3"> - <p><strong>Skills:</strong> {{ candidate.skills }}</p> - </div> - <div class="col-md-6 mb-3"> - <p><strong>Contact Email:</strong> {{ candidate.user.email }}</p> - </div> - </div> - - <div class="mb-3"> - <strong>CV:</strong> - <a href="{{ candidate.resume.url }}" target="_blank" class="btn btn-sm btn-info"> - View CV - </a> - </div> - {% endif %} -</div> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Candidate Details{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/candidate_details.css' %}" rel="stylesheet"> +{% endblock styles %} +<!--Deatails of the candidates including the CV are available for viewing.--> +<div class="container mt-5"> + <h1 class="mb-4">Candidate Details</h1> + {% if restricted %} + <div class="alert alert-warning" role="alert"> + The details for this candidate are currently restricted. + </div> + <p>To view their details and CV, please request access.</p> + <form method="post" action="{% url 'send_notification' candidate.user.id %}" class="mt-3"> + {% csrf_token %} + <button type="submit" class="btn btn-warning">Request CV Access</button> + </form> + {% else %} + <div class="row"> + <div class="col-md-6 mb-3"> + <p><strong>First Name:</strong> {{ candidate.user.first_name }}</p> + </div> + <div class="col-md-6 mb-3"> + <p><strong>Last Name:</strong> {{ candidate.user.last_name }}</p> + </div> + </div> + + <div class="row"> + <div class="col-md-6 mb-3"> + <p><strong>Skills:</strong> {{ candidate.skills }}</p> + </div> + <div class="col-md-6 mb-3"> + <p><strong>Contact Email:</strong> {{ candidate.user.email }}</p> + </div> + </div> + + <div class="mb-3"> + <strong>CV:</strong> + <a href="{{ candidate.resume.url }}" target="_blank" class="btn btn-sm btn-info"> + View CV + </a> + </div> + {% endif %} +</div> +{% endblock content %} diff --git a/templates/candidatelist.html b/templates/candidatelist.html index 85447ec141b509929edfc6a56df8e2adad760058..048cbf6802f60560666ecb2f048187f2c05260ea 100644 --- a/templates/candidatelist.html +++ b/templates/candidatelist.html @@ -1,103 +1,103 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Candidate List{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/candidatelist.css' %}" rel="stylesheet"> -{% endblock styles %} -<h1>Candidate List</h1> - -<!-- Filters --> -<form method="get" class="mb-3"> - <div class="row"> - <!-- Skill Filter --> - <div class="col-md-4"> - <label for="skill">Filter by Skill:</label> - <input type="text" name="skill" id="skill" class="form-control" placeholder="e.g., Python, Java" value="{{ skill_filter }}"> - </div> - - <!-- Restricted Filter --> - <div class="col-md-4"> - <label for="restricted">Filter by Details Visibility:</label> - <select name="restricted" id="restricted" class="form-control"> - <option value="all" {% if restricted_filter == 'all' %}selected{% endif %}>All</option> - <option value="restricted" {% if restricted_filter == 'restricted' %}selected{% endif %}>Restricted</option> - <option value="visible" {% if restricted_filter == 'visible' %}selected{% endif %}>Visible</option> - </select> - </div> - - <!-- Submit Button --> - <div class="col-md-4 d-flex align-items-end"> - <button type="submit" class="btn btn-primary">Filter</button> - </div> - </div> -</form> - - -<table class="table table-bordered table-hover"> - <thead> - <tr> - <th>First Name</th> - <th>Last Name</th> - <th>Skills</th> - <th>Details Restricted</th> - <th>Actions</th> - </tr> - </thead> - <tbody> - {% for candidate in candidates %} - <tr> - <td>{{ candidate.user.first_name }}</td> - <td>{{ candidate.user.last_name }}</td> - <td>{{ candidate.skills }}</td> - <td> - {% if not candidate.cv_visibility %} - <span style="color: red;">Restricted</span> - {% else %} - <span style="color: green;">Visible</span> - {% endif %} - </td> - <td> - {% if candidate.cv_visibility %} - <a href="{% url 'candidate_details' candidate.id %}" class="btn btn-primary">View Details</a> - {% else %} - <form method="post" action="{% url 'send_notification' candidate.user.id %}"> - {% csrf_token %} - <input type="hidden" name="source" value="candidate_list"> - <button type="submit" class="btn btn-warning">Request Details Access</button> - </form> - {% endif %} - </td> - </tr> - {% endfor %} - </tbody> -</table> - - -<!-- Pagination --> -<nav aria-label="Page navigation"> - <ul class="pagination"> - {% if candidates.has_previous %} - <li class="page-item"> - <a class="page-link" href="?page=1&skill={{ skill_filter }}&restricted={{ restricted_filter }}">First</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ candidates.previous_page_number }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Previous</a> - </li> - {% endif %} - {% for num in candidates.paginator.page_range %} - <li class="page-item {% if candidates.number == num %}active{% endif %}"> - <a class="page-link" href="?page={{ num }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">{{ num }}</a> - </li> - {% endfor %} - {% if candidates.has_next %} - <li class="page-item"> - <a class="page-link" href="?page={{ candidates.next_page_number }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Next</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ candidates.paginator.num_pages }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Last</a> - </li> - {% endif %} - </ul> -</nav> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Candidate List{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/candidatelist.css' %}" rel="stylesheet"> +{% endblock styles %} +<h1>Candidate List</h1> + +<!-- Filters --> +<form method="get" class="mb-3"> + <div class="row"> + <!-- Skill filter to see which candidates excel at which job--> + <div class="col-md-4"> + <label for="skill">Filter by Skill:</label> + <input type="text" name="skill" id="skill" class="form-control" placeholder="e.g., Python, Java" value="{{ skill_filter }}"> + </div> + + <!-- Restricted Filter Used to filter out those who do not wish to readily give out personal details--> + <div class="col-md-4"> + <label for="restricted">Filter by Details Visibility:</label> + <select name="restricted" id="restricted" class="form-control"> + <option value="all" {% if restricted_filter == 'all' %}selected{% endif %}>All</option> + <option value="restricted" {% if restricted_filter == 'restricted' %}selected{% endif %}>Restricted</option> + <option value="visible" {% if restricted_filter == 'visible' %}selected{% endif %}>Visible</option> + </select> + </div> + + <!-- Submit Button --> + <div class="col-md-4 d-flex align-items-end"> + <button type="submit" class="btn btn-primary">Filter</button> + </div> + </div> +</form> + + +<table class="table table-bordered table-hover"> + <thead> + <tr> + <th>First Name</th> + <th>Last Name</th> + <th>Skills</th> + <th>Details Restricted</th> + <th>Actions</th> + </tr> + </thead> + <tbody> + {% for candidate in candidates %} + <tr> + <td>{{ candidate.user.first_name }}</td> + <td>{{ candidate.user.last_name }}</td> + <td>{{ candidate.skills }}</td> + <td> + {% if not candidate.cv_visibility %} + <span style="color: red;">Restricted</span> + {% else %} + <span style="color: green;">Visible</span> + {% endif %} + </td> + <td> + {% if candidate.cv_visibility %} + <a href="{% url 'candidate_details' candidate.id %}" class="btn btn-primary">View Details</a> + {% else %} + <form method="post" action="{% url 'send_notification' candidate.user.id %}"> + {% csrf_token %} + <input type="hidden" name="source" value="candidate_list"> + <button type="submit" class="btn btn-warning">Request Details Access</button> + </form> + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> +</table> + + +<!-- Pagination --> +<nav aria-label="Page navigation"> + <ul class="pagination"> + {% if candidates.has_previous %} + <li class="page-item"> + <a class="page-link" href="?page=1&skill={{ skill_filter }}&restricted={{ restricted_filter }}">First</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ candidates.previous_page_number }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Previous</a> + </li> + {% endif %} + {% for num in candidates.paginator.page_range %} + <li class="page-item {% if candidates.number == num %}active{% endif %}"> + <a class="page-link" href="?page={{ num }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">{{ num }}</a> + </li> + {% endfor %} + {% if candidates.has_next %} + <li class="page-item"> + <a class="page-link" href="?page={{ candidates.next_page_number }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Next</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ candidates.paginator.num_pages }}&skill={{ skill_filter }}&restricted={{ restricted_filter }}">Last</a> + </li> + {% endif %} + </ul> +</nav> +{% endblock content %} diff --git a/templates/index.html b/templates/index.html index bb446b61716f5a8a5f90810739caf184bb48c4cc..0134004084a7873a8aad49ff9a9864211b77a828 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,21 +1,21 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Home{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/home.css' %}" rel="stylesheet"> -{% endblock styles %} - -<section class="hero-section"> - <div class="hero-content"> - <h1>Get Jobs FAST</h1> - <p>Thousands of jobs available throughout your location.</p> - <form class="search-bar" action="{% url 'job_list' %}" method="get"> - <input type="text" name="query" placeholder="Search by job title, keyword, or company..." /> - <button type="submit" class="btn btn-primary">Search</button> - </form> - <p class="subtext">Find your next career move with just a few clicks.</p> - </div> -</section> - -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Home{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/home.css' %}" rel="stylesheet"> +{% endblock styles %} +<!--The home screen used to quickly go to job list after pressing the search button if you were logged in--> +<section class="hero-section"> + <div class="hero-content"> + <h1>Get Jobs FAST</h1> + <p>Thousands of jobs available throughout your location.</p> + <form class="search-bar" action="{% url 'job_list' %}" method="get"> + <input type="text" name="query" placeholder="Search by job title, keyword, or company..." /> + <button type="submit" class="btn btn-primary">Search</button> + </form> + <p class="subtext">Find your next career move with just a few clicks.</p> + </div> +</section> + +{% endblock content %} diff --git a/templates/joblist.html b/templates/joblist.html index a31bc45b27096870ef1ac02e8d92411519ff378d..e2276651e7e59b5a046e69a63cccabe221c3b277 100644 --- a/templates/joblist.html +++ b/templates/joblist.html @@ -1,114 +1,114 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Job List{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/joblist.css' %}" rel="stylesheet"> -{% endblock styles %} -<div class="container"> - <h1>Job List</h1> - <form method="get" class="mb-3"> - <div class="row"> - <!-- Business Category Filter --> - <div class="col-md-4"> - <label for="business_category">Business Category:</label> - <select name="business_category" id="business_category" class="form-control"> - <option value="all" {% if business_category_filter == 'all' %}selected{% endif %}>All</option> - {% for category in business_categories %} - <option value="{{ category }}" {% if category == business_category_filter %}selected{% endif %}>{{ category }}</option> - {% endfor %} - </select> - </div> - - <!-- Status Filter --> - <div class="col-md-4"> - <label for="status">Status:</label> - <select name="status" id="status" class="form-control"> - <option value="all" {% if status_filter == 'all' %}selected{% endif %}>All</option> - <option value="Open" {% if status_filter == 'Open' %}selected{% endif %}>Open</option> - <option value="Close" {% if status_filter == 'Close' %}selected{% endif %}>Close</option> - </select> - </div> - - <!-- Submit Button --> - <div class="col-md-4 d-flex align-items-end"> - <button type="submit" class="btn btn-primary">Filter</button> - </div> - </div> - </form> -<div class="container"> - {% if employers %} - <table class="table table-bordered table-hover"> - <thead> - <tr> - <th>Business Name</th> - <th>Business Category</th> - <th>Type</th> - <th>Location and Region</th> - <th>Job Offered</th> - <th>Status</th> - <th>Actions</th> - </tr> - </thead> - <tbody> - {% for employer in page_obj %} - <tr> - <td>{{ employer.business_name }}</td> - <td>{{ employer.business_category }}</td> - <td>{{ employer.business_type }}</td> - <td>{{ employer.location }} {{ employer.region }}</td> - <td>{{ employer.fields_for_jobs }}</td> - <td> - {% if employer.status == "Open" %} - <span class="badge badge-success">Open</span> - {% else %} - <span class="badge badge-danger">Close</span> - {% endif %} - </td> - <td> - {% if employer.status == "Open" %} - {% if request.user.user_type == "job_seeker" %} - <a href="{% url 'onboarding_form' employer.id %}" class="btn btn-primary">Fill Onboarding Form</a> - {% else %} - <span class="text-muted">Must be Candidate</span> - {% endif %} - {% else %} - <span class="text-muted">Closed</span> - {% endif %} - </td> - </tr> - {% endfor %} - </tbody> - - </table> - <!-- Pagination Links --> -<nav> - <ul class="pagination"> - {% if page_obj.has_previous %} - <li class="page-item"> - <a class="page-link" href="?page=1&business_category={{ business_category_filter }}&status={{ status_filter }}">First</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ page_obj.previous_page_number }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Previous</a> - </li> - {% endif %} - {% for num in page_obj.paginator.page_range %} - <li class="page-item {% if page_obj.number == num %}active{% endif %}"> - <a class="page-link" href="?page={{ num }}&business_category={{ business_category_filter }}&status={{ status_filter }}">{{ num }}</a> - </li> - {% endfor %} - {% if page_obj.has_next %} - <li class="page-item"> - <a class="page-link" href="?page={{ page_obj.next_page_number }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Next</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ page_obj.paginator.num_pages }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Last</a> - </li> - {% endif %} - </ul> -</nav> - {% else %} - <p>No employers available at the moment.</p> - {% endif %} -</div> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Job List{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/joblist.css' %}" rel="stylesheet"> +{% endblock styles %} +<div class="container"> + <h1>Job List</h1> + <form method="get" class="mb-3"> + <div class="row"> + <!-- Business Category Filter --> + <div class="col-md-4"> + <label for="business_category">Business Category:</label> + <select name="business_category" id="business_category" class="form-control"> + <option value="all" {% if business_category_filter == 'all' %}selected{% endif %}>All</option> + {% for category in business_categories %} + <option value="{{ category }}" {% if category == business_category_filter %}selected{% endif %}>{{ category }}</option> + {% endfor %} + </select> + </div> + + <!-- Status Filter --> + <div class="col-md-4"> + <label for="status">Status:</label> + <select name="status" id="status" class="form-control"> + <option value="all" {% if status_filter == 'all' %}selected{% endif %}>All</option> + <option value="Open" {% if status_filter == 'Open' %}selected{% endif %}>Open</option> + <option value="Close" {% if status_filter == 'Close' %}selected{% endif %}>Close</option> + </select> + </div> + + <!-- Submit Button --> + <div class="col-md-4 d-flex align-items-end"> + <button type="submit" class="btn btn-primary">Filter</button> + </div> + </div> + </form> +<div class="container"> + {% if employers %} + <table class="table table-bordered table-hover"> + <thead> + <tr> + <th>Business Name</th> + <th>Business Category</th> + <th>Type</th> + <th>Location and Region</th> + <th>Job Offered</th> + <th>Status</th> + <th>Actions</th> + </tr> + </thead> + <tbody> + {% for employer in page_obj %} + <tr> + <td>{{ employer.business_name }}</td> + <td>{{ employer.business_category }}</td> + <td>{{ employer.business_type }}</td> + <td>{{ employer.location }} {{ employer.region }}</td> + <td>{{ employer.fields_for_jobs }}</td> + <td> + {% if employer.status == "Open" %} + <span class="badge badge-success">Open</span> + {% else %} + <span class="badge badge-danger">Close</span> + {% endif %} + </td> + <td> + {% if employer.status == "Open" %} + {% if request.user.user_type == "job_seeker" %} + <a href="{% url 'onboarding_form' employer.id %}" class="btn btn-primary">Fill Job Application Form</a> + {% else %} + <span class="text-muted">Must be Candidate</span> + {% endif %} + {% else %} + <span class="text-muted">Closed</span> + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> + + </table> + <!-- Pagination Buttons which increase with the more content there is, only 10 will be seen at once.--> +<nav> + <ul class="pagination"> + {% if page_obj.has_previous %} + <li class="page-item"> + <a class="page-link" href="?page=1&business_category={{ business_category_filter }}&status={{ status_filter }}">First</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ page_obj.previous_page_number }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Previous</a> + </li> + {% endif %} + {% for num in page_obj.paginator.page_range %} + <li class="page-item {% if page_obj.number == num %}active{% endif %}"> + <a class="page-link" href="?page={{ num }}&business_category={{ business_category_filter }}&status={{ status_filter }}">{{ num }}</a> + </li> + {% endfor %} + {% if page_obj.has_next %} + <li class="page-item"> + <a class="page-link" href="?page={{ page_obj.next_page_number }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Next</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ page_obj.paginator.num_pages }}&business_category={{ business_category_filter }}&status={{ status_filter }}">Last</a> + </li> + {% endif %} + </ul> +</nav> + {% else %} + <p>No employers available at the moment.</p> + {% endif %} +</div> +{% endblock content %} diff --git a/templates/messagebox.html b/templates/messagebox.html index d77a786d65300ff23543a478f159d6fcf5bc3cdf..ba8928a1eea66c399a741f01eb9e650fd57a22d2 100644 --- a/templates/messagebox.html +++ b/templates/messagebox.html @@ -1,138 +1,140 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Message Box{% endblock title %} -{% block content %} -{% block styles %} -<link href="{% static 'css/messagebox.css' %}" rel="stylesheet"> -{% endblock styles %} -<div class="container mt-5"> - <h1>Message Box</h1> - <div class="d-flex justify-content-between mb-3"> - <div> - {% if request.user.user_type == "employer" %} - <a href="{% url 'view_archived_candidates' %}" class="btn btn-secondary">View Archived Candidates</a> - {% endif %} - <form method="post" action="{% url 'mark_all_as_read' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-primary">Mark All as Read</button> - </form> - <form method="post" action="{% url 'delete_all_notifications' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-danger">Delete All</button> - </form> - - {% if request.user.user_type == "job_seeker" %} - <form method="post" action="{% url 'accept_all_notifications' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-success">Accept All</button> - </form> - <form method="post" action="{% url 'deny_all_notifications' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-warning">Deny All</button> - </form> - {% elif request.user.user_type == "employer" %} - <form method="post" action="{% url 'archive_all_candidates' %}" style="display: inline;"> - {% csrf_token %} - <button type="submit" class="btn btn-info">Archive All</button> - </form> - {% endif %} - </div> - </div> - - <div class="btn-group mb-3"> - <a href="{% url 'message_box' %}?filter=active" class="btn btn-secondary {% if filter_type == 'active' %}active{% endif %}">Active</a> - <a href="{% url 'message_box' %}?filter=archived" class="btn btn-secondary {% if filter_type == 'archived' %}active{% endif %}">Archived</a> - </div> - - <table class="table table-bordered table-hover"> - <thead> - <tr> - <th>#</th> - <th>From</th> - <th>Message</th> - <th>Created At</th> - <th>Actions</th> - </tr> - </thead> - <tbody> - {% for notification in notifications %} - <tr class="{% if not notification.is_read %}table-warning{% endif %}"> - <td>{{ forloop.counter }}</td> - <td> - {% if notification.sender %} - {{ notification.sender.username }} - {% else %} - System - {% endif %} - </td> - <td>{{ notification.message }}</td> - <td>{{ notification.created_at|date:"Y-m-d H:i" }}</td> - <td> - {% if notification.cv_access %} - <a href="{{ notification.related_cv.url }}" target="_blank" class="btn btn-sm btn-secondary">View CV</a> - {% endif %} - - {% if not notification.is_read %} - <form action="{% url 'mark_notifications_as_read' notification.id %}" method="POST" style="display:inline-block;"> - {% csrf_token %} - <button type="submit" class="btn btn-sm btn-primary">Mark as Read</button> - </form> - {% endif %} - - <form action="{% url 'delete_notification' notification.id %}" method="POST" style="display:inline-block;"> - {% csrf_token %} - <button type="submit" class="btn btn-sm btn-danger">Delete</button> - </form> - - {% if request.user.user_type == "job_seeker" %} - <form action="{% url 'handle_notification' notification.id 'accept' %}" method="POST" style="display:inline-block;"> - {% csrf_token %} - <button type="submit" class="btn btn-sm btn-success">Accept</button> - </form> - <form action="{% url 'handle_notification' notification.id 'deny' %}" method="POST" style="display:inline-block;"> - {% csrf_token %} - <button type="submit" class="btn btn-sm btn-warning">Deny</button> - </form> - {% elif request.user.user_type == "employer" %} - <form action="{% url 'archive_candidate' notification.id %}" method="POST" style="display:inline-block;"> - {% csrf_token %} - <button type="submit" class="btn btn-sm btn-info">Archive</button> - </form> - {% endif %} - </td> - </tr> - {% empty %} - <tr> - <td colspan="5" class="text-center">No messages available.</td> - </tr> - {% endfor %} - </tbody> - </table> - - <nav aria-label="Page navigation"> - <ul class="pagination"> - {% if notifications.has_previous %} - <li class="page-item"> - <a class="page-link" href="?page=1&filter={{ filter_type }}">First</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ notifications.previous_page_number }}&filter={{ filter_type }}">Previous</a> - </li> - {% endif %} - {% for num in notifications.paginator.page_range %} - <li class="page-item {% if notifications.number == num %}active{% endif %}"> - <a class="page-link" href="?page={{ num }}&filter={{ filter_type }}">{{ num }}</a> - </li> - {% endfor %} - {% if notifications.has_next %} - <li class="page-item"> - <a class="page-link" href="?page={{ notifications.next_page_number }}&filter={{ filter_type }}">Next</a> - </li> - <li class="page-item"> - <a class="page-link" href="?page={{ notifications.paginator.num_pages }}&filter={{ filter_type }}">Last</a> - </li> - {% endif %} - </ul> - </nav> -</div> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Message Box{% endblock title %} +{% block content %} +{% block styles %} +<link href="{% static 'css/messagebox.css' %}" rel="stylesheet"> +{% endblock styles %} +<div class="container mt-5"> + <h1>Message Box</h1> + <div class="d-flex justify-content-between mb-3"> +<!--go into archived_candidates.html button--> + <div> + {% if request.user.user_type == "employer" %} + <a href="{% url 'view_archived_candidates' %}" class="btn btn-secondary">View Archived Candidates</a> + {% endif %} +<!--Mass action buttons--> + <form method="post" action="{% url 'mark_all_as_read' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-primary">Mark All as Read</button> + </form> + <form method="post" action="{% url 'delete_all_notifications' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-danger">Delete All</button> + </form> + + {% if request.user.user_type == "job_seeker" %} + <form method="post" action="{% url 'accept_all_notifications' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-success">Accept All</button> + </form> + <form method="post" action="{% url 'deny_all_notifications' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-warning">Deny All</button> + </form> + {% elif request.user.user_type == "employer" %} + <form method="post" action="{% url 'archive_all_candidates' %}" style="display: inline;"> + {% csrf_token %} + <button type="submit" class="btn btn-info">Archive All</button> + </form> + {% endif %} + </div> + </div> +<!--The filter for archived candidates--> + <div class="btn-group mb-3"> + <a href="{% url 'message_box' %}?filter=active" class="btn btn-secondary {% if filter_type == 'active' %}active{% endif %}">Active</a> + <a href="{% url 'message_box' %}?filter=archived" class="btn btn-secondary {% if filter_type == 'archived' %}active{% endif %}">Archived</a> + </div> + <!--Table for the notifications--> + <table class="table table-bordered table-hover"> + <thead> + <tr> + <th>#</th> + <th>From</th> + <th>Message</th> + <th>Created At</th> + <th>Actions</th> + </tr> + </thead> + <tbody> + {% for notification in notifications %} + <tr class="{% if not notification.is_read %}table-warning{% endif %}"> + <td>{{ forloop.counter }}</td> + <td> + {% if notification.sender %} + {{ notification.sender.username }} + {% else %} + System + {% endif %} + </td> + <td>{{ notification.message }}</td> + <td>{{ notification.created_at|date:"Y-m-d H:i" }}</td> + <td> + {% if notification.cv_access %} + <a href="{{ notification.related_cv.url }}" target="_blank" class="btn btn-sm btn-secondary">View CV</a> + {% endif %} + <!--action buttons--> + {% if not notification.is_read %} + <form action="{% url 'mark_notifications_as_read' notification.id %}" method="POST" style="display:inline-block;"> + {% csrf_token %} + <button type="submit" class="btn btn-sm btn-primary">Mark as Read</button> + </form> + {% endif %} + + <form action="{% url 'delete_notification' notification.id %}" method="POST" style="display:inline-block;"> + {% csrf_token %} + <button type="submit" class="btn btn-sm btn-danger">Delete</button> + </form> + + {% if request.user.user_type == "job_seeker" %} + <form action="{% url 'handle_notification' notification.id 'accept' %}" method="POST" style="display:inline-block;"> + {% csrf_token %} + <button type="submit" class="btn btn-sm btn-success">Accept</button> + </form> + <form action="{% url 'handle_notification' notification.id 'deny' %}" method="POST" style="display:inline-block;"> + {% csrf_token %}<!--accept and deny are only available for candidates--> + <button type="submit" class="btn btn-sm btn-warning">Deny</button> + </form> + {% elif request.user.user_type == "employer" %} <!-- archive is only available for employers--> + <form action="{% url 'archive_candidate' notification.id %}" method="POST" style="display:inline-block;"> + {% csrf_token %} + <button type="submit" class="btn btn-sm btn-info">Archive</button> + </form> + {% endif %} + </td> + </tr> + {% empty %} + <tr> + <td colspan="5" class="text-center">No messages available.</td> + </tr> + {% endfor %} + </tbody> + </table> +<!-- Pagination which allows only 10 to be shown at a time.--> + <nav aria-label="Page navigation"> + <ul class="pagination"> + {% if notifications.has_previous %} + <li class="page-item"> + <a class="page-link" href="?page=1&filter={{ filter_type }}">First</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ notifications.previous_page_number }}&filter={{ filter_type }}">Previous</a> + </li> + {% endif %} + {% for num in notifications.paginator.page_range %} + <li class="page-item {% if notifications.number == num %}active{% endif %}"> + <a class="page-link" href="?page={{ num }}&filter={{ filter_type }}">{{ num }}</a> + </li> + {% endfor %} + {% if notifications.has_next %} + <li class="page-item"> + <a class="page-link" href="?page={{ notifications.next_page_number }}&filter={{ filter_type }}">Next</a> + </li> + <li class="page-item"> + <a class="page-link" href="?page={{ notifications.paginator.num_pages }}&filter={{ filter_type }}">Last</a> + </li> + {% endif %} + </ul> + </nav> +</div> +{% endblock content %} diff --git a/templates/onboarding_form.html b/templates/onboarding_form.html index 6b6b0174e2cd8db100967a8d17f154bcff93e05a..e9ebd4e724d312b4d40411424885860d34e154f8 100644 --- a/templates/onboarding_form.html +++ b/templates/onboarding_form.html @@ -1,72 +1,72 @@ -{% extends 'base.html' %} -{% load static %} -{% block title %}Onboarding Form{% endblock title %} - -{% block content %} -{% block styles %} -<link href="{% static 'css/onboarding_form.css' %}" rel="stylesheet"> -{% endblock styles %} -<div class="onboarding-container"> - <h1>Employee Onboarding Form</h1> - <form action="{% url 'onboarding_form' employer.id %}" method="POST" enctype="multipart/form-data"> - {% csrf_token %} - <!-- Personal Details Section --> - <div class="onboarding-section-title">Personal Details</div> - <label for="onboarding-name">Full Name:</label> - <input type="text" id="onboarding-name" name="name" required> - - <label for="onboarding-address">Permanent Address:</label> - <textarea id="onboarding-address" name="address" rows="4" required></textarea> - - <!-- ID Card Information --> - <label for="onboarding-id-card">ID Card Information:</label> - <input type="text" id="onboarding-id-card" name="id_card" placeholder="Enter ID Card Number" required> - - <!-- Current Job --> - <div class="onboarding-section-title">Current Job</div> - <label for="onboarding-current-job">Where are you currently working?</label> - <input type="text" id="onboarding-current-job" name="current_job" required> - - <label for="onboarding-reason">Why do you want to join here?</label> - <textarea id="onboarding-reason" name="reason" rows="4" required></textarea> - - <!-- File Uploads --> - <div class="onboarding-section-title">Upload Documents</div> - <label for="onboarding-cv">Upload Resume:</label> - <input type="file" id="onboarding-cv" name="cv" accept=".pdf,.doc,.docx" required> - - <label for="onboarding-certificates">Upload Educational Certificates:</label> - <input type="file" id="onboarding-certificates" name="certificates" accept=".pdf,.jpg,.jpeg,.png" multiple required> - - <!-- Educational Achievements --> - <div class="onboarding-section-title">Educational Achievements</div> - <label for="onboarding-education">List your educational achievements:</label> - <textarea id="onboarding-education" name="education" rows="4" required></textarea> - - <!-- Expertise --> - <div class="onboarding-section-title">Expertise and Experience</div> - <label for="onboarding-field">How well-versed are you in the required field?</label> - <select id="onboarding-field" name="field" required> - <option value="" disabled selected>Select your expertise level</option> - <option value="Beginner">Beginner</option> - <option value="Intermediate">Intermediate</option> - <option value="Advanced">Advanced</option> - </select> - - <label for="onboarding-experience">Years of Experience in the Field:</label> - <input type="number" id="onboarding-experience" name="experience" min="0" placeholder="Enter number of years" required> - - <!-- Submit Button --> - <button type="submit" class="onboarding-submit-btn">Submit Form</button> - </form> -</div> - - <script> - document.querySelector('form').addEventListener('submit', function () { - setTimeout(function () { - window.location.href = "{% url 'job_list' %}"; - }, 2000); // Redirect after 2 seconds - }); -</script> - -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block title %}Onboarding Form{% endblock title %} + +{% block content %} +{% block styles %} +<link href="{% static 'css/onboarding_form.css' %}" rel="stylesheet"> +{% endblock styles %} +<div class="onboarding-container"> + <h1>Employee Onboarding Form</h1> + <form action="{% url 'onboarding_form' employer.id %}" method="POST" enctype="multipart/form-data"> + {% csrf_token %} + <!-- Personal Details Section --> + <div class="onboarding-section-title">Personal Details</div> + <label for="onboarding-name">Full Name:</label> + <input type="text" id="onboarding-name" name="name" required> + + <label for="onboarding-address">Permanent Address:</label> + <textarea id="onboarding-address" name="address" rows="4" required></textarea> + + <!-- ID Card Information --> + <label for="onboarding-id-card">ID Card Information:</label> + <input type="text" id="onboarding-id-card" name="id_card" placeholder="Enter ID Card Number" required> + + <!-- Current Job --> + <div class="onboarding-section-title">Current Job</div> + <label for="onboarding-current-job">Where are you currently working?</label> + <input type="text" id="onboarding-current-job" name="current_job" required> + + <label for="onboarding-reason">Why do you want to join here?</label> + <textarea id="onboarding-reason" name="reason" rows="4" required></textarea> + + <!-- File Uploads --> + <div class="onboarding-section-title">Upload Documents</div> + <label for="onboarding-cv">Upload Resume:</label> + <input type="file" id="onboarding-cv" name="cv" accept=".pdf,.doc,.docx" required> + + <label for="onboarding-certificates">Upload Educational Certificates:</label> + <input type="file" id="onboarding-certificates" name="certificates" accept=".pdf,.jpg,.jpeg,.png" multiple required> + + <!-- Educational Achievements --> + <div class="onboarding-section-title">Educational Achievements</div> + <label for="onboarding-education">List your educational achievements:</label> + <textarea id="onboarding-education" name="education" rows="4" required></textarea> + + <!-- Expertise --> + <div class="onboarding-section-title">Expertise and Experience</div> + <label for="onboarding-field">How well-versed are you in the required field?</label> + <select id="onboarding-field" name="field" required> + <option value="" disabled selected>Select your expertise level</option> + <option value="Beginner">Beginner</option> + <option value="Intermediate">Intermediate</option> + <option value="Advanced">Advanced</option> + </select> + + <label for="onboarding-experience">Years of Experience in the Field:</label> + <input type="number" id="onboarding-experience" name="experience" min="0" placeholder="Enter number of years" required> + + <!-- Submit Button, should start a download of the content in a zipped folder with the pdfs. --> + <button type="submit" class="onboarding-submit-btn">Submit Form</button> + </form> +</div> + + <script> + document.querySelector('form').addEventListener('submit', function () { + setTimeout(function () { + window.location.href = "{% url 'job_list' %}"; + }, 2000); // Redirect after 2 seconds + }); +</script> + +{% endblock content %} diff --git a/templates/password_reset.html b/templates/password_reset.html index 34c774229e47f602b6c82d4eb524b103669b1dff..e39dc14dee75d5711b913e31bf31f0861f21cf85 100644 --- a/templates/password_reset.html +++ b/templates/password_reset.html @@ -1,21 +1,22 @@ -{% extends 'base.html' %} -{% load static %} -{% block content %} -{% block styles %} -<link href="{% static 'css/password_reset.css' %}" rel="stylesheet"> -{% endblock styles %} -<h2>Forgot Password</h2> -<p>Enter your email address, and we'll send you a link to reset your password.</p> -<form method="post"> - {% csrf_token %} - {{ form.as_p }} - <button type="submit" class="btn btn-primary">Send Password Reset Email</button> -</form> -{% if messages %} - <ul> - {% for message in messages %} - <li class="{{ message.tags }}">{{ message }}</li> - {% endfor %} - </ul> -{% endif %} -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block content %} +{% block styles %} +<link href="{% static 'css/password_reset.css' %}" rel="stylesheet"> +{% endblock styles %} +<!--Send email/speak to admin so that they can email you--> +<h2>Forgot Password</h2> +<p>Enter your email address, and we'll send you a link to reset your password.</p> +<form method="post"> + {% csrf_token %} + {{ form.as_p }} + <button type="submit" class="btn btn-primary">Send Password Reset Email</button> +</form> +{% if messages %} + <ul> + {% for message in messages %} + <li class="{{ message.tags }}">{{ message }}</li> + {% endfor %} + </ul> +{% endif %} +{% endblock content %} diff --git a/templates/password_reset_done.html b/templates/password_reset_done.html index 34eebe5a4fce97c85cc25ec44bebaf48db4039e9..fab4bfd387b6c2993593292794eb12ffedc9ef92 100644 --- a/templates/password_reset_done.html +++ b/templates/password_reset_done.html @@ -1,10 +1,12 @@ -{% extends 'base.html' %} -{% load static %} -{% block content %} -{% block styles %} -<link href="{% static 'css/password_reset_done.css' %}" rel="stylesheet"> -{% endblock styles %} -<h2>Password Reset Sent</h2> -<p>Check your email for a link to reset your password.</p> -<a href="{% url 'login' %}">Back to Login</a> -{% endblock content %} +{% extends 'base.html' %} +{% load static %} +{% block content %} +{% block styles %} +<!-- The success page to show that the email information has been sent to the admin --> +<!-- so that the admin can send an email asking for more information and end the problem--> +<link href="{% static 'css/password_reset_done.css' %}" rel="stylesheet"> +{% endblock styles %} +<h2>Password Reset Sent</h2> +<p>Check your email for a link to reset your password.</p> +<a href="{% url 'login' %}">Back to Login</a> +{% endblock content %}