Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

Commit b8cde81

Browse files
committed
(close #24) Terminar la vista de los responsables
Ahora los responsables de aula pueden ver los becarios que están en su centro, junto con información para contactarlos.
1 parent 83da813 commit b8cde81

File tree

4 files changed

+41
-14
lines changed

4 files changed

+41
-14
lines changed

gespai/context_processors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
def context_processor(request):
66
return {
77
'is_osl': request.user.groups.filter(name='osl').exists(),
8-
'is_alu': request.user.groups.filter(name='alu').exists()
8+
'is_alu': request.user.groups.filter(name='alumnado').exists(),
9+
'is_responsable': request.user.groups.filter(name='responsableaula').exists(),
910
}

gespai/templates/gespai/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,24 @@ <h4>Área Personal</h4>
8686
</div>
8787
</div>
8888
{% endif %}
89+
{% if is_responsable %}
90+
<div class="col-xs-12 col-sm-6">
91+
<div class="panel panel-default">
92+
<div class="panel-body">
93+
<div class="row">
94+
<div class="col-md-2 align-center">
95+
<i class="fa fa-users fa-5x"></i>
96+
</div>
97+
<div class="col-md-10">
98+
<h4>Área para responsables de aula</h4>
99+
<p>Revisa la información de los becarios de tu centro.</p>
100+
<a class="btn btn-primary btn-sm" href="{% url 'responsables:index' %}"><i class="fa fa-angle-double-right"></i> Acceder</a>
101+
</div>
102+
</div>
103+
</div>
104+
</div>
105+
</div>
106+
{% endif %}
89107
</div>
90108

91109
<div class="row">

responsables/templates/responsables/becarios.html

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
{% extends "gespai/base.html" %} {% block content %}
2-
<div class="container-fluid">
2+
<div class="container">
33
<div class="content-section">
4-
<h1 class="page-header">Cambios Pendientes</h1>
4+
<h1 class="page-header">Becarios para {{ emplazamiento }}</h1>
55
{% if becarios %}
6-
<div class="table-responsive">
7-
<table class="table table-striped table-hover">
8-
<tr>
9-
<th>Becario</th>
10-
</tr>
11-
{% for becario in becarios %}
12-
<td>{{ becario }}</td>
13-
{% endfor %}
14-
</table>
15-
</div>
16-
{% else %}
6+
{% for becario in becarios %}
7+
<div class="panel panel-primary">
8+
<div class="panel-body">
9+
<div class="row">
10+
<div class="col-md-1 align-center">
11+
<i class="fa fa-user fa-5x"></i>
12+
</div> <!-- col-2 -->
13+
<div class="col-md-11">
14+
<b>Nombre:</b> {{ becario }}<br>
15+
<b>Teléfono:</b> {{ becario.telefono }}<br>
16+
<b>Correo:</b> {{ becario.email }}<br>
17+
<b>Turno:</b> {{ becario.plaza_asignada.get_horario_display }}<br>
18+
</div> <!-- .col-10 -->
19+
</div> <!-- .alert .alert-primary .alert-block -->
20+
</div> <!-- .alert .alert-primary .alert-block -->
21+
</div> <!-- .row-->
22+
{% endfor %}
23+
{% else %}
1724
<div class="alert alert-danger">No hay becarios asignados a su centro o su cuenta de usuario está mal configurada..</div>
1825
{% endif %}
1926
</div>

responsables/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def get_context_data(self, *args, **kwargs):
1515
context = super(BecariosView, self).get_context_data(**kwargs)
1616
correo = self.request.user.username + "@ull.edu.es"
1717
emplazamiento_responsable = models.ResponsableAula.objects.get(email=correo).emplazamiento
18+
context["emplazamiento"] = emplazamiento_responsable
1819
plazas = models.Plaza.objects.filter(emplazamiento=emplazamiento_responsable)
1920
becarios = models.Becario.objects.filter(plaza_asignada__in=plazas)
2021
context["becarios"] = becarios

0 commit comments

Comments
 (0)