Ask for confirmation before dropping changes or unregistering a player
This commit is contained in:
@@ -35,6 +35,7 @@ Delete Supprimer
|
|||||||
Director Directeur
|
Director Directeur
|
||||||
Download Télécharger
|
Download Télécharger
|
||||||
Download the standalone web interface module which suits your need, then follow Télécharger le module d’interface web qui correspond à vos besoins, puis suivez
|
Download the standalone web interface module which suits your need, then follow Télécharger le module d’interface web qui correspond à vos besoins, puis suivez
|
||||||
|
Drop changes? Abandonner les changements ?
|
||||||
Edit Éditer
|
Edit Éditer
|
||||||
Encoding Encodage
|
Encoding Encodage
|
||||||
Enter the magic word Entrer le mot magique
|
Enter the magic word Entrer le mot magique
|
||||||
@@ -127,6 +128,7 @@ Tournament name Nom du tournoi
|
|||||||
Tournament type Type de tournoi
|
Tournament type Type de tournoi
|
||||||
Unpair Désapparier
|
Unpair Désapparier
|
||||||
Unregister Désinscrire
|
Unregister Désinscrire
|
||||||
|
Unregister this player? Désinscrire ce joueur ?
|
||||||
Update Mettre à jour
|
Update Mettre à jour
|
||||||
We offer you the flexibility to use Nous vous offrons la flexibilité d’utiliser
|
We offer you the flexibility to use Nous vous offrons la flexibilité d’utiliser
|
||||||
Welcome to Bienvenue sur
|
Welcome to Bienvenue sur
|
||||||
|
@@ -157,6 +157,12 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
$('#cancel-register').on('click', e => {
|
$('#cancel-register').on('click', e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
if ($('#player-form').hasClass('edit') && !$('#register').hasClass('disabled')) {
|
||||||
|
let confirmMessage = $('#drop-changes').text();
|
||||||
|
if (!confirm(confirmMessage)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
close_modal();
|
close_modal();
|
||||||
searchHighlight = undefined;
|
searchHighlight = undefined;
|
||||||
return false;
|
return false;
|
||||||
@@ -246,6 +252,7 @@ onLoad(() => {
|
|||||||
}
|
}
|
||||||
form.removeClass('add');
|
form.removeClass('add');
|
||||||
$('#player').removeClass('create').addClass('edit');
|
$('#player').removeClass('create').addClass('edit');
|
||||||
|
$('#register').addClass('disabled');
|
||||||
modal('player');
|
modal('player');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -310,12 +317,15 @@ onLoad(() => {
|
|||||||
$('#unregister').on('click', e => {
|
$('#unregister').on('click', e => {
|
||||||
let form = $('#player-form')[0];
|
let form = $('#player-form')[0];
|
||||||
let id = form.val('id');
|
let id = form.val('id');
|
||||||
api.deleteJson(`tour/${tour_id}/part/${id}`)
|
let confirmMessage = $('#unregister-player').text();
|
||||||
.then(ret => {
|
if (confirm(confirmMessage)) {
|
||||||
if (ret !== 'error') {
|
api.deleteJson(`tour/${tour_id}/part/${id}`)
|
||||||
window.location.reload();
|
.then(ret => {
|
||||||
}
|
if (ret !== 'error') {
|
||||||
});
|
window.location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$('#reg-status').on('click', e => {
|
$('#reg-status').on('click', e => {
|
||||||
let current = $('#final-reg').hasClass('final');
|
let current = $('#final-reg').hasClass('final');
|
||||||
@@ -429,4 +439,7 @@ onLoad(() => {
|
|||||||
$('#browse-players').on('click', e => {
|
$('#browse-players').on('click', e => {
|
||||||
search('*');
|
search('*');
|
||||||
});
|
});
|
||||||
|
$('.player-fields').on('change input', e => {
|
||||||
|
$('#register').removeClass('disabled');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@@ -146,71 +146,73 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="search-result"></div>
|
<div id="search-result"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="two stackable fields">
|
<div class="player-fields">
|
||||||
<div class="eight wide field">
|
<div class="two stackable fields">
|
||||||
<label>Family name</label>
|
<div class="eight wide field">
|
||||||
<span class="info"></span>
|
<label>Family name</label>
|
||||||
<input type="text" name="name" placeholder="last name"/>
|
<span class="info"></span>
|
||||||
|
<input type="text" name="name" placeholder="last name"/>
|
||||||
|
</div>
|
||||||
|
<div class="eight wide field">
|
||||||
|
<label>Given name</label>
|
||||||
|
<span class="info"></span>
|
||||||
|
<input type="text" name="firstname" placeholder="first name"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="eight wide field">
|
<div class="two stackable fields">
|
||||||
<label>Given name</label>
|
<div class="eight wide field">
|
||||||
<span class="info"></span>
|
<label>Country</label>
|
||||||
<input type="text" name="firstname" placeholder="first name"/>
|
<span class="info"></span>
|
||||||
</div>
|
<select name="country">
|
||||||
</div>
|
<option></option>
|
||||||
<div class="two stackable fields">
|
|
||||||
<div class="eight wide field">
|
|
||||||
<label>Country</label>
|
|
||||||
<span class="info"></span>
|
|
||||||
<select name="country">
|
|
||||||
<option></option>
|
|
||||||
#set($defaultCountry = $translate.defaultCountry[$request.lang])
|
#set($defaultCountry = $translate.defaultCountry[$request.lang])
|
||||||
#foreach($country in $countries.countries)
|
#foreach($country in $countries.countries)
|
||||||
<option value="$country.key">$country.value</option>
|
<option value="$country.key">$country.value</option>
|
||||||
#end
|
#end
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="eight wide field">
|
||||||
|
<label>Club</label>
|
||||||
|
<span class="info"></span>
|
||||||
|
<input type="text" name="club" placeholder="club"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="eight wide field">
|
<div class="two stackable fields">
|
||||||
<label>Club</label>
|
<div class="eight wide field">
|
||||||
<span class="info"></span>
|
<label>Rank</label>
|
||||||
<input type="text" name="club" placeholder="club"/>
|
<span class="info"></span>
|
||||||
</div>
|
<select name="rank">
|
||||||
</div>
|
<option></option>
|
||||||
<div class="two stackable fields">
|
|
||||||
<div class="eight wide field">
|
|
||||||
<label>Rank</label>
|
|
||||||
<span class="info"></span>
|
|
||||||
<select name="rank">
|
|
||||||
<option></option>
|
|
||||||
#levels()
|
#levels()
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="eight wide field">
|
||||||
|
<label>Rating</label>
|
||||||
|
<span class="info"></span>
|
||||||
|
<input name="rating" type="text" class="numeric"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="eight wide field">
|
<div class="inline fields">
|
||||||
<label>Rating</label>
|
<label>Final ?</label>
|
||||||
<span class="info"></span>
|
<div id="final-reg" class="field">
|
||||||
<input name="rating" type="text" class="numeric"/>
|
<input name="final" type="hidden"/>
|
||||||
</div>
|
<button id="reg-status" type="button" class="ui icon roundedremove mini button">
|
||||||
</div>
|
<span class="final"><i class="fa fa-check"></i></span>
|
||||||
<div class="inline fields">
|
<span class="preliminary"><i class="fa fa-question"></i></span>
|
||||||
<label>Final ?</label>
|
</button>
|
||||||
<div id="final-reg" class="field">
|
</div>
|
||||||
<input name="final" type="hidden"/>
|
<label>Participation</label>
|
||||||
<button id="reg-status" type="button" class="ui icon roundedremove mini button">
|
|
||||||
<span class="final"><i class="fa fa-check"></i></span>
|
|
||||||
<span class="preliminary"><i class="fa fa-question"></i></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<label>Participation</label>
|
|
||||||
#foreach($r in [1..$tour.rounds])
|
#foreach($r in [1..$tour.rounds])
|
||||||
<div class="centered field">
|
<div class="centered field">
|
||||||
<label>R${r}</label>
|
<label>R${r}</label>
|
||||||
<input name="r${r}" type="checkbox" checked="checked" class="participation"/>
|
<input name="r${r}" type="checkbox" checked="checked" class="participation"/>
|
||||||
</div>
|
</div>
|
||||||
#end
|
#end
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="popup-footer">
|
<div class="popup-footer">
|
||||||
<button id="cancel-register" type="button" class="ui gray right labeled icon floating close button">
|
<button id="cancel-register" type="button" class="ui gray right labeled icon floating button">
|
||||||
<i class="times icon"></i>
|
<i class="times icon"></i>
|
||||||
<span class="edition">Close</span>
|
<span class="edition">Close</span>
|
||||||
<span class="creation">Close</span>
|
<span class="creation">Close</span>
|
||||||
@@ -288,6 +290,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
#end
|
#end
|
||||||
|
<div id="drop-changes" class="hidden">Drop changes?</div>
|
||||||
|
<div id="unregister-player" class="hidden">Unregister this player?</div>
|
||||||
#[[
|
#[[
|
||||||
<script id="result" type="text/template">
|
<script id="result" type="text/template">
|
||||||
{{for #data}}
|
{{for #data}}
|
||||||
|
Reference in New Issue
Block a user