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 () {
|
||||
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' ) ): {};
|
||||
}, 1 );
|
||||
this.cart = localStorage.getItem( 'cart' ) ? JSON.parse( localStorage.getItem( 'cart' ) ): {};
|
||||
// this.loadTickets();
|
||||
this.loadTickets();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -124,17 +124,24 @@
|
||||
// Load seatplan from server
|
||||
let height = $( document ).height() * 0.8;
|
||||
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 ) {
|
||||
res.json().then( data => {
|
||||
this.draggables = this.scaleUp( data.data );
|
||||
this.prepSeatplan();
|
||||
res.json().then( json => {
|
||||
this.event = json ?? {};
|
||||
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' );
|
||||
},
|
||||
openRightClickMenu( id, event, hasSeatplan ) {
|
||||
this.currentlyOpenMenu = id;
|
||||
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' } } )
|
||||
} else {
|
||||
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 ) {
|
||||
if ( command === 'editLocation' ) {
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
methods: {
|
||||
setActiveTicket ( 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 () {
|
||||
fetch( '/getAPI/getAllEvents' ).then( res => {
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
this.$router.push( '/tickets' );
|
||||
}
|
||||
this.eventID = sessionStorage.getItem( 'selectedTicket' );
|
||||
this.hasSeatplan = sessionStorage.getItem( 'hasSeatplan' );
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user