mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
Loading event data from ui possible now
This commit is contained in:
@@ -162,7 +162,11 @@ export default {
|
|||||||
},
|
},
|
||||||
loadTickets () {
|
loadTickets () {
|
||||||
fetch( '/getAPI/getEvent?event=' + sessionStorage.getItem( 'selectedTicket' ) ).then( res => {
|
fetch( '/getAPI/getEvent?event=' + sessionStorage.getItem( 'selectedTicket' ) ).then( res => {
|
||||||
|
if ( res.status === 200 ) {
|
||||||
|
res.json().then( json => {
|
||||||
|
this.event = json ?? {};
|
||||||
|
} );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -171,7 +175,7 @@ export default {
|
|||||||
this.cart = localStorage.getItem( 'cart' ) ? JSON.parse( localStorage.getItem( 'cart' ) ): {};
|
this.cart = localStorage.getItem( 'cart' ) ? JSON.parse( localStorage.getItem( 'cart' ) ): {};
|
||||||
}, 1 );
|
}, 1 );
|
||||||
this.cart = localStorage.getItem( 'cart' ) ? JSON.parse( localStorage.getItem( 'cart' ) ): {};
|
this.cart = localStorage.getItem( 'cart' ) ? JSON.parse( localStorage.getItem( 'cart' ) ): {};
|
||||||
// this.loadTickets();
|
this.loadTickets();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -124,17 +124,24 @@
|
|||||||
// Load seatplan from server
|
// Load seatplan from server
|
||||||
let height = $( document ).height() * 0.8;
|
let height = $( document ).height() * 0.8;
|
||||||
this.scaleFactor = ( height / 900 ) * this.zoomFactor;
|
this.scaleFactor = ( height / 900 ) * this.zoomFactor;
|
||||||
fetch( localStorage.getItem( 'url' ) + '/getAPI/getSeatplan?location=' + sessionStorage.getItem( 'selectedTicket' ) ).then( res => {
|
fetch( '/getAPI/getEvent?event=' + sessionStorage.getItem( 'selectedTicket' ) ).then( res => {
|
||||||
if ( res.status === 200 ) {
|
if ( res.status === 200 ) {
|
||||||
res.json().then( data => {
|
res.json().then( json => {
|
||||||
this.draggables = this.scaleUp( data.data );
|
this.event = json ?? {};
|
||||||
this.prepSeatplan();
|
fetch( localStorage.getItem( 'url' ) + '/getAPI/getSeatplan?location=' + this.event.location ).then( res => {
|
||||||
|
if ( res.status === 200 ) {
|
||||||
|
res.json().then( data => {
|
||||||
|
this.draggables = this.scaleUp( data.data );
|
||||||
|
this.prepSeatplan();
|
||||||
|
} );
|
||||||
|
} else if ( res.status === 500 ) {
|
||||||
|
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
||||||
|
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
||||||
|
this.prepSeatplan();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} );
|
||||||
} );
|
} );
|
||||||
} else if ( res.status === 500 ) {
|
|
||||||
if ( sessionStorage.getItem( 'seatplan' ) ) {
|
|
||||||
this.draggables = this.scaleUp( JSON.parse( sessionStorage.getItem( 'seatplan' ) ) );
|
|
||||||
this.prepSeatplan();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -128,12 +128,12 @@
|
|||||||
, 'settings' );
|
, 'settings' );
|
||||||
},
|
},
|
||||||
openRightClickMenu( id, event, hasSeatplan ) {
|
openRightClickMenu( id, event, hasSeatplan ) {
|
||||||
|
this.currentlyOpenMenu = id;
|
||||||
if ( hasSeatplan ) {
|
if ( hasSeatplan ) {
|
||||||
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'editor': { 'command': 'openEditor', 'symbol': 'tune', 'display': 'Edit seatplan' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } )
|
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'editor': { 'command': 'openEditor', 'symbol': 'tune', 'display': 'Edit seatplan' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } )
|
||||||
} else {
|
} else {
|
||||||
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } )
|
this.$refs.rclk.openRightClickMenu( event, { 'edit': { 'command': 'editLocation', 'symbol': 'edit', 'display': 'Edit location' }, 'delete': { 'command': 'deleteLocation', 'symbol': 'delete', 'display': 'Delete location' } } )
|
||||||
}
|
}
|
||||||
this.currentlyOpenMenu = id;
|
|
||||||
},
|
},
|
||||||
executeCommand( command ) {
|
executeCommand( command ) {
|
||||||
if ( command === 'editLocation' ) {
|
if ( command === 'editLocation' ) {
|
||||||
|
|||||||
@@ -91,6 +91,8 @@
|
|||||||
methods: {
|
methods: {
|
||||||
setActiveTicket ( id ) {
|
setActiveTicket ( id ) {
|
||||||
sessionStorage.setItem( 'selectedTicket', id );
|
sessionStorage.setItem( 'selectedTicket', id );
|
||||||
|
sessionStorage.setItem( 'ticketData', { 'description': this.events[ id ][ 'description' ], 'name': this.events[ id ][ 'name' ], 'locationName': this.events[ id ][ 'locationName' ] } );
|
||||||
|
sessionStorage.setItem( 'hasSeatplan', this.events[ id ][ 'hasSeatplan' ] );
|
||||||
},
|
},
|
||||||
loadEvents () {
|
loadEvents () {
|
||||||
fetch( '/getAPI/getAllEvents' ).then( res => {
|
fetch( '/getAPI/getAllEvents' ).then( res => {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
this.$router.push( '/tickets' );
|
this.$router.push( '/tickets' );
|
||||||
}
|
}
|
||||||
this.eventID = sessionStorage.getItem( 'selectedTicket' );
|
this.eventID = sessionStorage.getItem( 'selectedTicket' );
|
||||||
|
this.hasSeatplan = sessionStorage.getItem( 'hasSeatplan' );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user