up
This commit is contained in:
parent
cc92e2b5d7
commit
4f6a388129
3 changed files with 33 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
|
|
||||||
@if(showOptions){
|
@if(showOptions){
|
||||||
<div class="aside">
|
<div class="aside">
|
||||||
|
|
||||||
|
|
@ -29,13 +30,7 @@
|
||||||
<input type="checkbox" [(ngModel)]="pleinAirMode" (change)="togglePleinAir()">
|
<input type="checkbox" [(ngModel)]="pleinAirMode" (change)="togglePleinAir()">
|
||||||
Mode plein air
|
Mode plein air
|
||||||
</label>
|
</label>
|
||||||
@if (pleinAirMode) {
|
|
||||||
<div class="quick-actions" style="margin-top:8px; display:flex; gap:6px; flex-wrap:wrap;">
|
|
||||||
<button class="btn" (click)="quickCreate('traffic.contestation')">🚩 Contester</button>
|
|
||||||
<button class="btn" (click)="quickCreate('traffic.interruption')">⛓️ Interruption</button>
|
|
||||||
<button class="btn" (click)="quickCreate('traffic.wrong_way')">⛖ Détourné</button>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="filters-group">
|
<div class="filters-group">
|
||||||
|
|
@ -191,6 +186,14 @@
|
||||||
<button class="button toggle-options" (click)="showOptions = !showOptions">
|
<button class="button toggle-options" (click)="showOptions = !showOptions">
|
||||||
Options
|
Options
|
||||||
</button>
|
</button>
|
||||||
|
@if (pleinAirMode) {
|
||||||
|
<div class="quick-actions" style="margin-top:8px; display:flex; gap:6px; flex-wrap:wrap;">
|
||||||
|
<button class="btn" (click)="quickCreate('traffic.contestation')">🚩 Contester</button>
|
||||||
|
<button class="btn" (click)="quickCreate('traffic.interruption')">⛓️ Interruption</button>
|
||||||
|
<button class="btn" (click)="quickCreate('traffic.wrong_way')">⛖ Détourné</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
@if (toasts.length) {
|
@if (toasts.length) {
|
||||||
<div class="toaster" style="position:fixed;right:16px;top:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;">
|
<div class="toaster" style="position:fixed;right:16px;top:16px;display:flex;flex-direction:column;gap:8px;z-index:1000;">
|
||||||
@for (t of toasts; track t.id) {
|
@for (t of toasts; track t.id) {
|
||||||
|
|
|
||||||
|
|
@ -251,3 +251,14 @@ app-edit-form{
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.quick-actions{
|
||||||
|
margin-top: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
gap: 6px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
position: fixed;
|
||||||
|
right: 5rem;
|
||||||
|
bottom: 1.1rem;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
@ -88,6 +88,7 @@ export class Home implements OnInit, OnDestroy {
|
||||||
const id = (map.get('id') || '').trim();
|
const id = (map.get('id') || '').trim();
|
||||||
const what = (map.get('what') || '').trim();
|
const what = (map.get('what') || '').trim();
|
||||||
const pleinAir = (map.get('pleinair') || '').trim().toLowerCase();
|
const pleinAir = (map.get('pleinair') || '').trim().toLowerCase();
|
||||||
|
const preset = (map.get('preset') || '').trim().toLowerCase();
|
||||||
const limitParam = map.get('limit');
|
const limitParam = map.get('limit');
|
||||||
const limit = limitParam ? Number(limitParam) : null;
|
const limit = limitParam ? Number(limitParam) : null;
|
||||||
// Charger selon les query params
|
// Charger selon les query params
|
||||||
|
|
@ -104,6 +105,10 @@ export class Home implements OnInit, OnDestroy {
|
||||||
if (pleinAir === '1' || pleinAir === 'true' || pleinAir === 'yes') {
|
if (pleinAir === '1' || pleinAir === 'true' || pleinAir === 'yes') {
|
||||||
this.enablePleinAirMode();
|
this.enablePleinAirMode();
|
||||||
}
|
}
|
||||||
|
// Support: preset=plein_air
|
||||||
|
if (preset === 'plein_air') {
|
||||||
|
this.enablePleinAirMode();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.startAutoReload();
|
this.startAutoReload();
|
||||||
}
|
}
|
||||||
|
|
@ -355,7 +360,13 @@ export class Home implements OnInit, OnDestroy {
|
||||||
geometry: { type: 'Point', coordinates: [lon, lat] }
|
geometry: { type: 'Point', coordinates: [lon, lat] }
|
||||||
} as any;
|
} as any;
|
||||||
this.OedbApi.createEvent(feature).subscribe({
|
this.OedbApi.createEvent(feature).subscribe({
|
||||||
next: () => { this.pushToast('success', 'Évènement créé'); this.selected = null; this.loadEvents(); },
|
next: () => {
|
||||||
|
this.pushToast('success', 'Évènement créé');
|
||||||
|
this.selected = null;
|
||||||
|
// Après création rapide en plein air: recharger uniquement ce type pour feedback instantané
|
||||||
|
this.selectedWhatFilter = w;
|
||||||
|
this.loadEvents({ what: w });
|
||||||
|
},
|
||||||
error: () => { this.pushToast('error', 'Échec de création'); }
|
error: () => { this.pushToast('error', 'Échec de création'); }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue