webcodelab commited on
Commit
a011d5b
Β·
verified Β·
1 Parent(s): 21584b7

Create resume_rankings.html

Browse files
Files changed (1) hide show
  1. app/templates/resume_rankings.html +155 -0
app/templates/resume_rankings.html ADDED
@@ -0,0 +1,155 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {% extends "base.html" %}
2
+ {% block title %}Resume Rankings – Resume Ranker API{% endblock %}
3
+
4
+ {% block extra_head %}
5
+ {# Link any specific CSS for this page here if separate from dashboard.css #}
6
+ {% endblock %}
7
+
8
+ {% block content %}
9
+ <div class="dashboard-wrapper">
10
+ <aside class="sidebar" id="sidebar">
11
+ <div class="sidebar-header">
12
+ <div class="logo">ResumeRanker<span style="color:var(--accent)">.API</span></div>
13
+ <button class="close-sidebar" id="closeSidebar" aria-label="Close menu">
14
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
15
+ </button>
16
+ </div>
17
+ <nav class="sidebar-nav">
18
+ <a href="{{ url_for('auth.dashboard') }}" class="nav-item">
19
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-grid"><rect x="3" y="3" width="7" height="7"></rect><rect x="14" y="3" width="7" height="7"></rect><rect x="14" y="14" width="7" height="7"></rect><rect x="3" y="14" width="7" height="7"></rect></svg>
20
+ <span>Dashboard</span>
21
+ </a>
22
+ <a href="{{ url_for('auth.generate_api') }}" class="nav-item">
23
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-key"><path d="M19 10H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2z"></path><circle cx="12" cy="16" r="2"></circle><path d="M15 10V4.5a2.5 2.5 0 0 0-5 0V10"></path></svg>
24
+ <span>My API Keys</span>
25
+ </a>
26
+ <a href="{{ url_for('api.rank_resumes') }}" class="nav-item active"> {# Active #}
27
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-award"><circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.89"></polyline></svg>
28
+ <span>Resume Rankings</span>
29
+ </a>
30
+ <a href="{{ url_for('auth.try_api') }}" class="nav-item">
31
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-play-circle"><circle cx="12" cy="12" r="10"></circle><polygon points="10 8 16 12 10 16 10 8"></polygon></svg>
32
+ <span>Try It Now</span>
33
+ </a>
34
+ <a href="{{ url_for('auth.try_api') }}" class="nav-item">
35
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l-.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
36
+ <span>Settings</span>
37
+ </a>
38
+ <a href="{{ url_for('auth.logout') }}" class="nav-item logout-item">
39
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="17 16 22 12 17 8"></polyline><line x1="22" y1="12" x2="10" y2="12"></line></svg>
40
+ <span>Logout</span>
41
+ </a>
42
+ </nav>
43
+ </aside>
44
+
45
+ <div class="main-content-area" id="mainContentArea">
46
+ <header class="dashboard-header">
47
+ <button class="hamburger-dashboard" id="hamburgerDashboard" aria-label="Open sidebar menu">
48
+ <span></span><span></span><span></span>
49
+ </button>
50
+ <div class="user-settings">
51
+ <span class="user-name">{{ user.username }}</span>
52
+ <div class="user-avatar">
53
+ <img src="https://ui-avatars.com/api/?name={{ user.username | urlencode }}&background=2563eb&color=fff&size=30" alt="User Avatar">
54
+ </div>
55
+ <button class="theme-toggle" id="themeToggleDashboard" aria-label="Toggle dark mode">πŸŒ™</button>
56
+ </div>
57
+ </header>
58
+
59
+ <div class="content-padding">
60
+ <h1 class="welcome-title">Resume Ranking History</h1>
61
+ <p class="subtitle">A complete list of your past resume uploads and their ranking results.</p>
62
+
63
+ {% if error %}
64
+ <div class="error-message">{{ error }}</div>
65
+ {% endif %}
66
+
67
+ {% if success %}
68
+ <div class="success-message">{{ success }}</div>
69
+ {% endif %}
70
+
71
+ <div class="section-card recent-uploads-full">
72
+ <h3 class="section-title">All Uploaded Resumes</h3>
73
+ {% if all_uploads %} {# assuming a variable 'all_uploads' will be passed #}
74
+ <div class="table-responsive">
75
+ <table class="data-table">
76
+ <thead>
77
+ <tr>
78
+ <th>Filename</th>
79
+ <th>Score</th>
80
+ <th>Uploaded Date</th>
81
+ <th>Job Description Used</th>
82
+ <th>Action</th>
83
+ </tr>
84
+ </thead>
85
+ <tbody>
86
+ {% for resume in all_uploads %}
87
+ <tr>
88
+ <td data-label="Filename">{{ resume.name }}</td>
89
+ <td data-label="Score">{{ resume.score }}</td>
90
+ <td data-label="Uploaded Date">{{ resume.uploaded_date }}</td>
91
+ <td data-label="Job Description">{{ resume.job_description_summary | default('N/A') }}</td> {# Example: show summary of JD #}
92
+ <td data-label="Action"><a href="{{ url_for('auth.view_result', resume_id=resume.id) }}" class="btn small-btn view-btn">View Result</a></td>
93
+ </tr>
94
+ {% endfor %}
95
+ </tbody>
96
+ </table>
97
+ </div>
98
+ {% else %}
99
+ <p class="no-data-message">No ranking history available. <a href="{{ url_for('auth.try_api') }}">Try ranking a resume now!</a></p>
100
+ {% endif %}
101
+ </div>
102
+
103
+ <p class="mt-4"><a href="{{ url_for('auth.dashboard') }}" class="btn secondary-btn">← Back to Dashboard</a></p>
104
+ </div>
105
+ </div>
106
+ </div>
107
+ {% endblock %}
108
+
109
+ {% block extra_scripts %}
110
+ <script>
111
+ // Theme toggle & Sidebar toggle JS from dashboard.html
112
+ const themeToggleDashboard = document.getElementById('themeToggleDashboard');
113
+ const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
114
+ function setTheme(theme) {
115
+ document.documentElement.setAttribute('data-theme', theme);
116
+ localStorage.setItem('theme', theme);
117
+ themeToggleDashboard.textContent = theme === 'dark' ? 'β˜€οΈ' : 'πŸŒ™';
118
+ }
119
+ const savedTheme = localStorage.getItem('theme');
120
+ setTheme(savedTheme || (prefersDark ? 'dark' : 'light'));
121
+ themeToggleDashboard.onclick = () => {
122
+ const current = document.documentElement.getAttribute('data-theme');
123
+ setTheme(current === 'dark' ? 'light' : 'dark');
124
+ };
125
+
126
+ const hamburgerDashboard = document.getElementById('hamburgerDashboard');
127
+ const sidebar = document.getElementById('sidebar');
128
+ const mainContentArea = document.getElementById('mainContentArea');
129
+ const closeSidebarBtn = document.getElementById('closeSidebar');
130
+
131
+ hamburgerDashboard.onclick = () => {
132
+ sidebar.classList.add('open');
133
+ mainContentArea.classList.add('shifted');
134
+ };
135
+ closeSidebarBtn.onclick = () => {
136
+ sidebar.classList.remove('open');
137
+ mainContentArea.classList.remove('shifted');
138
+ };
139
+ mainContentArea.onclick = (event) => {
140
+ if (sidebar.classList.contains('open') && !sidebar.contains(event.target) && !hamburgerDashboard.contains(event.target)) {
141
+ sidebar.classList.remove('open');
142
+ mainContentArea.classList.remove('shifted');
143
+ }
144
+ };
145
+ Array.from(sidebar.getElementsByClassName('nav-item')).forEach(item => {
146
+ item.onclick = () => {
147
+ if (window.innerWidth <= 900) {
148
+ sidebar.classList.remove('open');
149
+ mainContentArea.classList.remove('shifted');
150
+ }
151
+ };
152
+ });
153
+ </script>
154
+ {% endblock %}
155
+