Loading seat prices from api, layout changes not final
This commit is contained in:
@@ -6,7 +6,8 @@ import {
|
|||||||
OmdbSearch,
|
OmdbSearch,
|
||||||
Bestellung,
|
Bestellung,
|
||||||
Eintrittskarte,
|
Eintrittskarte,
|
||||||
StatisticsFilm, StatisticsVorstellung
|
StatisticsFilm, StatisticsVorstellung,
|
||||||
|
Sitzkategorie
|
||||||
} from '@infinimotion/model-frontend';
|
} from '@infinimotion/model-frontend';
|
||||||
import { HttpClient } from "@angular/common/http";
|
import { HttpClient } from "@angular/common/http";
|
||||||
import { inject, Injectable } from "@angular/core";
|
import { inject, Injectable } from "@angular/core";
|
||||||
@@ -204,4 +205,12 @@ export class HttpService {
|
|||||||
getShowStatistics(): Observable<StatisticsVorstellung[]> {
|
getShowStatistics(): Observable<StatisticsVorstellung[]> {
|
||||||
return this.http.get<StatisticsVorstellung[]>(`${this.baseUrl}statistics/shows`)
|
return this.http.get<StatisticsVorstellung[]>(`${this.baseUrl}statistics/shows`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Sitzkategorie APIs */
|
||||||
|
|
||||||
|
/* GET /api/sitzkategorie */
|
||||||
|
getSeatCategories(): Observable<Sitzkategorie[]> {
|
||||||
|
return this.http.get<Sitzkategorie[]>(`${this.baseUrl}sitzkategorie`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
letter-spacing: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||||
|
gap: 30px;
|
||||||
|
max-width: 1000px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: #faf8ff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card h2 {
|
||||||
|
margin-top: 0;
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.5);
|
||||||
|
padding-bottom: 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px 0;
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,99 +1,51 @@
|
|||||||
<!DOCTYPE html>
|
<app-menu-header label="Preislisten" icon="euro_symbol"></app-menu-header>
|
||||||
<html lang="de">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
||||||
<title>Kino Preisliste</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
background: #ffffff;
|
|
||||||
color: #000000;
|
|
||||||
margin: 0;
|
|
||||||
padding: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
<div class="menu-container my-20">
|
||||||
text-align: center;
|
<!-- Popcorn -->
|
||||||
margin-bottom: 40px;
|
<div class="card">
|
||||||
letter-spacing: 2px;
|
<h2>🍿 Popcorn</h2>
|
||||||
}
|
<div class="item"><span>Klein</span><span>3,50 €</span></div>
|
||||||
|
<div class="item"><span>Mittel</span><span>5,00 €</span></div>
|
||||||
.menu-container {
|
<div class="item"><span>Groß</span><span>6,50 €</span></div>
|
||||||
display: grid;
|
<div class="item"><span>Extra Butter</span><span>1,00 €</span></div>
|
||||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
|
||||||
gap: 30px;
|
|
||||||
max-width: 1000px;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
background: #faf8ff;
|
|
||||||
padding: 20px;
|
|
||||||
border-radius: 12px;
|
|
||||||
box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.card h2 {
|
|
||||||
margin-top: 0;
|
|
||||||
border-bottom: 1px solid rgba(255, 215, 0, 0.5);
|
|
||||||
padding-bottom: 10px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
padding: 8px 0;
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Kino Preisliste</h1>
|
|
||||||
|
|
||||||
<div class="menu-container">
|
|
||||||
<!-- Popcorn -->
|
|
||||||
<div class="card">
|
|
||||||
<h2>🍿 Popcorn</h2>
|
|
||||||
<div class="item"><span>Klein</span><span>3,50 €</span></div>
|
|
||||||
<div class="item"><span>Mittel</span><span>5,00 €</span></div>
|
|
||||||
<div class="item"><span>Groß</span><span>6,50 €</span></div>
|
|
||||||
<div class="item"><span>Extra Butter</span><span>1,00 €</span></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Nachos -->
|
|
||||||
<div class="card">
|
|
||||||
<h2>🧀 Nachos</h2>
|
|
||||||
<div class="item"><span>Portion</span><span>4,50 €</span></div>
|
|
||||||
<div class="item"><span>Käse-Dip</span><span>1,00 €</span></div>
|
|
||||||
<div class="item"><span>Salsa-Dip</span><span>1,00 €</span></div>
|
|
||||||
<div class="item"><span>Guacamole</span><span>1,50 €</span></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Getränke -->
|
|
||||||
<div class="card">
|
|
||||||
<h2>🥤 Getränke</h2>
|
|
||||||
<div class="item"><span>Softdrink Klein</span><span>2,80 €</span></div>
|
|
||||||
<div class="item"><span>Softdrink Mittel</span><span>3,50 €</span></div>
|
|
||||||
<div class="item"><span>Softdrink Groß</span><span>4,20 €</span></div>
|
|
||||||
<div class="item"><span>Wasser</span><span>2,50 €</span></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Süßigkeiten -->
|
|
||||||
<div class="card">
|
|
||||||
<h2>🍬 Süßigkeiten</h2>
|
|
||||||
<div class="item"><span>Schokoladentafel</span><span>2,50 €</span></div>
|
|
||||||
<div class="item"><span>Gummibärchen</span><span>2,20 €</span></div>
|
|
||||||
<div class="item"><span>Kindertüte</span><span>3,00 €</span></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
|
||||||
</html>
|
<!-- Nachos -->
|
||||||
|
<div class="card">
|
||||||
|
<h2>🧀 Nachos</h2>
|
||||||
|
<div class="item"><span>Portion</span><span>4,50 €</span></div>
|
||||||
|
<div class="item"><span>Käse-Dip</span><span>1,00 €</span></div>
|
||||||
|
<div class="item"><span>Salsa-Dip</span><span>1,00 €</span></div>
|
||||||
|
<div class="item"><span>Guacamole</span><span>1,50 €</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Getränke -->
|
||||||
|
<div class="card">
|
||||||
|
<h2>🥤 Getränke</h2>
|
||||||
|
<div class="item"><span>Softdrink Klein</span><span>2,80 €</span></div>
|
||||||
|
<div class="item"><span>Softdrink Mittel</span><span>3,50 €</span></div>
|
||||||
|
<div class="item"><span>Softdrink Groß</span><span>4,20 €</span></div>
|
||||||
|
<div class="item"><span>Wasser</span><span>2,50 €</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Süßigkeiten -->
|
||||||
|
<div class="card">
|
||||||
|
<h2>🍬 Süßigkeiten</h2>
|
||||||
|
<div class="item"><span>Schokoladentafel</span><span>2,50 €</span></div>
|
||||||
|
<div class="item"><span>Gummibärchen</span><span>2,20 €</span></div>
|
||||||
|
<div class="item"><span>Kindertüte</span><span>3,00 €</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@if (seatCategories.length > 0) {
|
||||||
|
<!-- Sitze -->
|
||||||
|
<div class="card">
|
||||||
|
<h2>🪑 Sitzplätze</h2>
|
||||||
|
@for (seatCategory of seatCategories; track seatCategory.id) {
|
||||||
|
<div class="item"><span> <mat-icon style="font-size: 20px; width: 20px; height: 20px">
|
||||||
|
{{ seatCategory.icon }}
|
||||||
|
</mat-icon></span><span>{{seatCategory.name}}</span><span>{{getPriceDisplay(seatCategory.price)}}</span></div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, inject, OnInit } from '@angular/core';
|
||||||
|
import { Sitzkategorie } from '@infinimotion/model-frontend';
|
||||||
|
import { HttpService } from '../http.service';
|
||||||
|
import { LoadingService } from '../loading.service';
|
||||||
|
import { catchError, of, tap } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pricelist',
|
selector: 'app-pricelist',
|
||||||
@@ -6,6 +10,32 @@ import { Component } from '@angular/core';
|
|||||||
templateUrl: './pricelist.component.html',
|
templateUrl: './pricelist.component.html',
|
||||||
styleUrl: './pricelist.component.css'
|
styleUrl: './pricelist.component.css'
|
||||||
})
|
})
|
||||||
export class PricelistComponent {
|
export class PricelistComponent implements OnInit{
|
||||||
|
seatCategories: Sitzkategorie[] = [];
|
||||||
|
|
||||||
|
private http=inject(HttpService);
|
||||||
|
private loading=inject(LoadingService);
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.loadSeatCategories();
|
||||||
|
}
|
||||||
|
|
||||||
|
private loadSeatCategories() : void {
|
||||||
|
this.loading.show();
|
||||||
|
this.http.getSeatCategories().pipe(
|
||||||
|
tap(seatCategories => {
|
||||||
|
this.seatCategories = seatCategories.sort((a, b) => a.id - b.id);
|
||||||
|
this.loading.hide();
|
||||||
|
}),
|
||||||
|
catchError(err => {
|
||||||
|
this.loading.showError(err);
|
||||||
|
console.error('Fehler beim Laden der Sitzkategorien', err);
|
||||||
|
return of([]);
|
||||||
|
})
|
||||||
|
).subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
getPriceDisplay(price: number): string {
|
||||||
|
return `${(price / 100).toFixed(2)} €`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user