From 545c0c494fd9df4af0b4e8b1345de145f9623384 Mon Sep 17 00:00:00 2001 From: alazo Date: Sun, 8 Jan 2017 22:23:53 +0100 Subject: [PATCH] version beta --- .gitignore | 5 + .project | 18 ++ .pydevproject | 12 + .settings/org.eclipse.core.resources.prefs | 5 + cms/migrations/0013_auto_20170108_2119.py | 27 ++ cms/models.py | 77 +++++- cms/static/css/main.css | 16 +- cms/static/img/header.gif | Bin 0 -> 5430 bytes cms/views.py | 279 +++++++++++++++++++-- common/settings.py | 2 +- common/urls.py | 6 +- media/media/header.gif | Bin 0 -> 4190 bytes static/css/main.css | 7 - templates/cms/base_site.html | 16 +- templates/cms/index.html | 8 +- templates/cms/module_detail.html | 20 +- templates/cms/periodes.html | 38 ++- templates/cms/processus_detail.html | 2 +- 18 files changed, 467 insertions(+), 71 deletions(-) create mode 100644 .gitignore create mode 100644 .project create mode 100644 .pydevproject create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 cms/migrations/0013_auto_20170108_2119.py create mode 100755 cms/static/img/header.gif create mode 100755 media/media/header.gif delete mode 100644 static/css/main.css diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4383301 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.pyc +common/local_settings.py +db.sqlite3 +*.sql + diff --git a/.project b/.project new file mode 100644 index 0000000..6de12a2 --- /dev/null +++ b/.project @@ -0,0 +1,18 @@ + + + eds + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + org.python.pydev.django.djangoNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..1b60d58 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,12 @@ + + + +DJANGO_MANAGE_LOCATION +eds/manage.py + + +/${PROJECT_DIR_NAME} + +python 3.0 +eds + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..d76493b --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +encoding//cms/forms.py=utf-8 +encoding//cms/models.py=utf-8 +encoding//cms/views.py=utf-8 +encoding//common/settings.py=utf-8 diff --git a/cms/migrations/0013_auto_20170108_2119.py b/cms/migrations/0013_auto_20170108_2119.py new file mode 100644 index 0000000..17d6169 --- /dev/null +++ b/cms/migrations/0013_auto_20170108_2119.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.4 on 2017-01-08 21:19 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('cms', '0012_auto_20170104_1347'), + ] + + operations = [ + migrations.AlterModelOptions( + name='competence', + options={'ordering': ('code',), 'verbose_name': 'compétence'}, + ), + migrations.AlterModelOptions( + name='processus', + options={'ordering': ('code',), 'verbose_name_plural': 'processus'}, + ), + migrations.AlterModelOptions( + name='souscompetence', + options={'ordering': ('code',), 'verbose_name': 'sous-compétence'}, + ), + ] diff --git a/cms/models.py b/cms/models.py index 501d586..dd0a4ed 100644 --- a/cms/models.py +++ b/cms/models.py @@ -5,8 +5,22 @@ Created on 17 nov. 2012 @author: alzo ''' from django.db import models +from django.http.response import HttpResponse +from django.conf import settings - +from reportlab.platypus import SimpleDocTemplate +from reportlab.platypus import Paragraph, Spacer, PageBreak, Table, TableStyle, Image +from reportlab.graphics.shapes import Line +from reportlab.lib.pagesizes import A4, landscape +from reportlab.lib.units import cm +from reportlab.lib.enums import TA_LEFT, TA_CENTER +from reportlab.lib import colors +from reportlab.lib.styles import ParagraphStyle as PS +style_8_c = PS(name='CORPS', fontName='Helvetica', fontSize=6, alignment = TA_CENTER) +style_normal = PS(name='CORPS', fontName='Helvetica', fontSize=8, alignment = TA_LEFT) +style_bold = PS(name='CORPS', fontName='Helvetica-Bold', fontSize=10, alignment = TA_LEFT) +style_title = PS(name='CORPS', fontName='Helvetica', fontSize=12, alignment = TA_LEFT) +style_adress = PS(name='CORPS', fontName='Helvetica', fontSize=10, alignment = TA_LEFT, leftIndent=300) # Create your models here. CHOIX_TYPE_SAVOIR = ( @@ -32,6 +46,9 @@ class Enseignant(models.Model): def __str__(self): return '{0} {1}'.format(self.nom, self.prenom) + def descr(self): + return '{0} ({1})'.format(self.__str__(), self.email) + class Domaine(models.Model): code = models.CharField(max_length=20, blank=True) @@ -102,7 +119,7 @@ class Module(models.Model): return "{1}".format(self.id, self.__str__()) def url_code(self): - return "{1}".format(self.id, self.code) + return "{1}".format(self.id, self.code, self.nom) class Competence(models.Model): @@ -143,7 +160,6 @@ class Ressource(models.Model): class Objectif(models.Model): libelle = models.CharField(max_length=200, blank=False) - #type = models.CharField(max_length=30, choices = CHOIX_TYPE_SAVOIR) module=models.ForeignKey(Module, null=True, default=None) def __str__(self): @@ -155,10 +171,61 @@ class Document(models.Model): - +class PDFResponse(HttpResponse): + def __init__(self, filename, title=''): + HttpResponse.__init__(self, content_type='application/pdf') + self['Content-Disposition'] = 'attachment; filename={0}'.format(filename) + self['Content-Type'] = 'charset=utf-8' + self.story = [] + image = Image(settings.MEDIA_ROOT + '/media/header.gif', width=350, height=40) + image.hAlign = 0 + + self.story.append(image) + self.story.append(Spacer(0,1*cm)) + + data = [['Filières EDS', title]] + t = Table(data, colWidths=[8*cm,8*cm]) + t.setStyle(TableStyle([ ('ALIGN',(0,0),(0,0),'LEFT'), + ('ALIGN',(1,0),(-1,-1),'RIGHT'), + ('LINEABOVE', (0,0) ,(-1,-1), 0.5, colors.black), + ('LINEBELOW', (0,-1),(-1,-1), 0.5, colors.black), + ])) + t.hAlign = 0 + self.story.append(t) + + +class MyDocTemplate(SimpleDocTemplate): + + def __init__(self, name): + + #BaseDocTemplate.__init__(self,name, pagesize=A4, topMargin=0.5*cm) + SimpleDocTemplate.__init__(self, name, pagesize=A4, topMargin=0.5*cm) + self.fileName = name + + + def beforePage(self): + # page number + self.canv.saveState() + self.canv.setFontSize(8) + #self.canv.drawCentredString(self.CENTRE_WIDTH,1*cm,"Page : " + str(self.canv.getPageNumber())) + self.canv.restoreState() + + + +class MyDocTemplateLandscape(SimpleDocTemplate): + + def __init__(self, name): + SimpleDocTemplate.__init__(self, name, pagesize=landscape(A4), topMargin=0.5*cm) + self.fileName = name + + def beforePage(self): + # page number + self.canv.saveState() + self.canv.setFontSize(8) + #self.canv.drawCentredString(self.CENTRE_WIDTH,1*cm,"Page : " + str(self.canv.getPageNumber())) + self.canv.restoreState() - \ No newline at end of file diff --git a/cms/static/css/main.css b/cms/static/css/main.css index 80bb59e..0f584d6 100644 --- a/cms/static/css/main.css +++ b/cms/static/css/main.css @@ -31,12 +31,11 @@ #plan { border-collapse: separate; - border-spacing: 5px 10px; - + border-spacing: 5px 6px; } table th { - font-size:120%; + font-size:110%; } ul, ul li { @@ -49,11 +48,16 @@ ul li { list-style-type:none; */ } - .liste-table { + margin-left:10px; + padding-left:0px; + +} + +.liste-table li{ list-style-type:square; - margin-left:0px; - padding:0px; + margin-left:3px; + padding:0px 10px;; } .clear-booth { float:none; diff --git a/cms/static/img/header.gif b/cms/static/img/header.gif new file mode 100755 index 0000000000000000000000000000000000000000..a02c592c075ad9b2815758633b8dd23d296fd0f1 GIT binary patch literal 5430 zcmbW3=|9x_`^Vp(F&JjX)`#qoBZE$dk}TiTi2cI@wi^k=XK+k9CUYhwiUX<&`5X5mf9+?cDB;UVQ5QwVE|GJ^gQA|3+(h$IS4? zTZ@^CR+(9^H%l(mz5DnFxi*S5_@nj7hvAXpQ zN`9V_N`3J%E&WvnEi)_obxv*`oxx zZNHZLC8?+PSImLIq4&SSjE;>@OioSz(mTKK3(fM%>ZkwsYoEV-UH`VR`F-oh_RpPN zARww}#i7*&qxNVywsJBXo=K=#r&+ztYKoFQ;xXF#HoGNOg%GKDs_=DNBJMoXv8^zt zBSq(Wd)g^(Zr4kLyGx^O+`M-gcxOn~x`^JJZI!5XrM-yJmus4BT`f2n76aY1mk^9^ z!b_=|h5n`+Cy4A7{|iNz^?n{^Ut+d9#?(3YwF8nOMCz;JCoOvq2N=R8x=!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o7qdCXshx{%6ybC~HEJ)} z?x-CF%eR}_6uUlEmE7y-UKXv&FnYHKlr)NV_OYg!X z$ew1oFSo9+It8`?mIo>hGQHT$URDPoup=!Bq#3;nX$O)##tUW#&$?&DvquKYCU&;< ziS!WDS_M{Gz9`bQy8bO%Y1OFi4q0mCGTT0SypvU^<5d(K$M#A;YLhl8Km+J1t9xZT z|B_NQ&a*p}$3yXpuTg*mC_R+kPj19yI7(S@jpXE^{i66ef z27#+hPOMT@T7UCP(CpA<&mOEW$-mn9KJYkC(3b0>H01ku%(-jes)=YMy7=J;mpc4G zki(MTv&R)H!hYnZF~O<{tlh;HoGe_Z9)dVP8bAK6npMG~|5$B_d;!F0rL-60OT%0- z68p>J543hJ(_v!eOu-vPg!s<*+MV&8=whr+2dZF7tbiHzqmci2!vEz2svD^4bV{g1 zV|S*^>dLWkiQ{P6biG2f9eToiZTg-6n8;No=E=mqn(@OsQ%J8#)e}<{Q8BESGjiQC z=zy8@u4yT;DbDtUd_kF@1R_kK1Ln*c#mr@{v~X8uBzw5x92RtS{MOl`x$Uvco;(Xv zD7RwN=gGp|lM7j^EWZMMlJdgi8bDYE8Y2r~J8;mUxo21PpNc(<+W8o#ytur82?W6S F{{TLc`9=T$ literal 0 HcmV?d00001 diff --git a/cms/views.py b/cms/views.py index 644f8f4..d156640 100644 --- a/cms/views.py +++ b/cms/views.py @@ -5,9 +5,10 @@ Created on 4 déc. 2012 @author: alzo ''' import os -from django.shortcuts import render +from django.shortcuts import render, render_to_response from django.views.generic import ListView, TemplateView, DetailView -from .models import Domaine, Processus, Module, Document, Document +from .models import Domaine, Processus, Module, Document, PDFResponse, MyDocTemplate, MyDocTemplateLandscape +from .models import style_normal, style_bold, style_title from django.db.models import F, Sum from django.conf import settings @@ -15,12 +16,19 @@ from django.http import HttpResponseRedirect from django.http import HttpResponse from .forms import DocumentForm +from reportlab.pdfgen import canvas + +from reportlab.platypus import Paragraph, Spacer, PageBreak, Table, TableStyle, Preformatted +from reportlab.lib.units import cm +from reportlab.lib.enums import TA_LEFT +from reportlab.lib import colors +from reportlab.lib.colors import HexColor + # Create your views here. class HomeView(TemplateView): template_name = 'cms/index.html' - def get_context_data(self, **kwargs): context = super(HomeView, self).get_context_data(**kwargs) for d in Domaine.objects.all().order_by('code'): @@ -33,7 +41,89 @@ class HomeView(TemplateView): context[m.code] = m return context + + +class HomwPDFView(TemplateView): + template_name = 'cms/index.html' + def render_to_response(self, context, **response_kwargs): + + response = PDFResponse('PlanFormation.pdf' ,'Plan de formation') + d = Domaine.objects.all().order_by('code') + p = Processus.objects.all().order_by('code') + + + data = [['Domaines','Processus', 'Sem1', 'Sem2', 'Sem3','Sem4','Sem5','Sem6'], + [Preformatted(d[0].__str__(), style_normal, maxLineLength=40), Preformatted(p[0].__str__(), style_normal, maxLineLength=60) , 'M01' , '' ,'' , '' , '' ,'' ], + ['' , '' , 'M02' , '' ,'' , '' , '' ,'' ], + ['' , Preformatted(p[1].__str__(), style_normal, maxLineLength=60) , '' , 'M03' ,'' , '' , '' , '' ], + ['' , '' , '' , 'M04' ,'' , '' , '' , '' ], + [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' ], + ['' , '' , '' , '' ,'' , 'M08' , '' , '' ], + [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(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[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[7].__str__(), style_normal, maxLineLength=40), Preformatted(p[10].__str__(), style_normal, maxLineLength=60) , 'Macc' , '' ,'' , '' , '' , '' ], + ] + + t = Table(data, colWidths=[5.5*cm, 8*cm, 1.5*cm, 1.5*cm,1.5*cm, 1.5*cm,1.5*cm,1.5*cm], spaceBefore=1*cm, spaceAfter=1*cm) + t.setStyle(TableStyle([ + ('SIZE', (0,0), (-1,-1), 8), + ('FONT', (0,0), (-1,0), 'Helvetica-Bold'), + ('VALIGN',(0,0),(-1,-1),'MIDDLE'), + ('ALIGN',(2,0),(-1,-1),'CENTER'), + + #('BOX',(0,0),(-1,-1), 0.25, colors.black), + ('GRID',(0,0),(-1,-1), 0.25, colors.black), + ('SPAN',(0,1), (0,4)), + ('SPAN',(1,1), (1,2)), + ('SPAN',(1,3), (1,4)), + ('SPAN',(0,5), (0,7)), + ('SPAN',(1,6), (1,7)), + ('SPAN',(0,8), (0,9)), + ('SPAN',(0,8), (0,9)), + ('SPAN',(5,8), (6,8)), + ('SPAN',(5,9), (6,9)), + ('SPAN',(2,11), (-1,11)), + ('SPAN',(2,12), (3,12)), + ('SPAN',(4,12), (5,12)), + ('SPAN',(6,12), (7,12)), + ('SPAN',(2,13), (3,13)), + ('SPAN',(4,13), (5,13)), + ('SPAN',(6,13), (7,13)), + ('SPAN',(2,14), (-1,14)), + ('BACKGROUND',(0,1), (1,4), colors.orange), + ('BACKGROUND',(2,1), (2,2), colors.orange), + ('BACKGROUND',(3,3), (3,4), colors.orange), + ('BACKGROUND',(0,5), (1,7), colors.red), + ('BACKGROUND',(2,5), (2,5), colors.red), + ('BACKGROUND',(4,5), (4,5), colors.red), + ('BACKGROUND',(5,6), (5,6), colors.red), + ('BACKGROUND',(7,6), (7,6), colors.red), + ('BACKGROUND',(5,7), (5,7), colors.red), + ('BACKGROUND',(0,8), (1,9), colors.pink), + ('BACKGROUND',(5,8), (-1,8), colors.pink), + ('BACKGROUND',(5,9), (6,9), colors.pink), + ('BACKGROUND',(0,10), (1,10), HexColor('#AD7FA8')), + ('BACKGROUND',(5,10), (5,10), HexColor('#AD7FA8')), + ('BACKGROUND',(7,10), (7,10), HexColor('#AD7FA8')), + ('BACKGROUND',(0,11), (-1,11), HexColor('#729FCF')), + ('BACKGROUND',(0,12), (-1,12), colors.lightgreen), + ('BACKGROUND',(0,13), (-1,13), colors.white), + ('BACKGROUND',(0,14), (-1,14), colors.lightgrey), + ])) + + t.hAlign = 0 + response.story.append(t) + + doc = MyDocTemplateLandscape(response) + doc.build(response.story) + + return response class DomaineDetailView(DetailView): @@ -65,7 +155,102 @@ class ModuleListView(ListView): template_name = 'cms/module_list.html' model = Module +def Preformatted_left(text): + return Preformatted(text, style_normal, maxLineLength=15) + +def Preformatted_right(text): + return Preformatted(text, style_normal, maxLineLength=110) + + +class ModulePDF(DetailView): + + template_name = 'cms/module_detail.html' + model = Module + + def get_object(self): + # Call the superclass + return super(ModulePDF, self).get_object() + + + + def render_to_response(self, context, **response_kwargs): + #return DetailView.render_to_response(self, context, **response_kwargs) + m = self.get_object() + response = PDFResponse('Module_{0}.pdf'.format(m.code) ,'Module de formation') + + + str_comp = '' + for c in m.competences.all(): + str_comp += '- {0} ({1})\n'.format(c.libelle, c.code) + if self.request.user.is_authenticated: + for sc in c.souscompetence_set.all(): + str_comp += ' -- {0}\n'.format(sc.libelle) + + str_res = '' + for c in m.ressource_set.all(): + str_res += '- {0}\n'.format(c.libelle) + + str_obj = '' + for c in m.objectif_set.all(): + str_obj += '- {0}\n'.format(c.libelle) + + lines = m.contenu.split('\n') + str_con = '' + for l in lines: + str_con += '{0}\n'.format(l) + + response.story.append(Spacer(0,1*cm)) + response.story.append(Paragraph(m.__str__(), style_title)) + + data = [[Preformatted_left('Domaine'), Preformatted_right(m.processus.domaine.__str__())], + [Preformatted_left('Processus'), Preformatted_right(m.processus.__str__())], + [Preformatted_left('Situation emblématique'), Preformatted_right(m.situation)], + [Preformatted_left('Compétences visées'), Preformatted_right(str_comp)], + [Preformatted_left('Ressources à acquérir'), Preformatted_right(str_res)], + [Preformatted_left('Objectifs à atteindre'), Preformatted_right(str_obj)], + [Preformatted_left('Contenu'), Preformatted_right(str_con)], + [Preformatted_left('Evaluation'), Preformatted_right(m.evaluation)], + [Preformatted_left('Type'), Preformatted_right(m.type)], + [Preformatted_left('Semestre'), Preformatted_right(m.semestre)], + [Preformatted_left('Présentiel'), Preformatted_right('{0} heures'.format(m.periode_presentiel))], + [Preformatted_left('Travail personnel'), Preformatted_right('{0} heures'.format(m.travail_perso))], + [Preformatted_left('Responsable'), Preformatted_right(m.processus.domaine.responsable.descr())], + ] + t = Table(data, colWidths=[2.5*cm,10*cm]) + t.setStyle(TableStyle([ ('ALIGN',(0,0),(-1,-1),'LEFT'), + ('VALIGN',(0,0),(-1,-1),'TOP'), + ('LEFTPADDING', (0,0),(-1,-1), 0), + ])) + t.hAlign=0 + response.story.append(Spacer(0,1*cm)) + response.story.append(t) + + + doc = MyDocTemplate(response) + doc.build(response.story) + + return response + +""" +Calcul du nombre de périodes de formation +""" +def get_context(context): + liste = Module.objects.exclude(periode_presentiel = 0) + context['tot'] = liste.aggregate(Sum(F('periode_presentiel'))) + context['sem1'] = liste.exclude(sem1 = 0) + context['tot1'] = liste.aggregate(Sum(F('sem1'))) + context['sem2'] = liste.exclude(sem2 = 0) + context['tot2'] = liste.aggregate(Sum(F('sem2'))) + context['sem3'] = liste.exclude(sem3 = 0) + context['tot3'] = liste.aggregate(Sum(F('sem3'))) + context['sem4'] = liste.exclude(sem4 = 0) + context['tot4'] = liste.aggregate(Sum(F('sem4'))) + context['sem5'] = liste.exclude(sem5 = 0) + context['tot5'] = liste.aggregate(Sum(F('sem5'))) + context['sem6'] = liste.exclude(sem6 = 0) + context['tot6'] = liste.aggregate(Sum(F('sem6'))) + return context class PeriodeView(TemplateView): @@ -73,25 +258,69 @@ class PeriodeView(TemplateView): def get_context_data(self, **kwargs): context = TemplateView.get_context_data(self, **kwargs) - liste = Module.objects.exclude(periode_presentiel = 0) - context['tot'] = liste.aggregate(Sum(F('periode_presentiel'))) - context['sem1'] = liste.exclude(sem1 = 0) - context['tot1'] = liste.aggregate(Sum(F('sem1'))) - context['sem2'] = liste.exclude(sem2 = 0) - context['tot2'] = liste.aggregate(Sum(F('sem2'))) - context['sem3'] = liste.exclude(sem3 = 0) - context['tot3'] = liste.aggregate(Sum(F('sem3'))) - context['sem4'] = liste.exclude(sem4 = 0) - context['tot4'] = liste.aggregate(Sum(F('sem4'))) - context['sem5'] = liste.exclude(sem5 = 0) - context['tot5'] = liste.aggregate(Sum(F('sem5'))) - context['sem6'] = liste.exclude(sem6 = 0) - context['tot6'] = liste.aggregate(Sum(F('sem6'))) - - return context - - + return get_context(context) + +class PeriodePDFView(TemplateView): + template_name = 'cms/periodes.html' + + def render_to_response(self, context, **response_kwargs): + + response = PDFResponse('Périodes.pdf' ,'Périodes de formation') + context = get_context(context) + + data = [['Semestre 1', '{0} h.'.format(context['tot1']['sem1__sum']),'', 'Semestre 2', '{0} h.'.format(context['tot2']['sem2__sum'])], + [context['sem1'][0], '{0} h.'.format(context['sem1'][0].sem1),'', context['sem2'][0], '{0} h.'.format(context['sem2'][0].sem2) ], + [context['sem1'][1], '{0} h.'.format(context['sem1'][1].sem1),'', context['sem2'][1], '{0} h.'.format(context['sem2'][1].sem2) ], + [context['sem1'][2], '{0} h.'.format(context['sem1'][2].sem1),'', context['sem2'][2], '{0} h.'.format(context['sem2'][2].sem2) ], + [context['sem1'][3], '{0} h.'.format(context['sem1'][3].sem1),'', context['sem2'][3], '{0} h.'.format(context['sem2'][3].sem2) ], + [context['sem1'][4], '{0} h.'.format(context['sem1'][4].sem1),'', context['sem2'][4], '{0} h.'.format(context['sem2'][4].sem2) ], + [context['sem1'][5], '{0} h.'.format(context['sem1'][5].sem1),'', '','' ], + [context['sem1'][6], '{0} h.'.format(context['sem1'][6].sem1),'', '','' ], + ['Semestre 3', '{0} h.'.format(context['tot3']['sem3__sum']),'', 'Semestre 4', '{0} h.'.format(context['tot4']['sem4__sum'])], + [context['sem3'][0], '{0} h.'.format(context['sem3'][0].sem3),'', context['sem4'][0], '{0} h.'.format(context['sem4'][0].sem4) ], + [context['sem3'][1], '{0} h.'.format(context['sem3'][1].sem3),'', context['sem4'][1], '{0} h.'.format(context['sem4'][1].sem4) ], + [context['sem3'][2], '{0} h.'.format(context['sem3'][2].sem3),'', context['sem4'][2], '{0} h.'.format(context['sem4'][2].sem4) ], + [context['sem3'][3], '{0} h.'.format(context['sem3'][3].sem3),'', context['sem4'][3], '{0} h.'.format(context['sem4'][3].sem4) ], + [context['sem3'][4], '{0} h.'.format(context['sem3'][4].sem3),'', context['sem4'][4], '{0} h.'.format(context['sem4'][4].sem4) ], + [context['sem3'][5], '{0} h.'.format(context['sem3'][5].sem3),'', context['sem4'][5], '{0} h.'.format(context['sem4'][5].sem4) ], + ['','', '',context['sem4'][6], '{0} h.'.format(context['sem4'][6].sem4) ], + ['Semestre 5', '{0} h.'.format(context['tot5']['sem5__sum']),'', 'Semestre 6', '{0} h.'.format(context['tot6']['sem6__sum'])], + [context['sem5'][0], '{0} h.'.format(context['sem5'][0].sem5),'', context['sem6'][0], '{0} h.'.format(context['sem6'][0].sem6) ], + [context['sem5'][1], '{0} h.'.format(context['sem5'][1].sem5),'', context['sem6'][1], '{0} h.'.format(context['sem6'][1].sem6) ], + [context['sem5'][2], '{0} h.'.format(context['sem5'][2].sem5),'', context['sem6'][2], '{0} h.'.format(context['sem6'][2].sem6) ], + [context['sem5'][3], '{0} h.'.format(context['sem5'][3].sem5),'', context['sem6'][3], '{0} h.'.format(context['sem6'][3].sem6) ], + [context['sem5'][4], '{0} h.'.format(context['sem5'][4].sem5),'', context['sem6'][4], '{0} h.'.format(context['sem6'][4].sem6) ], + [context['sem5'][5], '{0} h.'.format(context['sem5'][5].sem5),'', '','' ], + [context['sem5'][6], '{0} h.'.format(context['sem5'][6].sem5),'', '','' ], + ] + + t = Table(data, colWidths=[6.5*cm,1*cm, 1*cm, 6.5*cm, 1*cm], spaceBefore=2*cm, spaceAfter=1.5*cm) + t.setStyle(TableStyle([ ('ALIGN',(0,0),(-1,-1),'LEFT'), + ('VALIGN',(0,0),(-1,-1),'TOP'), + ('LEFTPADDING', (0,0),(-1,-1), 0), + ('SIZE', (0,0), (-1,-1), 8), + ('ALIGN', (1,0), (1,-1), 'RIGHT'), + ('ALIGN', (-1,0), (-1,-1), 'RIGHT'), + ('LINEBELOW', (0,0), (1,0), 1, colors.black), + ('LINEBELOW', (3,0), (-1,0), 1, colors.black), + + ('TOPPADDING', (0,8), (-1,8), 15), + ('LINEBELOW', (0,8), (1,8), 1, colors.black), + ('LINEBELOW', (3,8), (-1,8), 1, colors.black), + ('TOPPADDING', (0,16), (-1,16), 15), + ('LINEBELOW', (0,16), (1,16), 1, colors.black), + ('LINEBELOW', (3,16), (-1,16), 1, colors.black), + ])) + + t.hAlign = 0 + response.story.append(t) + + response.story.append(Paragraph('Total des heures de cours: {0} h.'.format(context['tot']['periode_presentiel__sum']), style_normal)) + doc = MyDocTemplate(response) + doc.build(response.story) + + return response def AddDoc(request): if request.method == 'POST': @@ -114,5 +343,11 @@ def Download(request, file_name): response['Content-Length'] = os.stat(f).st_size return response - + +def pdf_view(request): + with open('/home/alzo/dev/eds/media/media/EDS_Calendrier_2017.pdf', 'r') as pdf: + response = HttpResponse(pdf.read().decode('latin-1') , content_type='application/pdf') + response['Content-Disposition'] = 'inline;filename=some_file.pdf' + return response + pdf.closed \ No newline at end of file diff --git a/common/settings.py b/common/settings.py index ffe054d..3205592 100644 --- a/common/settings.py +++ b/common/settings.py @@ -113,7 +113,7 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static/') MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') from .local_settings import * diff --git a/common/urls.py b/common/urls.py index 6224abf..af56370 100644 --- a/common/urls.py +++ b/common/urls.py @@ -21,6 +21,7 @@ from django.conf.urls.static import static urlpatterns = [ url(r'^$', views.HomeView.as_view(), name='home'), + url(r'^plan_pdf/$', views.HomwPDFView.as_view(), name='plan-pdf'), url(r'^admin/', admin.site.urls), url(r'^domaine/(?P\d+)$', views.DomaineDetailView.as_view(), name='domaine-detail'), url(r'^domaines/$', views.DomaineListView.as_view(), name='domaine-list'), @@ -28,7 +29,10 @@ urlpatterns = [ url(r'^processus/$', views.ProcessusListView.as_view(), name='processus-list'), url(r'^module/(?P\d+)$', views.ModuleDetailView.as_view(), name='module-detail'), url(r'^modules/$', views.ModuleListView.as_view(), name='module-list'), - url(r'^periode$', views.PeriodeView.as_view(), name='periode'), + url(r'^periodes$', views.PeriodeView.as_view(), name='periodes'), + url(r'^periodes_pdf$', views.PeriodePDFView.as_view(), name='periodes-pdf'), url(r'^upload$', views.AddDoc, name='upload'), url(r'^download/(?P.+)$', views.Download, name='download'), + url(r'^calendrier/$', views.pdf_view, name='pdf-view'), + url(r'^module_pdf/(?P\d+)$', views.ModulePDF.as_view(), name='module-pdf'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/media/media/header.gif b/media/media/header.gif new file mode 100755 index 0000000000000000000000000000000000000000..59d0a3c2fb28a1f104aa15f91a8f9ea42542e0ef GIT binary patch literal 4190 zcmc)H`6JU0z`*g(?C{xg%rQ*Y$W4f06gKBpMK`8rR4aU@?FpK{1wmZhxb45cBQxwtix6zu0W3;@X^8&h`$e9csT81H|t9_ zp*}8&s7*b8{z776N@8N_|28QpH7V)J*@jQYyj|E&f!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R2lw)&lGyn04kLP{%^I1Jk{VhHG?sEQ){{oC#f_BY z(If#UCe3Sq13acSNBv4{S;n?^T&8-OYr6rKf04^}JTAM%mwV)qZ5; zT{JJgkRIxyqYdWIs-15^*FA+H;wag3@jk@M3_zQq2eQTfdCT^D7ffHqDn#FpyB?Mz z4sUFY)wAq006#>k#{SbpGlbm>n2H(vt6tY8Dr^UUfQz)fRJm4<8h!VlJ gHbX|d;Wk8QvQ2BnxjSUTCheFS%KO$5GzjedA0wf*-T(jq literal 0 HcmV?d00001 diff --git a/static/css/main.css b/static/css/main.css deleted file mode 100644 index c54c70b..0000000 --- a/static/css/main.css +++ /dev/null @@ -1,7 +0,0 @@ -@CHARSET "UTF-8"; - -#titre_col ul li { - list-style-type:none; -} - - diff --git a/templates/cms/base_site.html b/templates/cms/base_site.html index 0df6da7..e35847e 100644 --- a/templates/cms/base_site.html +++ b/templates/cms/base_site.html @@ -2,8 +2,17 @@ {% block title %}EDS{% endblock %} -{% block branding %}

Formation EDS

{% endblock %} -{% block usertools %}{% endblock %} +{% block branding %}

Formation en Education sociale ES

{% endblock %} +{% block usertools %} +
+{% if user.is_authenticated %} +{% block welcome-msg %}Bienvenue {% firstof user.username %}.{% endblock %} +Site public  Admin +{% else %} +Admin +{% endif %} +
+{% endblock %} {% block nav-global %}{% endblock %} {% block breadcrumbs %} {% endblock %} diff --git a/templates/cms/module_detail.html b/templates/cms/module_detail.html index 85c4677..5cb0c60 100644 --- a/templates/cms/module_detail.html +++ b/templates/cms/module_detail.html @@ -10,13 +10,15 @@ - - - - - - + + + + + + {% if object.periode_presentiel > 0 %} @@ -28,9 +30,9 @@ {% if object.travail_perso > 0 %} {% endif %} - +
Domaine{{object.processus.domaine.url|safe}}
Processus{{object.processus.url|safe}}
Situation emblématique{{object.situation}}
Compétences visées

L'éducateur social, l'éducatrice sociale

-{% for c in object.competences.all %}- {{c.libelle}} ({{c.code}})
{% endfor %}
Ressources{% for c in object.ressource_set.all %}- {{c}}
{% endfor %}
Objectifs{% for c in object.objectif_set.all %}- {{c}}
{% endfor %}
Contenu{{object.contenu}}
Evaluation{{object.evaluation}}
Situation emblématique{{object.situation|linebreaksbr}}
Compétences visées

L'éducateur social, l'éducatrice sociale:

+{% for c in object.competences.all %}- {{c.libelle}} ({{c.code}})
+{% if user.is_authenticated %} +{% for sc in c.souscompetence_set.all %}    - {{sc.libelle}}
{%endfor %}{% endif %}{% endfor %}
Ressources à acquérir{% for c in object.ressource_set.all %}- {{c}}
{% endfor %}
Objectifs à atteindre{% for c in object.objectif_set.all %}- {{c}}
{% endfor %}
Contenu{{object.contenu|linebreaksbr}}
Evaluation{{object.evaluation|linebreaksbr}}
Type{{object.type}}
Semestre{{object.semestre}}
Travail perso.{{object.travail_perso}} heures
Responsable{{object.processus.domaine.responsable}} ({{object.processus.domaine.responsable.email}})
Responsable{{object.processus.domaine.responsable.descr}}
- +

Imprimer en PDF

{% endblock %} diff --git a/templates/cms/periodes.html b/templates/cms/periodes.html index 8609849..7ad341a 100644 --- a/templates/cms/periodes.html +++ b/templates/cms/periodes.html @@ -1,47 +1,59 @@ {% extends "./base_site.html" %} {% load i18n static %} -{% block extrastyle %}{{ block.super }} -{% endblock %} - {% block coltype %}colMS{% endblock %} -{% block bodyclass %}{{ block.super }} dashboard{% endblock %} - -{% block breadcrumbs %}{% endblock %} {% block content %}

Périodes de formation

- + + + + + + + + + +
Semestre 1{{tot1.sem1__sum}}h.
Semestre 1{{tot1.sem1__sum}}h.Semestre 2{{tot2.sem2__sum}}h.
{% for s in sem1 %} {% endfor %} - +
{{s}}{{s.sem1}} h.
Semestre 2{{tot2.sem2__sum}}h.
+
+ {% for s in sem2 %} {% endfor %} - +
{{s}}{{s.sem2}} h.
Semestre 3{{tot3.sem3__sum}}h.
+
Semestre 3{{tot3.sem3__sum}}h.Semestre 4{{tot4.sem4__sum}}h.
{% for s in sem3 %} {% endfor %} - +
{{s}}{{s.sem3}} h.
Semestre 4{{tot4.sem4__sum}}h.
{% for s in sem4 %} {% endfor %} - +
{{s}}{{s.sem4}} h.
Semestre 5{{tot5.sem5__sum}}h.
Semestre 5{{tot5.sem5__sum}}h.Semestre 6{{tot6.sem6__sum}}h.
{% for s in sem5 %} {% endfor %} - +
{{s}}{{s.sem5}} h.
Semestre 6{{tot6.sem6__sum}}h.
+ {% for s in sem6 %} {% endfor %}
{{s}}{{s.sem6}} h.
-{{tot.tot__sum}} +
+
+Total des périodes de cours: {{tot.periode_presentiel__sum}} heures + +

+Imprimer en PDF
{% endblock %} diff --git a/templates/cms/processus_detail.html b/templates/cms/processus_detail.html index bc89180..bfeb01a 100644 --- a/templates/cms/processus_detail.html +++ b/templates/cms/processus_detail.html @@ -13,7 +13,7 @@

{{object}}

-
Description{{object.description}}
Compétences visées

L'éducateur social, l'éducatrice sociale

+
Compétences visées

L'éducateur social, l'éducatrice sociale:

{% for m in object.module_set.all %}{% for c in m.competences.all %} - {{c.libelle}} ({{c.code}})
{% endfor %}{% endfor %}
Domaine{{object.domaine.url|safe}}