Commit 3c411e16 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

rechargement de la page après ajout d'un mot

parent e26710e1
......@@ -110,7 +110,7 @@ def editEntry(request):
}
return JsonResponse(rep)
def addEntry(request):
def newEntry(request):
mot = request.GET.get('mot', None)
trans = request.GET.get('trans', None)
ipCli = get_client_ip(request)
......
......@@ -15,7 +15,7 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import path
from colorapp.views import main, dicoView, editEntry, addEntry, redirApp, main0, dicoReq, getLog
from colorapp.views import main, dicoView, editEntry, newEntry, redirApp, main0, dicoReq, getLog
urlpatterns = [
path('admin/', admin.site.urls),
......@@ -25,6 +25,6 @@ urlpatterns = [
path('app/dico/', dicoView),
path('dicoSearch/', dicoReq),
path('modifEntry/', editEntry),
path('addEntry/', addEntry),
path('addEntry/', newEntry),
path('getLog/', getLog)
]
......@@ -64,6 +64,7 @@ function validEntry(mot, trans) {
console.log(data.reponse);
window.alert(data.reponse);
document.getElementById('popAddw').style.display = 'none';
document.location.reload(true); // recharge la page
},
error: function(){
// document.getElementById('loader').style.display = 'none';
......@@ -85,7 +86,7 @@ function bugMark() {
for (i = 0; i < bugs.length; i++) {
var newMark = document.createElement('span');
newMark.classList = 'glyphicon glyphicon-flash bugMark';
newMark.title = "Colorisation impossible ! L'erreur a été signalée.";
newMark.title = "Problème de colorisation ! L'erreur a été signalée.";
bugs[i].parentNode.insertBefore(newMark,bugs[i].nextSibling);
};
}
......
......@@ -208,8 +208,8 @@ def addEntry(user,mot,trans):
print("Modification du dictionnaire par",user,": ajout de mot =",mot,"; transList = ",transList)
return "Ajout effectué avec succès ! Merci pour votre participation !"
def rewriteDico():
print('Rewritting dictionary...')
with tempfile.NamedTemporaryFile(dir='.', delete=False, mode="w") as tmp:
json.dump(word2trans, tmp, ensure_ascii=False)
os.replace(tmp.name, dicFile)
......
This diff is collapsed.
This diff is collapsed.
{"accueil": ["a.kœj"], "lire": ["liʁ"], "encyclopédie": ["ɑ̃.si.klɔ.pe.di"], "manga": ["mɑ̃.ɡa"], "ouvrage": ["u.vʁaʒ"], "siège": ["sjɛʒ"], "chaise": ["ʃɛz", "ʃez"], "fauteuil": ["fo.tœj"], "meuble": ["mœbl"], "mardi": ["maʁ.di"], "lundi": ["lœ̃.di"], "semaine": ["sə.mɛn", "smɛn"], "militaire": ["mi.li.tɛʁ"], "suis": ["sɥi"], "barbe à papa": ["baʁ.b‿a pa.pa"], "manchot": ["mɑ̃.ʃo"], "pingouin": ["pɛ̃.ɡwɛ̃"], "mercredi": ["mɛʁ.kʁə.di"], "bande dessinée": ["bɑ̃d dɛ.si.ne"], "oiseau": ["wa.zo"], "allemand": ["al.mɑ̃"], "allemande": ["al.mɑ̃d"], "allemands": ["al.mɑ̃"], "jeudi": ["ʒø.di"], "vendredi": ["vɑ̃.dʁə.di"], "ailé": ["ɛ.le", "e.le"], "voler": ["vɔ.le"], "ovipare": ["ɔ.vi.paʁ"], "poisson": ["pwa.sɔ̃"], "travail": ["tʁa.vaj"], "armée": ["aʁ.me"], "nouveau": ["nu.vo"], "pinyin": ["pin.jin"], "sinogramme": ["si.nɔ.ɡʁam"], "kanji": ["kan.ʒi", "kɑ̃n.ʒi", "kɑ̃.ʒi"], "chair à canon": ["ʃɛ.ʁ‿a ka.nɔ̃"], "jour": ["ʒuʁ"], "groupe": ["ɡʁup"], "école": ["e.kɔl"], "cd-rom": ["se.de.ʁɔm"], "photographie": ["fɔ.to.ɡʁa.fi", "fɔ.tɔ.ɡʁa.fi"], "ordinateur": ["ɔʁ.di.na.tœʁ"], "janvier": ["ʒɑ̃.vje"], "année": ["a.ne"], "février": ["fe.vʁi.je"], "mars": ["maʁs"], "avril": ["a.vʁil", "ɑ.vʁɪl"], "mai": ["mɛ", "me", "ma.i", "ɛ.m‿a.i"], "juin": ["ʒɥɛ̃", "ʒy.œ̃"], "juillet": ["ʒɥi.jɛ"], "octobre": ["ɔk.tɔbʁ"], "novembre": ["nɔ.vɑ̃bʁ"], "décembre": ["de.sɑ̃bʁ"], "computer": ["kɔ̃.py.te", "kɔ̃.pju.tœʁ"], "anglais": ["ɑ̃.ɡlɛ"], "lieu": ["ljø"], "physique": ["fi.zik"], "concertation": ["kɔ̃.sɛʁ.ta.sjɔ̃"], "interrogation": ["ɛ̃.tɛ.ʁɔ.ɡa.sjɔ̃", "ɛ̃.te.ʁɔ.ɡa.sjɔ̃"], "homogène": ["ɔ.mɔ.ʒɛn"], "imprimante": ["ɛ̃.pʁi.mɑ̃t"], "empirique": ["ɑ̃.pi.ʁik"], "observation": ["ɔp.sɛʁ.va.sjɔ̃"], "hypothèse": ["i.pɔ.tɛz"], "collaboration": ["kɔ.la.bɔ.ʁa.sjɔ̃"], "samedi": ["sam.di"], "dimanche": ["di.mɑ̃ʃ"], "prendre": ["pʁɑ̃dʁ"], "le": ["lə"], "la": ["la"], "les": ["le", "lɛ"], "fin": ["fɛ̃"], "abréviation": ["a.bʁe.vja.sjɔ̃"], "essai": ["e.sɛ", "ɛ.sɛ", "e.se", "ɛ.se"], "chinois": ["ʃi.nwa"], "procrastiner": ["pʁɔ.kʁas.ti.ne"], "espagnol": ["ɛs.pa.ɲɔl"], "espagnols": ["ɛs.pa.ɲɔl"], "neuf": ["nœf"], "et": ["e", "ɛt", "i.ti"], "un": ["œ̃"], "nord": ["nɔʁ"], "sud": ["syd"], "localisation": ["lɔ.ka.li.za.sjɔ̃"], "terre": ["tɛʁ"], "dico": ["di.ko"], "je": ["ʒə"], "mot": ["mo"], "une": ["yn"], "aux": ["o"], "personne": ["pɛʁ.sɔn"], "green": ["ɡʁin"], "plage": ["plaʒ"], "lès": ["lɛ"], "nom commun": ["nɔ̃ kɔ.mœ̃"], "des": ["de"], "ou": ["u"], "cérémonie": ["se.ʁe.mɔ.ni"], "toulouse": ["tu.luz"], "on": ["ɔ̃", "ɔ.ɛn"], "o": ["o", "wɛst"], "arrivant": ["a.ʁi.vɑ̃"], "japonais": ["ʒa.pɔ.nɛ"], "consistant": ["kɔ̃.sis.tɑ̃"], "verbe": ["vɛʁb"], "accueille": ["a.kœj"], "rare": ["ʁaʁ", "ʁɑʁ"], "travaux": ["tʁa.vo"], "anglaise": ["ɑ̃.ɡlɛz"], "anglaises": ["ɑ̃.ɡlɛz"], "portugais": ["pɔʁ.ty.ɡɛ"], "ordre": ["ɔʁdʁ"], "deux": ["dø"], "internet": ["ɛ̃.tɛʁ.nɛt"], "courriel": ["ku.ʁjɛl"], "pourriel": ["pu.ʁjɛl"], "arriver": ["a.ʁi.ve"], "ensemble": ["ɑ̃.sɑ̃bl"], "nom": ["nɔ̃"], "adjectif": ["ad.ʒɛk.tif"], "alphabétique": ["al.fa.be.tik"], "du": ["dy", "de.y"], "traduction": ["tʁa.dyk.sjɔ̃"], "sens": ["sɑ̃s", "sɛn", "sɑ̃"], "néerlandais": ["ne.ɛʁ.lɑ̃.dɛ"], "néerlandaises": ["ne.ɛʁ.lɑ̃.dɛz"], "livre": ["livʁ"], "alphabet": ["al.fa.bɛ"], "habitant": ["a.bi.tɑ̃"], "a": ["ɑ", "a"], "texte": ["tɛkst"], "article": ["aʁ.tikl"], "langue": ["lɑ̃ɡ"], "élément": ["e.le.mɑ̃"], "unitaire": ["y.ni.tɛʁ"], "mobilier": ["mɔ.bi.lje"], "étranger": ["e.tʁɑ̃.ʒe"], "chat": ["ʃa", "tʃat"], "blog": ["blɔɡ"], "sujet": ["sy.ʒɛ"], "au": ["o"], "b": ["be"], "corps": ["kɔʁ", "kɔʁp"], "gouvernement": ["ɡu.vɛʁ.nə.mɑ̃"], "de": ["də", "de", "de.ø"], "généralement": ["ʒe.ne.ʁal.mɑ̃"], "an": ["ɑ̃", "an"], "chose": ["ʃoz"], "région": ["ʁe.ʒjɔ̃"], "nommer": ["nɔ.me"], "animal": ["a.ni.mal"], "a priori": ["a pʁi.ɔ.ʁi", "a pʁi.jɔ.ʁi"], "indéfini": ["ɛ̃.de.fi.ni"], "calculateur": ["kal.ky.la.tœʁ"], "terme": ["tɛʁm"], "rédemption": ["ʁe.dɑ̃.psjɔ̃"], "tu": ["ty", "t͡sy", "te.y"], "phrase": ["fʁɑz"], "homonyme": ["ɔ.mɔ.nim"], "aimer": ["e.me", "ɛ.me"], "uns": ["œ̃"], "énergie": ["e.nɛʁ.ʒi"], "électrique": ["e.lɛk.tʁik"], "électricité": ["e.lɛk.tʁi.si.te"], "chas": ["ʃa"], "maçon": ["ma.sɔ̃", "mɑ.sɔ̃"], "charpentier": ["ʃaʁ.pɑ̃.tje"], "jeu": ["ʒø"], "gamin": ["ɡa.mɛ̃"], "avéré": ["a.ve.ʁe"], "gamine": ["ɡa.min"], "mots": ["mo"], "système": ["sis.tɛm"], "grec": ["ɡʁɛk"], "singulier": ["sɛ̃.ɡy.lje"], "à": ["a"], "irrégulier": ["i.ʁe.ɡy.lje"], "l": ["ɛl"], "il": ["il"], "c": ["se", "sɛ"], "d": ["de"], "e": ["ə", "ɛst", "ø", "œ"], "mon": ["mɔ̃", "mɔ̃ː", "mɔn"], "ton": ["tɔ̃", "tɔ̃.n‿"], "son": ["sɔ̃"], "astrométrie": ["as.tʁɔ.me.tʁi"], "astronomie": ["as.tʁɔ.nɔ.mi"], "entropie": ["ɑ̃.tʁɔ.pi"], "ma": ["ma"], "mes": ["mɛ", "me", "mɛs"], "ta": ["ta", "te.a"], "tes": ["tɛ", "te"], "sa": ["sa", "ɛs.a", "sɑ"], "ses": ["se", "sɛ"], "cheval": ["ʃə.val", "ʃval"], "chevaux": ["ʃə.vo", "ʃvo"], "notre": ["nɔtʁ"], "nos": ["no"], "votre": ["vɔtʁ"], "vos": ["vo"], "leur": ["lœʁ"], "pomme": ["pɔm"], "pomme de terre": ["pɔm də tɛʁ"], "aucun": ["o.kœ̃"], "ouf": ["uf"], "aïe": ["aj"], "argot": ["aʁ.ɡo"], "slang": ["slɑ̃ɡ", "slaŋ"], "oh": ["o"], "aulx": ["o"], "homme": ["ɔm"], "futur": ["fy.tyʁ"], "bar": ["baʁ"], "barre": ["bɑʁ", "baʁ"], "italien": ["i.ta.ljɛ̃"], "là": ["la"], "unes": ["yn"], "ont": ["ɔ̃"], "avoir": ["a.vwaʁ"], "pluriel": ["ply.ʁjɛl"], "marché": ["maʁ.ʃe"], "catalan": ["ka.ta.lɑ̃"], "breton": ["bʁə.tɔ̃"], "utiliser": ["y.ti.li.ze"], "en": ["ɑ̃", "en"], "mandarin": ["mɑ̃.da.ʁɛ̃"], "relatif": ["ʁə.la.tif"], "pays": ["pe.i", "pɛ.i"], "mois": ["mwa"], "synonyme": ["si.nɔ.nim"], "latin": ["la.tɛ̃"], "eau": ["o"], "but": ["byt", "by"], "elle": ["ɛl"], "traduire": ["tʁa.dɥiʁ"], "espéranto": ["ɛs.pe.ʁɑ̃.to"], "éclairci": ["e.klɛʁ.si"], "pas": ["pa", "pɑ"], "quintal": ["kɛ̃.tal"], "nous": ["nu"], "finir": ["fi.niʁ"], "bienvenue": ["bjɛ̃.və.ny"], "éclaircie": ["e.klɛʁ.si"], "auparavant": ["o.pa.ʁa.vɑ̃"], "néanmoins": ["ne.ɑ̃.mwɛ̃"], "réseau": ["ʁe.zo"], "logiciel": ["lɔ.ʒi.sjɛl"], "voiture": ["vwa.tyʁ"], "enfant": ["ɑ̃.fɑ̃"], "dix": ["dis", "di", "diz"], "vingt": ["vɛ̃", "vɛ̃t"], "trente": ["tʁɑ̃t"], "quinze": ["kɛ̃z"], "blanc": ["blɑ̃"], "rouge": ["ʁuʒ"], "jaune": ["ʒon", "ʒɔn"], "melk": ["mɛlk"], "hongrois": ["ɔ̃.ɡʁwa", "*ɔ̃.ɡʁwa", "*ɔ̃ɡ.ʁwa"], "hongrie": ["*ɔ̃.ɡʁi"], "cinq": ["sɛ̃k"], "cinq minutes": ["sɛ̃ mi.nyt"], "cinq cents": ["sɛ̃.sɑ̃"], "cinq mille": ["sɛ̃.mil", "sɛ̃k.mil"], "cinq mètres": ["sɛ̃.mɛtʁ", "sɛ̃k.mɛtʁ", "k", "sɛ̃.k‿ɑ̃"], "lui": ["lɥi", "lu.i", "lwi"], "cardinal": ["kaʁ.di.nal"], "ordinal": ["ɔʁ.di.nal"], "premier": ["pʁə.mje"], "lentement": ["lɑ̃t.mɑ̃", "lɑ̃.tə.mɑ̃"], "voire": ["vwaʁ"], "dorénavant": ["dɔ.ʁe.na.vɑ̃"], "dopage": ["dɔ.paʒ"], "malveillant": ["mal.vɛ.jɑ̃"], "pareil": ["pa.ʁɛj"], "fatwa": ["fa.twa"], "gestion": ["ʒɛs.tjɔ̃"], "discipline": ["di.si.plin"], "énoncer": ["e.nɔ̃.se"], "fournir": ["fuʁ.niʁ"], "apprivoiser": ["a.pʁi.vwa.ze"], "domestiquer": ["dɔ.mɛs.ti.ke"], "rendre": ["ʁɑ̃dʁ"], "échange": ["e.ʃɑ̃ʒ"], "extérieur": ["ɛk.stɛ.ʁjœʁ"], "au-delà": ["o.də.la"], "seuil": ["sœj"], "maison": ["me.zɔ̃", "mɛ.zɔ̃"], "grand": ["ɡʁɑ̃"], "chatteries": ["ʃat.ʁi"], "chaton": ["ʃa.tɔ̃"], "ronronner": ["ʁɔ̃.ʁɔ.ne"], "foyer": ["fwa.je"], "feu": ["fø"], "déploiement": ["de.plwa.mɑ̃"], "acronyme": ["a.kʁɔ.nim"], "sigle": ["siɡl"], "programmation": ["pʁɔ.ɡʁa.ma.sjɔ̃"], "contrepartie": ["kɔ̃.tʁə.paʁ.ti"], "opérateur": ["ɔ.pe.ʁa.tœʁ"], "étendu": ["e.tɑ̃.dy"], "stocker": ["stɔ.ke"], "alentour": ["a.lɑ̃.tuʁ"]
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment