jQuery(document).ready(function($) { let userVotes = {}; function updateView() { if (djVotingSystem.isAdmin) { $('#pending-artists-heading').show(); $('#pending-artist-table').show(); $('.actions-column').show(); $('.edit-button, .delete-button').show(); } else { $('#pending-artists-heading').hide(); $('#pending-artist-table').hide(); $('.actions-column').hide(); $('.edit-button, .delete-button').hide(); } } function loadArtists() { $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'get_artists' }, success: function(response) { if (response.success) { const artists = response.data; $('#dj-vote-table-body').empty(); $('#pending-artist-table-body').empty(); artists.forEach(artist => { if (artist.status === 'pending' && djVotingSystem.isAdmin) { $('#pending-artist-table-body').append(createPendingArtistRow(artist)); } else if (artist.status === 'published') { $('#dj-vote-table-body').append(createArtistRow(artist)); } }); loadUserVotes(); } } }); } function loadUserVotes() { // Charger les votes de l'utilisateur depuis le stockage local userVotes = JSON.parse(localStorage.getItem('userVotes')) || {}; // Appliquer l'indicateur visuel pour les votes existants Object.keys(userVotes).forEach(artistId => { const voteType = userVotes[artistId]; $(`.vote-button[data-artist-id="${artistId}"][data-vote-type="${voteType}"]`).addClass('selected-vote'); }); } function createArtistRow(artist) { return ` ${artist.name} ${artist.name} ${artist.music_style} ${artist.artist_type} ${artist.votes} ${djVotingSystem.isAdmin ? ` ` : ''} `; } function createPendingArtistRow(artist) { return ` ${artist.name} ${artist.name} ${artist.music_style} ${artist.artist_type} ${artist.url} `; } $('#new-artist-form').on('submit', function(e) { e.preventDefault(); const artistName = $('#artist-name').val().trim(); const musicStyle = $('#music-style').val().trim(); const artistType = $('#artist-type').val().trim(); const artistUrl = $('#artist-url').val().trim(); const artistPhoto = $('#artist-photo')[0].files[0]; const reader = new FileReader(); reader.onload = function(e) { const photoUrl = e.target.result; $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'register_artist', name: artistName, music_style: musicStyle, artist_type: artistType, url: artistUrl, photo: photoUrl }, success: function(response) { if (response.success) { $('#newArtistModal').modal('hide'); $('#new-artist-form')[0].reset(); alert('L\'artiste a été ajouté et est en attente de validation par un administrateur.'); loadArtists(); } else { alert(response.data || 'Erreur lors de l\'ajout de l\'artiste.'); } } }); }; reader.readAsDataURL(artistPhoto); }); $(document).on('click', '.approve-button', function() { const artistId = $(this).data('artist-id'); $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'approve_artist', id: artistId }, success: function(response) { if (response.success) { loadArtists(); } else { alert('Erreur lors de l\'approbation de l\'artiste.'); } } }); }); $(document).on('click', '.reject-button', function() { const artistId = $(this).data('artist-id'); $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'reject_artist', id: artistId }, success: function(response) { if (response.success) { loadArtists(); } else { alert('Erreur lors du rejet de l\'artiste.'); } } }); }); $(document).on('click', '.edit-button', function() { const artistId = $(this).data('artist-id'); const artistRow = $(this).closest('tr'); const artistName = artistRow.find('td:nth-child(2) a').text(); const musicStyle = artistRow.find('td:nth-child(3)').text(); const artistType = artistRow.find('td:nth-child(4)').text(); const artistUrl = artistRow.find('td:nth-child(2) a').attr('href'); const artistPhoto = artistRow.find('td:nth-child(1) img').attr('src'); $('#edit-artist-id').val(artistId); $('#edit-artist-name').val(artistName); $('#edit-music-style').val(musicStyle); $('#edit-artist-type').val(artistType); $('#edit-artist-url').val(artistUrl); $('#edit-artist-photo').val(''); $('#editArtistModal').modal('show'); }); $('#edit-artist-form').on('submit', function(e) { e.preventDefault(); const artistId = $('#edit-artist-id').val().trim(); const artistName = $('#edit-artist-name').val().trim(); const musicStyle = $('#edit-music-style').val().trim(); const artistType = $('#edit-artist-type').val().trim(); const artistUrl = $('#edit-artist-url').val().trim(); const artistPhoto = $('#edit-artist-photo')[0].files[0]; const formData = new FormData(); formData.append('action', 'update_artist'); formData.append('id', artistId); formData.append('name', artistName); formData.append('music_style', musicStyle); formData.append('artist_type', artistType); formData.append('url', artistUrl); if (artistPhoto) { const reader = new FileReader(); reader.onload = function(e) { formData.append('photo', e.target.result); submitUpdateForm(formData); }; reader.readAsDataURL(artistPhoto); } else { submitUpdateForm(formData); } }); function submitUpdateForm(formData) { $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: formData, contentType: false, processData: false, success: function(response) { if (response.success) { $('#editArtistModal').modal('hide'); loadArtists(); } else { alert('Erreur lors de la modification de l\'artiste.'); } } }); } $(document).on('click', '.delete-button', function() { const artistId = $(this).data('artist-id'); const artistName = $(this).closest('tr').find('td:nth-child(2) a').text(); $('#delete-artist-id').val(artistId); $('#delete-artist-name').text(artistName); $('#confirmDeleteModal').modal('show'); }); $('#confirm-delete-button').on('click', function() { const artistId = $('#delete-artist-id').val(); $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'delete_artist', id: artistId }, success: function(response) { if (response.success) { $('#confirmDeleteModal').modal('hide'); loadArtists(); } else { alert('Erreur lors de la suppression de l\'artiste.'); } } }); }); $(document).on('click', '.vote-button', function() { const artistId = $(this).data('artist-id'); const voteType = $(this).data('vote-type'); $.ajax({ url: djVotingSystem.ajax_url, method: 'POST', data: { action: 'add_vote', artist_id: artistId, vote_type: voteType }, success: function(response) { if (response.success) { $('#votes-' + artistId).text(response.data.new_votes); $('.vote-button[data-artist-id="' + artistId + '"]').removeClass('selected-vote'); $(`.vote-button[data-artist-id="${artistId}"][data-vote-type="${voteType}"]`).addClass('selected-vote'); // Mettre à jour le vote de l'utilisateur dans le stockage local userVotes[artistId] = voteType; localStorage.setItem('userVotes', JSON.stringify(userVotes)); } else { alert(response.data || 'Erreur lors du vote.'); } } }); }); loadArtists(); updateView(); }); Magnetiic Agency Launching Party: Dj Caline, Dj Kwamé, Dj Schnake, Esteban Desigual | Agenda Techno
Accueil Evénements Techno - Techno Mag Soirée Magnetiic Agency Launching Party: Dj Caline, Dj Kwamé, Dj Schnake, Esteban Desigual

Magnetiic Agency Launching Party: Dj Caline, Dj Kwamé, Dj Schnake, Esteban Desigual

̸
PROGRAMMATION
Dj Caline, Dj Kwamé, Dj Schnake, Esteban Desigual
Partager

Genres
Trance
Electro
La Darude presents Magnetiic Agency Launching Party
Propulsée par La Darude l’année dernière, Magnetiic Agency lance officiellement ses évents en février 2024 !
Pour sa 1ère soirée, l’agence de booking investit le Rex Club en donnant carte blanche à ses artistes pour une programmation musicale naviguant entre la Trance, la Hard Techno et la Hard Dance.

Established by La Darude last year, Magnetiic Agency officially launches its events in February 2024!
For its 1st party, the booking agency takes over Rex Club with a line-up made up of Trance, Hard Techno and Hard Dance.

Noter cet article

L'événement est terminé.

Date

07 Fév 2024
Expiré!

Heure

12:55 pm - 12:55 pm

Tarif

8.00 €

Plus d'Infos

Billetterie

Labels

Tekno

Lieu

5 Boulevard Poissonnière, 75002 Paris, France
5 Boulevard Poissonnière, 75002 Paris, France
Catégorie
QR Code
Powered by Modern Events Calendar