portal-dashboard/portal_dashboard/www/index.html

104 lines
3 KiB
HTML

<!-- portal_dashboard/www/index.html -->
<!DOCTYPE html>
<html>
<div class="header" style="display: flex; justify-content: flex-end; align-items: center; max-width: 800px; margin: 0 auto 30px auto;">
<div class="user-menu" style="position: relative;">
<button onclick="toggleMenu()" style="background: none; border: none; cursor: pointer;">
<i class="fas fa-user-circle" style="font-size: 1.5rem; color: #007bff;"></i>
</button>
<div id="dropdown" style="display: none; position: absolute; right: 0; background: #fff; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); padding: 10px; min-width: 150px; z-index: 10;">
<div style="padding: 5px 10px; font-size: 0.9rem;">{{ frappe.session.full_name }}</div>
<hr style="margin: 5px 0;">
<a href="/me" style="text-decoration: none; display: block; padding: 5px 10px; color: #333;">My Account</a>
<a href="/app" style="text-decoration: none; display: block; padding: 5px 10px; color: #333;">ERP Desk</a>
<a href="/?cmd=logout" style="text-decoration: none; display: block; padding: 5px 10px; color: #c00;">Log Out</a>
</div>
</div>
</div>
<script>
function toggleMenu() {
var dropdown = document.getElementById('dropdown');
dropdown.style.display = dropdown.style.display === 'block' ? 'none' : 'block';
}
// Close menu when clicking outside
document.addEventListener('click', function (e) {
if (!e.target.closest('.user-menu')) {
document.getElementById('dropdown').style.display = 'none';
}
});
</script>
<head>
<title>Sea Haven Portal</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" rel="stylesheet">
<style>
body {
font-family: "Segoe UI", sans-serif;
background-color: #f9f9f9;
text-align: center;
padding: 40px;
}
h1 {
margin-bottom: 40px;
font-size: 2.5rem;
color: #333;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 30px;
max-width: 800px;
margin: 0 auto;
}
.app-link {
background: #fff;
padding: 30px 20px;
border-radius: 10px;
text-decoration: none;
color: #333;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.app-link:hover {
transform: translateY(-4px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.app-link i {
font-size: 2.5rem;
margin-bottom: 10px;
color: #007bff;
}
.app-label {
font-size: 1rem;
font-weight: 600;
margin-top: 10px;
}
</style>
</head>
<body>
{% if frappe.session.user == "Guest" %}
<script>
window.location.href = "/login?redirect-to=/";
</script>
{% endif %}
<h1>Sea Haven Portal</h1>
<div class="grid">
{% for app in apps %}
<a href="{{ app.url }}" class="app-link">
<i class="fas {{ app.icon }}"></i>
<div class="app-label">{{ app.label }}</div>
</a>
{% endfor %}
</div>
</body>
</html>