Commit c604cb72 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

Ajout titre, version auto, liens code source et commits

parent fd117c24
......@@ -16,4 +16,8 @@ class Entree:
motcond: str
transcond: str
result: list
nb: int
\ No newline at end of file
nb: int
class commitData:
update: str
listCommits: str
\ No newline at end of file
from django.shortcuts import render, HttpResponseRedirect
from static.scripts import textPhonographer as txtphono
from .models import Phonograph, Data, Entree
from .models import Phonograph, Data, Entree, commitData
import spacy
import os
import subprocess
nlp = spacy.load('fr')
def redirApp(request):
......@@ -13,8 +13,8 @@ def main(request):
text = request.POST['inText']
nlpText = nlp(text)
data = Data()
data.update = os.system('git log -1 --format=%cd')
data.text = text
data.update = updateTime()
data.pphh = []
for token in nlpText:
......@@ -33,15 +33,19 @@ def main(request):
data = Data()
data.text = ''
data.pphh = []
data.update = os.system('git log -1 --format=%cd')
data.update = updateTime()
return render(request, 'coloriseur.html', {'data': data})
def updateTime():
upd = str(subprocess.check_output(["git", "log", "-1", "--format=%cd", "--date=short"]))
ver = str(subprocess.check_output(["git", "rev-list", "--all", "--count"]))
return 'Version 1.'+ver[2:-3]+' ('+upd[2:-3]+')'
def main0(request):
data = Data()
data.text = ''
data.pphh = []
data.update = os.system('git log -1 --format=%cd')
data.update = updateTime()
return render(request, 'coloriseur.html', {'data': data})
......@@ -80,3 +84,8 @@ def editEntry(request):
return render(request, 'editDico.html', {'data': data})
""" def commits(request):
data = commitData()
data.update = updateTime()
data.listCommits = subprocess.check_output(["git", "log", "--pretty=full"]).decode()
return render(request, 'commits.html', {'data': data}) """
\ No newline at end of file
......@@ -102,7 +102,7 @@ def decoupage(mot,trans):
# Association phonème→graphème
# Boucle sur la chaîne de phonèmes à partir du dernier
while trans != '':
print(mot,trans) # décommenter pour afficher le détails dans le terminal
#print(mot,trans) # décommenter pour afficher le détails dans le terminal
# Traitement des caractères phonèmes à prendre par deux
if trans[-1] == '̃' or trans[-2:] in xListe:
......
......@@ -108,3 +108,9 @@ textarea {
.editButton {
display: inline;
}
.footer {
margin-top: 20px;
font-style: italic;
font-size: 1em;
}
\ No newline at end of file
......@@ -8,7 +8,10 @@
<link rel="stylesheet" type="text/css" href="{% static 'styles/kinephones_style.css'%}">
</head>
<body>
<div>
<h1>Coloriseur phonographémique</h1>
</div>
<div class="inputDiv">
<form action="/app/" method="post">{% csrf_token %}
......@@ -34,5 +37,11 @@
</form>
</div>
<footer>
<div class="footer">S.Coulange, {{data.update}} |
<a href="https://gricad-gitlab.univ-grenoble-alpes.fr/pedagogies-multimodales/wikicolor">Code source</a>
- <a href="https://gricad-gitlab.univ-grenoble-alpes.fr/pedagogies-multimodales/wikicolor/commits/master">Journal des modifications</a>
</div>
</footer>
</body>
</html>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html>
<head>
<title>Coloriseur phonographémique</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="{% static 'styles/styles.css'%}">
<link rel="stylesheet" type="text/css" href="{% static 'styles/kinephones_style.css'%}">
</head>
<body>
<div>
<h1>Coloriseur phonographémique</h1>
<h2>Journal des modifications</h2>
</div>
<div>
<form action="/app/" method="POST">{% csrf_token %}
<button formaction="/app/">Retour au coloriseur</button>
</form>
</div>
<div>
{{ data.listCommits }}
</div>
<footer>
<div class="footer">S.Coulange, {{data.update}} |
<a href="https://gricad-gitlab.univ-grenoble-alpes.fr/pedagogies-multimodales/wikicolor">Code source</a>
- <a href="/app/commits">Journal des modifications</a>
</div>
</footer>
</body>
</html>
\ 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