update colors + bugfixes

This commit is contained in:
2023-10-07 16:55:42 +02:00
parent 5d55140681
commit 033fdf3483
7 changed files with 52 additions and 36 deletions

View File

@@ -168,30 +168,28 @@ class POSTHandler {
if ( this.events[ data.eventID ].maxTickets == 0 || ticketCount < this.events[ data.eventID ].maxTickets ) {
// check if enough tickets are still available
if ( ticketCount < this.ticketTotals[ data.eventID ] - this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ] ) {
if ( data.count < this.ticketTotals[ data.eventID ] ) {
if ( ticketCount < parseInt( this.ticketTotals[ data.eventID ] ) - parseInt( this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ] ) ) {
if ( data.count > this.ticketTotals[ data.eventID ] ) {
ticketCount = this.ticketTotals[ data.eventID ];
// Create details
let info = {};
info[ data.eventID ] = {};
info[ data.eventID ][ id ] = data;
if ( !this.temporarilySelected[ data.eventID ] ) {
this.temporarilySelected[ data.eventID ] = {};
}
if ( !this.temporaryTotals[ data.eventID ] ) {
this.temporaryTotals[ data.eventID ] = 0;
}
db.writeDataSimple( 'temp', 'user_id', session.id, { 'user_id': session.id, 'timestamp': new Date().toString(), 'data': JSON.stringify( info ) } );
this.temporarilySelected[ data.eventID ][ id ] = info;
this.temporaryTotals[ data.eventID ] -= this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ];
this.temporaryTotals[ data.eventID ] += ticketCount;
this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ] = ticketCount;
this.countFreeSeats();
resolve( 'ok' );
} else {
reject( { 'code': 409, 'message': 'ERR_ALL_OCCUPIED' } );
}
// Create details
let info = {};
info[ data.eventID ] = {};
info[ data.eventID ][ id ] = data;
if ( !this.temporarilySelected[ data.eventID ] ) {
this.temporarilySelected[ data.eventID ] = {};
}
if ( !this.temporaryTotals[ data.eventID ] ) {
this.temporaryTotals[ data.eventID ] = 0;
}
db.writeDataSimple( 'temp', 'user_id', session.id, { 'user_id': session.id, 'timestamp': new Date().toString(), 'data': JSON.stringify( info ) } );
this.temporarilySelected[ data.eventID ][ id ] = info;
this.temporaryTotals[ data.eventID ] -= this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ];
this.temporaryTotals[ data.eventID ] += ticketCount;
this.temporarilySelectedTotals[ session.id ][ data.eventID ][ id ] = ticketCount;
this.countFreeSeats();
resolve( 'ok' );
} else {
reject( { 'code': 409, 'message': 'ERR_ALL_OCCUPIED' } );
}

View File

@@ -1 +1 @@
{"test4":{"secAr4s7":{"id":"secAr4s7","component":1,"ticketOption":"1","eventID":"test4","category":"1","name":"Row 5, Seat 8"},"secAr6s14":{"id":"secAr6s14","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 15"},"secAr6s10":{"id":"secAr6s10","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 11"},"comp1secAr5s11":{"id":"comp1secAr5s11","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 6, Seat 12"}},"test3":{"ticket1_1":{"id":"ticket1_1","component":1,"ticketOption":"1","eventID":"test3","count":1,"category":"1","name":"Category 1 (Child)"}}}
{"test4":{"secAr4s7":{"id":"secAr4s7","component":1,"ticketOption":"1","eventID":"test4","category":"1","name":"Row 5, Seat 8"},"secAr6s14":{"id":"secAr6s14","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 15"},"secAr6s10":{"id":"secAr6s10","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 11"},"comp1secAr5s11":{"id":"comp1secAr5s11","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 6, Seat 12"}},"test3":{"ticket1_1":{"id":"ticket1_1","component":1,"ticketOption":"1","eventID":"test3","count":10,"category":"1","name":"Category 1 (Child)"},"ticket1":{"id":"ticket1_1","component":1,"ticketOption":"1","eventID":"test3","count":1,"category":"1","name":"Category 1 (Child)"}}}

View File

@@ -43,7 +43,7 @@
--popup-color: rgb(224, 224, 224);
--accent-color: #42b983;
--hover-color: rgb(165, 165, 165);
--accent-background-hover: rgb(124, 140, 236);
--accent-background-hover: #648cab;
--overlay-color: rgba(0, 0, 0, 0.7);
--inactive-color: rgb(100, 100, 100);
--hint-color: rgb(174, 210, 221);
@@ -58,7 +58,7 @@
--popup-color: rgb(58, 58, 58);
--accent-color: #42b983;
--hover-color: rgb(83, 83, 83);
--accent-background-hover: rgb(124, 140, 236);
--accent-background-hover: #648cab;
--overlay-color: rgba(104, 104, 104, 0.575);
--inactive-color: rgb(190, 190, 190);
--hint-color: rgb(88, 91, 110);

View File

@@ -2,10 +2,10 @@
<div class="seatingWrapper">
<div class="noseatplan">
<h2>Available tickets</h2>
<button @click="cartHandling()">Add selected tickets to cart</button>
<button @click="cartHandling()" class="button">Add selected tickets to cart</button>
<div class="wrapper">
<div v-for="ticket in event.categories">
{{ event[ 'categories' ][ ticket.id ][ 'name' ] }}
<div v-for="ticket in event.categories" style="margin-bottom: 1.5%;">
<h4 style="margin: 0.5%;">{{ event[ 'categories' ][ ticket.id ][ 'name' ] }}</h4>
<table>
<tr v-for="ticketOption in event[ 'ageGroups' ]">
<td>
@@ -266,6 +266,23 @@ export default {
height: 100%;
}
.button {
transition: all 1s;
padding: 1%;
border-radius: 50px;
border: none;
background-color: var( --accent-background-hover );
cursor: pointer;
color: var( --secondary-color );
margin-bottom: 3%;
text-decoration: none;
}
.button:hover {
background-color: var( --accent-background );
border-radius: 10px;
}
.noseatplan {
grid-area: main;
display: flex;