| <!DOCTYPE html>
|
| <html lang="en">
|
| <head>
|
| <meta charset="UTF-8">
|
| <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| <title>Job Applications</title>
|
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css">
|
| <style>
|
|
|
| .search-input {
|
| border-top-left-radius: 50px;
|
| border-bottom-left-radius: 50px;
|
| border-right: none;
|
| }
|
| .search-btn {
|
| border-top-right-radius: 50px;
|
| border-bottom-right-radius: 50px;
|
| border-left: none;
|
| }
|
|
|
| .download-btn {
|
| border-top-right-radius: 25px;
|
| border-bottom-right-radius: 25px;
|
| border-top-left-radius: 25px;
|
| border-bottom-left-radius: 25px;
|
| border-left: none;
|
| margin-left: 2px;
|
| padding: 0.375rem 0.75rem;
|
| }
|
| </style>
|
| </head>
|
| <body>
|
| <div class="container mt-5">
|
| <h1 class="text-center">Career Crafter</h1>
|
|
|
|
|
| <ul class="nav nav-tabs" id="jobTabs" role="tablist">
|
| <li class="nav-item" role="presentation">
|
| <button class="nav-link{% if not edit_job %} active{% endif %}" id="list-tab" data-bs-toggle="tab" data-bs-target="#list" type="button" role="tab" aria-controls="list" aria-selected="{{ 'true' if not edit_job else 'false' }}">Job List</button>
|
| </li>
|
| <li class="nav-item" role="presentation">
|
| <button class="nav-link{% if edit_job %} active{% endif %}" id="add-tab" data-bs-toggle="tab" data-bs-target="#add" type="button" role="tab" aria-controls="add" aria-selected="{{ 'true' if edit_job else 'false' }}">Add Job</button>
|
| </li>
|
| <li class="nav-item" role="presentation">
|
| <button class="nav-link" id="prepme-tab" data-bs-toggle="tab" data-bs-target="#prepme" type="button" role="tab" aria-controls="prepme" aria-selected="false">PrepMe</button>
|
| </li>
|
| </ul>
|
|
|
|
|
| <div class="tab-content" id="jobTabsContent">
|
|
|
| <div class="tab-pane fade{% if not edit_job %} show active{% endif %}" id="list" role="tabpanel" aria-labelledby="list-tab">
|
|
|
| <div class="mb-3">
|
| {# Clickable status filters #}
|
| <a href="{{ url_for('jobs', search=search_query, sort=sort_by, direction=direction, status_filter='Applied') }}" class="badge bg-primary me-2 {% if status_filter=='Applied' %}bg-opacity-75{% endif %}">Applied: {{ applied_count }}</a>
|
| <a href="{{ url_for('jobs', search=search_query, sort=sort_by, direction=direction, status_filter='Rejected') }}" class="badge bg-danger me-2 {% if status_filter=='Rejected' %}bg-opacity-75{% endif %}">Rejected: {{ rejected_count }}</a>
|
| <a href="{{ url_for('jobs', search=search_query, sort=sort_by, direction=direction, status_filter='Interviewing') }}" class="badge bg-warning text-dark me-2 {% if status_filter=='Interviewing' %}bg-opacity-75{% endif %}">Interviewing: {{ interviewing_count }}</a>
|
| <a href="{{ url_for('jobs', search=search_query) }}" class="badge bg-secondary">All</a>
|
| </div>
|
|
|
| <div class="row justify-content-center mb-4">
|
| <div class="col-md-6">
|
| <form method="get" action="{{ url_for('jobs') }}">
|
| <div class="input-group">
|
| <input type="search" class="form-control search-input" name="search" placeholder="Search by company, position, or status" value="{{ search_query }}">
|
| <button class="btn btn-primary search-btn" type="submit">Search</button>
|
| <a href="{{ url_for('download_jobs', search=search_query) }}" class="btn btn-success download-btn" type="button">CSV</a>
|
| </div>
|
| </form>
|
| </div>
|
| </div>
|
| <h2 class="mt-2">Job List</h2>
|
| <table class="table table-bordered">
|
| <thead>
|
| <tr>
|
| <th>Company</th>
|
| <th>
|
| {% set pos_dir = 'desc' if sort_by=='position' and direction=='asc' else 'asc' %}
|
| <a href="{{ url_for('jobs', search=search_query, sort='position', direction=pos_dir) }}">
|
| Position
|
| {% if sort_by=='position' %}
|
| {% if direction=='asc' %} ▲ {% else %} ▼ {% endif %}
|
| {% endif %}
|
| </a>
|
| </th>
|
| <th>
|
| {% set date_dir = 'desc' if sort_by=='date_applied' and direction=='asc' else 'asc' %}
|
| <a href="{{ url_for('jobs', search=search_query, sort='date_applied', direction=date_dir) }}">
|
| Date Applied
|
| {% if sort_by=='date_applied' %}
|
| {% if direction=='asc' %} ▲ {% else %} ▼ {% endif %}
|
| {% endif %}
|
| </a>
|
| </th>
|
| <th>
|
| {% set status_dir = 'desc' if sort_by=='status' and direction=='asc' else 'asc' %}
|
| <a href="{{ url_for('jobs', search=search_query, sort='status', direction=status_dir) }}">
|
| Status
|
| {% if sort_by=='status' %}
|
| {% if direction=='asc' %} ▲ {% else %} ▼ {% endif %}
|
| {% endif %}
|
| </a>
|
| </th>
|
| <th>Resume Used</th>
|
| <th>Interview Details</th>
|
| <th>Comments</th>
|
| <th>Link</th>
|
| <th>Job Description</th>
|
| <th>Actions</th>
|
| </tr>
|
| </thead>
|
| <tbody>
|
| {% for job in jobs %}
|
| <tr>
|
| <td>{{ job.company }}</td>
|
| <td>{{ job.position }}</td>
|
| <td>{{ job.date_applied }}</td>
|
| <td>{{ job.status }}</td>
|
| <td>{{ job.resume_used }}</td>
|
| <td>{{ job.interview_details }}</td>
|
| <td>{{ job.comments }}</td>
|
| <td><a href="{{ job.link }}" target="_blank">Link</a></td>
|
| <td>{{ job.job_description }}</td>
|
| <td>
|
| <form method="POST" action="/delete_job/{{ job.id }}" style="display:inline;">
|
| <button type="submit" class="btn btn-sm btn-danger">Delete</button>
|
| </form>
|
| <a href="/edit_job/{{ job.id }}" class="btn btn-sm btn-warning">Edit</a>
|
| <button class="btn btn-sm btn-info prepme-btn" data-job-id="{{ job.id }}">PrepMe</button>
|
| </td>
|
| </tr>
|
| {% endfor %}
|
| </tbody>
|
| </table>
|
| </div>
|
|
|
|
|
| <div class="tab-pane fade{% if edit_job %} show active{% endif %}" id="add" role="tabpanel" aria-labelledby="add-tab">
|
| <form method="POST" action="{% if edit_job %}/edit_job/{{ edit_job.id }}{% else %}/jobs{% endif %}" class="mt-4">
|
| <div class="mb-3">
|
| <label for="company" class="form-label">Company</label>
|
| <input type="text" class="form-control" id="company" name="company" value="{{ edit_job.company if edit_job else '' }}" required>
|
| </div>
|
| <div class="mb-3">
|
| <label for="position" class="form-label">Position</label>
|
| <input type="text" class="form-control" id="position" name="position" value="{{ edit_job.position if edit_job else '' }}" required>
|
| </div>
|
| <div class="mb-3">
|
| <label for="resume_used" class="form-label">Resume Used</label>
|
| <input type="text" class="form-control" id="resume_used" name="resume_used" value="{{ edit_job.resume_used if edit_job else '' }}">
|
| </div>
|
| <div class="mb-3">
|
| <label for="date_applied" class="form-label">Date Applied</label>
|
| <input type="date" class="form-control" id="date_applied" name="date_applied" value="{{ edit_job.date_applied if edit_job else '' }}">
|
| </div>
|
| <div class="mb-3">
|
| <label for="status" class="form-label">Status</label>
|
| <select class="form-control" id="status" name="status">
|
| <option value="Applied" {% if edit_job and edit_job.status == 'Applied' %}selected{% endif %}>Applied</option>
|
| <option value="Interviewing" {% if edit_job and edit_job.status == 'Interviewing' %}selected{% endif %}>Interviewing</option>
|
| <option value="Rejected" {% if edit_job and edit_job.status == 'Rejected' %}selected{% endif %}>Rejected</option>
|
| <option value="On Hold" {% if edit_job and edit_job.status == 'On Hold' %}selected{% endif %}>On Hold</option>
|
| <option value="Offer" {% if edit_job and edit_job.status == 'Offer' %}selected{% endif %}>Offer</option>
|
| </select>
|
| </div>
|
| <div class="mb-3">
|
| <label for="interview_details" class="form-label">Interview Details</label>
|
| <textarea class="form-control" id="interview_details" name="interview_details">{{ edit_job.interview_details if edit_job else '' }}</textarea>
|
| </div>
|
| <div class="mb-3">
|
| <label for="comments" class="form-label">Comments</label>
|
| <textarea class="form-control" id="comments" name="comments">{{ edit_job.comments if edit_job else '' }}</textarea>
|
| </div>
|
| <div class="mb-3">
|
| <label for="link" class="form-label">Link</label>
|
| <input type="url" class="form-control" id="link" name="link" value="{{ edit_job.link if edit_job else '' }}">
|
| </div>
|
| <div class="mb-3">
|
| <label for="job_description" class="form-label">Job Description</label>
|
| <textarea class="form-control" id="job_description" name="job_description">{{ edit_job.job_description if edit_job else '' }}</textarea>
|
| </div>
|
| <button type="submit" class="btn btn-primary">{% if edit_job %}Update Job{% else %}Add Job{% endif %}</button>
|
| </form>
|
| </div>
|
|
|
|
|
| <div class="tab-pane fade" id="prepme" role="tabpanel" aria-labelledby="prepme-tab">
|
| <h2 class="mt-4">PrepMe Chatbot</h2>
|
| <div class="card">
|
| <div class="card-body">
|
| {% if jobs %}
|
| <h5 class="card-title">Job: {{ jobs[0].company }} - {{ jobs[0].position }}</h5>
|
| <p class="card-text">Job Description: {{ jobs[0].job_description }}</p>
|
| {% else %}
|
| <p>No jobs available.</p>
|
| {% endif %}
|
| </div>
|
| </div>
|
| <div class="chat-container mt-4">
|
| <div id="chat-box" class="border p-3" style="height: 300px; overflow-y: scroll;">
|
|
|
| </div>
|
| <div class="input-group mt-3">
|
| <input type="text" id="user-input" class="form-control" placeholder="Type your message here...">
|
| <button id="send-btn" class="btn btn-primary">Send</button>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
| </div>
|
|
|
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
| </body>
|
| </html> |