Skip to content

Commit

Permalink
textArea no InserePub, retira "fix" no thead, ativa logout.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajnus committed Nov 25, 2023
1 parent af79948 commit 208d3f5
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,28 @@ back/TheForum/TheForum/__pycache__/settings.cpython-311.pyc
back/TheForum/TheForum/__pycache__/urls.cpython-311.pyc
back/TheForum/TheForum/__pycache__/wsgi.cpython-311.pyc
back/TheForum/db.sqlite3
back/TheForum/accounts/__pycache__/__init__.cpython-311.pyc
back/TheForum/accounts/__pycache__/admin.cpython-311.pyc
back/TheForum/accounts/__pycache__/apps.cpython-311.pyc
back/TheForum/accounts/__pycache__/models.cpython-311.pyc
back/TheForum/accounts/__pycache__/serializers.cpython-311.pyc
back/TheForum/accounts/__pycache__/urls.cpython-311.pyc
back/TheForum/accounts/__pycache__/views.cpython-311.pyc
back/TheForum/accounts/migrations/__pycache__/__init__.cpython-311.pyc
back/TheForum/forum/__pycache__/__init__.cpython-311.pyc
back/TheForum/forum/__pycache__/admin.cpython-311.pyc
back/TheForum/forum/__pycache__/apps.cpython-311.pyc
back/TheForum/forum/__pycache__/models.cpython-311.pyc
back/TheForum/forum/__pycache__/serializers.cpython-311.pyc
back/TheForum/forum/__pycache__/urls.cpython-311.pyc
back/TheForum/forum/__pycache__/views.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/__init__.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/0001_initial.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/0002_auto_20231111_1456.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/0003_remove_comentario_data_publicacao.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/0004_alter_comentario_autor.cpython-311.pyc
back/TheForum/forum/migrations/__pycache__/0005_auto_20231112_1830.cpython-311.pyc
back/TheForum/TheForum/__pycache__/__init__.cpython-311.pyc
back/TheForum/TheForum/__pycache__/settings.cpython-311.pyc
back/TheForum/TheForum/__pycache__/urls.cpython-311.pyc
back/TheForum/TheForum/__pycache__/wsgi.cpython-311.pyc
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 style="color: #00FF41;"> The Forum </h1>
<!--h1 style="color: white;">Publicações:</h1-->
<form action="" method="get">
<table border="1" style="color: white;">
<thead table-layout:fixed>
<thead>
<tr>
<td>Publicação</td>
<td>Texto</td>
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/inserePub.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ <h1 style="color: white;">Inserir Publicação</h1>
<td><input type="text" name="titulo" id="titulo"></td>
</tr>
<tr>
<td style="color: white;" align="right">Text:</td>
<td><input type="text" name="texto" id="texto"></td>
<td style="color: white;" align="right">Texto:</td>
<td><textarea type="text" name="texto" id="texto" rows="5" cols="33" style="padding-top: 10px;"></textarea></td>
</tr>
</tbody>
</table>
Expand Down
26 changes: 26 additions & 0 deletions frontend/public/javascript/logout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"use strict";
onload = (evento) => {
document.getElementById('logout').addEventListener('click', (evento) => {
console.log("Clickei!");
const token = localStorage.getItem('token');
fetch(backendAddress + 'accounts/token-auth/', {
method: 'DELETE',
headers: {
'Authorization': 'Token ' + token,
'Content-Type': 'application/json'
}
})
.then(response => {
const mensagem = document.getElementById('mensagem');
if (response.ok) {
window.location.assign('/');
}
else {
mensagem.innerHTML = 'Erro ' + response.status;
}
})
.catch(erro => {
console.log(erro);
});
});
};

0 comments on commit 208d3f5

Please sign in to comment.