Commit 63b8dd70 authored by bhmeyer's avatar bhmeyer Committed by msrr18

Resolve "Criar visualizator"

parent bb0da3cf
......@@ -3,6 +3,14 @@ SITE-OWNER-GROUP = www-data
all:
# The follows commands permit to use manage.py and
# docker-compose up with make. Examples:
# make docker-manage migrate
# make docker-manage makemigrations uploads
# make docker-up --build
%:
@:
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
clean:
@rm -rf *~ *.pyc *.backup
......@@ -47,7 +55,7 @@ docker-production:
docker-compose --project-directory . -f docker_scripts/docker-production.yml -p adega up
docker-remove-all:
docker rm adega_web adega_db_1
docker rm adega_web adega_db
docker rmi adega_web
......@@ -57,15 +65,6 @@ docker-install:
apt-get install docker-compose
# The follows commands permit to use manage.py with make. Examples:
# make docker-manage migrate
# make docker-manage makemigrations uploads
%:
@:
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
docker-manage:
@echo $(call args,"")
docker exec -it adega_web bash -c "cd src; python3 manage.py $(call args,'')"
......
......@@ -92,9 +92,12 @@ footer h3 {
background-color: #132940;
}
.sidebar > li > .dropdown-menu { background-color:#1a2c3f; }
.sidebar > li > a { background-color:#1a2c3f; }
.sidebar > li > button { background-color:#1a2c3f; }
.sidebar > li > .dropdown-menu { background-color:#1a2c3f;
}
.sidebar > li > a { background-color:#1a2c3f;
}
.sidebar > li > button { background-color:#1a2c3f;
}
.sidebar ul {
list-style:none;
......@@ -181,4 +184,171 @@ footer h3 {
margin-left:10px;
margin-right:10px;
cursor: pointer;
}
\ No newline at end of file
}
/* =========================== PAINEIS ============= */
/* =============================================== PANEL */
.panel-container {
display: -webkit-flex;
display: flex;
justify-content: space-between;
}
.data-panel {
padding: 10px 10px 20px;
margin: 10px;
border-bottom: 2px solid #3c3c3c;
font-size: 1.3em;
flex: 1;
box-shadow: 0 0 1px #DDD;
}
span.data {
margin: 0 1.5em;
}
.panel-line {
display: flex;
}
.data-panel .data-panel {
margin: 2px;
font-size: 1em;
border-bottom: 1px solid #3c3c3c;
box-shadow: none;
}
/* =================================================== GRADE */
/* ============================================== GRADE */
.grade {
/* width: 100%; */
display: flex;
overflow-x: auto;
overflow-y: hidden;
}
.grade-head {
padding: 5px;
text-align: center;
font-weight: bold; }
.grade .code,
.grade .name {
display: block; }
/* ============================================== MATERIA */
.materia {
background-color: #FFF;
padding: 6px 6px 0px;
margin: 1px 1px 2px;
font-size: small;
border-bottom: 4px solid white; }
.materia.approved {
border-color: #6B8E23;
}
.materia.equivalence {
border-color: rgb(138, 64, 207);
}
.materia.failed {
border-color: #B22222;
}
.materia.cancelled {
border-color: #FFD700;
}
.materia.registered {
border-color: #ADD8E6;
}
.materia .info {
margin: 2px;
text-align: center;
}
.materia .details {
margin: 2px;
text-align: center;
}
.materia .code {
display: none; }
.materia .cursadas {
display: none; }
.materia .detail-name {
font-variant: small-caps; }
.materia .details {
border-top: 1px solid #F4F4F4;
padding-top: 4px;
margin-top: 3px;
display: flex;
height: 4em;
}
.materia .code {
color: #444; }
.materia .detail-name {
font-size: x-small; }
.materia .detail {
padding: 0 3px; }
.materia .detail span {
display: block;
width: 100%;
text-align: center; }
#materias-atuais {
display: flex;
background-color: #EEE; }
#materias-atuais .materia {
min-width: 170px; }
/* ============================================== SEMESTRE */
.semestre {
min-width: 100px;
/* max-width: 250px; */
margin: 1px;
background-color: #EEE;
display: flex;
flex-direction: column;
align-content: flex-start;
align-items: stretch; }
/* ============================================== HISTORICO */
#desenvolvimento {
overflow-x: auto;
overflow-y: hidden;
display: flex; }
#desenvolvimento .desc {
padding: 6px 8px; }
#desenvolvimento .res {
padding: 6px 8px;
display: absolute;
bottom: 0; }
.desc .periodo {
display: block;
text-align: center;
font-weight: bold;
font-size: 1.2em;
margin: 10px; }
......@@ -4,4 +4,12 @@ register = template.Library()
@register.filter
def to_percent(value):
return "{:.2f}".format(float(value)*100) + "%"
\ No newline at end of file
return "{:.2f}".format(float(value)*100) + "%"
@register.filter
def fix_2digit(value):
return "{:.2f}".format(float(value))
@register.filter
def remove_spaces(value):
return value.replace(' ', '')
\ No newline at end of file
......@@ -39,24 +39,24 @@
{% endblock content %}
</section>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<h3>Links</h3>
<ul>
<li><a href="http://pet.inf.ufpr.br/projetos/adega.html">Página oficial do projeto</a></li>
<li><a href="http://gitlab.c3sl.ufpr.br/pet/adega">Código fonte</a></li>
<li><a href="#">Desenvolvedores</a></li>
</ul>
</div>
<div class="col-md-4 offset-md-4">
<h3>Mantido por</h3>
<a href="http://pet.inf.ufpr.br">
<img src="/static/pet/logo_preto.png" width="75%">
</a>
<div class="container container-fluid">
<div class="row">
<div class="col-md-4">
<h3>Links</h3>
<ul>
<li><a href="http://pet.inf.ufpr.br/doku.php?id=adega">Página oficial do projeto</a></li>
<li><a href="https://gitlab.c3sl.ufpr.br/adega/adega">Código fonte</a></li>
<!-- <li><a href="#">Desenvolvedores</a></li> -->
</ul>
</div>
<div class="col-md-4 offset-md-4">
<h3>Mantido por</h3>
<a href="http://pet.inf.ufpr.br">
<img src="{% static 'pet/logo_pet_h_branco.png' %}" width="50%">
</a>
</div>
</div>
</div>
</div>
</footer>
</footer>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -15,10 +15,70 @@
<div class="nav nav-tabs" role="tablist">
<a class="nav-item nav-link active" href="#resumo" aria-controls="resumo" data-toggle="tab">Resumo</a>
<a class="nav-item nav-link" href="#disciplinas" aria-controls="disciplinas" data-toggle="tab">Lista de Disciplinas</a>
<a class="nav-item nav-link" href="#grid" aria-controls="grid" data-toggle="tab">Grade</a>
</div>
</div>
<div class="tab-content">
<!-- TODO: Add dynamic grid for each degree -->
<div role="tabpanel" class="tab-pane" id="grid">
<br>
<div class="grade">
{% for semester in analysis_result.grid%}
<div class="semestre">
<div class="grade-head">{{forloop.counter}}º</div>
{% for course in semester %}
<div data-toggle="tooltip" data-placement="top" title="{{course.name}}" class="materia {{ course.situation}}">
<div class="info">
{% if course.is_real_code %}
<span class="name">
<a href="{% url 'course:detail' submission_id=submission.id codigo_disciplina=course.code|remove_spaces %}">
{{ course.code }}</a>
</span>
{% else %}
<span class="name">{{ course.code }}</span>
{% endif %}
</div>
<div class="details">
{% if course.detail %}
<div class="detail">
<span class="detail-name">Matrículas</span>
<span class="detail-value">{{course.detail.count}}</span>
</div>
<div class="detail">
<span class="detail-name">Nota média</span>
<span class="detail-value">{{course.detail.mean_grade|fix_2digit}}</span>
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
<br>
<div class="grade">
{% for course in analysis_result.grid_extra %}
<div class="semestre">
<div class="info semestre">
<div class="materia">
{{course.code}} - {{course.name}}
<br>
<b>Necessário: {{course.necessary}}</b>
</div>
<div class="materia"> Nota média: {{course.grade|fix_2digit}}</div>
<div class="materia approved">Aprovações <br> {{course.approves}}</div>
<div class="materia equivalence">Equivalências <br> {{course.equivalences}}</div>
<div class="materia registered">Matrículas (semestre atual) <br> {{course.registered}}</div>
<div class="materia failed"> Reprovações <br> {{course.fails}}</div>
<div class="materia cancelled"> Cancelamentos <br> {{course.cancelled}}</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div role="tabpanel" class="tab-pane active" id="resumo">
<table class="table">
<tr>
......@@ -71,6 +131,7 @@
</table>
</div>
<br>
<br>
<div role="tabpanel" class="tab-pane" id="disciplinas">
......
......@@ -11,6 +11,8 @@ import json
from submission.models import Submission
from guardian.decorators import permission_required_or_403
from student.grid import DegreeGrid
@permission_required_or_403('view_student', (Submission, 'id', 'submission_id'))
def detail(request, submission_id, grr):
submission_id = int(submission_id)
......@@ -25,7 +27,10 @@ def detail(request, submission_id, grr):
submission_id
)
hist = cache_j["aluno_turmas"]
dg = DegreeGrid(DegreeGrid.bcc_grid_2011)
grid_info, grid_info_extra = dg.get_situation(hist)
analysis_result = {
'indice_aprovacao' : cache_j['taxa_aprovacao'],
'periodo_real': cache_j['periodo_real'],
......@@ -35,7 +40,9 @@ def detail(request, submission_id, grr):
'posicao_turmaIngresso_semestral': json.dumps(cache_j['posicao_turmaIngresso_semestral']),
'ira_por_quantidade_disciplinas': json.dumps(cache_j['ira_por_quantidade_disciplinas']),
'student': cache_j['student'],
'aluno_turmas': cache_j["aluno_turmas"],
'aluno_turmas': hist,
'grid': grid_info,
'grid_extra': grid_info_extra
}
return render(request, 'student/detail.html', {
......
......@@ -73,9 +73,9 @@ class EvasionForm:
return ""
@staticmethod
def str_to_code(str):
def str_to_code(name):
for ef in EvasionForm.EVASION_FORM:
if(ef[1] == str):
if(ef[1] == name):
return ef[0]
return -1
......@@ -195,3 +195,17 @@ class Situation:
SIT_TRANCAMENTO_ADMINISTRATIVO,
SIT_CANCELADO
)
@staticmethod
def code_to_str(code):
for sit in Situation.SITUATIONS:
if(sit[0] == code):
return sit[1].replace("'","").replace("\"","")
return ""
@staticmethod
def str_to_code(name):
for sit in Situation.SITUATIONS:
if(sit[1] == name):
return sit[0]
return -1
Markdown is supported
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