updated layout and volunteer

change the ui and now able to remove assigned addresses from volunteer
This commit is contained in:
Mann Patel
2025-08-28 00:15:10 -06:00
parent d7f6c794b4
commit 9dd24e71e7
20 changed files with 302 additions and 536 deletions

View File

@@ -27,19 +27,22 @@
</h3>
<p class="text-gray-600">{{ .Volunteer.Email }}</p>
<div class="flex items-center mt-2 space-x-4">
<span class="text-gray-600">User Role:</span>
<span
class="inline-flex items-center px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 border border-blue-200"
>
<i class="fas fa-user-check mr-1"></i>
Volunteer
</span>
<span class="text-gray-600">User ID:</span>
<span class="font-mono text-gray-900">{{ .Volunteer.UserID }}</span>
<span class="text-gray-600">Current Role:</span>
<span class="text-gray-900">
{{ if eq .Volunteer.RoleID 2 }}Team Leader{{ else }}Volunteer{{
end }}
</span>
<span class="text-gray-600">User ID:</span>
<span
class="inline-flex items-center px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 border border-blue-200"
>
<i class="fas fa-user-check mr-1"></i>
{{ .Volunteer.UserID }}</span
>
</div>
</div>
</div>
@@ -107,6 +110,7 @@
<label class="block text-sm font-semibold text-gray-700 mb-2">
Phone Number
</label>
r
<input
type="text"
name="phone"
@@ -127,13 +131,13 @@
required
class="w-full px-4 py-3 border border-gray-300 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 bg-white"
>
<option value="">--Select Role--</option>
<option value="3" {{if eq .Volunteer.RoleID 3}}selected{{end}}>
Volunteer
</option>
<option value="" disabled selected hidden>Select Role</option>
<option value="2" {{if eq .Volunteer.RoleID 2}}selected{{end}}>
Team Leader
</option>
<option value="3" {{if eq .Volunteer.RoleID 3}}selected{{end}}>
Volunteer
</option>
</select>
<p class="text-xs text-gray-500 mt-1">
Team Leaders can manage volunteers and access additional features
@@ -169,107 +173,6 @@
</div>
</form>
</div>
<!-- Configuration Settings Section -->
<div class="border-t border-gray-200 pt-8 mt-8">
<h3 class="text-lg font-semibold text-gray-900 mb-6 flex items-center">
<i class="fas fa-cog text-blue-600 mr-3"></i>
Volunteer Settings
</h3>
<form
method="post"
action="/volunteer/settings"
id="volunteerSettingsForm"
>
<div class="space-y-6">
<!-- Add New Setting -->
<div class="bg-white border border-gray-200 p-6">
<h4 class="text-md font-semibold text-gray-800 mb-4">
Add New Setting
</h4>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-4">
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2">
Setting Name
</label>
<input
type="text"
id="newVolunteerSettingName"
class="w-full px-4 py-3 border border-gray-300 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 bg-white"
placeholder="Enter setting name"
/>
</div>
<div>
<label class="block text-sm font-semibold text-gray-700 mb-2">
Setting Value
</label>
<input
type="text"
id="newVolunteerSettingValue"
class="w-full px-4 py-3 border border-gray-300 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 bg-white"
placeholder="Enter setting value"
/>
</div>
<div class="flex items-end">
<button
type="button"
onclick="addVolunteerSetting()"
class="w-full px-6 py-3 bg-green-600 text-white hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-green-500 font-medium"
>
<i class="fas fa-plus mr-2"></i>
Add Setting
</button>
</div>
</div>
</div>
<!-- Current Settings -->
<div class="bg-white border border-gray-200 p-6">
<h4 class="text-md font-semibold text-gray-800 mb-4">
Current Settings
</h4>
<div id="volunteerSettingsList" class="space-y-3">
<!-- Settings will be dynamically added here -->
<div
class="text-gray-500 text-sm"
id="noVolunteerSettingsMessage"
>
No settings configured for this volunteer yet. Add settings
above.
</div>
</div>
</div>
</div>
<!-- Settings Form Actions -->
<div
class="mt-8 pt-6 border-t border-gray-200 flex justify-between items-center"
>
<div class="flex items-center text-sm text-gray-500">
<i class="fas fa-info-circle text-blue-500 mr-2"></i>
Settings are specific to this volunteer and applied immediately
</div>
<div class="flex space-x-3">
<button
type="button"
onclick="clearAllVolunteerSettings()"
class="px-6 py-2 border border-red-300 text-red-700 bg-white hover:bg-red-50 focus:outline-none focus:ring-2 focus:ring-red-500 font-medium"
>
<i class="fas fa-trash mr-2"></i>
Clear All
</button>
<button
type="submit"
class="px-6 py-2 bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 font-medium"
>
<i class="fas fa-save mr-2"></i>
Save Settings
</button>
</div>
</div>
</form>
</div>
</div>
</div>