Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
adega
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
64
Issues
64
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
adega
adega
Commits
63b8dd70
Commit
63b8dd70
authored
Mar 22, 2019
by
bhmeyer
Committed by
msrr18
Mar 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Criar visualizator"
parent
bb0da3cf
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
794 additions
and
36 deletions
+794
-36
makefile
makefile
+9
-10
src/adega/static/adega/css/styles.css
src/adega/static/adega/css/styles.css
+174
-4
src/adega/templatetags/adega_templatetag.py
src/adega/templatetags/adega_templatetag.py
+9
-1
src/public/templates/public/base.html
src/public/templates/public/base.html
+17
-17
src/student/grid.py
src/student/grid.py
+499
-0
src/student/templates/student/detail.html
src/student/templates/student/detail.html
+61
-0
src/student/views.py
src/student/views.py
+9
-2
src/submission/analysis/utils/situations.py
src/submission/analysis/utils/situations.py
+16
-2
No files found.
makefile
View file @
63b8dd70
...
...
@@ -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,''
)
"
...
...
src/adega/static/adega/css/styles.css
View file @
63b8dd70
...
...
@@ -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
;
}
src/adega/templatetags/adega_templatetag.py
View file @
63b8dd70
...
...
@@ -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
src/public/templates/public/base.html
View file @
63b8dd70
...
...
@@ -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
src/student/grid.py
0 → 100644
View file @
63b8dd70
This diff is collapsed.
Click to expand it.
src/student/templates/student/detail.html
View file @
63b8dd70
...
...
@@ -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"
>
...
...
src/student/views.py
View file @
63b8dd70
...
...
@@ -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'
,
{
...
...
src/submission/analysis/utils/situations.py
View file @
63b8dd70
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment