Commit 2e862399 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

Amélioration player Home

parent cf8d9617
......@@ -27,6 +27,14 @@ DEBUG = True
ALLOWED_HOSTS = ['phonographe.alem-app.fr','127.0.0.1','phonographe-preprod.alem-app.fr']
CORS_ORIGIN_ALLOW_ALL = False
CORS_ALLOWED_ORIGINS = [
"http://127.0.0.1:8000"
]
CSRF_TRUSTED_ORIGINS = [
"http://127.0.0.1:8000"
]
# Application definition
......@@ -37,12 +45,14 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'corsheaders',
'clavier'
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
......
No preview for this file type
......@@ -44,23 +44,44 @@ jQuery.each(allseries, function(i, val) {
newSerie.classList = "serie";
pageSerie.appendChild(newSerie);
// HEADER
serieHeader = document.createElement('div');
serieHeader.classList = "serieHeader";
newSerie.appendChild(serieHeader);
serieBody = document.createElement('div');
serieBody.classList = "serieBody";
newSerie.appendChild(serieBody);
// // nom de la série
ti = document.createElement('div');
ti.classList = "serieTi";
ti.innerHTML = val["nom"];
serieHeader.appendChild(ti);
// // description
descr = document.createElement('div');
descr.classList = "serieDescr";
descr.innerHTML = val["description"];
serieHeader.appendChild(descr);
// // ligne auteur et nombre de mots
infoPlus = document.createElement('div');
infoPlus.classList = "serieHeaderInfoPlus";
serieHeader.appendChild(infoPlus);
// // // auteur
aut = document.createElement('div');
aut.classList = "serieDe";
aut.innerHTML = val["auteur"];
infoPlus.appendChild(aut);
// // // nombre de mots
de = document.createElement('div');
de.classList = "serieDe";
de.innerHTML = "(" + val["mots"].length + " mots)";
serieHeader.appendChild(de);
infoPlus.appendChild(de);
// BODY
serieBody = document.createElement('div');
serieBody.classList = "serieBody";
newSerie.appendChild(serieBody);
li = document.createElement('div');
li.classList = "serieLi";
......@@ -74,4 +95,30 @@ jQuery.each(allseries, function(i, val) {
});
\ No newline at end of file
});
async function getColorisation() {
// ON EMBALLE TOUT ÇA
var colis = {
inText: "en",
lang: "fr"
}
console.log('Envoi colis:',colis);
// Paramètres d'envoi
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(colis)
};
// ENVOI
const response = await fetch('http://wikicolor.alem-app.fr/colorize/', options);
console.log('En attente de réponse...');
const data = await response.json();
console.log(data);
}
\ No newline at end of file
......@@ -23,8 +23,8 @@
}
.serie {
width: 250px;
height: 250px;
width: 310px;
height: 350px;
margin: 10px;
background-color: lightcoral;
border: solid 1px black;
......@@ -33,16 +33,30 @@
overflow: hidden;
}
.serie:hover {
border: solid 4px black;
border: solid 3px black;
}
.serieHeader {
position: relative;
height: 100px;
display: -ms-flexbox; /* IE10 */
display: flex;
-ms-flex-wrap: wrap; /* IE10 */
flex-wrap: wrap;
flex-direction: column;
justify-content: space-between;
height: 150px;
padding: 5px 3px;
background-color: lightslategray;
background-color: rgb(148, 159, 170);
margin: auto;
overflow: auto;
}
.serieHeaderInfoPlus {
display: -ms-flexbox; /* IE10 */
display: flex;
-ms-flex-wrap: wrap; /* IE10 */
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
}
.serieTi {
font-size: 1.2em;
font-weight: bold;
......@@ -57,7 +71,7 @@
}
.serieBody {
position: relative;
height: 150px;
height: 210px;
padding: 5px 3px;
background-color: cornsilk;
margin: auto;
......
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