diff --git a/app.js b/app.js index 2371209..8bfad09 100644 --- a/app.js +++ b/app.js @@ -64,3 +64,4 @@ app.use('/', routes); const PORT = process.env.PORT || 3000; app.listen(PORT, () => console.log('Serveur lancé sur http://localhost:' + PORT)); + diff --git a/controllers/search.js b/controllers/search.js new file mode 100644 index 0000000..c9fcfb8 --- /dev/null +++ b/controllers/search.js @@ -0,0 +1,24 @@ +const sqlite3 = require('sqlite3').verbose(); +const dbPath = '../database.sqlite'; +const db = new sqlite3.Database(dbPath, (err) => { + if (err) { + console.error(err.message); + } + console.log('Connected to the SQLite database.'); +}); + +import L from 'leaflet'; + +const key = 'YOUR_MAPTILER_API_KEY_HERE'; +document.addEventListener('DOMContentLoaded', function() { + const map = L.map('search-map').setView([49.2125578, 16.62662018], 14); + L.tileLayer(`https://api.maptiler.com/maps/streets-v2/{z}/{x}/{y}.png?key=${key}`, { + tileSize: 512, + zoomOffset: -1, + minZoom: 1, + attribution: "\u003ca href=\"https://www.maptiler.com/copyright/\" target=\"_blank\"\u003e\u0026copy; MapTiler\u003c/a\u003e \u003ca href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\"\u003e\u0026copy; OpenStreetMap contributors\u003c/a\u003e", + crossOrigin: true + }).addTo(map); +}); + +alert("connard"); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 28f1223..a24bd7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "ejs": "^3.1.10", "express": "^5.1.0", "express-session": "^1.18.2", + "leaflet": "^1.9.4", "passport": "^0.7.0", "passport-discord": "^0.1.4", "sqlite3": "^5.1.7" @@ -1182,6 +1183,12 @@ "node": ">=10" } }, + "node_modules/leaflet": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz", + "integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==", + "license": "BSD-2-Clause" + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", diff --git a/package.json b/package.json index 7b151f3..b6b236f 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "ejs": "^3.1.10", "express": "^5.1.0", "express-session": "^1.18.2", + "leaflet": "^1.9.4", "passport": "^0.7.0", "passport-discord": "^0.1.4", "sqlite3": "^5.1.7" diff --git a/routes.js b/routes.js index 73b52f7..06c179e 100644 --- a/routes.js +++ b/routes.js @@ -7,6 +7,11 @@ router.get('/', (req, res) => { res.render('index', { user: req.user }); }); +// Page de recherche +router.get('/recherche', (req, res) => { + res.render('search', { user: req.user }); +}); + // Auth Discord router.get('/auth/discord', passport.authenticate('discord')); diff --git a/static/carte.png b/static/carte.png new file mode 100644 index 0000000..4cd6aeb Binary files /dev/null and b/static/carte.png differ diff --git a/views/search.ejs b/views/search.ejs new file mode 100644 index 0000000..d4da0ea --- /dev/null +++ b/views/search.ejs @@ -0,0 +1,43 @@ + + + + Rechercher un restaurant + + + + + + + + + + + + element + element + element + element + element + element + + +
+
+ + + + +
+
Nom ville
+
Filtrer par
+
Champ de recherche
+
Affiner recherche
+
+ + +
+
+ + + + \ No newline at end of file