From 80d52ff81938238226d06669575a8aa601987ce3 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 2 Oct 2025 23:19:15 +0200 Subject: [PATCH] up edit menu --- frontend/src/app/pages/home/home.html | 5 +- frontend/src/app/pages/home/home.ts | 6 +- frontend/src/app/pages/home/menu/menu.html | 71 ++++++++++- frontend/src/app/pages/home/menu/menu.scss | 15 +++ frontend/src/app/pages/home/menu/menu.ts | 14 +++ frontend/src/oedb-types.ts | 133 +++++++++++++++++++++ 6 files changed, 238 insertions(+), 6 deletions(-) create mode 100644 frontend/src/oedb-types.ts diff --git a/frontend/src/app/pages/home/home.html b/frontend/src/app/pages/home/home.html index a57993b..9af8203 100644 --- a/frontend/src/app/pages/home/home.html +++ b/frontend/src/app/pages/home/home.html @@ -1,8 +1,7 @@

home works!

- OpenEventDatabase - stats - sources + +
main part diff --git a/frontend/src/app/pages/home/home.ts b/frontend/src/app/pages/home/home.ts index 09da8ff..77195bf 100644 --- a/frontend/src/app/pages/home/home.ts +++ b/frontend/src/app/pages/home/home.ts @@ -1,11 +1,13 @@ import { Component } from '@angular/core'; +import {Menu} from './menu/menu'; @Component({ selector: 'app-home', - imports: [], + imports: [ + Menu + ], templateUrl: './home.html', styleUrl: './home.scss' }) export class Home { - } diff --git a/frontend/src/app/pages/home/menu/menu.html b/frontend/src/app/pages/home/menu/menu.html index 136889f..77cd4bb 100644 --- a/frontend/src/app/pages/home/menu/menu.html +++ b/frontend/src/app/pages/home/menu/menu.html @@ -1 +1,70 @@ -

menu works!

+ + OpenEventDatabase + stats + sources + + (editor +
+
+ +
+
+ + + @for (oedbc of oedb_what_categories; track $index) { +
+
+ {{ oedbc.emoji }} +
+ +
+ + {{ oedbc.label }} +
+
+ } +
+ +
+ (bouton de template pour ne pas remplir le formulaire) +
+ + (reste optionnel du formulaire) + + + + + + +
+ + + + + + +
+ + + + + + + +
+ +
+

données

+ (liste des éléments trouvés) +
    +
  • +
+ (bouton pour exporter) + +
+ +
diff --git a/frontend/src/app/pages/home/menu/menu.scss b/frontend/src/app/pages/home/menu/menu.scss index e69de29..3b1c8df 100644 --- a/frontend/src/app/pages/home/menu/menu.scss +++ b/frontend/src/app/pages/home/menu/menu.scss @@ -0,0 +1,15 @@ +:host { + + #what_categories{ + + .cateogry { + background: #f8f8f8; + border-radius: 4px; + padding: 10px; + margin-bottom: 10px; + width: 300px; + display: block; + border: 1px solid #ddd; + } + } +} diff --git a/frontend/src/app/pages/home/menu/menu.ts b/frontend/src/app/pages/home/menu/menu.ts index 51196da..1566e22 100644 --- a/frontend/src/app/pages/home/menu/menu.ts +++ b/frontend/src/app/pages/home/menu/menu.ts @@ -1,4 +1,5 @@ import { Component } from '@angular/core'; +import oedb_what_categories from '../../../../oedb-types'; @Component({ selector: 'app-menu', @@ -8,4 +9,17 @@ import { Component } from '@angular/core'; }) export class Menu { + public oedb_what_categories: Array = []; + + constructor() { + let keys = Object.keys(oedb_what_categories.presets.what); + + this.oedb_what_categories = []; + + keys.forEach((key) => { + this.oedb_what_categories.push( + oedb_what_categories.presets.what[key as keyof typeof oedb_what_categories.presets.what] + ); + }) + } } diff --git a/frontend/src/oedb-types.ts b/frontend/src/oedb-types.ts new file mode 100644 index 0000000..ffb7cb3 --- /dev/null +++ b/frontend/src/oedb-types.ts @@ -0,0 +1,133 @@ +const oedb = { + presets : { + what : { + 'community': { + label: 'Événement de base', + description: 'Événement communautaire', + category: 'Communauté', + emoji: '\\o/', + duration : '1D' // 1 day + }, + // Community / OSM + 'community.osm.event': { + emoji: '🗺️', + label: 'Événement OpenStreetMap', + category: 'Communauté', + description: 'Événement lié à la communauté OpenStreetMap' + }, + + // Culture / Arts + 'culture.arts': { + emoji: '🎨', + label: 'Arts et culture', + category: 'Culture', + description: 'Événement artistique et culturel' + }, + 'culture.geek': { + emoji: '🤓', + label: 'Culture geek', + category: 'Culture', + description: 'Événement geek, technologie, gaming' + }, + 'culture.music': { + emoji: '🎵', + label: 'Musique', + category: 'Culture', + description: 'Événement musical général' + }, + + // Music specific + 'music.festival': { + emoji: '🎪', + label: 'Festival de musique', + category: 'Musique', + description: 'Festival musical' + }, + + // Power / Energy + 'power.production.unavail': { + emoji: '⚡', + label: 'Production électrique indisponible', + category: 'Énergie', + description: 'Arrêt ou réduction de production électrique' + }, + + // Sale / Commerce + 'sale': { + emoji: '🛒', + label: 'Vente / Commerce', + category: 'Commerce', + description: 'Événement commercial, vente, marché' + }, + + // Time / Temporal + 'time.daylight.summer': { + emoji: '☀️', + label: 'Heure d\'été', + category: 'Temps', + description: 'Passage à l\'heure d\'été' + }, + + // Tourism + 'tourism.exhibition': { + emoji: '🖼️', + label: 'Exposition', + category: 'Tourisme', + description: 'Exposition, salon, foire' + }, + + // Traffic / Transportation + 'traffic.accident': { + emoji: '💥', + label: 'Accident', + category: 'Circulation', + description: 'Accident de la circulation' + }, + 'traffic.incident': { + emoji: '⚠️', + label: 'Incident de circulation', + category: 'Circulation', + description: 'Incident sur la route' + }, + 'traffic.obstacle': { + emoji: '🚧', + label: 'Obstacle', + category: 'Circulation', + description: 'Obstacle sur la voie' + }, + 'traffic.partially_closed': { + emoji: '🚦', + label: 'Voie partiellement fermée', + category: 'Circulation', + description: 'Fermeture partielle de voie' + }, + 'traffic.roadwork': { + emoji: '', + label: 'Travaux routiers', + category: 'Circulation', + description: 'Travaux sur la chaussée' + }, + 'wildlife': { + emoji: '🦌', + label: 'Animal', + category: 'Vie sauvage', + description: 'Détection d\'animaux' + }, + 'traffic.mammoth': { + emoji: '🦣', + label: 'Mammouth laineux wohoooo! (évènement de test)', + category: 'Obstacle', + description: 'Un mammouth laineux bloque la route' + }, + 'hazard.piranha': { + emoji: '🐟', + label: 'Piranha dans la piscine', + category: 'Danger', + description: 'Des pirana attaquent dans cette piscine' + } + // ici ajouter d'autres catégories d'évènements à suggérer + } + } +} + +export default oedb;