Compare commits

..

3 Commits

Author SHA1 Message Date
ef3c1f4bfe Fixed deploys 2021-11-27 13:28:39 +01:00
Marce Coll
f04bb3f69b Merge branch 'main' of ssh://git.lajuntament.space:2222/lajuntament/absencia-de-presencia 2021-11-27 13:26:01 +01:00
Marce Coll
139e11b5fc Some style, fixed JS 2021-11-27 13:25:20 +01:00
5 changed files with 54 additions and 6 deletions

View File

@@ -7,8 +7,8 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py .
COPY static .
COPY templates .
COPY static static
COPY templates templates
COPY deploy/presencia.ini .
CMD ["uwsgi", "--ini", "presencia.ini"]

View File

@@ -6,5 +6,5 @@ gid = www-data
chdir = /app/
processes = 4
threads = 2
socket = 0.0.0.0:5000
http = 0.0.0.0:5000
wsgi-disable-file-wrapper = false

View File

@@ -16,4 +16,23 @@ r(() => {
const resultat = await response.text();
g('response').innerHTML = resultat;
});
const afegirPart = (t) => {
const frase = g('frase');
let conector = ' de ';
if (frase.value === '') {
conector = 'la ';
}
g('frase').value = g('frase').value + conector + t;
}
g('absencia').addEventListener('click', () => {
afegirPart('absencia')
});
g('presencia').addEventListener('click', () => {
afegirPart('presencia')
});
})

23
static/style.css Normal file
View File

@@ -0,0 +1,23 @@
button {
padding: 30px;
font-size: 14px;
}
#frase {
width: 800px;
height: 300px;
text-align: center;
font-size: 17px;
}
#container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
#buttons {
padding: 50px;
}

View File

@@ -2,11 +2,17 @@
<head>
<title>Absencia de Presencia</title>
<script src="/static/index.js"></script>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
<div>
<input type="text" id="frase"/>
<input type="button" id="submit"/>
<div id="container">
<textarea id="frase"></textarea>
<div id="buttons">
<button id="absencia">Absencia</button>
<button id="presencia">Presencia</button>
<button id="submit">Calcula</button>
</div>
</div>
<p id="response"></p>