Skip to content

Commit

Permalink
fix: mise a jour des collectes
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Jun 17, 2024
1 parent 7680ccf commit 27856b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions js/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const ALEXI_URL = "https://dhdaines.github.io/alexi";
export const ZONALDA_API_URL = "https://zonalda.ecolingui.ca/api";
//export const ZONALDA_API_URL = "http://localhost:8000/api";
export const COLLECTES_URL = "https://ville.sainte-adele.qc.ca/upload/documents/SA-calendrier-collecte-2023-2024-8-5x11-vertical-CROP.pdf";
//export const ZONALDA_API_URL = "https://zonalda.ecolingui.ca/api";
export const ZONALDA_API_URL = "http://localhost:8000/api";
export const COLLECTES_URL = "https://ville.sainte-adele.qc.ca/upload/images/SA-calendrier-collecte-2023-2024-8-5x11-vertical-CROP.jpg";
export const COLLECTE_ZONE_URL = {
jaune: "https://lespaysdenhaut.com/wp-content/uploads/2023/07/SainteAdele_jaune2023-24.pdf",
rose: "https://lespaysdenhaut.com/wp-content/uploads/2023/07/SainteAdele_rose-2023-24.pdf",
Expand Down
7 changes: 5 additions & 2 deletions js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import VectorSource from "ol/source/Vector.js";
import { Tile as TileLayer, Vector as VectorLayer } from "ol/layer.js";
import OSM from "ol/source/OSM";
import { fromLonLat, toLonLat } from "ol/proj.js";
import { ZONALDA_API_URL, ALEXI_URL, COLLECTES_URL } from "./config";
import { ZONALDA_API_URL, ALEXI_URL, COLLECTES_URL, COLLECTE_ZONE_URL } from "./config";
import { GeocoderAutocomplete } from '@geoapify/geocoder-autocomplete';
import { Feature as GeoJSONFeature, Point as GeoJSONPoint, Position as GeoJSONPosition } from "geojson";
import { circular } from "ol/geom/Polygon";
Expand Down Expand Up @@ -104,7 +104,10 @@ function collecteTexte(info) {
if (info === null)
return "inconnue";
const { couleur, jour } = info;
return `${jour} <a target="_blank" href="${COLLECTES_URL}">(calendrier PDF)</a>`;
if (couleur in COLLECTE_ZONE_URL)
return `${jour} (zone ${couleur}) <a href="${COLLECTE_ZONE_URL[couleur]}">(calendrier PDF)</a>`;
else
return `${jour} <a target="_blank" href="${COLLECTES_URL}">(calendrier PDF)</a>`;
}

function conseilTexte(info) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27856b9

Please sign in to comment.