PDF_periodes

This commit is contained in:
alazo 2017-08-13 22:58:46 +02:00
parent 7b04443965
commit d9d4fd7879
31 changed files with 1175 additions and 999 deletions

View file

@ -3,11 +3,10 @@ from django.contrib import admin
from .models import (Enseignant, Domaine, Competence, SousCompetence, Objectif, from .models import (Enseignant, Domaine, Competence, SousCompetence, Objectif,
Ressource, Module, Processus, Document, UploadDoc) Ressource, Module, Processus, Document, UploadDoc)
from .forms import (ProcessusAdminForm, ProcessusInlineAdminForm, ModuleAdminForm, DomaineAdminForm, CompetenceAdminForm, from .forms import (ProcessusAdminForm, ProcessusInlineAdminForm, ModuleAdminForm,
SousCompetenceInlineAdminForm, CompetenceInlineAdminForm, ObjectifAdminForm, RessourceAdminForm, DomaineAdminForm, CompetenceAdminForm, SousCompetenceInlineAdminForm,
SousCompetenceAdminForm, DocumentAdminForm, UploadAdminForm ) CompetenceInlineAdminForm, ObjectifAdminForm, RessourceAdminForm,
SousCompetenceAdminForm, DocumentAdminForm, UploadAdminForm)
# Register your models here.
class SousCompetenceInline(admin.TabularInline): class SousCompetenceInline(admin.TabularInline):
@ -19,8 +18,8 @@ class SousCompetenceInline(admin.TabularInline):
class CompetenceInline(admin.TabularInline): class CompetenceInline(admin.TabularInline):
form = CompetenceInlineAdminForm form = CompetenceInlineAdminForm
model = Competence model = Competence
extra=0 extra = 0
#template ='templates/admin/cms/processus/edit_inline/tabular.html'
class SousCompetenceAdmin(admin.ModelAdmin): class SousCompetenceAdmin(admin.ModelAdmin):
form = SousCompetenceAdminForm form = SousCompetenceAdminForm
@ -33,10 +32,10 @@ class RessourceAdmin(admin.ModelAdmin):
class ModuleAdmin(admin.ModelAdmin): class ModuleAdmin(admin.ModelAdmin):
form = ModuleAdminForm form = ModuleAdminForm
inlines = [CompetenceInline,] inlines = [CompetenceInline]
extra = 0 extra = 0
fields = (('code', 'nom'), fields = (('code', 'nom'),
('situation'), 'situation',
('contenu', 'contenu_published'), ('contenu', 'contenu_published'),
('didactique', 'didactique_published'), ('didactique', 'didactique_published'),
('evaluation', 'evaluation_published'), ('evaluation', 'evaluation_published'),
@ -45,7 +44,7 @@ class ModuleAdmin(admin.ModelAdmin):
('sem1', 'sem2'), ('sem1', 'sem2'),
('sem3', 'sem4'), ('sem3', 'sem4'),
('sem5', 'sem6'), ('sem5', 'sem6'),
('processus'), 'processus',
) )
@ -60,7 +59,7 @@ class ObjectifAdmin(admin.ModelAdmin):
class ProcessusInlineAdmin(admin.TabularInline): class ProcessusInlineAdmin(admin.TabularInline):
form = ProcessusInlineAdminForm form = ProcessusInlineAdminForm
model = Processus model = Processus
extra=0 extra = 0
class CompetenceAdmin(admin.ModelAdmin): class CompetenceAdmin(admin.ModelAdmin):
@ -73,7 +72,7 @@ class CompetenceAdmin(admin.ModelAdmin):
class DomaineAdmin(admin.ModelAdmin): class DomaineAdmin(admin.ModelAdmin):
list_display = ('nom', 'responsable',) list_display = ('nom', 'responsable',)
form = DomaineAdminForm form = DomaineAdminForm
inlines = [ProcessusInlineAdmin,] inlines = [ProcessusInlineAdmin]
class DocumentAdmin(admin.ModelAdmin): class DocumentAdmin(admin.ModelAdmin):

View file

@ -1,25 +1,19 @@
# -*- encoding: utf-8 -*- """
'''
Created on 17 nov. 2012 Created on 17 nov. 2012
@author: alzo @author: alzo
''' """
from .models import (Processus, Module, Domaine, Competence, SousCompetence, Document,
UploadDoc)
from django import forms from django import forms
#from django.forms import Textarea, TextInput from .models import (Processus, Module, Domaine, Competence, SousCompetence, Document, UploadDoc)
from tinymce.widgets import TinyMCE from tinymce.widgets import TinyMCE
class DocumentAdminForm(forms.ModelForm): class DocumentAdminForm(forms.ModelForm):
class Meta: class Meta:
model = Document model = Document
fields = ('titre', 'texte','published') fields = ('titre', 'texte', 'published')
widgets = { widgets = {
'texte': TinyMCE(attrs={'cols': 120, 'rows': 30}), 'texte': TinyMCE(attrs={'cols': 120, 'rows': 30}),
@ -28,146 +22,146 @@ class DocumentAdminForm(forms.ModelForm):
class ProcessusAdminForm(forms.ModelForm): class ProcessusAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ProcessusAdminForm, self).__init__(*args, **kwargs)
#self.fields['nom'].widget.attrs['size']='50'
class Meta: class Meta:
model = Processus model = Processus
fields = ('code', 'nom', 'domaine', 'description') fields = ('code', 'nom', 'domaine', 'description')
widgets = { widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}), 'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
'description': forms.Textarea(attrs={'cols': 125, 'rows':8}), 'description': forms.Textarea(attrs={'cols': 125, 'rows': 8}),
} }
class DomaineAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(DomaineAdminForm, self).__init__(*args, **kwargs) super(ProcessusAdminForm, self).__init__(*args, **kwargs)
class DomaineAdminForm(forms.ModelForm):
class Meta: class Meta:
model = Domaine model = Domaine
fields = ('code', 'nom', 'responsable') fields = ('code', 'nom', 'responsable')
widgets = { widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}), 'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
} }
def __init__(self, *args, **kwargs):
super(DomaineAdminForm, self).__init__(*args, **kwargs)
class CompetenceAdminForm(forms.ModelForm): class CompetenceAdminForm(forms.ModelForm):
class Meta:
model = Competence
fields = '__all__'
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(CompetenceAdminForm, self).__init__(*args, **kwargs) super(CompetenceAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = Competence
fields = ('__all__')
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}),
}
class SousCompetenceAdminForm(forms.ModelForm): class SousCompetenceAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(SousCompetenceAdminForm, self).__init__(*args, **kwargs) super(SousCompetenceAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}),
}
class CompetenceInlineAdminForm(forms.ModelForm): class CompetenceInlineAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows': 1}),
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(CompetenceInlineAdminForm, self).__init__(*args, **kwargs) super(CompetenceInlineAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows':1}),
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}),
}
class SousCompetenceInlineAdminForm(forms.ModelForm): class SousCompetenceInlineAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows': 1}),
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 1}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(SousCompetenceInlineAdminForm, self).__init__(*args, **kwargs) super(SousCompetenceInlineAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows':1}),
'nom': forms.Textarea(attrs={'cols': 125, 'rows':1}),
}
class ProcessusInlineAdminForm(forms.ModelForm): class ProcessusInlineAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows': 1}),
'nom': forms.Textarea(attrs={'cols': 75, 'rows': 4}),
'description': forms.Textarea(attrs={'cols': 95, 'rows': 6}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ProcessusInlineAdminForm, self).__init__(*args, **kwargs) super(ProcessusInlineAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'code': forms.Textarea(attrs={'cols': 5, 'rows':1}),
'nom': forms.Textarea(attrs={'cols': 75, 'rows':4}),
'description': forms.Textarea(attrs={'cols': 95, 'rows':6}),
}
class ObjectifAdminForm(forms.ModelForm): class ObjectifAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ObjectifAdminForm, self).__init__(*args, **kwargs) super(ObjectifAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}),
}
class RessourceAdminForm(forms.ModelForm): class RessourceAdminForm(forms.ModelForm):
class Meta:
model = SousCompetence
fields = '__all__'
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows': 3}),
}
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(RessourceAdminForm, self).__init__(*args, **kwargs) super(RessourceAdminForm, self).__init__(*args, **kwargs)
class Meta:
model = SousCompetence
fields = ('__all__')
widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':3}),
}
class ModuleAdminForm(forms.ModelForm): class ModuleAdminForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(ModuleAdminForm, self).__init__(*args, **kwargs)
#self.fields['nom'].widget.attrs['size']='50'
class Meta: class Meta:
model = Module model = Module
fields = ('__all__') fields = '__all__'
widgets = { widgets = {
'nom': forms.Textarea(attrs={'cols': 125, 'rows':2}), 'nom': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
'description': forms.Textarea(attrs={'cols': 125, 'rows':4}), 'description': forms.Textarea(attrs={'cols': 125, 'rows': 4}),
'situation': forms.Textarea(attrs={'cols': 125, 'rows':6}), 'situation': forms.Textarea(attrs={'cols': 125, 'rows': 6}),
'contenu': forms.Textarea(attrs={'cols': 125, 'rows':4}), 'contenu': forms.Textarea(attrs={'cols': 125, 'rows': 4}),
'didactique': forms.Textarea(attrs={'cols': 125, 'rows':2}), 'didactique': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
'evaluation': forms.Textarea(attrs={'cols': 125, 'rows':2}), 'evaluation': forms.Textarea(attrs={'cols': 125, 'rows': 2}),
} }
def __init__(self, *args, **kwargs):
super(ModuleAdminForm, self).__init__(*args, **kwargs)
class UploadAdminForm(forms.ModelForm): class UploadAdminForm(forms.ModelForm):
class Meta: class Meta:
model = UploadDoc model = UploadDoc
fields = ('titre', 'docfile', 'published', ) fields = ('titre', 'docfile', 'published', )

View file

@ -21,6 +21,7 @@ class Migration(migrations.Migration):
('published', models.BooleanField(default=False)), ('published', models.BooleanField(default=False)),
], ],
), ),
migrations.RemoveField( migrations.RemoveField(
model_name='document', model_name='document',
name='docfile', name='docfile',

View file

@ -1,50 +1,52 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
''' """
Created on 17 nov. 2012 Created on 17 nov. 2012
@author: alzo @author: alzo
''' """
from django.db import models from django.db import models
from django.http.response import HttpResponse from django.http.response import HttpResponse
from django.conf import settings from django.conf import settings
from tinymce import models as tinymce_models from tinymce import models as tinymce_models
from reportlab.platypus import SimpleDocTemplate from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus import Paragraph, Spacer, PageBreak, Table, TableStyle, Image from reportlab.platypus import Table, TableStyle, Image
from reportlab.graphics.shapes import Line
from reportlab.lib.pagesizes import A4, landscape from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib.units import cm from reportlab.lib.units import cm
from reportlab.lib.enums import TA_LEFT, TA_CENTER from reportlab.lib.enums import TA_LEFT, TA_CENTER
from reportlab.lib import colors from reportlab.lib import colors
from reportlab.lib.styles import ParagraphStyle as PS 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_8_c = PS(name='CORPS', fontName='Helvetica', fontSize=6, alignment=TA_CENTER)
style_bold = PS(name='CORPS', fontName='Helvetica-Bold', fontSize=10, alignment = TA_LEFT) style_normal = PS(name='CORPS', fontName='Helvetica', fontSize=8, alignment=TA_LEFT)
style_title = PS(name='CORPS', fontName='Helvetica', fontSize=12, alignment = TA_LEFT) style_bold = PS(name='CORPS', fontName='Helvetica-Bold', fontSize=10, alignment=TA_LEFT)
style_adress = PS(name='CORPS', fontName='Helvetica', fontSize=10, alignment = TA_LEFT, leftIndent=300) style_title = PS(name='CORPS', fontName='Helvetica', fontSize=12, alignment=TA_LEFT)
# Create your models here. style_adress = PS(name='CORPS', fontName='Helvetica', fontSize=10, alignment=TA_LEFT, leftIndent=300)
CHOIX_TYPE_SAVOIR = ( CHOIX_TYPE_SAVOIR = (
('Savoir','savoir'), ('Savoir', 'savoir'),
('Savoir méthodologique','savoir méthodologique'), ('Savoir méthodologique', 'savoir méthodologique'),
('Savoir relationnel','savoir relationnel'), ('Savoir relationnel', 'savoir relationnel'),
) )
CHOIX_TYPE_MODULE = ( CHOIX_TYPE_MODULE = (
('Spécifique', 'spécifique'), ('Spécifique', 'spécifique'),
('Transversal', 'transversal'), ('Transversal', 'transversal'),
) )
class Enseignant(models.Model): class Enseignant(models.Model):
sigle = models.CharField(max_length=5, blank=True, default='')
class Meta:
ordering =('nom',)
sigle = models.CharField(max_length= 5, blank=True, default='')
nom = models.CharField(max_length=20, blank=True, default='') nom = models.CharField(max_length=20, blank=True, default='')
prenom = models.CharField(max_length=20, blank=True, default='') prenom = models.CharField(max_length=20, blank=True, default='')
email = models.EmailField(blank=True, default='') email = models.EmailField(blank=True, default='')
class Meta:
ordering = ('nom',)
def __str__(self): def __str__(self):
return '{0} {1}'.format(self.nom, self.prenom) return '{0} {1}'.format(self.nom, self.prenom)
@ -56,15 +58,12 @@ class Enseignant(models.Model):
class Domaine(models.Model): class Domaine(models.Model):
class Meta:
ordering = ('code',)
code = models.CharField(max_length=20, blank=True) code = models.CharField(max_length=20, blank=True)
nom = models.CharField(max_length=200, blank=False) nom = models.CharField(max_length=200, blank=False)
responsable = models.ForeignKey(Enseignant, null=True, default=None) responsable = models.ForeignKey(Enseignant, null=True, default=None)
#height_screen = 50 class Meta:
ordering = ('code', )
def __str__(self): def __str__(self):
return '{0} - {1}'.format(self.code, self.nom) return '{0} - {1}'.format(self.code, self.nom)
@ -72,36 +71,17 @@ class Domaine(models.Model):
def url(self): def url(self):
return "<a href='/domaine/{0}'>{1}</a>".format(self.id, self.__str__()) return "<a href='/domaine/{0}'>{1}</a>".format(self.id, self.__str__())
"""
def svg(self):
processus = self.processus_set.all()
svg = '<rect x="20" y="{0}" rx="5" ry="5" width="250" height="{1}" fill="{2}" stroke="black" stroke-width="1" />'
txt = '<text x="25" y="{0}" style="stroke:#000000;font-size:10;">{1}</text>'
height_frame = processus.count()* self.height_screen
color = settings.DOMAINE_COULEURS[self.code]
return svg.format(20, height_frame , color) + txt.format(50, self.__str__())
def json(self):
dic_js = {}
dic_js['{code'] = self.code
dic_js['nom'] = self.nom
dic_js['resp'] = self.responsable.nom
return '{'
"""
class Processus(models.Model): class Processus(models.Model):
class Meta:
ordering = ('code',)
verbose_name_plural = 'processus'
code = models.CharField(max_length=20, blank=True) code = models.CharField(max_length=20, blank=True)
nom = models.CharField(max_length=200, blank=False) nom = models.CharField(max_length=200, blank=False)
domaine = models.ForeignKey(Domaine, null=False) domaine = models.ForeignKey(Domaine, null=False)
description = models.TextField(default='') description = models.TextField(default='')
class Meta:
ordering = ('code',)
verbose_name_plural = 'processus'
def __str__(self): def __str__(self):
return '{0} - {1}'.format(self.code, self.nom) return '{0} - {1}'.format(self.code, self.nom)
@ -110,21 +90,16 @@ class Processus(models.Model):
class Module(models.Model): class Module(models.Model):
class Meta:
ordering = ('code',)
code = models.CharField(max_length=10, blank=False, default='Code') code = models.CharField(max_length=10, blank=False, default='Code')
nom = models.CharField(max_length=100, blank=False, default='Nom du module') nom = models.CharField(max_length=100, blank=False, default='Nom du module')
type = models.CharField(max_length=20, choices= CHOIX_TYPE_MODULE) type = models.CharField(max_length=20, choices=CHOIX_TYPE_MODULE)
situation = models.TextField() situation = models.TextField()
evaluation = models.TextField() evaluation = models.TextField()
contenu = models.TextField() contenu = models.TextField()
periode_presentiel = models.IntegerField(verbose_name='Présentiel') periode_presentiel = models.IntegerField(verbose_name='Présentiel')
travail_perso = models.IntegerField(verbose_name = 'Travail personnel') travail_perso = models.IntegerField(verbose_name='Travail personnel')
pratique_prof = models.IntegerField(default=0, verbose_name='Pratique prof.') pratique_prof = models.IntegerField(default=0, verbose_name='Pratique prof.')
didactique = models.TextField() didactique = models.TextField()
evaluation = models.TextField()
sem1 = models.IntegerField(default=0) sem1 = models.IntegerField(default=0)
sem2 = models.IntegerField(default=0) sem2 = models.IntegerField(default=0)
@ -139,6 +114,9 @@ class Module(models.Model):
evaluation_published = models.BooleanField(default=False) evaluation_published = models.BooleanField(default=False)
contenu_published = models.BooleanField(default=False) contenu_published = models.BooleanField(default=False)
class Meta:
ordering = ('code',)
def __str__(self): def __str__(self):
return '{0} - {1}'.format(self.code, self.nom) return '{0} - {1}'.format(self.code, self.nom)
@ -150,58 +128,52 @@ class Module(models.Model):
class Competence(models.Model): class Competence(models.Model):
class Meta:
ordering = ('code',)
verbose_name = 'compétence'
code = models.CharField(max_length=20, blank=True) code = models.CharField(max_length=20, blank=True)
nom = models.CharField(max_length=250, blank=False) nom = models.CharField(max_length=250, blank=False)
type = models.CharField(max_length=35, blank=True, default='') type = models.CharField(max_length=35, blank=True, default='')
module = models.ForeignKey(Module, null=True, default=None) module = models.ForeignKey(Module, null=True, default=None)
proces_eval = models.ForeignKey(Processus, null=True, default=True) proces_eval = models.ForeignKey(Processus, null=True, default=True)
list_display = ('code', 'nom', 'type','proces_eval') list_display = ('code', 'nom', 'type', 'proces_eval')
class Meta:
ordering = ('code',)
verbose_name = 'compétence'
def __str__(self): def __str__(self):
return '{0} - {1}'.format(self.code, self.nom) return '{0} - {1}'.format(self.code, self.nom)
class SousCompetence(models.Model): class SousCompetence(models.Model):
code = models.CharField(max_length=20, blank=True)
nom = models.CharField(max_length=250, blank=False)
competence = models.ForeignKey(Competence, null=False)
class Meta: class Meta:
ordering = ('code',) ordering = ('code',)
verbose_name = 'sous-compétence' verbose_name = 'sous-compétence'
code = models.CharField(max_length=20, blank=True)
nom = models.CharField(max_length=250, blank=False)
competence = models.ForeignKey(Competence, null=False)
def __str__(self): def __str__(self):
return '{0} - {1}'.format(self.code, self.nom) return '{0} - {1}'.format(self.code, self.nom)
class Ressource(models.Model): class Ressource(models.Model):
nom = models.CharField(max_length=200, blank=False) nom = models.CharField(max_length=200, blank=False)
type = models.CharField(max_length=30, choices = CHOIX_TYPE_SAVOIR, default='Savoir') type = models.CharField(max_length=30, choices=CHOIX_TYPE_SAVOIR, default='Savoir')
module=models.ForeignKey(Module, null=True, default=None) module = models.ForeignKey(Module, null=True, default=None)
def __str__(self): def __str__(self):
return '{0}'.format(self.nom) return '{0}'.format(self.nom)
class Objectif(models.Model): class Objectif(models.Model):
nom = models.CharField(max_length=200, blank=False) nom = models.CharField(max_length=200, blank=False)
module=models.ForeignKey(Module, null=True, default=None) module = models.ForeignKey(Module, null=True, default=None)
def __str__(self): def __str__(self):
return '{0}'.format(self.nom) return '{0}'.format(self.nom)
class Document(models.Model): class Document(models.Model):
#docfile = models.FileField(upload_to='media/')
titre = models.CharField(max_length=128, blank=True) titre = models.CharField(max_length=128, blank=True)
texte = tinymce_models.HTMLField(blank=True,) texte = tinymce_models.HTMLField(blank=True,)
published = models.BooleanField(default=False) published = models.BooleanField(default=False)
@ -211,22 +183,15 @@ class Document(models.Model):
class UploadDoc(models.Model): class UploadDoc(models.Model):
class Meta:
verbose_name= 'UploadDoc'
docfile = models.FileField(upload_to='doc/') docfile = models.FileField(upload_to='doc/')
titre = models.CharField(max_length=100, blank=False) titre = models.CharField(max_length=100, blank=False)
published = models.BooleanField(default=False) published = models.BooleanField(default=False)
class Meta:
verbose_name = 'UploadDoc'
def __str__(self): def __str__(self):
return self.titre return self.titre
"""
class OffreEmploi(models.Model):
source = models.CharField(max_lenght=200, blank=False)
descr = model.HTMLField(blank=False)
published = models.BooleanField(default=False)
"""
class PDFResponse(HttpResponse): class PDFResponse(HttpResponse):
@ -238,19 +203,17 @@ class PDFResponse(HttpResponse):
self.story = [] self.story = []
image = Image(settings.MEDIA_ROOT + '/media/header.png', width=520, height=75) image = Image(settings.MEDIA_ROOT + '/media/header.png', width=520, height=75)
image.hAlign = TA_LEFT image.hAlign = TA_LEFT
self.story.append(image) self.story.append(image)
#self.story.append(Spacer(0,1*cm)) data = list(['Filières EDS', title])
data = [['Filières EDS', title]]
if portrait: if portrait:
t = Table(data, colWidths=[8*cm,8*cm]) t = Table(data, colWidths=[8*cm, 8*cm])
else: else:
t = Table(data, colWidths=[11*cm,11*cm]) t = Table(data, colWidths=[11*cm, 11*cm])
t.setStyle(TableStyle([ ('ALIGN',(0,0),(0,0),'LEFT'), t.setStyle(TableStyle([
('ALIGN',(1,0),(-1,-1),'RIGHT'), ('ALIGN', (0, 0), (0, 0), 'LEFT'),
('LINEABOVE', (0,0) ,(-1,-1), 0.5, colors.black), ('ALIGN', (1, 0), (-1, -1), 'RIGHT'),
('LINEBELOW', (0,-1),(-1,-1), 0.5, colors.black), ('LINEABOVE', (0, 0), (-1, -1), 0.5, colors.black),
('LINEBELOW', (0, -1), (-1, -1), 0.5, colors.black),
])) ]))
t.hAlign = TA_LEFT t.hAlign = TA_LEFT
self.story.append(t) self.story.append(t)
@ -270,7 +233,7 @@ class MyDocTemplate(SimpleDocTemplate):
# page number # page number
self.canv.saveState() self.canv.saveState()
self.canv.setFontSize(8) self.canv.setFontSize(8)
self.canv.drawCentredString(self.CENTRE_WIDTH,1*cm,"Page : " + str(self.canv.getPageNumber())) self.canv.drawCentredString(self.CENTRE_WIDTH, 1*cm, "Page : " + str(self.canv.getPageNumber()))
self.canv.restoreState() self.canv.restoreState()
@ -288,8 +251,5 @@ class MyDocTemplateLandscape(SimpleDocTemplate):
# page number # page number
self.canv.saveState() self.canv.saveState()
self.canv.setFontSize(8) self.canv.setFontSize(8)
self.canv.drawCentredString(self.CENTRE_WIDTH,1*cm,"Page : " + str(self.canv.getPageNumber())) self.canv.drawCentredString(self.CENTRE_WIDTH, 1*cm, "Page : " + str(self.canv.getPageNumber()))
self.canv.restoreState() self.canv.restoreState()

129
cms/pdf.py Normal file
View file

@ -0,0 +1,129 @@
from django.http.response import HttpResponse
from django.conf import settings
from reportlab.pdfgen import canvas
from reportlab.platypus import SimpleDocTemplate, Frame
from reportlab.platypus import Table, TableStyle, Image
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)
class PDFResponse(HttpResponse):
def __init__(self, filename, title='', portrait=True):
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.png', width=400, height=80)
image.hAlign = TA_LEFT
self.story.append(image)
data = [['Filières EDS', title]]
if portrait:
t = Table(data, colWidths=[8*cm, 8*cm])
else:
t = Table(data, colWidths=[11*cm, 11*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 = TA_LEFT
self.story.append(t)
class MyDocTemplate(SimpleDocTemplate):
def __init__(self, name):
SimpleDocTemplate.__init__(self, name, pagesize=A4, topMargin=0.5*cm, leftMargin=1*cm)
self.fileName = name
self.PAGE_WIDTH = A4[0]
self.PAGE_HEIGHT = A4[1]
self.CENTRE_WIDTH = self.PAGE_WIDTH/2.0
self.CENTRE_HEIGHT = self.PAGE_HEIGHT/2.0
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*cm, leftMargin=2*cm)
self.fileName = name
self.PAGE_WIDTH = A4[1]
self.PAGE_HEIGHT = A4[0]
self.CENTRE_WIDTH = self.PAGE_WIDTH/2.0
self.CENTRE_HEIGHT = self.PAGE_HEIGHT/2.0
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 PeriodPDF(object):
"""Imprime les heures de cours par semestre"""
def __init__(self, filename):
self.canv = canvas.Canvas(filename, pagesize=A4)
self.canv.setPageCompression(0)
self.canv.setFont('Helvetica', 9)
header_frame = Frame(1.2*cm, 24*cm, 18*cm, 5*cm, showBoundary=0)
story = []
image = Image(settings.MEDIA_ROOT + 'logo.png', width=520, height=90)
story.append(image)
data = [['Filières EDS', 'Périodes de formation']]
t = Table(data, colWidths=[8.5*cm, 8.5*cm], spaceBefore=0, spaceAfter=0, hAlign=TA_LEFT)
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),
]))
story.append(t)
header_frame.addFromList(story, self.canv)
def produce_half_year(self, half_year_id, modules, total):
initial_pos_x = [2, 11]
initial_pos_y = [17, 17, 10, 10, 3, 3]
width = 7*cm
height = 6.5*cm
x = initial_pos_x[(half_year_id-1) % 2]*cm
y = initial_pos_y[half_year_id-1]*cm
my_frame = Frame(x, y, width, height, showBoundary=0)
data = [['Semestre {0}'.format(half_year_id), '{0} h.'.format(total)]]
for line in modules:
value = getattr(line, 'sem{0}'.format(half_year_id))
data.append([line.nom, '{0} h.'.format(value)])
t = Table(data, colWidths=[7*cm, 1*cm], spaceBefore=0, spaceAfter=0, hAlign=TA_LEFT)
t.setStyle(TableStyle([('ALIGN', (0, 0), (0, 0), 'LEFT'),
('ALIGN', (1, 0), (-1, -1), 'RIGHT'),
('LINEBELOW', (0, 0), (1, 0), 1, colors.black),
('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'), ]))
story = [t]
my_frame.addFromList(story, self.canv)
def print_total(self, total):
self.canv.drawString(2*cm, 2*cm, 'Total de la formation: {0} heures'.format(total))

View file

@ -1,24 +1,24 @@
''' """
Created on 4 déc. 2012 Created on 4 déc. 2012
@author: alzo @author: alzo
''' """
from django.views.generic import ListView, TemplateView, DetailView from django.views.generic import ListView, TemplateView, DetailView
from .models import (Domaine, Processus, Module, Competence, Document, UploadDoc,
PDFResponse, MyDocTemplate, MyDocTemplateLandscape)
from .models import style_normal, style_bold, style_title
from django.db.models import F, Sum from django.db.models import F, Sum
from django.http import HttpResponse
from reportlab.platypus import Paragraph, Spacer, Table, TableStyle, Preformatted
from reportlab.platypus import Paragraph, Spacer, PageBreak, Table, TableStyle, Preformatted
from reportlab.lib.units import cm from reportlab.lib.units import cm
from reportlab.lib.enums import TA_LEFT
from reportlab.lib import colors from reportlab.lib import colors
from reportlab.lib.colors import HexColor from reportlab.lib.colors import HexColor
from cms.pdf import PeriodPDF
from .models import style_normal, style_title
from .models import (Domaine, Processus, Module, Competence, Document, UploadDoc,
PDFResponse, MyDocTemplate, MyDocTemplateLandscape)
# Create your views here. # Create your views here.
class HomeView(TemplateView): class HomeView(TemplateView):
template_name = 'cms/index.html' template_name = 'cms/index.html'
@ -26,116 +26,113 @@ class HomeView(TemplateView):
context = super(HomeView, self).get_context_data(**kwargs) context = super(HomeView, self).get_context_data(**kwargs)
for d in Domaine.objects.all().order_by('code'): for d in Domaine.objects.all().order_by('code'):
context[d.code] = d context[d.code] = d
for c in Processus.objects.all().order_by('code'): for c in Processus.objects.all().order_by('code'):
context[c.code] = c context[c.code] = c
for m in Module.objects.all().order_by('code'): for m in Module.objects.all().order_by('code'):
context[m.code] = m context[m.code] = m
return context return context
class Element(object): class Element(object):
def __init__(self, el, top_left, bottom_right): def __init__(self, el):
self.txt = el.__str__() self.txt = el.__str__()
class HomePDFView(TemplateView): class HomePDFView(TemplateView):
template_name = 'cms/index.html' template_name = 'cms/index.html'
def formating(self, el1=None, length=40 ): def formating(self, el1='', length=40):
el1 = '' if el1 is None else el1.__str__() el1 = '' if el1 == '' else el1.__str__()
return Preformatted(el1, style_normal, maxLineLength=length) return Preformatted(el1, style_normal, maxLineLength=length)
def pf40(self, txt): # def pf40(self, txt):
return Preformatted(txt, style_normal, maxLineLength=40) # return Preformatted(txt, style_normal, maxLineLength=40)
def render_to_response(self, context, **response_kwargs): def render_to_response(self, context, **response_kwargs):
response = PDFResponse('PlanFormation.pdf' ,'Plan de formation', portrait=False) response = PDFResponse('PlanFormation.pdf', 'Plan de formation', portrait=False)
d = Domaine.objects.all().order_by('code') d = Domaine.objects.all().order_by('code')
p = Processus.objects.all().order_by('code') p = Processus.objects.all().order_by('code')
data = [['Domaines','Processus', 'Sem1', 'Sem2', 'Sem3','Sem4','Sem5','Sem6'], data = [
[self.formating(d[0]), self.formating(p[0], 60) , 'M01' , '' ,'' , '' , '' ,'' ], ['Domaines', 'Processus', 'Sem1', 'Sem2', 'Sem3', 'Sem4', 'Sem5', 'Sem6'],
[self.formating(None), self.formating(None, 60) , 'M02' , '' ,'' , '' , '' ,'' ], [self.formating(d[0]), self.formating(p[0], 60), 'M01', '', '', '', '', ''],
[self.formating(None), self.formating(p[1], 60) , '' , '' ,'' , 'M03' , '' , '' ], [self.formating(''), self.formating('', 60), 'M02', '', '', '', '', ''],
[self.formating(None), self.formating(None, 60) , '' , 'M04' ,'' , '' , '' , '' ], [self.formating(''), self.formating(p[1], 60), '', '', '', 'M03', '', ''],
[self.formating(d[1]), self.formating(p[2], 60) , 'M05' , '' ,'M06' , '' , '' , '' ], [self.formating(''), self.formating('', 60), '', 'M04', '', '', '', ''],
[self.formating(None), self.formating(p[3], 60) , '' , '' ,'' , '' , 'M07' , 'M09' ], [self.formating(d[1]), self.formating(p[2], 60), 'M05', '', 'M06', '', '', ''],
[self.formating(None), self.formating(None, 60) , '' , '' ,'' ,'' , 'M08' , '' ], [self.formating(''), self.formating(p[3], 60), '', '', '', '', 'M07', 'M09'],
[self.formating(d[2]), self.formating(p[4], 60), '' , '' , 'M10' , '' , 'M12' ], [self.formating(''), self.formating('', 60), '', '', '', '', 'M08', ''],
[self.formating(None), self.formating(p[5], 60) , '' , '' , 'M11' '' , '' ], [self.formating(d[2]), self.formating(p[4], 60), '', '', 'M10', '', 'M12'],
[self.formating(d[3]), self.formating(p[6], 60) , '' , '' , 'M13' , '' ,'' , 'M14' ], [self.formating(''), self.formating(p[5], 60), '', '', 'M11', '', ''],
[self.formating(d[4]), self.formating(p[7], 60) , 'M15' , '' ,'' , '' , '' , '' ], [self.formating(d[3]), self.formating(p[6], 60), '', '', 'M13', '', '', 'M14'],
[self.formating(d[5]), self.formating(p[8], 60) , 'M16_1' , '' ,'M16_2' , '' , 'M16_3' , '' ], [self.formating(d[4]), self.formating(p[7], 60), 'M15', '', '', '', '', ''],
[self.formating(d[6]), self.formating(p[9], 60) , 'M17_1' , '' ,'M17_2' , '' , 'M17_3' , '' ], [self.formating(d[5]), self.formating(p[8], 60), 'M16_1', '', 'M16_2', '', 'M16_3', ''],
[self.formating(d[7]), self.formating(p[10],60), 'Macc' , '' ,'' , '' , '' , '' ], [self.formating(d[6]), self.formating(p[9], 60), 'M17_1', '', 'M17_2', '', 'M17_3', ''],
[self.formating(d[7]), self.formating(p[10], 60), 'Macc', '', '', '', '', ''],
] ]
print(data) print(data)
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=0.5*cm, spaceAfter=1*cm) 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=0.5*cm, spaceAfter=1*cm)
t.setStyle(TableStyle([ t.setStyle(TableStyle([
('SIZE', (0,0), (-1,-1), 8), ('SIZE', (0, 0), (-1, -1), 8),
('FONT', (0,0), (-1,0), 'Helvetica-Bold'), ('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
('ALIGN',(2,0),(-1,-1),'CENTER'), ('ALIGN', (2, 0), (-1, -1), 'CENTER'),
('GRID',(0,0),(-1,-1), 0.25, colors.black), ('GRID', (0, 0), (-1, -1), 0.25, colors.black),
#Domaine 1 # Domaine 1
('SPAN',(0,1), (0,4)), ('SPAN', (0, 1), (0, 4)),
('SPAN',(1,1), (1,2)), ('SPAN', (1, 1), (1, 2)),
('SPAN',(1,3), (1,4)), ('SPAN', (1, 3), (1, 4)),
('BACKGROUND',(0,1), (1,4), colors.orange), ('BACKGROUND', (0, 1), (1, 4), colors.orange),
('BACKGROUND',(2,1), (2,2), colors.orange), ('BACKGROUND', (2, 1), (2, 2), colors.orange),
('BACKGROUND',(5,3), (5,3), colors.orange), ('BACKGROUND', (5, 3), (5, 3), colors.orange),
('BACKGROUND',(3,4), (3,4), colors.orange), ('BACKGROUND', (3, 4), (3, 4), colors.orange),
#Domaine 2 # Domaine 2
('SPAN',(0,5), (0,7)), ('SPAN', (0, 5), (0, 7)),
('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',(6,6), (6,6), colors.red), ('BACKGROUND', (6, 6), (6, 6), colors.red),
('BACKGROUND',(7,6), (7,6), colors.red), ('BACKGROUND', (7, 6), (7, 6), colors.red),
('BACKGROUND',(6,7), (6,7), colors.red), ('BACKGROUND', (6, 7), (6, 7), colors.red),
#Domaine 3 # Domaine 3
('SPAN',(0,8), (0,9)), ('SPAN', (0, 8), (0, 9)),
('SPAN',(1,6), (1,7)), ('SPAN', (1, 6), (1, 7)),
('SPAN',(4,8), (5,8)), ('SPAN', (4, 8), (5, 8)),
('SPAN',(4,9), (5,9)), ('SPAN', (4, 9), (5, 9)),
('BACKGROUND',(0,8), (1,9), colors.pink), ('BACKGROUND', (0, 8), (1, 9), colors.pink),
('BACKGROUND',(4,8), (6,8), colors.pink), ('BACKGROUND', (4, 8), (6, 8), colors.pink),
('BACKGROUND',(4,9), (5,9), colors.pink), ('BACKGROUND', (4, 9), (5, 9), colors.pink),
#Domaine 4 # Domaine 4
('BACKGROUND',(0,10), (1,10), HexColor('#AD7FA8')), ('BACKGROUND', (0, 10), (1, 10), HexColor('#AD7FA8')),
('BACKGROUND',(4,10), (4,10), HexColor('#AD7FA8')), ('BACKGROUND', (4, 10), (4, 10), HexColor('#AD7FA8')),
('BACKGROUND',(7,10), (7,10), HexColor('#AD7FA8')), ('BACKGROUND', (7, 10), (7, 10), HexColor('#AD7FA8')),
#Domaine 5 # Domaine 5
('SPAN',(2,11), (-1,11)), ('SPAN', (2, 11), (-1, 11)),
('BACKGROUND',(0,11), (-1,11), HexColor('#729FCF')), ('BACKGROUND', (0, 11), (-1, 11), HexColor('#729FCF')),
#Domaine 6 # Domaine 6
('SPAN',(2,12), (3,12)), ('SPAN', (2, 12), (3, 12)),
('SPAN',(4,12), (5,12)), ('SPAN', (4, 12), (5, 12)),
('SPAN',(6,12), (7,12)), ('SPAN', (6, 12), (7, 12)),
('BACKGROUND',(0,12), (-1,12), colors.lightgreen), ('BACKGROUND', (0, 12), (-1, 12), colors.lightgreen),
#Domaine 7 # Domaine 7
('SPAN',(2,13), (3,13)), ('SPAN', (2, 13), (3, 13)),
('SPAN',(4,13), (5,13)), ('SPAN', (4, 13), (5, 13)),
('SPAN',(6,13), (7,13)), ('SPAN', (6, 13), (7, 13)),
('BACKGROUND',(0,13), (-1,13), colors.white), ('BACKGROUND', (0, 13), (-1, 13), colors.white),
#Domaine 8 # Domaine 8
('SPAN',(2,14), (-1,14)), ('SPAN', (2, 14), (-1, 14)),
('BACKGROUND',(0,14), (-1,14), colors.lightgrey), ('BACKGROUND', (0, 14), (-1, 14), colors.lightgrey),
])) ]))
t.hAlign = 0 t.hAlign = 0
response.story.append(t) response.story.append(t)
doc = MyDocTemplateLandscape(response) doc = MyDocTemplateLandscape(response)
doc.build(response.story) doc.build(response.story)
return response return response
@ -169,11 +166,11 @@ class ModuleListView(ListView):
model = Module model = Module
def Preformatted_left(text): def preformatted_left(text):
return Preformatted(text, style_normal, maxLineLength=15) return Preformatted(text, style_normal, maxLineLength=15)
def Preformatted_right(text): def preformatted_right(text):
return Preformatted(text, style_normal, maxLineLength=110) return Preformatted(text, style_normal, maxLineLength=110)
@ -181,6 +178,7 @@ class EvaluationView(ListView):
template_name = 'cms/evaluation.html' template_name = 'cms/evaluation.html'
model = Processus model = Processus
class DocumentListView(ListView): class DocumentListView(ListView):
template_name = 'cms/document_list.html' template_name = 'cms/document_list.html'
model = Document model = Document
@ -189,7 +187,6 @@ class DocumentListView(ListView):
query = Document.objects.filter(published=True) query = Document.objects.filter(published=True)
return query return query
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super(DocumentListView, self).get_context_data(**kwargs) context = super(DocumentListView, self).get_context_data(**kwargs)
context['upload'] = UploadDoc.objects.filter(published=True) context['upload'] = UploadDoc.objects.filter(published=True)
@ -197,7 +194,7 @@ class DocumentListView(ListView):
class DocumentDetailView(DetailView): class DocumentDetailView(DetailView):
template_name ='cms/document_detail.html' template_name = 'cms/document_detail.html'
model = Document model = Document
@ -221,7 +218,7 @@ class ModulePDF(DetailView):
def render_to_response(self, context, **response_kwargs): def render_to_response(self, context, **response_kwargs):
m = self.get_object() m = self.get_object()
response = PDFResponse('Module_{0}.pdf'.format(m.code) ,'Module de formation') response = PDFResponse('Module_{0}.pdf'.format(m.code), 'Module de formation')
str_comp = '' str_comp = ''
for c in m.competence_set.all(): for c in m.competence_set.all():
@ -251,32 +248,34 @@ class ModulePDF(DetailView):
for l in lines: for l in lines:
str_con += '{0}\n'.format(l) str_con += '{0}\n'.format(l)
response.story.append(Spacer(0,1*cm)) response.story.append(Spacer(0, 1*cm))
response.story.append(Paragraph(m.__str__(), style_title)) response.story.append(Paragraph(m.__str__(), style_title))
data = [[Preformatted_left('Domaine'), Preformatted_right(m.processus.domaine.__str__())], data = [
[Preformatted_left('Processus'), Preformatted_right(m.processus.__str__())], [preformatted_left('Domaine'), preformatted_right(m.processus.domaine.__str__())],
[Preformatted_left('Situation emblématique'), Preformatted_right(m.situation)], [preformatted_left('Processus'), preformatted_right(m.processus.__str__())],
[Preformatted_left('Compétences visées'), Preformatted_right(str_comp)], [preformatted_left('Situation emblématique'), preformatted_right(m.situation)],
[Preformatted_left('Plus-value sur le CFC ASE'), Preformatted_right(str_scom)], [preformatted_left('Compétences visées'), preformatted_right(str_comp)],
#[Preformatted_left('Ressources à acquérir'), Preformatted_right(str_res)], [preformatted_left('Plus-value sur le CFC ASE'), preformatted_right(str_scom)],
[Preformatted_left('Objectifs à atteindre'), Preformatted_right(str_obj)], # [Preformatted_left('Ressources à acquérir'), Preformatted_right(str_res)],
[Preformatted_left('Didactique'), Preformatted_right(m.didactique)], [preformatted_left('Objectifs à atteindre'), preformatted_right(str_obj)],
#[Preformatted_left('Contenu'), Preformatted_right(str_con)], [preformatted_left('Didactique'), preformatted_right(m.didactique)],
[Preformatted_left('Evaluation'), Preformatted_right(m.evaluation)], # [Preformatted_left('Contenu'), Preformatted_right(str_con)],
[Preformatted_left('Type'), Preformatted_right('{0}, obligatoire'.format(m.type))], [preformatted_left('Evaluation'), preformatted_right(m.evaluation)],
[Preformatted_left('Semestre'), Preformatted_right('Sem. {0}'.format(m.semestre))], [preformatted_left('Type'), preformatted_right('{0}, obligatoire'.format(m.type))],
[Preformatted_left('Présentiel'), Preformatted_right('{0} heures'.format(m.periode_presentiel))], [preformatted_left('Semestre'), preformatted_right('Sem. {0}'.format(m.semestre))],
[Preformatted_left('Travail personnel'), Preformatted_right('{0} heures'.format(m.travail_perso))], [preformatted_left('Présentiel'), preformatted_right('{0} heures'.format(m.periode_presentiel))],
[Preformatted_left('Responsable'), Preformatted_right(m.processus.domaine.responsable.descr_pdf())], [preformatted_left('Travail personnel'), preformatted_right('{0} heures'.format(m.travail_perso))],
[preformatted_left('Responsable'), preformatted_right(m.processus.domaine.responsable.descr_pdf())],
] ]
t = Table(data, colWidths=[2.5*cm,10*cm]) t = Table(data, colWidths=[2.5*cm, 10*cm])
t.setStyle(TableStyle([ ('ALIGN',(0,0),(-1,-1),'LEFT'), t.setStyle(TableStyle([
('VALIGN',(0,0),(-1,-1),'TOP'), ('ALIGN', (0, 0), (-1, -1), 'LEFT'),
('LEFTPADDING', (0,0),(-1,-1), 0), ('VALIGN', (0, 0), (-1, -1), 'TOP'),
])) ('LEFTPADDING', (0, 0), (-1, -1), 0), ])
t.hAlign=0 )
response.story.append(Spacer(0,1*cm)) t.hAlign = 0
response.story.append(Spacer(0, 1*cm))
response.story.append(t) response.story.append(t)
doc = MyDocTemplate(response) doc = MyDocTemplate(response)
@ -288,23 +287,24 @@ def get_context(context):
""" """
Calcul du nombre de périodes de formation Calcul du nombre de périodes de formation
""" """
liste = Module.objects.exclude(periode_presentiel = 0) liste = Module.objects.exclude(periode_presentiel=0)
#context['tot'] = liste.aggregate(Sum(F('periode_presentiel'))) # context['tot'] = liste.aggregate(Sum(F('periode_presentiel')))
context['sem1'] = liste.exclude(sem1 = 0) context['sem1'] = liste.exclude(sem1=0)
context['tot1'] = liste.aggregate(Sum(F('sem1'))) context['tot1'] = liste.aggregate(Sum(F('sem1')))['sem1__sum']
context['sem2'] = liste.exclude(sem2 = 0) context['sem2'] = liste.exclude(sem2=0)
context['tot2'] = liste.aggregate(Sum(F('sem2'))) context['tot2'] = liste.aggregate(Sum(F('sem2')))['sem2__sum']
context['sem3'] = liste.exclude(sem3 = 0) context['sem3'] = liste.exclude(sem3=0)
context['tot3'] = liste.aggregate(Sum(F('sem3'))) context['tot3'] = liste.aggregate(Sum(F('sem3')))['sem3__sum']
context['sem4'] = liste.exclude(sem4 = 0) context['sem4'] = liste.exclude(sem4=0)
context['tot4'] = liste.aggregate(Sum(F('sem4'))) context['tot4'] = liste.aggregate(Sum(F('sem4')))['sem4__sum']
context['sem5'] = liste.exclude(sem5 = 0) context['sem5'] = liste.exclude(sem5=0)
context['tot5'] = liste.aggregate(Sum(F('sem5'))) context['tot5'] = liste.aggregate(Sum(F('sem5')))['sem5__sum']
context['sem6'] = liste.exclude(sem6 = 0) context['sem6'] = liste.exclude(sem6=0)
context['tot6'] = liste.aggregate(Sum(F('sem6'))) context['tot6'] = liste.aggregate(Sum(F('sem6')))['sem6__sum']
context['tot'] = context['tot1']['sem1__sum'] + context['tot2']['sem2__sum'] + context['tot3']['sem3__sum'] + \
context['tot4']['sem4__sum'] + context['tot5']['sem5__sum'] + context['tot6']['sem6__sum'] context['tot'] = context['tot1'] + context['tot2'] + context['tot3'] + \
context['tot4'] + context['tot5'] + context['tot6']
return context return context
@ -318,72 +318,24 @@ class PeriodeView(TemplateView):
class PeriodePDFView(TemplateView): class PeriodePDFView(TemplateView):
template_name = 'cms/periodes.html'
def render_to_response(self, context, **response_kwargs): def render_to_response(self, context, **response_kwargs):
response = PDFResponse('Périodes.pdf' ,'Périodes de formation')
context = get_context(context) context = get_context(context)
filename = 'periode.pdf'
pdf = PeriodPDF(filename)
for semestre_id in range(1, 7):
modules = context['sem{0}'.format(str(semestre_id))]
total = context['tot{0}'.format(str(semestre_id))]
pdf.produce_half_year(semestre_id, modules, total)
pdf.print_total(context['tot'])
pdf.canv.save()
data = [['Semestre 1', '{0} h.'.format(context['tot1']['sem1__sum']),'', 'Semestre 2', '{0} h.'.format(context['tot2']['sem2__sum'])], with open(filename, mode='rb') as fh:
[context['sem1'][0], '{0} h.'.format(context['sem1'][0].sem1),'', context['sem2'][0], '{0} h.'.format(context['sem2'][0].sem2) ], response = HttpResponse(fh.read(), content_type='application/pdf')
[context['sem1'][1], '{0} h.'.format(context['sem1'][1].sem1),'', context['sem2'][1], '{0} h.'.format(context['sem2'][1].sem2) ], response['Content-Disposition'] = 'attachment; filename="{0}"'.format(filename)
[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['sem2'][5], '{0} h.'.format(context['sem2'][5].sem2) ],
[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) ],
['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,15), (-1,15), 15),
('LINEBELOW', (0,15), (1,15), 1, colors.black),
('LINEBELOW', (3,15), (-1,15), 1, colors.black),
('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
('FONT', (0, 8), (-1, 8), 'Helvetica-Bold'),
('FONT', (0, 15), (-1, 15), 'Helvetica-Bold'),
]))
t.hAlign = 0
response.story.append(t)
response.story.append(Paragraph('Total des heures de cours: {0} heures'.format(context['tot']), style_normal))
doc = MyDocTemplate(response)
doc.build(response.story)
return response return response
class CompetenceListView(ListView): class CompetenceListView(ListView):
model = Competence model = Competence
template_name = 'cms/competence_list.html' template_name = 'cms/competence_list.html'
@ -401,9 +353,6 @@ class TravailPersoListView(ListView):
return get_context(context) return get_context(context)
""" """
class AddDocument(TemplateView): class AddDocument(TemplateView):
template_name = 'cms/upload.html' template_name = 'cms/upload.html'

View file

@ -42,6 +42,7 @@ INSTALLED_APPS = [
'cms', 'cms',
] ]
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
@ -72,9 +73,6 @@ TEMPLATES = [
WSGI_APPLICATION = 'common.wsgi.application' WSGI_APPLICATION = 'common.wsgi.application'
# Password validation # Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
@ -128,10 +126,18 @@ STUDENT_IMPORT_MAPPING = {
'Email élève': 'email_rpn', 'Email élève': 'email_rpn',
'Date nais. élève': 'date_naissance', 'Date nais. élève': 'date_naissance',
'Classe': 'klasse', 'Classe': 'klasse',
} }
DOMAINE_COULEURS = {'D1':'#fcaf3e', 'D2': '#cc0000', 'D3': '#ef896b', 'D4': '#ad7fa8', 'D5': '#729fcf', 'D6':'#73d216', 'D7':'#ffffff', 'D8':'#babdb6' } DOMAINE_COULEURS = {
'D1': '#fcaf3e',
'D2': '#cc0000',
'D3': '#ef896b',
'D4': '#ad7fa8',
'D5': '#729fcf',
'D6': '#73d216',
'D7': '#ffffff',
'D8': '#babdb6'
}
TINYMCE_JS_URL = MEDIA_URL + 'js/tiny_mce/tiny_mce.js' TINYMCE_JS_URL = MEDIA_URL + 'js/tiny_mce/tiny_mce.js'
TINYMCE_JS_ROOT = MEDIA_ROOT + 'js/tiny_mce' TINYMCE_JS_ROOT = MEDIA_ROOT + 'js/tiny_mce'
@ -146,5 +152,3 @@ TINYMCE_SPELLCHECKER = True
TINYMCE_COMPRESSOR = True TINYMCE_COMPRESSOR = True
from .local_settings import * from .local_settings import *

View file

@ -15,10 +15,11 @@ Including another URLconf
""" """
from django.conf.urls import url, include from django.conf.urls import url, include
from django.contrib import admin from django.contrib import admin
from cms import views
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from cms import views
urlpatterns = [ urlpatterns = [
url(r'^$', views.HomeView.as_view(), name='home'), url(r'^$', views.HomeView.as_view(), name='home'),
url(r'^plan_pdf/$', views.HomePDFView.as_view(), name='plan-pdf'), url(r'^plan_pdf/$', views.HomePDFView.as_view(), name='plan-pdf'),
@ -34,15 +35,15 @@ urlpatterns = [
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'^competences/$', views.CompetenceListView.as_view(), name='competences'),
url(r'^travail/$', views.TravailPersoListView.as_view(), name='travail'), 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'),
url(r'^module_pdf/(?P<pk>\d+)$', views.ModulePDF.as_view(), name='module-pdf'), url(r'^module_pdf/(?P<pk>\d+)$', views.ModulePDF.as_view(), name='module-pdf'),
url(r'^documents/$', views.DocumentListView.as_view(), name='document-list'), url(r'^documents/$', views.DocumentListView.as_view(), name='document-list'),
url(r'^document/(?P<pk>\d+)$', views.DocumentDetailView.as_view(), name='document-detail'), url(r'^document/(?P<pk>\d+)$', views.DocumentDetailView.as_view(), name='document-detail'),
url(r'^upload/(?P<pk>\d+)$', views.UploadDetailView.as_view(), name='upload-detail'), url(r'^upload/(?P<pk>\d+)$', views.UploadDetailView.as_view(), name='upload-detail'),
#url(r'^emplois/$', views.EmploiListView.as_view(), name='emploi-list'), # url(r'^emplois/$', views.EmploiListView.as_view(), name='emploi-list'),
url(r'^tinymce/', include('tinymce.urls'), name='tinymce-js'), url(r'^tinymce/', include('tinymce.urls'), name='tinymce-js'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT ) ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View file

View file

@ -1,87 +0,0 @@
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)
class PDFResponse(HttpResponse):
def __init__(self, filename, title='', portrait=True):
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.png', width=480, height=80)
image.hAlign = TA_LEFT
self.story.append(image)
#self.story.append(Spacer(0,1*cm))
data = [['Filières EDS', title]]
if portrait:
t = Table(data, colWidths=[8*cm,8*cm])
else:
t = Table(data, colWidths=[11*cm,11*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 = TA_LEFT
self.story.append(t)
class MyDocTemplate(SimpleDocTemplate):
def __init__(self, name):
SimpleDocTemplate.__init__(self, name, pagesize=A4, topMargin=0*cm)
self.fileName = name
self.PAGE_WIDTH = A4[0]
self.PAGE_HEIGHT = A4[1]
self.CENTRE_WIDTH = self.PAGE_WIDTH/2.0
self.CENTRE_HEIGHT = self.PAGE_HEIGHT/2.0
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*cm, leftMargin=2*cm)
self.fileName = name
self.PAGE_WIDTH = A4[1]
self.PAGE_HEIGHT = A4[0]
self.CENTRE_WIDTH = self.PAGE_WIDTH/2.0
self.CENTRE_HEIGHT = self.PAGE_HEIGHT/2.0
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()

View file

@ -2,15 +2,18 @@
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"fr" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <html lang="{{ LANGUAGE_CODE|default:"fr" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head> <head>
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" /> <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
{% block extrastyle %}{% endblock %} {% block extrastyle %}{% endblock %}
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %} {% if LANGUAGE_BIDI %}
{% block extrahead %} <link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />
<script type="text/javascript" src="{% static "js/tiny_mce/tiny_mce.js" %}"></script>{% endblock %} {% endif %}
{% block extrahead %}
<script type="text/javascript" src="{% static "js/tiny_mce/tiny_mce.js" %}"></script>
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %} {% endblock %}
{% block blockbots %}
<meta name="robots" content="NONE,NOARCHIVE" />
{% endblock %}
</head> </head>
{% load i18n %} {% load i18n %}

View file

@ -1,15 +1,13 @@
{% extends "./base.html" %} {% extends "./base.html" %}
{% block title %}EDS{% endblock %} {% block title %}EDS{% endblock %}
{% block branding %} {% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1> <h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
{% endblock %} {% endblock %}
{% block nav-global %}{% endblock %} {% block nav-global %}{% endblock %}
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'home' %}">Accueil</a>&nbsp;&nbsp; <a href="{% url 'home' %}">Accueil</a>&nbsp;&nbsp;
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,25 +1,28 @@
{% extends "./base_site.html" %} {% extends "./base_site.html" %}
{% load i18n static %} {% load i18n static %}
{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> {% block extrastyle %}
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />{% endblock %} {{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />
{% endblock %}
{% block coltype %}colMS{% endblock %} {% block coltype %}colMS{% endblock %}
{% block bodyclass %}{{ block.super }} dashboard{% endblock %} {% block bodyclass %}
{{ block.super }} dashboard
{% endblock %}
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<a href="{% url 'home' %}">Accueil</a> <a href="{% url 'home' %}">Accueil</a>
<a href="{% url 'document' %}">Document</a> <a href="{% url 'document' %}">Document</a>
</div> </div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="content-main">
<div id="content-main"> Page non trouvée
Page non trouvée </div>
</div>
{% endblock %} {% endblock %}

View file

@ -2,18 +2,16 @@
{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
<html lang="{{ LANGUAGE_CODE|default:"fr" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}> <html lang="{{ LANGUAGE_CODE|default:"fr" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head> <head>
<title>{% block title %}{% endblock %}</title> <title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" /> <link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" /> <link rel="stylesheet" type="text/css" href="{% static "admin/css/base.css" %}" />
<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" /> <link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />
<script type="text/javascript" src="{% static "js/tiny_mce/tiny_mce.js" %}"></script> <script type="text/javascript" src="{% static "js/tiny_mce/tiny_mce.js" %}"></script>
<script src="{% static 'js/jquery.js' %}"></script>
{% block extrastyle %}<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />{% endblock %}
<script src="{% static 'js/jquery.js' %}"></script> {% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
{% block extrastyle %}<link rel="stylesheet" type="text/css" href="{% static "css/main.css" %}" />{% endblock %} {% block extrahead %}{% endblock %}
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %} {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head> </head>
{% load i18n %} {% load i18n %}

View file

@ -2,35 +2,37 @@
{% block title %}EDS{% endblock %} {% block title %}EDS{% endblock %}
{% block branding %}<h1 id="site-name"><a href="{% url 'home' %}">Ecole Santé-social Pierre-Coullery</a> &nbsp;&nbsp;Formation en Education sociale</h1>{% endblock %} {% block branding %}
<h1 id="site-name"><a href="{% url 'home' %}">Ecole Santé-social Pierre-Coullery</a> &nbsp;&nbsp;Formation en Education sociale</h1>
{% endblock %}
{% block usertools %} {% block usertools %}
<div id="user-tools"> <div id="user-tools">
{% if user.is_authenticated %} {% if user.is_authenticated %}
{% block welcome-msg %}Bienvenue <strong>{% firstof user.username %}</strong>.{% endblock %} {% block welcome-msg %}Bienvenue <strong>{% firstof user.username %}</strong>.{% endblock %}
<a href="{% url 'home' %}">Site public</a>&nbsp;&nbsp;<a href="{% url 'admin:index' %}">Admin</a> <a href="{% url 'home' %}">Site public</a>&nbsp;&nbsp;<a href="{% url 'admin:index' %}">Admin</a>
{% else %} {% else %}
<a href="{% url 'admin:index' %}">Admin</a> <a href="{% url 'admin:index' %}">Admin</a>
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}
{% block nav-global %}{% endblock %} {% block nav-global %}{% endblock %}
{% block breadcrumbs %} {% block breadcrumbs %}
<div class="breadcrumbs"> <div class="breadcrumbs">
<ul> <ul>
<li><a href="{% url 'home' %}">Accueil</a>&nbsp;&nbsp;</li> <li><a href="{% url 'home' %}">Accueil</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'domaine-list' %}">Domaines</a>&nbsp;&nbsp;</li> <li><a href="{% url 'domaine-list' %}">Domaines</a>&nbsp;&nbsp;</li>
<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 'competences' %}">Compétences</a>&nbsp;&nbsp;</li>
<li><a href="{% url 'travail' %}">Heures de formation</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> -->
<li><a href="{% url 'document-list' %}">Documents</a>&nbsp;&nbsp;</li> <li><a href="{% url 'document-list' %}">Documents</a>&nbsp;&nbsp;</li>
{% if has_permission %} {% if has_permission %}
<li><a href="#">Calendrier</a>&nbsp;&nbsp;</li> <li><a href="#">Calendrier</a>&nbsp;&nbsp;</li>
{% endif %} {% endif %}
</ul> </ul>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -6,17 +6,19 @@
{% block bodyclass %}{{ block.super }}{% endblock %} {% block bodyclass %}{{ block.super }}{% endblock %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des compétences du PEC avec les modules correspondants</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>
<tr><th width="10px">&nbsp;</th><td colspan="2"><a href=" {% url 'module-detail' c.module.id %}">{{ c.module }}</a></td></tr> <td colspan="3">{{ c }}</td>
{% endfor %} </tr>
</table> <tr>
<th width="10px">&nbsp;</th>
<td colspan="2"><a href=" {% url 'module-detail' c.module.id %}">{{ c.module }}</a></td>
</tr>
{% endfor %}
</table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -8,14 +8,13 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<div style="margin:auto;width:50%;">
<div style="margin:auto;width:50%;"> <h1><b>{{object}}</b></h1>
<h1><b>{{object}}</b></h1> <p>{{object.texte|safe}}</p>
<p>{{object.texte|safe}}</p> </div>
</div> <div style="height: 600px;width: 400px;">
<div style="height: 600px;width: 400px;"> <object data="media/media/EDS_Calendrier_2017.pdf" type="text/html" codetype="application/pdf" ></object>
<object data="media/media/EDS_Calendrier_2017.pdf" type="text/html" codetype="application/pdf" ></object> </div>
</div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -7,15 +7,14 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des documents</h1> <h1>Liste des documents</h1>
<ol> <ol>
{% for doc in object_list %} {% for doc in object_list %}
<li><a href="{% url 'document-detail' doc.id %}">{{ doc }}</a></li> <li><a href="{% url 'document-detail' doc.id %}">{{ doc }}</a></li>
{% endfor %} {% endfor %}
{% for fic in upload %}
{% for fic in upload %} <li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }}</a></li>
<li><a href="{% url 'upload-detail' fic.id %}">{{ fic.titre }}</a></li> {% endfor %}
{% endfor %} </ol>
</ol>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -8,18 +8,17 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Domaine: {{object}}</h1> <h1>Domaine: {{object}}</h1>
{% for p in object.processus_set.all %} {% for p in object.processus_set.all %}
<div class="processus"><h2>Processus: {{ p.url|safe }}</h2></div> <div class="processus"><h2>Processus: {{ p.url|safe }}</h2></div>
{% for m in p.module_set.all %} {% for m in p.module_set.all %}
<div class="module">Module: <a href="/module/{{m.id}}">{{ m }}</a></div> <div class="module">Module: <a href="/module/{{m.id}}">{{ m }}</a></div>
<div class="competence">Compétences visées</div> <div class="competence">Compétences visées</div>
{% for c in m.competences.all %} {% for c in m.competences.all %}
<div class="competence">{{ c }}</div> <div class="competence">{{ c }}</div>
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -11,20 +11,27 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des domaines</h1>
<table border="0">
{% for d in object_list %}
<tr><td colspan="3">{{d}}</td></td></tr>
{% for p in d.processus_set.all %}
<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 %}
</table>
<h1>Liste des domaines</h1>
<table border="0">
{% for d in object_list %}
<tr>
<td colspan="3">{{d}}</td></td>
</tr>
{% for p in d.processus_set.all %}
<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;</th>
<td><a href=" {% url 'module-detail' m.id %}">{{m}}</a></td>
</tr>
{% endfor %}
{% endfor %}
{% endfor %}
</table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -49,8 +49,7 @@
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function(){
$(document).ready(function(){
$('select').change(function(){ $('select').change(function(){
cl = $(this).attr('class'); cl = $(this).attr('class');
tt = 'select.' + cl +' option:selected' tt = 'select.' + cl +' option:selected'
@ -70,12 +69,11 @@ $(document).ready(function(){
$(this).addClass('current'); $(this).addClass('current');
$("#"+tab_id).addClass('current'); $("#"+tab_id).addClass('current');
}); });
}); });
</script> </script>
<div id="content-main"> <div id="content-main">
<h1>Evaluation des compétences</h1> <h1>Evaluation des compétences</h1>
<div class="container"> <div class="container">
<div> <div>
<ul class="tabs"> <ul class="tabs">
<li class="tab-link current" data-tab="P01">P01</li> <li class="tab-link current" data-tab="P01">P01</li>
@ -87,28 +85,34 @@ $(document).ready(function(){
<li class="tab-link" data-tab="P07">P07</li> <li class="tab-link" data-tab="P07">P07</li>
<li class="tab-link" data-tab="P08">P08</li> <li class="tab-link" data-tab="P08">P08</li>
</ul> </ul>
<hr/> <hr>
</div> </div>
{% for p in object_list %} {% for p in object_list %}
<div id="{{p.code}}" class="tab-content"> <div id="{{p.code}}" class="tab-content">
<table> <table>
<tr><th>{{p}}</th><td width="100px"><div id="tot_{{p.code}}"></div></td></tr> <tr>
<th>{{p}}</th>
<td width="100px">
<div id="tot_{{p.code}}"></div>
</td>
</tr>
{% for c in p.competence_set.all %} {% for c in p.competence_set.all %}
<tr><td>{{c}}</td><td><select class="{{p.code}}" ><option value="0">0</option> <tr>
<td>{{c}}</td>
<td>
<select class="{{p.code}}" >
<option value="0">0</option>
<option value="1">1</option> <option value="1">1</option>
<option value="2">2</option> <option value="2">2</option>
<option value="3">3</option></select></td></tr> <option value="3">3</option>
</select>
</td>
</tr>
{% endfor %} {% endfor %}
</table> </table>
</div> </div>
{% endfor %} {% endfor %}
</div><!-- container -->
</div><!-- container -->
</div> </div>
{% endblock %} {% endblock %}

View file

@ -7,8 +7,8 @@
<div id="content-main"> <div id="content-main">
<table id="plan"> <table id="plan">
<tr> <tr>
<th width="300px">Domaines</th> <th width="300px">Domaines</th>
<th width="600px">Processus</th> <th width="600px">Processus</th>
<th width="180px" style="text-align:center;">Sem1</th> <th width="180px" style="text-align:center;">Sem1</th>
@ -17,89 +17,135 @@
<th width="180px" style="text-align:center;">Sem4</th> <th width="180px" style="text-align:center;">Sem4</th>
<th width="180px" style="text-align:center;">Sem5</th> <th width="180px" style="text-align:center;">Sem5</th>
<th width="180px" style="text-align:center;">Sem6</th> <th width="180px" style="text-align:center;">Sem6</th>
</tr> </tr>
<tr>
<tr>
<td rowspan="4" class="l1 d">{{D1.url|safe}}</td> <td rowspan="4" class="l1 d">{{D1.url|safe}}</td>
<td rowspan="2" class="l1 p">{{P01.url|safe}}</td> <td rowspan="2" class="l1 p">{{P01.url|safe}}</td>
<td class="l1 m">{{M01.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td class="l1 m">{{M01.url_code|safe}}</td>
</tr> <td>&nbsp;</td>
<tr> <td>&nbsp;</td>
<td>&nbsp;</td>
<td class="l1 m" >{{M02.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td>&nbsp;</td>
</tr> <td>&nbsp;</td>
<tr> </tr>
<tr>
<td class="l1 m" >{{M02.url_code|safe}}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2" class="l1 p">{{P02.url|safe}}</td> <td rowspan="2" class="l1 p">{{P02.url|safe}}</td>
<td></td><td>&nbsp;</td><td>&nbsp;</td><td class="l1 m">{{M03.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td> <td></td>
</tr> <td>&nbsp;</td>
<tr> <td>&nbsp;</td>
<td class="l1 m">{{M03.url_code|safe}}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td></td><td class="l1 m">{{ M04.url_code|safe }}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td></td>
</tr> <td class="l1 m">{{ M04.url_code|safe }}</td>
<!-- Ligne 2 --> <td>&nbsp;</td>
<tr> <td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<!-- Ligne 2 -->
<tr>
<td rowspan="3" class="l2 d">{{D2.url|safe}}</td> <td rowspan="3" class="l2 d">{{D2.url|safe}}</td>
<td class="l2 p">{{P03.url|safe}}</td> <td class="l2 p">{{P03.url|safe}}</td>
<td class="l2 m">{{M05.url_code|safe}}</td><td>&nbsp;</td><td class="l2 m">{{M06.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td> <td class="l2 m">{{M05.url_code|safe}}</td>
</tr> <td>&nbsp;</td>
<tr> <td class="l2 m">{{M06.url_code|safe}}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td rowspan="2" class="l2 p">{{P04.url|safe}}</td> <td rowspan="2" class="l2 p">{{P04.url|safe}}</td>
<td></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class="l2 m">{{M07.url_code|safe}}</td><td class="l2 m">{{M09.url_code|safe}}</td> <td></td>
</tr> <td>&nbsp;</td>
<tr> <td>&nbsp;</td>
<td></td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class="l2 m">{{M08.url_code|safe}}</td><td>&nbsp;</td> <td>&nbsp;</td>
</tr> <td class="l2 m">{{M07.url_code|safe}}</td>
<td class="l2 m">{{M09.url_code|safe}}</td>
</tr>
<tr>
<td></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="l2 m">{{M08.url_code|safe}}</td
><td>&nbsp;</td>
</tr>
<!-- Ligne 3 --> <!-- Ligne 3 -->
<tr> <tr>
<td rowspan="2" class="l3 d">{{D3.url|safe}}</td> <td rowspan="2" class="l3 d">{{D3.url|safe}}</td>
<td class="l3 p">{{P05.url|safe}}</td> <td class="l3 p">{{P05.url|safe}}</td>
<td >&nbsp;</td><td>&nbsp;</td><td colspan="2" class="l3 m">{{M10.url_code|safe}}</td><td class="l3 m">{{M12.url_code|safe}}</td><td>&nbsp;</td> <td >&nbsp;</td>
</tr> <td>&nbsp;</td>
<tr> <td colspan="2" class="l3 m">{{M10.url_code|safe}}</td>
<td class="l3 m">{{M12.url_code|safe}}</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="l3 p">{{P06.url|safe}}</td> <td class="l3 p">{{P06.url|safe}}</td>
<td >&nbsp;</td><td>&nbsp;</td><td colspan="2" class="l3 m">{{M11.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td> <td >&nbsp;</td>
</tr> <td>&nbsp;</td>
<!-- Ligne 4 --> <td colspan="2" class="l3 m">{{M11.url_code|safe}}</td>
<tr> <td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<!-- Ligne 4 -->
<tr>
<td class="l4 d">{{D4.url|safe}}</td> <td class="l4 d">{{D4.url|safe}}</td>
<td class="l4 p">{{P07.url|safe}}</td> <td class="l4 p">{{P07.url|safe}}</td>
<td >&nbsp;</td><td>&nbsp;</td><td class="l4 m">{{M13.url_code|safe}}</td><td>&nbsp;</td><td>&nbsp;</td><td class="l4 m">{{M14.url_code|safe}}</td> <td >&nbsp;</td>
</tr> <td>&nbsp;</td>
<td class="l4 m">{{M13.url_code|safe}}</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="l4 m">{{M14.url_code|safe}}</td>
</tr>
<!-- Ligne 5 --> <!-- Ligne 5 -->
<tr> <tr>
<td class="l5 d">{{D5.url|safe}}</td> <td class="l5 d">{{D5.url|safe}}</td>
<td class="l5 p">{{P08.url|safe}}</td> <td class="l5 p">{{P08.url|safe}}</td>
<td colspan="6" class="l5 m">{{M15.url_code|safe}}</td> <td colspan="6" class="l5 m">{{M15.url_code|safe}}</td>
</tr> </tr>
<!-- Ligne 6 --> <!-- Ligne 6 -->
<tr> <tr>
<td class="l6 d">{{D6.url|safe}}</td> <td class="l6 d">{{D6.url|safe}}</td>
<td class="l6 p">{{P09.url|safe}}</td> <td class="l6 p">{{P09.url|safe}}</td>
<td colspan="2" class="l6 m">{{M16_1a.url_code|safe}} / {{M16_1b.url_code|safe}} / {{M16_1c.url_code|safe}} / {{M16_1d.url_code|safe}} / {{M16_1e.url_code|safe}}</td> <td colspan="2" class="l6 m">{{M16_1a.url_code|safe}} / {{M16_1b.url_code|safe}} / {{M16_1c.url_code|safe}} / {{M16_1d.url_code|safe}} / {{M16_1e.url_code|safe}}</td>
<td colspan="2" class="l6 m">{{M16_2a.url_code|safe}} / {{M16_2b.url_code|safe}} / {{M16_2c.url_code|safe}}</td> <td colspan="2" class="l6 m">{{M16_2a.url_code|safe}} / {{M16_2b.url_code|safe}} / {{M16_2c.url_code|safe}}</td>
<td colspan="2" class="l6 m">{{M16_3a.url_code|safe}} / {{M16_3b.url_code|safe}}</td> <td colspan="2" class="l6 m">{{M16_3a.url_code|safe}} / {{M16_3b.url_code|safe}}</td>
</tr> </tr>
<!-- Ligne 7 --> <!-- Ligne 7 -->
<tr> <tr>
<td class="l7 d">{{D7.url|safe}}</td> <td class="l7 d">{{D7.url|safe}}</td>
<td class="l7 p">{{P10.url|safe}}</td> <td class="l7 p">{{P10.url|safe}}</td>
<td colspan="2" class="l7 m">{{M17_1.url_code|safe}}</td> <td colspan="2" class="l7 m">{{M17_1.url_code|safe}}</td>
<td colspan="2" class="l7 m">{{M17_2.url_code|safe}}</td> <td colspan="2" class="l7 m">{{M17_2.url_code|safe}}</td>
<td colspan="2" class="l7 m">{{M17_3.url_code|safe}}</td> <td colspan="2" class="l7 m">{{M17_3.url_code|safe}}</td>
</tr> </tr>
<!-- Ligne 8 --> <!-- Ligne 8 -->
<tr> <tr>
<td class="l8 d">{{D8.url|safe}}</td> <td class="l8 d">{{D8.url|safe}}</td>
<td class="l8 p">{{P11.url|safe}}</td> <td class="l8 p">{{P11.url|safe}}</td>
<td colspan="6" class="l8 m">{{MACC.url_code|safe}}</td> <td colspan="6" class="l8 m">{{MACC.url_code|safe}}</td>
</tr> </tr>
</table> </table>
<br/> <br>
<a href="{% url 'plan-pdf' %}">Imprimer en PDF</a> <a href="{% url 'plan-pdf' %}">Imprimer en PDF</a>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -4,44 +4,90 @@
{% block coltype %}colMS{% endblock %} {% block coltype %}colMS{% endblock %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>{{object}}</h1> <h1>{{object}}</h1>
<table> <table>
<tr><th width="100px">Domaine</th><td>{{object.processus.domaine.url|safe}}</td></tr> <tr>
<tr><th>Processus</th><td>{{object.processus.url|safe}}</td></tr> <th width="100px">Domaine</th>
<tr><th>Situation emblématique</th><td>{{object.situation|linebreaksbr}}</td></tr> <td>{{object.processus.domaine.url|safe}}</td>
<tr><th>Compétences visées</th><td><p>L'éducateur social, l'éducatrice sociale:</p> </tr>
{% for c in object.competence_set.all %}- {{c.nom}} ({{c.code}})<br />{% endfor %}</td></tr> <tr>
<tr><th>Plus-value sur le CFC ASE</th><td> <th>Processus</th>
{% for c in object.competence_set.all %} <td>{{object.processus.url|safe}}</td>
{% for sc in c.souscompetence_set.all %} </tr>
- {{sc.nom}} (voir {{sc.competence.code}}) <br /> <tr>
{%endfor %} <th>Situation emblématique</th>
{% endfor %} <td>{{object.situation|linebreaksbr}}</td>
</td></tr> </tr>
<tr>
<th>Compétences visées</th>
<!-- <tr><th>Ressources à acquérir</th><td>{% for c in object.ressource_set.all %}- {{c}}<br />{% endfor %}</td></tr> --> <td>
<tr><th>Objectifs à atteindre</th><td>{% for c in object.objectif_set.all %}- {{c}}<br />{% endfor %}</td></tr> <p>L'éducateur social, l'éducatrice sociale:</p>
<tr><th>Didactique</th><td>{{ object.didactique }}</td></tr> {% for c in object.competence_set.all %}
<!-- <tr><th>Contenu</th><td>{{object.contenu|linebreaksbr}}</td></tr> --> - {{c.nom}} ({{c.code}})<br>
<tr><th>Evaluation</th><td>{{object.evaluation|linebreaksbr}}</td></tr> {% endfor %}
<tr><th>Type</th><td>{{object.type}}, obligatoire</td></tr> </td>
<tr><th>Semestre</th><td>Sem. {{object.semestre}}</td></tr> </tr>
{% if object.periode_presentiel > 0 %} <tr>
<tr><th>Présentiel</th><td>{{object.periode_presentiel}} heures</td></tr> <th>Plus-value sur le CFC ASE</th>
{% endif %} <td>
{% if object.pratique_prof > 0 %} {% for c in object.competence_set.all %}
<tr><th>Pratique prof.</th><td>{{object.pratique_prof}} heures</td></tr> {% for sc in c.souscompetence_set.all %}
{% endif %} - {{sc.nom}} (voir {{sc.competence.code}}) <br>
{% if object.travail_perso > 0 %} {%endfor %}
<tr><th>Travail perso.</th><td>{{object.travail_perso}} heures</td></tr> {% endfor %}
{% endif %} </td>
<tr><th>Responsable</th><td>{{object.processus.domaine.responsable.descr|safe}}</td></tr> </tr>
</table> <!-- <tr><th>Ressources à acquérir</th><td>{% for c in object.ressource_set.all %}- {{c}}<br />{% endfor %}</td></tr> -->
<p><a href="{% url 'module-pdf' object.id %}">Imprimer en PDF</a></p> <tr>
<th>Objectifs à atteindre</th>
<td>
{% for c in object.objectif_set.all %}
- {{c}}<br>
{% endfor %}
</td>
</tr>
<tr>
<th>Didactique</th>
<td>{{ object.didactique }}</td>
</tr>
<!-- <tr><th>Contenu</th><td>{{object.contenu|linebreaksbr}}</td></tr> -->
<tr>
<th>Evaluation</th>
<td>{{object.evaluation|linebreaksbr}}</td>
</tr>
<tr>
<th>Type</th>
<td>{{object.type}}, obligatoire</td>
</tr>
<tr>
<th>Semestre</th>
<td>Sem. {{object.semestre}}</td>
</tr>
{% if object.periode_presentiel > 0 %}
<tr>
<th>Présentiel</th>
<td>{{object.periode_presentiel}} heures</td>
</tr>
{% endif %}
{% if object.pratique_prof > 0 %}
<tr>
<th>Pratique prof.</th>
<td>{{object.pratique_prof}} heures</td>
</tr>
{% endif %}
{% if object.travail_perso > 0 %}
<tr>
<th>Travail perso.</th>
<td>{{object.travail_perso}} heures</td>
</tr>
{% endif %}
<tr>
<th>Responsable</th>
<td>{{object.processus.domaine.responsable.descr|safe}}</td>
</tr>
</table>
<p><a href="{% url 'module-pdf' object.id %}">Imprimer en PDF</a></p>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -6,35 +6,83 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>{{object}}</h1> <h1>{{object}}</h1>
<table> <table>
<tr><th>Domaine</th><td>{{object.processus.domaine.url|safe}}</td></tr> <tr>
<tr><th>Processus</th><td>{{object.processus.url|safe}}</td></tr> <th>Domaine</th>
<tr><th>Situation emblématique</th><td>{{object.situation|linebreaksbr}}</td></tr> <td>{{object.processus.domaine.url|safe}}</td>
<tr><th>Compétences visées</th><td><p>L'éducateur social, l'éducatrice sociale:</p> </tr>
{% for c in object.competence_set.all %}- {{c.nom}} ({{c.code}})<br /> <tr>
{% if user.is_authenticated %} <th>Processus</th>
{% for sc in c.souscompetence_set.all %}&nbsp;&nbsp;&nbsp; -- {{sc.nom}} <br />{%endfor %}{% endif %}{% endfor %}</td></tr> <td>{{object.processus.url|safe}}</td>
<!-- <tr><th>Ressources à acquérir</th><td>{% for c in object.ressource_set.all %}- {{c}}<br />{% endfor %}</td></tr> --> </tr>
<tr><th>Objectifs à atteindre</th><td>{% for c in object.objectif_set.all %}- {{c}}<br />{% endfor %}</td></tr> <tr>
<tr><th>Didactique</th><td>{{ object.didactique }}</td></tr> <th>Situation emblématique</th>
<!-- <tr><th>Contenu</th><td>{{object.contenu|linebreaksbr}}</td></tr> --> <td>{{object.situation|linebreaksbr}}</td>
<tr><th>Evaluation</th><td>{{object.evaluation|linebreaksbr}}</td></tr> </tr>
<tr><th>Type</th><td>{{object.type}}, obligatoire</td></tr> <tr>
<tr><th>Semestre</th><td>Sem. {{object.semestre}}</td></tr> <th>Compétences visées</th>
{% if object.periode_presentiel > 0 %} <td><p>L'éducateur social, l'éducatrice sociale:</p>
<tr><th>Présentiel</th><td>{{object.periode_presentiel}} heures</td></tr> {% for c in object.competence_set.all %}
{% endif %} - {{c.nom}} ({{c.code}})<br>
{% if object.pratique_prof > 0 %} {% if user.is_authenticated %}
<tr><th>Pratique prof.</th><td>{{object.pratique_prof}} heures</td></tr> {% for sc in c.souscompetence_set.all %}
{% endif %} &nbsp;&nbsp;&nbsp; -- {{sc.nom}} <br>
{% if object.travail_perso > 0 %} {%endfor %}
<tr><th>Travail perso.</th><td>{{object.travail_perso}} heures</td></tr> {% endif %}
{% endif %} {% endfor %}
<tr><th>Responsable</th><td>{{object.processus.domaine.responsable.descr|safe}}</td></tr> </td>
</table> </tr>
<p><a href="{% url 'module-pdf' object.id %}">Imprimer en PDF</a></p> <!-- <tr><th>Ressources à acquérir</th><td>{% for c in object.ressource_set.all %}- {{c}}<br />{% endfor %}</td></tr> -->
<tr>
<th>Objectifs à atteindre</th>
<td>
{% for c in object.objectif_set.all %}
- {{c}}<br>
{% endfor %}
</td>
</tr>
<tr>
<th>Didactique</th>
<td>{{ object.didactique }}</td>
</tr>
<!-- <tr><th>Contenu</th><td>{{object.contenu|linebreaksbr}}</td></tr> -->
<tr>
<th>Evaluation</th>
<td>{{object.evaluation|linebreaksbr}}</td>
</tr>
<tr>
<th>Type</th>
<td>{{object.type}}, obligatoire</td>
</tr>
<tr>
<th>Semestre</th>
<td>Sem. {{object.semestre}}</td>
</tr>
{% if object.periode_presentiel > 0 %}
<tr>
<th>Présentiel</th>
<td>{{object.periode_presentiel}} heures</td>
</tr>
{% endif %}
{% if object.pratique_prof > 0 %}
<tr>
<th>Pratique prof.</th>
<td>{{object.pratique_prof}} heures</td>
</tr>
{% endif %}
{% if object.travail_perso > 0 %}
<tr>
<th>Travail perso.</th>
<td>{{object.travail_perso}} heures</td>
</tr>
{% endif %}
<tr>
<th>Responsable</th>
<td>{{object.processus.domaine.responsable.descr|safe}}</td>
</tr>
</table>
<p><a href="{% url 'module-pdf' object.id %}">Imprimer en PDF</a></p>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -8,14 +8,15 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des modules</h1> <h1>Liste des modules</h1>
<table> <table>
{% for m in object_list %} {% for m in object_list %}
<tr><th>{{m.code}}</th><td><a href=" {% url 'module-detail' m.id %}">{{m.nom}}</a></td></tr> <tr>
{% endfor %} <th>{{m.code}}</th>
</table> <td><a href=" {% url 'module-detail' m.id %}">{{m.nom}}</a></td>
</tr>
{% endfor %}
</table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -5,60 +5,99 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Périodes de formation</h1> <h1>Périodes de formation</h1>
<table> <table>
<tr><th width="290px">Semestre 1</th><th text-align="right">{{tot1.sem1__sum}}h.</th><th width="40px"></th><th width="290px">Semestre 2</th><th text-align="right">{{tot2.sem2__sum}}h.</th></tr> <tr>
<tr><td colspan="2"><table align="left"> <th width="290px">Semestre 1</th>
{% for s in sem1 %} <th text-align="right">{{tot1}}h.</th>
<tr><td width="290px">{{s}}</td><td>{{s.sem1}} h.</td></tr> <th width="40px"></th>
{% endfor %} <th width="290px">Semestre 2</th>
</table> <th text-align="right">{{tot2}}h.</th>
</td> </tr>
<td></td> <tr>
<td colspan="2"> <td colspan="2">
<table align="left"> <table align="left">
{% for s in sem2 %} {% for s in sem1 %}
<tr><td width="290px">{{s}}</td><td>{{s.sem2}} h.</td></tr> <tr><td width="290px">{{s}}</td><td>{{s.sem1}} h.</td></tr>
{% endfor %} {% endfor %}
</table> </table>
</td></tr> </td>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr> <td></td>
<tr><th>Semestre 3</th><th text-align="right">{{tot3.sem3__sum}}h.</th><th></th><th>Semestre 4</th><th text-align="right">{{tot4.sem4__sum}}h.</th> </tr> <td colspan="2">
<tr><td colspan="2"><table align="left"> <table align="left">
{% for s in sem3 %} {% for s in sem2 %}
<tr><td width="290px">{{s}}</td><td>{{s.sem3}} h.</td></tr> <tr><td width="290px">{{s}}</td><td>{{s.sem2}} h.</td></tr>
{% endfor %} {% endfor %}
</table></td> </table>
<td></td> </td>
<td colspan="2"><table align="left"> </tr>
{% for s in sem4 %} <tr>
<tr><td width="290px">{{s}}</td><td>{{s.sem4}} h.</td></tr> <td>&nbsp;</td>
{% endfor %} <td>&nbsp;</td>
</table></td></tr> </tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr> <tr>
<tr><th>Semestre 5</th><th text-align="right">{{tot5.sem5__sum}}h.</th><th></th><th>Semestre 6</th><th text-align="right">{{tot6.sem6__sum}}h.</th></tr> <th>Semestre 3</th>
<tr><td colspan="2"><table align="left"> <th text-align="right">{{tot3}}h.</th>
{% for s in sem5 %} <th></th>
<tr><td width="290px">{{s}}</td><td>{{s.sem5}} h.</td></tr> <th>Semestre 4</th>
{% endfor %} <th text-align="right">{{tot4}}h.</th>
</table></td> </tr>
<td></td> <tr>
<td colspan="2"> <td colspan="2">
<table align="left"> <table align="left">
{% for s in sem6 %} {% for s in sem3 %}
<tr><td width="290px">{{s}}</td><td>{{s.sem6}} h.</td></tr> <tr><td width="290px">{{s}}</td><td>{{s.sem3}} h.</td></tr>
{% endfor %} {% endfor %}
</table> </table>
</td></tr> </td>
</table> <td></td>
<td colspan="2">
<br/> <table align="left">
Total des heures de cours: {{tot}} heures {% for s in sem4 %}
<tr>
<br/><br/> <td width="290px">{{s}}</td>
<a href="{% url 'periodes-pdf' %}">Imprimer en PDF</a> <td>{{s.sem4}} h.</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<th>Semestre 5</th>
<th text-align="right">{{tot5}}h.</th>
<th></th>
<th>Semestre 6</th>
<th text-align="right">{{tot6}}h.</th>
</tr>
<tr>
<td colspan="2">
<table align="left">
{% for s in sem5 %}
<tr><td width="290px">{{s}}</td><td>{{s.sem5}} h.</td></tr>
{% endfor %}
</table>
</td>
<td></td>
<td colspan="2">
<table align="left">
{% for s in sem6 %}
<tr>
<td width="290px">{{s}}</td>
<td>{{s.sem6}} h.</td>
</tr>
{% endfor %}
</table>
</td>
</tr>
</table>
<br>
<p><strong>Total des heures de cours: {{tot}} heures</strong></p>
<a href="{% url 'periodes-pdf' %}">Imprimer en PDF</a>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,29 +1,46 @@
{% 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 }} dashboard{% endblock %} {% block bodyclass %}{{ block.super }} dashboard{% endblock %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>{{object}}</h1> <h1>{{object}}</h1>
<table> <table>
<tr><th width="100px">Description</th><td>{{object.description}}</td></tr> <tr>
<tr><th>Compétences visées</th><td><p>L'éducateur social, l'éducatrice sociale:</p> <th width="100px">Description</th>
{% for m in object.module_set.all %}{% for c in m.competences.all %} <td>{{object.description}}</td>
- {{c.libelle}} ({{c.code}})<br />{% endfor %}{% endfor %}</td></tr> </tr>
<tr><th>Domaine</th><td>{{object.domaine.url|safe}}</td></tr> <tr>
<tr><th>Responsable</th><td>{{object.domaine.responsable.descr|safe}}</td></tr> <th>Compétences visées</th>
<tr><th>Modules concernés</th><td>{% for m in object.module_set.all %}{{m.url|safe}}</br>{% endfor %}</td></tr> <td>
<p>L'éducateur social, l'éducatrice sociale:</p>
{% for m in object.module_set.all %}
</table> {% for c in m.competences.all %}
- {{c.libelle}} ({{c.code}})<br>
{% endfor %}
{% endfor %}
</td>
</tr>
<tr>
<th>Domaine</th>
<td>{{object.domaine.url|safe}}</td>
</tr>
<tr>
<th>Responsable</th>
<td>{{object.domaine.responsable.descr|safe}}</td>
</tr>
<tr>
<th>Modules concernés</th>
<td>
{% for m in object.module_set.all %}
{{m.url|safe}}<br>
{% endfor %}
</td>
</tr>
</table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,27 +1,27 @@
{% 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 %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Liste des processus</h1> <h1>Liste des processus</h1>
<table> <table>
{% for p in object_list %} {% for p in object_list %}
<tr><th>{{p.code}}</th><td><a href=" {% url 'processus-detail' p.id %}">{{p.nom}}</a></td></tr> <tr>
{% for m in p.module_set.all %} <th>{{p.code}}</th>
<tr><th>&nbsp;</th><td><a href=" {% url 'module-detail' m.id %}">{{m}}</a></td></tr> <td><a href=" {% url 'processus-detail' p.id %}">{{p.nom}}</a></td>
{% endfor %} </tr>
{% endfor %} {% for m in p.module_set.all %}
</table> <tr>
<th>&nbsp;</th>
<td><a href=" {% url 'module-detail' m.id %}">{{m}}</a></td>
</tr>
{% endfor %}
{% endfor %}
</table>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -8,29 +8,52 @@
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<h1>Répartion des heures de formation</h1> <h1>Répartion des heures de formation</h1>
<table border="0"> <table border="0">
<tr><th>Module</th><th >Heures de cours</th><th>Travail perso.</th><th>Pratique prof.</th></tr> <tr>
{% for m in object_list %} <th>Module</th>
<tr> <th >Heures de cours</th>
<td > <th>Travail perso.</th>
{% if forloop.last %} <th>Pratique prof.</th>
{{ m }} - Travail de diplôme </tr>
{% else %} {% for m in object_list %}
{{ m }} <tr>
{% endif %} <td >
</td> {% if forloop.last %}
<td align="center">{% if m.periode_presentiel == 0 %} &nbsp; {% else %} {{ m.periode_presentiel|rjust:"3" }} h. {% endif %}</td> {{ m }} - Travail de diplôme
<td align="center">{% if m.travail_perso == 0 %} &nbsp; {% else %} {{ m.travail_perso|rjust:"3" }} h. {% endif %}</td> {% else %}
<td align="center">{% if m.pratique_prof == 0 %} &nbsp; {% else %} {{ m.pratique_prof|rjust:"3" }} h.{% endif %}</td> {{ m }}
</tr> {% endif %}
{% endfor %} </td>
<tr> <td align="center">
<th >Total</th> {% if m.periode_presentiel == 0 %}
<th>{{ total_perso }} heures</th> &nbsp;
<th>{{ total_presentiel }} heures</th> {% else %}
<th>{{ total_pratique }} heures</th> {{ m.periode_presentiel|rjust:"3" }} h.
</tr> {% endif %}
</table> </td>
<td align="center">
{% if m.travail_perso == 0 %}
&nbsp;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> </div>
{% endblock %} {% endblock %}

View file

@ -13,13 +13,12 @@
<a href="{% url 'home' %}">Accueil</a> <a href="{% url 'home' %}">Accueil</a>
<a href="{% url 'upload' %}">Document</a> <a href="{% url 'upload' %}">Document</a>
</div> </div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div id="content-main">
<div id="content-main"> <h1>Enregistrements de documents</h1>
<h1>Enregistrements de documents</h1> {% if documents %}
{% if documents %}
<ul class="liste-verticale"> <ul class="liste-verticale">
{% for document in documents %} {% for document in documents %}
<li><a href="download/{{ document.docfile.name }}">{{document.docfile.name}}</a></li> <li><a href="download/{{ document.docfile.name }}">{{document.docfile.name}}</a></li>
@ -28,21 +27,17 @@
{% else %} {% else %}
<p>No documents.</p> <p>No documents.</p>
{% endif %} {% endif %}
<!-- Upload form. Note enctype attribute! --> <!-- Upload form. Note enctype attribute! -->
<div class="clear-booth">&nbsp; <div class="clear-booth">&nbsp;
<form action="{% url 'upload' %}" method="post" enctype="multipart/form-data"> <form action="{% url 'upload' %}" method="post" enctype="multipart/form-data">
{% csrf_token %} {% csrf_token %}
<p>{{ form.non_field_errors }}</p> <p>{{ form.non_field_errors }}</p>
<p>{{ form.docfile.label_tag }} {{ form.docfile.help_text }}</p> <p>{{ form.docfile.label_tag }} {{ form.docfile.help_text }}</p>
<p> <p>{{ form.docfile.errors }} {{ form.docfile }}</p>
{{ form.docfile.errors }}
{{ form.docfile }}
</p>
<p><input type="submit" value="Upload" /></p> <p><input type="submit" value="Upload" /></p>
</form> </form>
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -3,13 +3,10 @@
{% block coltype %}colMS{% endblock %} {% block coltype %}colMS{% endblock %}
{% block content %} {% block content %}
<div id="content-main"> <div id="content-main">
<iframe src="{{fichier}}" width="1200" height="800" align="middle"></iframe> <iframe src="{{fichier}}" width="1200" height="800" align="middle"></iframe>
</div> </div>
{% endblock %} {% endblock %}