Skip to content

Commit

Permalink
Update views and stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
g-otn committed May 24, 2019
1 parent 0a8cd9e commit c8835ea
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 6 deletions.
4 changes: 2 additions & 2 deletions public/scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function realizarlogin() {

// Configura callbacks e realiza a requisição
req.onload = () => verificarLogin(req.response)
req.onerror = () => mostrarErroDeLogin('A conexão com o servidor falhou')
req.onerror = () => mostrarErroDeLogin('A conexão com o servidor foi perdida')
req.open('POST', '/')
req.setRequestHeader('Content-type', 'application/json')
req.send(JSON.stringify({ usuario: usuario, senha: senha }))
Expand All @@ -50,7 +50,7 @@ function verificarLogin(resposta) {
document.title = 'Fatec Pretty Siga'
document.body.style.cursor = 'default'

mostrarAba('abaPerfil')
mostrarAba('abaNotasParciais')
}
}

Expand Down
27 changes: 27 additions & 0 deletions public/styles/abas/notas.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#abaNotasParciais {
text-align: center;
}

#abaNotasParciais .disciplina {
background-color: #a52a25;
color: lightgrey;
border-radius: 10px;
border: 1px dashed purple;
display: inline-block;
width: 30%;
min-width: 300px;
margin: 0 10px 20px;
vertical-align: top;
}

#abaNotasParciais .disciplina p {
margin-top: 0;
}

#abaNotasParciais .disciplina .sigla {
color: grey;
}

#abaNotasParciais pre {
text-align: left;
}
2 changes: 1 addition & 1 deletion public/styles/abas/perfil.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
}

.perfilDadosTabela tr:nth-child(2n) {
background-color: #a7403d15;
background-color: #a7403d2a;
}

.perfilDadosTabela tr:nth-child(2n) {
Expand Down
6 changes: 4 additions & 2 deletions routes/auth.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
var express = require('express')
var app = module.exports = express()
//var siga = require('../util/siga') // Padrão
var siga = require('../tests/mockSiga') // Para teste
var siga = require('../util/siga') // Padrão
//var siga = require('../tests/mockSiga') // Para teste

// Autenticação e envio de dados do aluno
app.post('/', (req, res) => {
siga.login(req.body.usuario, req.body.senha)
.then(dadosAluno => {
console.log(dadosAluno)
if (dadosAluno.erro !== undefined)
res.send(dadosAluno)
else
res.render('main', dadosAluno, (erro, html) => {
console.log(erro)
if (erro)
res.send({ erro: 'Ocorreu um erro no servidor e não foi possível gerar sua página de aluno' })
else
Expand Down
11 changes: 10 additions & 1 deletion views/abas/notas.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<h2><%= (notasParciais[0].discipline.periodId + 1) %>º Período</h2>
<% notasParciais.forEach(e => { %>
<div class="disciplina">
<h4><%= e.discipline.name %></h4>
<p>
<span class="sigla"><%= e.discipline.code %></span>
</p>
</div>
<% }) %>
<pre>
<%= JSON.stringify(notasParciais, null, ' ') %>
<%= JSON.stringify(notasParciais, null, ' ') %>
</pre>

0 comments on commit c8835ea

Please sign in to comment.