Merge routing mock and user management pages
This commit is contained in:
parent
eeb74643d0
commit
55553eb6a6
6 changed files with 73 additions and 400 deletions
|
|
@ -1,308 +0,0 @@
|
|||
{{ template "sync/layout/base.html" . }}
|
||||
|
||||
{{ define "title" }}Data Entry{{ end }}
|
||||
{{ define "extraheader" }}
|
||||
<style>
|
||||
.tech-photo {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.main-container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.action-button {
|
||||
padding: 15px 30px;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
</style>
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<div class="container-fluid p-4 main-container">
|
||||
<h1 class="mb-4">Technician Routing & Dispatch</h1>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header bg-primary text-white">
|
||||
<h2 class="h4 mb-0">Technician Roster</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Technician</th>
|
||||
<th>Working Hours</th>
|
||||
<th>Truck Assignment</th>
|
||||
<th>Warrant Service</th>
|
||||
<th>Drone Certified</th>
|
||||
<th>Routing Options</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/men/32.jpg"
|
||||
alt="John Davis"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">John Davis</div>
|
||||
<div class="small text-muted">ID: T-1001</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>7:00 AM - 3:30 PM</td>
|
||||
<td>Truck #103</td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td><span class="badge bg-danger">No</span></td>
|
||||
<td>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="warrant-partner1"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Require second person for warrant service"
|
||||
/>
|
||||
<label class="form-check-label" for="warrant-partner1"
|
||||
>Warrant Partner</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="resident-history1"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Route to previously visited residents"
|
||||
/>
|
||||
<label class="form-check-label" for="resident-history1"
|
||||
>Prior Interactions</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="include-route1"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Include in route calculations"
|
||||
/>
|
||||
<label class="form-check-label" for="include-route1"
|
||||
>Include in Routes</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/women/65.jpg"
|
||||
alt="Sarah Johnson"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">Sarah Johnson</div>
|
||||
<div class="small text-muted">ID: T-1042</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>8:00 AM - 4:30 PM</td>
|
||||
<td>Truck #118</td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="warrant-partner2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Require second person for warrant service"
|
||||
/>
|
||||
<label class="form-check-label" for="warrant-partner2"
|
||||
>Warrant Partner</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="resident-history2"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Route to previously visited residents"
|
||||
/>
|
||||
<label class="form-check-label" for="resident-history2"
|
||||
>Prior Interactions</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="include-route2"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Include in route calculations"
|
||||
/>
|
||||
<label class="form-check-label" for="include-route2"
|
||||
>Include in Routes</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/men/44.jpg"
|
||||
alt="Michael Chen"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">Michael Chen</div>
|
||||
<div class="small text-muted">ID: T-1019</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>6:30 AM - 3:00 PM</td>
|
||||
<td>Truck #107</td>
|
||||
<td><span class="badge bg-danger">No</span></td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="warrant-partner3"
|
||||
disabled
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Require second person for warrant service"
|
||||
/>
|
||||
<label class="form-check-label" for="warrant-partner3"
|
||||
>Warrant Partner</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="resident-history3"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Route to previously visited residents"
|
||||
/>
|
||||
<label class="form-check-label" for="resident-history3"
|
||||
>Prior Interactions</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="include-route3"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Include in route calculations"
|
||||
/>
|
||||
<label class="form-check-label" for="include-route3"
|
||||
>Include in Routes</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/women/22.jpg"
|
||||
alt="Jessica Martinez"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">Jessica Martinez</div>
|
||||
<div class="small text-muted">ID: T-1055</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>7:30 AM - 4:00 PM</td>
|
||||
<td>Truck #112</td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td><span class="badge bg-success">Yes</span></td>
|
||||
<td>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="warrant-partner4"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Require second person for warrant service"
|
||||
/>
|
||||
<label class="form-check-label" for="warrant-partner4"
|
||||
>Warrant Partner</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check mb-2">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="resident-history4"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Route to previously visited residents"
|
||||
/>
|
||||
<label class="form-check-label" for="resident-history4"
|
||||
>Prior Interactions</label
|
||||
>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
id="include-route4"
|
||||
checked
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="left"
|
||||
title="Include in route calculations"
|
||||
/>
|
||||
<label class="form-check-label" for="include-route4"
|
||||
>Include in Routes</label
|
||||
>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-grid gap-2 col-md-6 mx-auto">
|
||||
<a
|
||||
href="{{ .URLs.DispatchResults }}"
|
||||
class="btn btn-primary btn-lg action-button"
|
||||
type="button"
|
||||
>
|
||||
<i class="bi bi-calculator me-2"></i>Calculate Routes
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
@ -2,15 +2,6 @@
|
|||
|
||||
{{ define "title" }}Setting - Users{{ end }}
|
||||
{{ define "extraheader" }}
|
||||
<style>
|
||||
.form-check-input.switch-lg {
|
||||
width: 3em;
|
||||
height: 1.5em;
|
||||
}
|
||||
.status-badge {
|
||||
width: 100px;
|
||||
}
|
||||
</style>
|
||||
{{ end }}
|
||||
{{ define "content" }}
|
||||
<div class="container-fluid p-4">
|
||||
|
|
@ -31,42 +22,32 @@
|
|||
<table class="table table-striped table-hover">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Full Name</th>
|
||||
<th>Email Address</th>
|
||||
<th>Username</th>
|
||||
<th>User</th>
|
||||
<th>Role</th>
|
||||
<th>Serve Warrants</th>
|
||||
<th>Status</th>
|
||||
<th>Last Login</th>
|
||||
<th>Tags</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<!-- Sample user data -->
|
||||
<tr>
|
||||
<td>John Doe</td>
|
||||
<td>john.doe@example.com</td>
|
||||
<td>johndoe</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm">
|
||||
<option>Lead</option>
|
||||
<option selected>Technician</option>
|
||||
<option>Administrator</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input
|
||||
class="form-check-input switch-lg"
|
||||
type="checkbox"
|
||||
checked
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/men/32.jpg"
|
||||
alt="John Davis"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">John Davis</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-success">Tech I</span></td>
|
||||
<td>
|
||||
<span class="badge bg-success status-badge">Active</span>
|
||||
</td>
|
||||
<td>2023-06-15 09:45 AM</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-warning" title="Deactivate">
|
||||
<i class="bi bi-person-x"></i>
|
||||
|
|
@ -74,25 +55,26 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jane Smith</td>
|
||||
<td>jane.smith@example.com</td>
|
||||
<td>janesmith</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm">
|
||||
<option selected>Lead</option>
|
||||
<option>Technician</option>
|
||||
<option>Administrator</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input switch-lg" type="checkbox" />
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/women/65.jpg"
|
||||
alt="Sarah Johnson"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">Sarah Johnson</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-success">Tech III</span></td>
|
||||
<td>
|
||||
<span class="badge bg-success status-badge">Active</span>
|
||||
</td>
|
||||
<td>2023-06-17 14:20 PM</td>
|
||||
<td>
|
||||
<span class="badge bg-warrant">warrant service</span>
|
||||
<span class="badge bg-drone">drone pilot</span>
|
||||
</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-warning" title="Deactivate">
|
||||
<i class="bi bi-person-x"></i>
|
||||
|
|
@ -100,62 +82,28 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Robert Johnson</td>
|
||||
<td>robert.j@example.com</td>
|
||||
<td>robertj</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm">
|
||||
<option>Lead</option>
|
||||
<option>Technician</option>
|
||||
<option selected>Administrator</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input
|
||||
class="form-check-input switch-lg"
|
||||
type="checkbox"
|
||||
checked
|
||||
<div class="d-flex align-items-center">
|
||||
<img
|
||||
src="https://randomuser.me/api/portraits/men/44.jpg"
|
||||
alt="Michael Chen"
|
||||
class="tech-photo me-3"
|
||||
/>
|
||||
<div>
|
||||
<div class="fw-bold">Michael Chen</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td><span class="badge bg-success">Tech I</span></td>
|
||||
<td>
|
||||
<span class="badge bg-secondary status-badge"
|
||||
>Deactivated</span
|
||||
>
|
||||
</td>
|
||||
<td>2023-06-10 11:30 AM</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-success" title="Activate">
|
||||
<i class="bi bi-person-check"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Emily Wilson</td>
|
||||
<td>emily.w@example.com</td>
|
||||
<td>emilyw</td>
|
||||
<td>
|
||||
<select class="form-select form-select-sm">
|
||||
<option>Lead</option>
|
||||
<option selected>Technician</option>
|
||||
<option>Administrator</option>
|
||||
</select>
|
||||
<span class="badge bg-success status-badge">Active</span>
|
||||
</td>
|
||||
<td>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input switch-lg" type="checkbox" />
|
||||
</div>
|
||||
<span class="badge bg-drone">drone pilot</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-warning text-dark status-badge"
|
||||
>Invited</span
|
||||
>
|
||||
</td>
|
||||
<td>Never</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-info" title="Resend Invitation">
|
||||
<i class="bi bi-envelope"></i>
|
||||
<button class="btn btn-sm btn-warning" title="Deactivate">
|
||||
<i class="bi bi-person-x"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -56,3 +56,4 @@ $theme-colors: map-merge(
|
|||
@import "./sync/pool-csv-upload.scss";
|
||||
@import "./sync/pool-by-id.scss";
|
||||
@import "./sync/settings.scss";
|
||||
@import "./sync/settings-user-list.scss";
|
||||
|
|
|
|||
19
scss/sync/settings-user-list.scss
Normal file
19
scss/sync/settings-user-list.scss
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
.bg-warrant {
|
||||
background-color: $warning;
|
||||
}
|
||||
.bg-drone {
|
||||
background-color: $info;
|
||||
}
|
||||
.form-check-input.switch-lg {
|
||||
width: 3em;
|
||||
height: 1.5em;
|
||||
}
|
||||
.status-badge {
|
||||
width: 100px;
|
||||
}
|
||||
.tech-photo {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
object-fit: cover;
|
||||
border-radius: 50%;
|
||||
}
|
||||
14
sync/admin.go
Normal file
14
sync/admin.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package sync
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
)
|
||||
|
||||
type contentAdminDash struct{}
|
||||
|
||||
func getAdminDash(ctx context.Context, user *models.User) (string, interface{}, *errorWithStatus) {
|
||||
content := contentAdminDash{}
|
||||
return "sync/admin-dash.html", content, nil
|
||||
}
|
||||
|
|
@ -23,7 +23,6 @@ func Router() chi.Router {
|
|||
|
||||
// Mock endpoints
|
||||
r.Get("/mock", renderMockList)
|
||||
addMock(r, "/mock/dispatch", "sync/mock/dispatch.html")
|
||||
addMock(r, "/mock/dispatch-results", "sync/mock/dispatch-results.html")
|
||||
addMock(r, "/mock/report", "sync/mock/report.html")
|
||||
addMock(r, "/mock/report/{code}", "sync/mock/report-detail.html")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue