Competences+Heures

This commit is contained in:
alazo 2017-05-04 17:16:04 +02:00
parent 12ce9c7900
commit 29270557fe
6 changed files with 76 additions and 24 deletions

View file

@ -59,11 +59,11 @@ class HomePDFView(TemplateView):
['' , Preformatted(p[1].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M03' , '' , '' ], ['' , Preformatted(p[1].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M03' , '' , '' ],
['' , '' , '' , 'M04' ,'' , '' , '' , '' ], ['' , '' , '' , 'M04' ,'' , '' , '' , '' ],
[Preformatted(d[1].__str__(), style_normal, maxLineLength=40), Preformatted(p[2].__str__(), style_normal, maxLineLength=60) , 'M05' , '' ,'M06' , '' , '' , '' ], [Preformatted(d[1].__str__(), style_normal, maxLineLength=40), Preformatted(p[2].__str__(), style_normal, maxLineLength=60) , 'M05' , '' ,'M06' , '' , '' , '' ],
['' , Preformatted(p[3].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M07' , '' , 'M09' ], ['' , Preformatted(p[3].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , '' , 'M07' , 'M09' ],
['' , '' , '' , '' ,'' , 'M08' , '' , '' ], ['' , '' , '' , '' ,'' ,'' , 'M08' , '' ],
[Preformatted(d[2].__str__(), style_normal, maxLineLength=40), Preformatted(p[4].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M10' , '' , 'M12' ], [Preformatted(d[2].__str__(), style_normal, maxLineLength=40), Preformatted(p[4].__str__(), style_normal, maxLineLength=60) , '' , '' , 'M10' , '' , 'M12' ],
['' , Preformatted(p[5].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M11' , '' , '' ], ['' , Preformatted(p[5].__str__(), style_normal, maxLineLength=60) , '' , '' , 'M11' '' , '' ],
[Preformatted(d[3].__str__(), style_normal, maxLineLength=40), Preformatted(p[6].__str__(), style_normal, maxLineLength=60) , '' , '' ,'' , 'M13' , '' , 'M14' ], [Preformatted(d[3].__str__(), style_normal, maxLineLength=40), Preformatted(p[6].__str__(), style_normal, maxLineLength=60) , '' , '' , 'M13' , '' ,'' , 'M14' ],
[Preformatted(d[4].__str__(), style_normal, maxLineLength=40), Preformatted(p[7].__str__(), style_normal, maxLineLength=60) , 'M15' , '' ,'' , '' , '' , '' ], [Preformatted(d[4].__str__(), style_normal, maxLineLength=40), Preformatted(p[7].__str__(), style_normal, maxLineLength=60) , 'M15' , '' ,'' , '' , '' , '' ],
[Preformatted(d[5].__str__(), style_normal, maxLineLength=40), Preformatted(p[8].__str__(), style_normal, maxLineLength=60) , 'M16_1' , '' ,'M16_2' , '' , 'M16_3' , '' ], [Preformatted(d[5].__str__(), style_normal, maxLineLength=40), Preformatted(p[8].__str__(), style_normal, maxLineLength=60) , 'M16_1' , '' ,'M16_2' , '' , 'M16_3' , '' ],
[Preformatted(d[6].__str__(), style_normal, maxLineLength=40), Preformatted(p[9].__str__(), style_normal, maxLineLength=60), 'M17_1' , '' ,'M17_2' , '' , 'M17_3' , '' ], [Preformatted(d[6].__str__(), style_normal, maxLineLength=40), Preformatted(p[9].__str__(), style_normal, maxLineLength=60), 'M17_1' , '' ,'M17_2' , '' , 'M17_3' , '' ],
@ -85,8 +85,8 @@ class HomePDFView(TemplateView):
('SPAN',(0,5), (0,7)), #Domaine 2 ('SPAN',(0,5), (0,7)), #Domaine 2
('SPAN',(1,6), (1,7)), ('SPAN',(1,6), (1,7)),
('SPAN',(0,8), (0,9)), #Domaine 3 ('SPAN',(0,8), (0,9)), #Domaine 3
('SPAN',(5,8), (6,8)), ('SPAN',(4,8), (5,8)),
('SPAN',(5,9), (6,9)), ('SPAN',(4,9), (5,9)),
('SPAN',(2,11), (-1,11)), ('SPAN',(2,11), (-1,11)),
('SPAN',(2,12), (3,12)), ('SPAN',(2,12), (3,12)),
('SPAN',(4,12), (5,12)), ('SPAN',(4,12), (5,12)),
@ -102,14 +102,14 @@ class HomePDFView(TemplateView):
('BACKGROUND',(0,5), (1,7), colors.red), ('BACKGROUND',(0,5), (1,7), colors.red),
('BACKGROUND',(2,5), (2,5), colors.red), ('BACKGROUND',(2,5), (2,5), colors.red),
('BACKGROUND',(4,5), (4,5), colors.red), ('BACKGROUND',(4,5), (4,5), colors.red),
('BACKGROUND',(5,6), (5,6), colors.red), ('BACKGROUND',(6,6), (6,6), colors.red),
('BACKGROperiodesUND',(7,6), (7,6), colors.red), ('BACKGROUND',(7,6), (7,6), colors.red),
('BACKGROUND',(5,7), (5,7), colors.red), ('BACKGROUND',(6,7), (6,7), colors.red),
('BACKGROUND',(0,8), (1,9), colors.pink), ('BACKGROUND',(0,8), (1,9), colors.pink),
('BACKGROUND',(5,8), (-1,8), colors.pink), ('BACKGROUND',(4,8), (6,8), colors.pink),
('BACKGROUND',(5,9), (6,9), colors.pink), ('BACKGROUND',(4,9), (5,9), colors.pink),
('BACKGROUND',(0,10), (1,10), HexColor('#AD7FA8')), ('BACKGROUND',(0,10), (1,10), HexColor('#AD7FA8')),
('BACKGROUND',(5,10), (5,10), HexColor('#AD7FA8')), ('BACKGROUND',(4,10), (4,10), HexColor('#AD7FA8')),
('BACKGROUND',(7,10), (7,10), HexColor('#AD7FA8')), ('BACKGROUND',(7,10), (7,10), HexColor('#AD7FA8')),
('BACKGROUND',(0,11), (-1,11), HexColor('#729FCF')), ('BACKGROUND',(0,11), (-1,11), HexColor('#729FCF')),
('BACKGROUND',(0,12), (-1,12), colors.lightgreen), ('BACKGROUND',(0,12), (-1,12), colors.lightgreen),
@ -361,6 +361,26 @@ class PeriodePDFView(TemplateView):
return response return response
class CompetenceListView(ListView):
model = Competence
template_name = 'cms/competence_list.html'
class TravailPersoListView(ListView):
model = Module
template_name = 'cms/travail_perso.html'
def get_context_data(self, **kwargs):
context = ListView.get_context_data(self, **kwargs)
context['total_perso'] = Module.objects.aggregate((Sum('travail_perso')))['travail_perso__sum']
context['total_presentiel'] = Module.objects.aggregate((Sum('periode_presentiel')))['periode_presentiel__sum']
context['total_pratique'] = Module.objects.aggregate((Sum('pratique_prof')))['pratique_prof__sum']
return get_context(context)
""" """
class AddDocument(TemplateView): class AddDocument(TemplateView):
template_name = 'cms/upload.html' template_name = 'cms/upload.html'

View file

@ -32,6 +32,8 @@ urlpatterns = [
url(r'^periodes$', views.PeriodeView.as_view(), name='periodes'), url(r'^periodes$', views.PeriodeView.as_view(), name='periodes'),
url(r'^periodes_pdf$', views.PeriodePDFView.as_view(), name='periodes-pdf'), url(r'^periodes_pdf$', views.PeriodePDFView.as_view(), name='periodes-pdf'),
url(r'^evaluation/$', views.EvaluationView.as_view(), name='evaluation'), url(r'^evaluation/$', views.EvaluationView.as_view(), name='evaluation'),
url(r'^competences/$', views.CompetenceListView.as_view(), name='competences'),
url(r'^travail/$', views.TravailPersoListView.as_view(), name='travail'),
#url(r'^upload/$', views.AddDocument.as_view(), name='upload'), #url(r'^upload/$', views.AddDocument.as_view(), name='upload'),
#url(r'^download/(?P<file_name>.+)$', views.Download, name='download'), #url(r'^download/(?P<file_name>.+)$', views.Download, name='download'),
#url(r'^calendrier/$', views.pdf_view, name='pdf-view'), #url(r'^calendrier/$', views.pdf_view, name='pdf-view'),

View file

@ -22,6 +22,8 @@
<li><a href="{% url 'processus-list' %}">Processus</a>&nbsp;&nbsp;</li> <li><a href="{% url 'processus-list' %}">Processus</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'module-list' %}">Modules</a>&nbsp;&nbsp;</li> <li><a href="{% url 'module-list' %}">Modules</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'periodes' %}">Périodes</a>&nbsp;&nbsp;</li> <li><a href="{% url 'periodes' %}">Périodes</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'competences' %}">Compétences</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'travail' %}">Heures de formation</a>&nbsp;&nbsp;</li>
<!-- <li><a href="{% url 'evaluation' %}">Evaluation</a>&nbsp;&nbsp;</li> --> <!-- <li><a href="{% url 'evaluation' %}">Evaluation</a>&nbsp;&nbsp;</li> -->

View file

@ -8,16 +8,11 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des compétences</h1> <h1>Liste des compétences du PEC avec les modules correspondants</h1>
<table border="0"> <table border="0">
{% for c in object_list %} {% for c in object_list %}
<tr><td colspan="3">{{ c }}</td></td></tr> <tr><td colspan="3">{{ c }}</td></td></tr>
{% for p in c.module_set.all %} <tr><th width="10px">&nbsp;</th><td colspan="2"><a href=" {% url 'module-detail' c.module.id %}">{{ c.module }}</a></td></tr>
<tr><th width="10px">&nbsp;</th><td colspan="2"><a href=" {% url 'processus-detail' p.id %}">{{p}}</a></td></tr>
{% for m in p.module_set.all %}
<tr><th colspan="2" width="45px">&nbsp;<td><a href=" {% url 'module-detail' m.id %}">{{m}}</a></td></tr>
{% endfor %}
{% endfor %}
{% endfor %} {% endfor %}
</table> </table>

View file

@ -1,9 +1,6 @@
{% extends "./base_site.html" %} {% extends "./base_site.html" %}
{% load i18n static %} {% load i18n static %}
{% block coltype %}colMS{% endblock %} {% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }}{% endblock %} {% block bodyclass %}{{ block.super }}{% endblock %}

View file

@ -0,0 +1,36 @@
{% extends "./base_site.html" %}
{% load i18n static %}
{% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }}{% endblock %}
{% block content %}
<div id="content-main">
<h1>Répartion des heures de formation</h1>
<table border="0">
<tr><th>Module</th><th >Heures de cours</th><th>Travail perso.</th><th>Pratique prof.</th></tr>
{% for m in object_list %}
<tr>
<td >
{% if forloop.last %}
{{ m }} - Travail de diplôme
{% else %}
{{ m }}
{% endif %}
</td>
<td align="center">{% if m.periode_presentiel == 0 %} &nbsp; {% else %} {{ m.periode_presentiel|rjust:"3" }} h. {% endif %}</td>
<td align="center">{% if m.travail_perso == 0 %} &nbsp; {% else %} {{ m.travail_perso|rjust:"3" }} h. {% endif %}</td>
<td align="center">{% if m.pratique_prof == 0 %} &nbsp; {% else %} {{ m.pratique_prof|rjust:"3" }} h.{% endif %}</td>
</tr>
{% endfor %}
<tr>
<th >Total</th>
<th>{{ total_perso }} heures</th>
<th>{{ total_presentiel }} heures</th>
<th>{{ total_pratique }} heures</th>
</tr>
</table>
</div>
{% endblock %}