Remove .html extensions from all links and URLs

- Updated all navigation links in HTML files
- Updated all hrefs and window.location redirects in JavaScript
- All links now use clean URLs without .html extensions
- Improves SEO and provides cleaner user experience
This commit is contained in:
Mikael Westöö
2026-01-23 22:40:26 +01:00
parent 2d6b2eece2
commit 61269bb9a4
11 changed files with 103 additions and 103 deletions

View File

@@ -1,7 +1,7 @@
// Admin JavaScript for Ryans Recruit Firm
// Check authentication on all admin pages except login
if (!window.location.pathname.includes('login.html')) {
if (!window.location.pathname.includes('login')) {
checkAuth();
}
@@ -11,7 +11,7 @@ async function checkAuth() {
const data = await response.json();
if (!data.loggedIn) {
window.location.href = '/admin/login.html';
window.location.href = '/admin/login';
return;
}
@@ -22,12 +22,12 @@ async function checkAuth() {
}
} catch (err) {
console.error('Auth check failed:', err);
window.location.href = '/admin/login.html';
window.location.href = '/admin/login';
}
}
// Login page handlers
if (window.location.pathname.includes('login.html')) {
if (window.location.pathname.includes('login')) {
checkFirstAdmin();
document.getElementById('login-form')?.addEventListener('submit', handleLogin);
}
@@ -71,7 +71,7 @@ async function handleLogin(e) {
if (response.ok) {
showAlert('Login successful!', 'success');
setTimeout(() => window.location.href = '/admin/dashboard.html', 500);
setTimeout(() => window.location.href = '/admin/dashboard', 500);
} else {
showAlert(result.error || 'Login failed', 'error');
}
@@ -85,7 +85,7 @@ async function handleLogin(e) {
}
// Dashboard page
if (window.location.pathname.includes('dashboard.html')) {
if (window.location.pathname.includes('dashboard')) {
loadDashboardStats();
}
@@ -109,7 +109,7 @@ async function loadDashboardStats() {
}
// Applications page
if (window.location.pathname.includes('applicants.html')) {
if (window.location.pathname.includes('applicants')) {
loadApplications();
}
@@ -153,7 +153,7 @@ async function loadApplications(filters = {}) {
<td>${new Date(app.applied_at).toLocaleDateString()}</td>
<td><span class="tag tag-${getStatusColor(app.status)}">${escapeHtml(app.status)}</span></td>
<td>
<a href="/admin/applicants.html?id=${app.id}" class="btn btn-sm btn-primary">View</a>
<a href="/admin/applicants?id=${app.id}" class="btn btn-sm btn-primary">View</a>
<a href="/api/admin/applications/${app.id}/cv" class="btn btn-sm btn-secondary" target="_blank">CV</a>
</td>
</tr>
@@ -169,7 +169,7 @@ async function loadApplications(filters = {}) {
}
// Jobs management page
if (window.location.pathname.includes('jobs.html') && window.location.pathname.includes('admin')) {
if (window.location.pathname.includes('jobs') && window.location.pathname.includes('admin')) {
loadAdminJobs();
}
@@ -246,10 +246,10 @@ async function toggleJobStatus(jobId, isActive) {
async function logout() {
try {
await fetch('/api/admin/logout', { method: 'POST' });
window.location.href = '/admin/login.html';
window.location.href = '/admin/login';
} catch (err) {
console.error('Logout error:', err);
window.location.href = '/admin/login.html';
window.location.href = '/admin/login';
}
}