Files
Poll-system/app/internal/templates/volunteer_dashboard.html

178 lines
8.4 KiB
HTML
Raw Normal View History

2025-08-26 14:13:09 -06:00
{{ define "content" }}
2025-08-28 17:09:23 -06:00
<div class="flex-1 flex flex-col overflow-hidden">
<!-- Main Content -->
<div class="flex-1 overflow-hidden bg-gray-50">
2025-08-29 16:49:13 -06:00
<div class="h-screen flex flex-col lg:flex-row gap-6 p-4 sm:p-6">
<!-- Left Column - Stats -->
<div class="w-full lg:w-1/2 flex flex-col gap-6 sticky top-0 self-start h-fit">
2025-08-28 17:09:23 -06:00
<!-- Today's Overview -->
<div class="bg-white rounded-lg shadow-sm border border-gray-200" x-data="{ open: true }">
<div class="px-4 sm:px-6 py-4 flex justify-between items-center cursor-pointer border-b border-gray-100" @click="open = !open">
<h3 class="text-sm font-semibold text-gray-900">Today's Overview</h3>
<i class="fas" :class="open ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
2025-09-03 14:35:47 -06:00
</div>
<div class="px-4 sm:px-6 py-4" x-show="open" x-collapse>
2025-08-28 17:09:23 -06:00
<div class="space-y-4">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0">
2025-08-28 17:09:23 -06:00
<i class="fas fa-calendar-day text-gray-600 text-xs"></i>
</div>
<span class="text-sm text-gray-700">Appointments Today</span>
</div>
<span class="text-lg font-semibold text-gray-900">{{ .Statistics.AppointmentsToday }}</span>
2025-08-28 17:09:23 -06:00
</div>
2025-08-28 23:27:24 -06:00
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0">
2025-08-28 23:27:24 -06:00
<i class="fas fa-calendar-week text-gray-600 text-xs"></i>
</div>
<span class="text-sm text-gray-700">Appointments Tomorrow</span>
2025-08-28 23:27:24 -06:00
</div>
<span class="text-lg font-semibold text-gray-900">{{ .Statistics.AppointmentsTomorrow }}</span>
2025-08-28 23:27:24 -06:00
</div>
2025-08-28 17:09:23 -06:00
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0">
<i class="fas fa-calendar-alt text-gray-600 text-xs"></i>
2025-08-28 17:09:23 -06:00
</div>
<span class="text-sm text-gray-700">This Week</span>
</div>
<span class="text-lg font-semibold text-gray-900">{{ .Statistics.AppointmentsThisWeek }}</span>
2025-08-28 17:09:23 -06:00
</div>
</div>
</div>
</div>
<!-- Polling Progress -->
<div class="bg-white rounded-lg shadow-sm border border-gray-200" x-data="{ open: true }">
<div class="px-4 sm:px-6 py-4 flex justify-between items-center cursor-pointer border-b border-gray-100" @click="open = !open">
<h3 class="text-sm font-semibold text-gray-900">Polling Progress</h3>
<i class="fas" :class="open ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
2025-09-03 14:35:47 -06:00
</div>
<div class="px-4 sm:px-6 py-4" x-show="open" x-collapse>
2025-08-28 17:09:23 -06:00
<div class="space-y-4">
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0">
2025-08-28 17:09:23 -06:00
<i class="fas fa-check-circle text-green-600 text-xs"></i>
</div>
<span class="text-sm text-gray-700">Polls Completed</span>
</div>
<span class="text-lg font-semibold text-green-600">{{ .Statistics.PollsCompleted }}</span>
2025-08-28 17:09:23 -06:00
</div>
<div class="flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-8 h-8 bg-gray-100 rounded-full flex items-center justify-center flex-shrink-0">
2025-08-28 17:09:23 -06:00
<i class="fas fa-clock text-orange-600 text-xs"></i>
</div>
<span class="text-sm text-gray-700">Polls Remaining</span>
</div>
<span class="text-lg font-semibold text-orange-600">{{ .Statistics.PollsRemaining }}</span>
2025-08-28 17:09:23 -06:00
</div>
<!-- Progress Bar -->
{{ if gt .Statistics.TotalAppointments 0 }}
<div class="mt-4 w-[250px]">
2025-08-28 17:09:23 -06:00
<div class="flex justify-between text-xs text-gray-600 mb-2">
<span>Progress</span>
<span>{{ .Statistics.PollsCompleted }}/{{ .Statistics.TotalAppointments }}</span>
2025-08-28 17:09:23 -06:00
</div>
<div class="w-full bg-gray-200 rounded-full h-2">
<div class="bg-blue-600 h-2 rounded-full transition-all duration-300" style="width: {{ .Statistics.PollCompletionPercent }}%"></div>
2025-08-28 17:09:23 -06:00
</div>
</div>
{{ end }}
</div>
2025-09-03 14:35:47 -06:00
</div>
</div>
<!-- Team Members -->
<div class="bg-white rounded-lg shadow-sm border border-gray-200" x-data="{ open: true }">
<div class="px-4 sm:px-6 py-4 flex justify-between items-center cursor-pointer border-b border-gray-100" @click="open = !open">
2025-09-03 14:35:47 -06:00
<h3 class="text-sm font-semibold text-gray-900">Team Members</h3>
<i class="fas" :class="open ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
2025-09-03 14:35:47 -06:00
</div>
<div class="px-4 sm:px-6 py-4" x-show="open" x-collapse>
2025-09-03 14:35:47 -06:00
<div class="space-y-3">
{{ range .Teammates }}
<div class="flex items-center justify-between">
<div>
<p class="text-sm font-medium text-gray-900">
{{ .FullName }}
{{ if .IsLead }}
<span class="ml-2 text-xs text-blue-600 font-semibold">{{ .Role }}</span>
2025-09-03 14:35:47 -06:00
{{ else }}
<span class="ml-2 text-xs text-gray-500">{{ .Role }}</span>
2025-09-03 14:35:47 -06:00
{{ end }}
</p>
</div>
<div class="text-sm text-gray-700">
<i class="fas fa-phone mr-1 text-gray-500"></i>{{ .Phone }}
</div>
</div>
{{ else }}
<p class="text-gray-500 text-sm">No teammates found</p>
{{ end }}
</div>
2025-08-28 17:09:23 -06:00
</div>
</div>
2025-08-26 14:13:09 -06:00
</div>
<!-- Right Column - Posts -->
<div class="flex-1 lg:w-1/2 overflow-y-auto pr-2">
{{ if .Posts }}
{{ range .Posts }}
<article class="bg-white rounded-lg shadow-sm border border-gray-200 mb-4">
<!-- Post Header -->
<div class="flex items-center px-6 py-4 border-b border-gray-100">
<div class="flex-shrink-0">
<div class="w-10 h-10 rounded-full bg-blue-500 flex items-center justify-center text-white font-semibold">
{{ slice .AuthorName 0 1 }}
</div>
</div>
<div class="ml-4">
<p class="text-sm font-semibold text-gray-900">{{ .AuthorName }}</p>
<p class="text-xs text-gray-500">{{ .CreatedAt.Format "Jan 2, 2006" }}</p>
2025-08-29 22:59:29 -06:00
</div>
</div>
<!-- Post Image -->
{{ if .ImageURL }}
<div class="w-full">
<img src="{{ .ImageURL }}" alt="Post image" class="w-full max-h-96 object-cover" onerror="this.parentElement.style.display='none'" />
</div>
{{ end }}
2025-08-29 22:59:29 -06:00
<!-- Post Content -->
{{ if .Content }}
<div class="px-6 pt-3 pb-4">
<p class="text-gray-900 leading-relaxed">
<span class="font-semibold">{{ .AuthorName }}</span> {{ .Content }}
</p>
</div>
{{ end }}
</article>
{{ end }}
{{ else }}
<div class="bg-white rounded-lg shadow-sm border border-gray-200 p-12 text-center">
<div class="max-w-sm mx-auto">
<div class="w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-inbox text-2xl text-gray-400"></i>
</div>
<h3 class="text-lg font-medium text-gray-900 mb-2">No posts yet</h3>
<p class="text-sm text-gray-500">Be the first to share something with the community!</p>
2025-08-29 22:59:29 -06:00
</div>
</div>
{{ end }}
</div>
2025-08-26 14:13:09 -06:00
</div>
</div>
</div>
{{ end }}