an updated and hopefully faster version of the ST Toolbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

97 lines
3.2 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ServiceTrade Tools</title>
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
<script>
// Read XSRF-TOKEN cookie and send as X-CSRF-Token on all htmx requests
document.addEventListener('DOMContentLoaded', function () {
document.body.addEventListener('htmx:configRequest', function (evt) {
var m = document.cookie.match(/(?:^|; )XSRF-TOKEN=([^;]+)/);
if (m) {
try { evt.detail.headers['X-CSRF-Token'] = decodeURIComponent(m[1]); } catch (e) { }
}
});
});
</script>
<link rel="stylesheet" href="/static/css/styles.css" />
<link rel="stylesheet" href="/static/css/upload.css" />
<script src="/static/js/dashboard-drag.js"></script>
</head>
<body class="flex h-screen bg-gray-100">
<!-- Sidebar -->
<aside class="sidebar">
<h1 class="title">ServiceTrade Tools</h1>
<nav>
<ul>
<li><a href="/">Dashboard</a></li>
<li><a href="/jobs">Jobs</a></li>
<li><a href="/assets">Assets</a></li>
<li><a href="/companies">Companies</a></li>
<li><a href="/contacts">Contacts</a></li>
<li><a href="/contracts">Contracts</a></li>
<li><a href="/generic">Generic Tools</a></li>
<li><a href="/invoices">Invoices</a></li>
<li><a href="/locations">Locations</a></li>
<li><a href="/notifications">Notifications</a></li>
<li><a href="/quotes">Quotes</a></li>
<li><a href="/services">Services</a></li>
<li><a href="/tags">Tags</a></li>
<li><a href="/users">Users</a></li>
<li><a href="/admin">Admin</a></li>
</ul>
</nav>
</aside>
<!-- Main content area -->
<main class="main-content">
<!-- Header with logout -->
<header class="header">
<button class="logout-btn" hx-post="/logout">Logout</button>
</header>
<!-- Dynamic content area -->
<div id="content" class="content">
{{if .BodyContent}}
{{.BodyContent}}
{{else if eq .Title "Invoice Management"}}
{{template "invoices_content" .}}
{{else if eq .Title "Jobs"}}
{{template "jobs_content" .}}
{{else if eq .Title "Assets"}}
{{template "assets_content" .}}
{{else if eq .Title "Companies"}}
{{template "companies_content" .}}
{{else if eq .Title "Contacts"}}
{{template "contacts_content" .}}
{{else if eq .Title "Contracts"}}
{{template "contracts_content" .}}
{{else if eq .Title "Generic"}}
{{template "generic_content" .}}
{{else if eq .Title "Locations"}}
{{template "locations_content" .}}
{{else if eq .Title "Notifications"}}
{{template "notifications_content" .}}
{{else if eq .Title "Quotes"}}
{{template "quotes_content" .}}
{{else if eq .Title "Services"}}
{{template "services_content" .}}
{{else if eq .Title "Tags"}}
{{template "tags_content" .}}
{{else if eq .Title "Users"}}
{{template "users_content" .}}
{{else if eq .Title "Admin"}}
{{template "admin_content" .}}
{{else}}
{{template "dashboard_content" .}}
{{end}}
</div>
</main>
</body>
</html>