Add export of json file
This commit is contained in:
@@ -20,6 +20,7 @@ Canadian byo-yomi Byo-yomi canadien
|
|||||||
Cancel Annuler
|
Cancel Annuler
|
||||||
Change Mettre à jour
|
Change Mettre à jour
|
||||||
Chinese rules Règles chinoises
|
Chinese rules Règles chinoises
|
||||||
|
Choose format Choix du format
|
||||||
Close Fermer
|
Close Fermer
|
||||||
Club Club
|
Club Club
|
||||||
Compile from the sources Compiler depuis les sources
|
Compile from the sources Compiler depuis les sources
|
||||||
@@ -33,6 +34,7 @@ Download the standalone web interface module which suits your need, then follow
|
|||||||
Edit Éditer
|
Edit Éditer
|
||||||
Enter the magic word Entrer le mot magique
|
Enter the magic word Entrer le mot magique
|
||||||
Export Exporter
|
Export Exporter
|
||||||
|
Export tournament Exporter le tournoi
|
||||||
Family name Nom de famille
|
Family name Nom de famille
|
||||||
First name Prénom
|
First name Prénom
|
||||||
Fischer timing Cadence Fisher
|
Fischer timing Cadence Fisher
|
||||||
@@ -73,6 +75,8 @@ Pair-go tournament Tournoi de pair-go
|
|||||||
Pairing Appariement
|
Pairing Appariement
|
||||||
Pairings for round Appariement pour la ronde
|
Pairings for round Appariement pour la ronde
|
||||||
Participation Participation
|
Participation Participation
|
||||||
|
Publish Publier
|
||||||
|
Publish standings Publier le classement
|
||||||
Rank Niveau
|
Rank Niveau
|
||||||
Rating Classement
|
Rating Classement
|
||||||
Register Inscrire
|
Register Inscrire
|
||||||
@@ -80,6 +84,7 @@ Registration Inscriptions
|
|||||||
Rengo with 2 players teams Rengo par équipes de 2
|
Rengo with 2 players teams Rengo par équipes de 2
|
||||||
Rengo with 3 players team Rengo par équipes de 3
|
Rengo with 3 players team Rengo par équipes de 3
|
||||||
Required field Champs requis
|
Required field Champs requis
|
||||||
|
Reset Mac Mahon groups Réinitialiser les groupes Mac Mahon
|
||||||
Results Résultats
|
Results Résultats
|
||||||
Results for round Résultats pour la ronde
|
Results for round Résultats pour la ronde
|
||||||
Round-robin Toutes rondes
|
Round-robin Toutes rondes
|
||||||
|
@@ -100,6 +100,28 @@ onLoad(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#export').on('click', e => {
|
$('#export').on('click', e => {
|
||||||
|
modal('export-modal');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#export-pairgoth').on('click', e => {
|
||||||
|
close_modal();
|
||||||
|
let form = $('#tournament-infos')[0];
|
||||||
|
let shortName = form.val('shortName');
|
||||||
|
let hdrs = headers();
|
||||||
|
hdrs['Accept'] = 'application/json';
|
||||||
|
fetch(`${base}tour/${tour_id}`, {
|
||||||
|
headers: hdrs
|
||||||
|
}).then(resp => {
|
||||||
|
if (resp.ok) return resp.text()
|
||||||
|
else throw "export error"
|
||||||
|
}).then(txt => {
|
||||||
|
let blob = new Blob(['\uFEFF', txt.trim()], {type: 'application/json;charset=utf-8'});
|
||||||
|
downloadFile(blob, `${shortName}.tour`);
|
||||||
|
}).catch(err => showError(err));
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#export-opengotha').on('click', e => {
|
||||||
|
close_modal();
|
||||||
let form = $('#tournament-infos')[0];
|
let form = $('#tournament-infos')[0];
|
||||||
let shortName = form.val('shortName');
|
let shortName = form.val('shortName');
|
||||||
let hdrs = headers();
|
let hdrs = headers();
|
||||||
|
@@ -235,3 +235,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="export-modal" class="popup">
|
||||||
|
<div class="popup-body">
|
||||||
|
<div class="popup-header">
|
||||||
|
Export tournament
|
||||||
|
</div>
|
||||||
|
<div class="popup-content">
|
||||||
|
<div class="horz">
|
||||||
|
<span>Choose format</span>
|
||||||
|
<button id="export-pairgoth" type="button" class="ui blue floating button">Pairgoth</button>
|
||||||
|
<button id="export-opengotha" type="button" class="ui blue floating button">OpenGotha</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="popup-footer">
|
||||||
|
<div class="form-actions">
|
||||||
|
<button type="button" class="ui gray floating cancel button">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@@ -94,17 +94,19 @@
|
|||||||
<div id="publish-modal" class="popup">
|
<div id="publish-modal" class="popup">
|
||||||
<div class="popup-body">
|
<div class="popup-body">
|
||||||
<div class="popup-header">
|
<div class="popup-header">
|
||||||
Download Standings
|
Publish standings
|
||||||
</div>
|
</div>
|
||||||
<div class="popup-content">
|
<div class="popup-content">
|
||||||
Choose format
|
<div class="horz">
|
||||||
</div>
|
<span>Choose format</span>
|
||||||
<div class="popup-footer">
|
|
||||||
<div class="form-actions">
|
|
||||||
<button type="button" class="ui gray floating cancel button">Cancel</button>
|
|
||||||
<button type="button" class="ui blue floating publish-egf button">EGF</button>
|
<button type="button" class="ui blue floating publish-egf button">EGF</button>
|
||||||
<button type="button" class="ui blue floating publish-ffg button">FFG</button>
|
<button type="button" class="ui blue floating publish-ffg button">FFG</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="popup-footer">
|
||||||
|
<div class="form-actions">
|
||||||
|
<button type="button" class="ui gray floating cancel button">Cancel</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user