Add auth redirect to portal index
Redirects unauthenticated users to signup.html Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
16f63bebe5
commit
a16e8668a8
1 changed files with 46 additions and 3 deletions
|
|
@ -5,6 +5,15 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Payfrit Business Portal</title>
|
<title>Payfrit Business Portal</title>
|
||||||
<link rel="stylesheet" href="portal.css">
|
<link rel="stylesheet" href="portal.css">
|
||||||
|
<script>
|
||||||
|
// Auth check - redirect to signup if not logged in
|
||||||
|
(function() {
|
||||||
|
const token = localStorage.getItem('payfrit_portal_token');
|
||||||
|
if (!token) {
|
||||||
|
window.location.href = 'signup.html';
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app">
|
<div class="app">
|
||||||
|
|
@ -209,6 +218,12 @@
|
||||||
</svg>
|
</svg>
|
||||||
Open KDS
|
Open KDS
|
||||||
</button>
|
</button>
|
||||||
|
<button class="action-btn" onclick="Portal.openQuickTasks()">
|
||||||
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
|
<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
|
||||||
|
</svg>
|
||||||
|
Quick Tasks
|
||||||
|
</button>
|
||||||
<button class="action-btn" onclick="Portal.openHUD()">
|
<button class="action-btn" onclick="Portal.openHUD()">
|
||||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||||
<path d="M18 20V10M12 20V4M6 20v-6"/>
|
<path d="M18 20V10M12 20V4M6 20v-6"/>
|
||||||
|
|
@ -425,11 +440,25 @@
|
||||||
<!-- Admin Tasks Page -->
|
<!-- Admin Tasks Page -->
|
||||||
<section class="page" id="page-admin-tasks">
|
<section class="page" id="page-admin-tasks">
|
||||||
<div class="admin-tasks-layout">
|
<div class="admin-tasks-layout">
|
||||||
<!-- Quick Task Templates Section -->
|
<!-- Task Categories Section -->
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" style="display:flex;justify-content:space-between;align-items:center;">
|
||||||
|
<h3>Task Categories</h3>
|
||||||
|
<button class="btn btn-sm btn-primary" onclick="Portal.showAddCategoryModal('task')">+ Add Category</button>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p style="color:#666;margin-bottom:16px;">Categories organize tasks and assign colors. Every task needs a category.</p>
|
||||||
|
<div class="categories-grid" id="taskCategoriesGrid">
|
||||||
|
<div class="empty-state">Loading...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Quick Tasks Section -->
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header" style="display:flex;justify-content:space-between;align-items:center;">
|
<div class="card-header" style="display:flex;justify-content:space-between;align-items:center;">
|
||||||
<h3>Quick Tasks</h3>
|
<h3>Quick Tasks</h3>
|
||||||
<button class="btn btn-sm btn-primary" onclick="Portal.showAddQuickTaskModal()">+ Add Template</button>
|
<button class="btn btn-sm btn-primary" onclick="Portal.showAddQuickTaskModal()">+ Add Quick Task</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p style="color:#666;margin-bottom:16px;">Create common tasks instantly with one tap.</p>
|
<p style="color:#666;margin-bottom:16px;">Create common tasks instantly with one tap.</p>
|
||||||
|
|
@ -453,6 +482,20 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Worker Ratings Section -->
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header" style="display:flex;justify-content:space-between;align-items:center;">
|
||||||
|
<h3>Worker Ratings</h3>
|
||||||
|
<button class="btn btn-sm btn-secondary" onclick="Portal.loadPendingRatings()">Refresh</button>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p style="color:#666;margin-bottom:16px;">Rate worker performance on recently completed tasks. These ratings help track performance over time.</p>
|
||||||
|
<div class="list-group" id="pendingRatingsList">
|
||||||
|
<div class="empty-state">Loading...</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
@ -590,6 +633,6 @@
|
||||||
<!-- Toast Container -->
|
<!-- Toast Container -->
|
||||||
<div class="toast-container" id="toastContainer"></div>
|
<div class="toast-container" id="toastContainer"></div>
|
||||||
|
|
||||||
<script src="portal.js?v=6"></script>
|
<script src="portal.js?v=9"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Reference in a new issue