Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finalizada historia de ocorrencias #48

Merged
merged 1 commit into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions conecta-cesar/app_cc/templates/app_cc/aluno/vocorrencias.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
<div>
<h1 class="text-center white-color">Ocorrências</h1>
<section class="caixa_de_ocorrencias white-color">
{% for review in reviews %}
{% if review.aluno.usuario == request.user %}
{% if user_reviews %}
{% for review in user_reviews %}
<div class="item_de_ocorrencia">
<h2>{{ review.title }}</h2>
<h4>{{ review.content }}</h4>
<p class="date">{{ review.data_ocorrencia }}</p>
</div>
{% endif %}
{% endfor %}
{% endfor %}
{% else %}
<p class="vazio">Não tem nenhuma ocorrência.</p>
{% endif %}
</section>
</div>
{% endblock %}
5 changes: 2 additions & 3 deletions conecta-cesar/app_cc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,8 @@ def delete_todo_item(request, item_id):

@has_role_or_redirect(Aluno)
def vocorrencias(request):
reviews = Review.objects.all()
print(reviews)
return render(request, 'app_cc/aluno/vocorrencias.html', {'reviews': reviews})
user_reviews = Review.objects.filter(aluno__usuario=request.user)
return render(request, 'app_cc/aluno/vocorrencias.html', {'user_reviews': user_reviews})
@has_role_or_redirect(Professor)
def ocorrenciasp(request):
alunos = AlunoModel.objects.all() # Recupera todos os alunos cadastrados
Expand Down
Binary file modified conecta-cesar/db.sqlite3
Binary file not shown.
10 changes: 9 additions & 1 deletion conecta-cesar/static/css/vocorrencias.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@
color: #777;
font-size: 0.9em;
margin: 10px 0;
}
}
.vazio{
background-color: #ff0000;
color:black !important;
padding:8px;
margin-left: 25%;
margin-right: 25%;
border-radius: 5px;
}
Loading