Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +6 -4
- index.html +505 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: purple
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: native-title
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: purple
|
| 5 |
+
colorTo: pink
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,505 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Country Deals - Native Title Agreements</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
| 9 |
+
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
| 10 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/Fuse.js/6.6.2/fuse.min.js"></script>
|
| 11 |
+
<style>
|
| 12 |
+
#map { height: 60vh; }
|
| 13 |
+
.custom-icon {
|
| 14 |
+
width: 24px;
|
| 15 |
+
height: 24px;
|
| 16 |
+
border-radius: 50%;
|
| 17 |
+
display: flex;
|
| 18 |
+
align-items: center;
|
| 19 |
+
justify-content: center;
|
| 20 |
+
color: white;
|
| 21 |
+
font-weight: bold;
|
| 22 |
+
}
|
| 23 |
+
.print-only {
|
| 24 |
+
display: none;
|
| 25 |
+
}
|
| 26 |
+
@media print {
|
| 27 |
+
.no-print {
|
| 28 |
+
display: none;
|
| 29 |
+
}
|
| 30 |
+
.print-only {
|
| 31 |
+
display: block;
|
| 32 |
+
}
|
| 33 |
+
#map {
|
| 34 |
+
height: 400px;
|
| 35 |
+
page-break-after: always;
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
</style>
|
| 39 |
+
</head>
|
| 40 |
+
<body class="bg-gray-50">
|
| 41 |
+
<header class="bg-green-800 text-white p-4 shadow-md">
|
| 42 |
+
<div class="container mx-auto flex flex-col md:flex-row justify-between items-center">
|
| 43 |
+
<h1 class="text-2xl font-bold">Country Deals</h1>
|
| 44 |
+
<p class="text-sm mt-2 md:mt-0">Native Title Agreements Explorer</p>
|
| 45 |
+
</div>
|
| 46 |
+
</header>
|
| 47 |
+
|
| 48 |
+
<main class="container mx-auto p-4">
|
| 49 |
+
<div class="no-print">
|
| 50 |
+
<div class="bg-white rounded-lg shadow-md p-6 mb-6">
|
| 51 |
+
<h2 class="text-xl font-semibold mb-4 text-gray-800">Find agreements on your country</h2>
|
| 52 |
+
<div class="flex flex-col md:flex-row gap-4">
|
| 53 |
+
<input
|
| 54 |
+
type="text"
|
| 55 |
+
id="communitySearch"
|
| 56 |
+
placeholder="Type your community name (e.g. Yindjibarndi)"
|
| 57 |
+
class="flex-grow p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-600 focus:border-transparent"
|
| 58 |
+
aria-label="Search for your community"
|
| 59 |
+
>
|
| 60 |
+
<button
|
| 61 |
+
id="searchButton"
|
| 62 |
+
class="bg-green-700 hover:bg-green-800 text-white font-bold py-3 px-6 rounded-lg transition-colors"
|
| 63 |
+
>
|
| 64 |
+
Search
|
| 65 |
+
</button>
|
| 66 |
+
</div>
|
| 67 |
+
<div id="searchResults" class="mt-4 hidden bg-gray-100 rounded-lg p-2 max-h-60 overflow-y-auto"></div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<div id="legend" class="bg-white rounded-lg shadow-md p-4 mb-6 hidden">
|
| 71 |
+
<h3 class="font-semibold mb-2">Legend</h3>
|
| 72 |
+
<div class="flex flex-wrap gap-4">
|
| 73 |
+
<div class="flex items-center">
|
| 74 |
+
<div class="w-4 h-4 rounded-full bg-green-600 mr-2"></div>
|
| 75 |
+
<span>ILUA</span>
|
| 76 |
+
</div>
|
| 77 |
+
<div class="flex items-center">
|
| 78 |
+
<div class="w-4 h-4 rounded-full bg-orange-500 mr-2"></div>
|
| 79 |
+
<span>Section 31 Mining Lease</span>
|
| 80 |
+
</div>
|
| 81 |
+
<div class="flex items-center">
|
| 82 |
+
<div class="w-4 h-4 rounded-full bg-blue-500 mr-2"></div>
|
| 83 |
+
<span>Other Agreements</span>
|
| 84 |
+
</div>
|
| 85 |
+
<div class="flex items-center">
|
| 86 |
+
<div class="w-4 h-4 rounded-full bg-red-600 mr-2"></div>
|
| 87 |
+
<span>Active Tenement</span>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
|
| 93 |
+
<div class="relative">
|
| 94 |
+
<div id="map" class="rounded-lg shadow-md"></div>
|
| 95 |
+
<div id="loadingIndicator" class="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center hidden">
|
| 96 |
+
<div class="bg-white p-4 rounded-lg">
|
| 97 |
+
<p class="font-semibold">Loading your country...</p>
|
| 98 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5 mt-2">
|
| 99 |
+
<div class="bg-green-600 h-2.5 rounded-full animate-pulse" style="width: 45%"></div>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<div id="agreementDetails" class="mt-6 hidden">
|
| 106 |
+
<div class="bg-white rounded-lg shadow-md p-6">
|
| 107 |
+
<h2 class="text-xl font-semibold mb-4 text-gray-800">Agreement Details</h2>
|
| 108 |
+
<div id="detailContent"></div>
|
| 109 |
+
<div class="mt-4 flex flex-wrap gap-4">
|
| 110 |
+
<button
|
| 111 |
+
id="printButton"
|
| 112 |
+
class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-lg transition-colors"
|
| 113 |
+
>
|
| 114 |
+
Print This Agreement
|
| 115 |
+
</button>
|
| 116 |
+
<button
|
| 117 |
+
id="helpButton"
|
| 118 |
+
class="bg-green-700 hover:bg-green-800 text-white font-bold py-2 px-4 rounded-lg transition-colors"
|
| 119 |
+
>
|
| 120 |
+
Need Help? Call Your NTRB
|
| 121 |
+
</button>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
|
| 126 |
+
<!-- Print section (hidden until printing) -->
|
| 127 |
+
<div id="printSection" class="print-only">
|
| 128 |
+
<h1 class="text-2xl font-bold mb-4">Country Deals - Agreement Summary</h1>
|
| 129 |
+
<div id="printMapContainer" class="mb-6"></div>
|
| 130 |
+
<div id="printAgreementsList" class="mb-6">
|
| 131 |
+
<h2 class="text-xl font-semibold mb-2">Agreements</h2>
|
| 132 |
+
<ul id="printAgreements" class="list-disc pl-5"></ul>
|
| 133 |
+
</div>
|
| 134 |
+
<div id="printHelpInfo" class="mt-6 pt-4 border-t border-gray-300">
|
| 135 |
+
<h3 class="font-semibold mb-2">Need Help?</h3>
|
| 136 |
+
<p>Contact your Native Title Representative Body (NTRB):</p>
|
| 137 |
+
<p id="printNtrbPhone" class="font-semibold mt-1"></p>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</main>
|
| 141 |
+
|
| 142 |
+
<footer class="bg-gray-800 text-white p-4 mt-8">
|
| 143 |
+
<div class="container mx-auto text-center text-sm">
|
| 144 |
+
<p>© 2023 Country Deals - Helping native title holders understand agreements on their country</p>
|
| 145 |
+
</div>
|
| 146 |
+
</footer>
|
| 147 |
+
|
| 148 |
+
<script>
|
| 149 |
+
// Mock data - in a real app this would come from the data pipeline
|
| 150 |
+
const communities = [
|
| 151 |
+
{
|
| 152 |
+
name: "Yindjibarndi",
|
| 153 |
+
bounds: [[-21.5, 117.5], [-21.0, 118.0]],
|
| 154 |
+
ntrb: "YNAC",
|
| 155 |
+
phone: "+61891821300"
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
name: "Noongar",
|
| 159 |
+
bounds: [[-32.5, 115.5], [-31.5, 117.5]],
|
| 160 |
+
ntrb: "SWALSC",
|
| 161 |
+
phone: "+61893588000"
|
| 162 |
+
}
|
| 163 |
+
];
|
| 164 |
+
|
| 165 |
+
// Mock tenement data
|
| 166 |
+
const tenements = [
|
| 167 |
+
{
|
| 168 |
+
type: "Tenement",
|
| 169 |
+
TENEMENT: "L52/123",
|
| 170 |
+
COMPANY: "Rio Tinto",
|
| 171 |
+
COMMODITY: "Iron Ore",
|
| 172 |
+
EXPIRY: "2025-12-31",
|
| 173 |
+
DOC_URL: "https://example.com/tenement/L52-123",
|
| 174 |
+
community: "Yindjibarndi",
|
| 175 |
+
coordinates: [-21.28, 117.78],
|
| 176 |
+
geometry: {
|
| 177 |
+
type: "Polygon",
|
| 178 |
+
coordinates: [[
|
| 179 |
+
[-21.3, 117.75],
|
| 180 |
+
[-21.3, 117.8],
|
| 181 |
+
[-21.25, 117.8],
|
| 182 |
+
[-21.25, 117.75],
|
| 183 |
+
[-21.3, 117.75]
|
| 184 |
+
]]
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
];
|
| 188 |
+
|
| 189 |
+
const agreements = [
|
| 190 |
+
{
|
| 191 |
+
id: 1,
|
| 192 |
+
community: "Yindjibarndi",
|
| 193 |
+
type: "ILUA",
|
| 194 |
+
title: "Yindjibarndi-FMG Agreement",
|
| 195 |
+
who: "Fortescue Metals Group",
|
| 196 |
+
what: "Iron ore mining agreement",
|
| 197 |
+
startDate: "2012-05-15",
|
| 198 |
+
endDate: "2032-05-15",
|
| 199 |
+
benefits: "Employment opportunities, training programs, and financial compensation",
|
| 200 |
+
contact: "Yindjibarndi Aboriginal Corporation",
|
| 201 |
+
coordinates: [-21.25, 117.75]
|
| 202 |
+
},
|
| 203 |
+
{
|
| 204 |
+
id: 2,
|
| 205 |
+
community: "Yindjibarndi",
|
| 206 |
+
type: "Section 31",
|
| 207 |
+
title: "Yindjibarndi Mining Lease",
|
| 208 |
+
who: "Rio Tinto",
|
| 209 |
+
what: "Pilbara mining operations",
|
| 210 |
+
startDate: "2015-08-01",
|
| 211 |
+
endDate: "2040-08-01",
|
| 212 |
+
benefits: "Royalty payments and cultural heritage protection",
|
| 213 |
+
contact: "Yindjibarndi Aboriginal Corporation",
|
| 214 |
+
coordinates: [-21.3, 117.8]
|
| 215 |
+
},
|
| 216 |
+
{
|
| 217 |
+
id: 3,
|
| 218 |
+
community: "Noongar",
|
| 219 |
+
type: "ILUA",
|
| 220 |
+
title: "Noongar Native Title Settlement",
|
| 221 |
+
who: "Western Australian Government",
|
| 222 |
+
what: "Land use agreement",
|
| 223 |
+
startDate: "2018-06-08",
|
| 224 |
+
endDate: "2068-06-08",
|
| 225 |
+
benefits: "Land transfers, funding for community programs",
|
| 226 |
+
contact: "South West Aboriginal Land and Sea Council",
|
| 227 |
+
coordinates: [-32.0, 116.5]
|
| 228 |
+
}
|
| 229 |
+
];
|
| 230 |
+
|
| 231 |
+
// Initialize map
|
| 232 |
+
const map = L.map('map').setView([-25.2744, 133.7751], 4);
|
| 233 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
| 234 |
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
| 235 |
+
}).addTo(map);
|
| 236 |
+
|
| 237 |
+
// Initialize search
|
| 238 |
+
const fuse = new Fuse(communities, {
|
| 239 |
+
keys: ['name'],
|
| 240 |
+
threshold: 0.3
|
| 241 |
+
});
|
| 242 |
+
|
| 243 |
+
const communitySearch = document.getElementById('communitySearch');
|
| 244 |
+
const searchResults = document.getElementById('searchResults');
|
| 245 |
+
const searchButton = document.getElementById('searchButton');
|
| 246 |
+
const loadingIndicator = document.getElementById('loadingIndicator');
|
| 247 |
+
const legend = document.getElementById('legend');
|
| 248 |
+
const agreementDetails = document.getElementById('agreementDetails');
|
| 249 |
+
const detailContent = document.getElementById('detailContent');
|
| 250 |
+
const printButton = document.getElementById('printButton');
|
| 251 |
+
const helpButton = document.getElementById('helpButton');
|
| 252 |
+
|
| 253 |
+
let currentCommunity = null;
|
| 254 |
+
let currentMarkers = [];
|
| 255 |
+
|
| 256 |
+
// Search functionality
|
| 257 |
+
communitySearch.addEventListener('input', (e) => {
|
| 258 |
+
const query = e.target.value.trim();
|
| 259 |
+
if (query.length < 3) {
|
| 260 |
+
searchResults.classList.add('hidden');
|
| 261 |
+
return;
|
| 262 |
+
}
|
| 263 |
+
|
| 264 |
+
const results = fuse.search(query);
|
| 265 |
+
if (results.length > 0) {
|
| 266 |
+
searchResults.innerHTML = results.map(result =>
|
| 267 |
+
`<div class="p-2 hover:bg-gray-200 cursor-pointer rounded" data-name="${result.item.name}">
|
| 268 |
+
${result.item.name}
|
| 269 |
+
</div>`
|
| 270 |
+
).join('');
|
| 271 |
+
searchResults.classList.remove('hidden');
|
| 272 |
+
} else {
|
| 273 |
+
searchResults.innerHTML = '<div class="p-2 text-gray-500">No communities found</div>';
|
| 274 |
+
searchResults.classList.remove('hidden');
|
| 275 |
+
}
|
| 276 |
+
});
|
| 277 |
+
|
| 278 |
+
searchResults.addEventListener('click', (e) => {
|
| 279 |
+
if (e.target.dataset.name) {
|
| 280 |
+
communitySearch.value = e.target.dataset.name;
|
| 281 |
+
searchResults.classList.add('hidden');
|
| 282 |
+
searchForCommunity(e.target.dataset.name);
|
| 283 |
+
}
|
| 284 |
+
});
|
| 285 |
+
|
| 286 |
+
searchButton.addEventListener('click', () => {
|
| 287 |
+
if (communitySearch.value.trim()) {
|
| 288 |
+
searchForCommunity(communitySearch.value.trim());
|
| 289 |
+
}
|
| 290 |
+
});
|
| 291 |
+
|
| 292 |
+
function searchForCommunity(communityName) {
|
| 293 |
+
loadingIndicator.classList.remove('hidden');
|
| 294 |
+
|
| 295 |
+
// Simulate network delay for demo purposes
|
| 296 |
+
setTimeout(() => {
|
| 297 |
+
const community = communities.find(c => c.name.toLowerCase() === communityName.toLowerCase());
|
| 298 |
+
if (community) {
|
| 299 |
+
currentCommunity = community;
|
| 300 |
+
showCommunityOnMap(community);
|
| 301 |
+
legend.classList.remove('hidden');
|
| 302 |
+
updateHelpButton(community);
|
| 303 |
+
} else {
|
| 304 |
+
alert("Community not found. Please try another name.");
|
| 305 |
+
}
|
| 306 |
+
loadingIndicator.classList.add('hidden');
|
| 307 |
+
}, 800);
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
function showCommunityOnMap(community) {
|
| 311 |
+
// Clear previous markers
|
| 312 |
+
currentMarkers.forEach(marker => map.removeLayer(marker));
|
| 313 |
+
currentMarkers = [];
|
| 314 |
+
|
| 315 |
+
// Zoom to community bounds
|
| 316 |
+
map.fitBounds(community.bounds);
|
| 317 |
+
|
| 318 |
+
// Add agreements and tenements for this community
|
| 319 |
+
const communityAgreements = agreements.filter(a => a.community === community.name);
|
| 320 |
+
const communityTenements = tenements.filter(t => t.community === community.name);
|
| 321 |
+
|
| 322 |
+
// Add tenement polygons
|
| 323 |
+
communityTenements.forEach(tenement => {
|
| 324 |
+
const polygon = L.polygon(tenement.geometry.coordinates, {
|
| 325 |
+
color: '#d73027',
|
| 326 |
+
weight: 2,
|
| 327 |
+
fillOpacity: 0.3
|
| 328 |
+
}).addTo(map);
|
| 329 |
+
|
| 330 |
+
polygon.bindPopup(`
|
| 331 |
+
<strong>Tenement ${tenement.TENEMENT}</strong><br/>
|
| 332 |
+
Holder: ${tenement.COMPANY}<br/>
|
| 333 |
+
Commodity: ${tenement.COMMODITY}<br/>
|
| 334 |
+
Expires: ${tenement.EXPIRY}<br/>
|
| 335 |
+
<a href="${tenement.DOC_URL}" target="_blank">Official register</a>
|
| 336 |
+
`);
|
| 337 |
+
|
| 338 |
+
currentMarkers.push(polygon);
|
| 339 |
+
});
|
| 340 |
+
|
| 341 |
+
// Add agreement markers
|
| 342 |
+
// Add tenements to print map
|
| 343 |
+
communityTenements.forEach(tenement => {
|
| 344 |
+
L.polygon(tenement.geometry.coordinates, {
|
| 345 |
+
color: '#d73027',
|
| 346 |
+
weight: 2,
|
| 347 |
+
fillOpacity: 0.3
|
| 348 |
+
}).addTo(printMapInstance);
|
| 349 |
+
|
| 350 |
+
// Add to agreements list
|
| 351 |
+
const li = document.createElement('li');
|
| 352 |
+
li.className = 'mb-2';
|
| 353 |
+
li.innerHTML = `
|
| 354 |
+
<strong>Tenement ${tenement.TENEMENT}</strong><br/>
|
| 355 |
+
<span class="text-sm">Held by ${tenement.COMPANY} for ${tenement.COMMODITY}</span><br/>
|
| 356 |
+
<span class="text-sm">Expires: ${tenement.EXPIRY}</span>
|
| 357 |
+
`;
|
| 358 |
+
printAgreements.appendChild(li);
|
| 359 |
+
});
|
| 360 |
+
|
| 361 |
+
// Add agreements to print map
|
| 362 |
+
communityAgreements.forEach(agreement => {
|
| 363 |
+
let iconColor;
|
| 364 |
+
if (agreement.type === "ILUA") {
|
| 365 |
+
iconColor = 'bg-green-600';
|
| 366 |
+
} else if (agreement.type === "Section 31") {
|
| 367 |
+
iconColor = 'bg-orange-500';
|
| 368 |
+
} else {
|
| 369 |
+
iconColor = 'bg-blue-500';
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
const marker = L.marker(agreement.coordinates, {
|
| 373 |
+
icon: L.divIcon({
|
| 374 |
+
className: 'custom-icon ' + iconColor,
|
| 375 |
+
html: agreement.type === "ILUA" ? 'I' : agreement.type === "Section 31" ? 'M' : 'A',
|
| 376 |
+
iconSize: [24, 24]
|
| 377 |
+
})
|
| 378 |
+
}).addTo(map);
|
| 379 |
+
|
| 380 |
+
marker.on('click', () => showAgreementDetails(agreement));
|
| 381 |
+
currentMarkers.push(marker);
|
| 382 |
+
});
|
| 383 |
+
}
|
| 384 |
+
|
| 385 |
+
function showAgreementDetails(agreement) {
|
| 386 |
+
detailContent.innerHTML = `
|
| 387 |
+
<h3 class="text-lg font-semibold mb-2">${agreement.title}</h3>
|
| 388 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
| 389 |
+
<div>
|
| 390 |
+
<p class="font-semibold">Who:</p>
|
| 391 |
+
<p>${agreement.who}</p>
|
| 392 |
+
</div>
|
| 393 |
+
<div>
|
| 394 |
+
<p class="font-semibold">What:</p>
|
| 395 |
+
<p>${agreement.what}</p>
|
| 396 |
+
</div>
|
| 397 |
+
<div>
|
| 398 |
+
<p class="font-semibold">Start Date:</p>
|
| 399 |
+
<p>${agreement.startDate}</p>
|
| 400 |
+
</div>
|
| 401 |
+
<div>
|
| 402 |
+
<p class="font-semibold">End Date:</p>
|
| 403 |
+
<p>${agreement.endDate}</p>
|
| 404 |
+
</div>
|
| 405 |
+
<div class="md:col-span-2">
|
| 406 |
+
<p class="font-semibold">Benefits:</p>
|
| 407 |
+
<p>${agreement.benefits}</p>
|
| 408 |
+
</div>
|
| 409 |
+
<div class="md:col-span-2">
|
| 410 |
+
<p class="font-semibold">Contact:</p>
|
| 411 |
+
<p>${agreement.contact}</p>
|
| 412 |
+
</div>
|
| 413 |
+
</div>
|
| 414 |
+
`;
|
| 415 |
+
agreementDetails.classList.remove('hidden');
|
| 416 |
+
|
| 417 |
+
// Scroll to details if on mobile
|
| 418 |
+
if (window.innerWidth < 768) {
|
| 419 |
+
agreementDetails.scrollIntoView({ behavior: 'smooth' });
|
| 420 |
+
}
|
| 421 |
+
}
|
| 422 |
+
|
| 423 |
+
function updateHelpButton(community) {
|
| 424 |
+
helpButton.innerHTML = `Need Help? Call ${community.ntrb}: ${community.phone}`;
|
| 425 |
+
helpButton.onclick = () => {
|
| 426 |
+
window.location.href = `tel:${community.phone.replace(/\D/g, '')}`;
|
| 427 |
+
};
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
+
// Print functionality
|
| 431 |
+
printButton.addEventListener('click', () => {
|
| 432 |
+
// Prepare print content
|
| 433 |
+
document.getElementById('printNtrbPhone').textContent =
|
| 434 |
+
`${currentCommunity.ntrb}: ${currentCommunity.phone}`;
|
| 435 |
+
|
| 436 |
+
// Clone map for printing
|
| 437 |
+
const printMapContainer = document.getElementById('printMapContainer');
|
| 438 |
+
printMapContainer.innerHTML = '';
|
| 439 |
+
const printMap = document.createElement('div');
|
| 440 |
+
printMap.style.height = '400px';
|
| 441 |
+
printMapContainer.appendChild(printMap);
|
| 442 |
+
|
| 443 |
+
// Create a new map instance for printing
|
| 444 |
+
const printMapInstance = L.map(printMap).setView(map.getCenter(), map.getZoom());
|
| 445 |
+
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
| 446 |
+
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
| 447 |
+
}).addTo(printMapInstance);
|
| 448 |
+
|
| 449 |
+
// Add community bounds
|
| 450 |
+
L.rectangle(currentCommunity.bounds, {color: "#ff7800", weight: 1}).addTo(printMapInstance);
|
| 451 |
+
|
| 452 |
+
// Add agreements
|
| 453 |
+
const communityAgreements = agreements.filter(a => a.community === currentCommunity.name);
|
| 454 |
+
const printAgreements = document.getElementById('printAgreements');
|
| 455 |
+
printAgreements.innerHTML = '';
|
| 456 |
+
|
| 457 |
+
communityAgreements.forEach(agreement => {
|
| 458 |
+
let iconColor;
|
| 459 |
+
if (agreement.type === "ILUA") {
|
| 460 |
+
iconColor = 'green';
|
| 461 |
+
} else if (agreement.type === "Section 31") {
|
| 462 |
+
iconColor = 'orange';
|
| 463 |
+
} else {
|
| 464 |
+
iconColor = 'blue';
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
L.circleMarker(agreement.coordinates, {
|
| 468 |
+
radius: 8,
|
| 469 |
+
fillColor: iconColor,
|
| 470 |
+
color: '#000',
|
| 471 |
+
weight: 1,
|
| 472 |
+
opacity: 1,
|
| 473 |
+
fillOpacity: 0.8
|
| 474 |
+
}).addTo(printMapInstance);
|
| 475 |
+
|
| 476 |
+
// Add to agreements list
|
| 477 |
+
const li = document.createElement('li');
|
| 478 |
+
li.className = 'mb-2';
|
| 479 |
+
li.innerHTML = `
|
| 480 |
+
<strong>${agreement.title}</strong> (${agreement.type})<br>
|
| 481 |
+
<span class="text-sm">With ${agreement.who} for ${agreement.what}</span><br>
|
| 482 |
+
<span class="text-sm">${agreement.startDate} to ${agreement.endDate}</span>
|
| 483 |
+
`;
|
| 484 |
+
printAgreements.appendChild(li);
|
| 485 |
+
});
|
| 486 |
+
|
| 487 |
+
// Trigger print
|
| 488 |
+
window.print();
|
| 489 |
+
});
|
| 490 |
+
|
| 491 |
+
// Keyboard accessibility
|
| 492 |
+
communitySearch.addEventListener('keydown', (e) => {
|
| 493 |
+
if (e.key === 'Enter') {
|
| 494 |
+
searchButton.click();
|
| 495 |
+
}
|
| 496 |
+
});
|
| 497 |
+
|
| 498 |
+
// Initialize with a sample community for demo purposes
|
| 499 |
+
setTimeout(() => {
|
| 500 |
+
communitySearch.value = "Yindjibarndi";
|
| 501 |
+
searchButton.click();
|
| 502 |
+
}, 1000);
|
| 503 |
+
</script>
|
| 504 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=lachieandmitch/native-title" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 505 |
+
</html>
|