First commit
This commit is contained in:
commit
dc05952f76
46 changed files with 1752 additions and 0 deletions
0
cms/__init__.py
Normal file
0
cms/__init__.py
Normal file
40
cms/admin.py
Normal file
40
cms/admin.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
from django.contrib import admin
|
||||
from .models import (Enseignant, Domaine, Competence, SousCompetence, Objectif,
|
||||
Ressource, Module, Processus)
|
||||
from django.forms.widgets import Widget
|
||||
from django.forms import widgets
|
||||
# Register your models here.
|
||||
|
||||
class SousCompetenceInline(admin.TabularInline):
|
||||
model = SousCompetence
|
||||
extra = 0
|
||||
|
||||
class CompetenceInline(admin.TabularInline):
|
||||
model = Competence
|
||||
extra=0
|
||||
#template ='templates/admin/cms/processus/edit_inline/tabular.html'
|
||||
|
||||
|
||||
class ModuleAdmin(admin.ModelAdmin):
|
||||
inlines = [CompetenceInline,]
|
||||
extra = 0
|
||||
|
||||
|
||||
class ProcessusAdmin(admin.ModelAdmin):
|
||||
inlines = (CompetenceInline,)
|
||||
|
||||
class CompetenceAdmin(admin.ModelAdmin):
|
||||
inlines = (SousCompetenceInline,)
|
||||
|
||||
class RessourceAdmin(admin.ModelAdmin):
|
||||
pass
|
||||
|
||||
|
||||
admin.site.register(Enseignant)
|
||||
admin.site.register(Domaine)
|
||||
admin.site.register(Competence, CompetenceAdmin)
|
||||
admin.site.register(SousCompetence)
|
||||
admin.site.register(Objectif)
|
||||
admin.site.register(Ressource)
|
||||
admin.site.register(Module)
|
||||
admin.site.register(Processus, ProcessusAdmin)
|
||||
5
cms/apps.py
Normal file
5
cms/apps.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class EvalConfig(AppConfig):
|
||||
name = 'cms'
|
||||
12
cms/forms.py
Normal file
12
cms/forms.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
'''
|
||||
Created on 17 nov. 2012
|
||||
|
||||
@author: alzo
|
||||
'''
|
||||
|
||||
from django import forms
|
||||
|
||||
class DocumentForm(forms.Form):
|
||||
docfile = forms.FileField(label='Selectionner un fichier',
|
||||
help_text='Taille max.: 42 megabytes')
|
||||
110
cms/migrations/0001_initial.py
Normal file
110
cms/migrations/0001_initial.py
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 09:06
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Competence',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(blank=True, max_length=20)),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Domaine',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(blank=True, max_length=20)),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Enseignant',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('sigle', models.CharField(blank=True, default='', max_length=5)),
|
||||
('nom', models.CharField(blank=True, default='', max_length=20)),
|
||||
('prenom', models.CharField(blank=True, default='', max_length=20)),
|
||||
('email', models.EmailField(blank=True, default='', max_length=254)),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Module',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(default='Code', max_length=10)),
|
||||
('nom', models.CharField(default='Nom du module', max_length=30)),
|
||||
('type', models.CharField(choices=[('Spécifique', 'spécifique'), ('Transversal', 'transversal')], max_length=20)),
|
||||
('situation', models.TextField()),
|
||||
('evaluation', models.TextField()),
|
||||
('contenu', models.TextField()),
|
||||
('periode_presentiel', models.IntegerField()),
|
||||
('travail_perso', models.IntegerField()),
|
||||
('sem1', models.IntegerField(default=0)),
|
||||
('sem2', models.IntegerField(default=0)),
|
||||
('sem3', models.IntegerField(default=0)),
|
||||
('sem4', models.IntegerField(default=0)),
|
||||
('sem5', models.IntegerField(default=0)),
|
||||
('sem6', models.IntegerField(default=0)),
|
||||
('semestre', models.CharField(default='', max_length=15)),
|
||||
('competences', models.ManyToManyField(to='cms.Competence')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Objectif',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
('type', models.CharField(choices=[('Savoir', 'savoir'), ('Savoir méthodologique', 'savoir méthodologique'), ('Savoir relationnel', 'savoir relationnel')], max_length=30)),
|
||||
('module', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Module')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Processus',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(blank=True, max_length=20)),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
('domaine', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cms.Domaine')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Ressource',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
('module', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Module')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SousCompetence',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('code', models.CharField(blank=True, max_length=20)),
|
||||
('libelle', models.CharField(max_length=200)),
|
||||
('competence', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cms.Competence')),
|
||||
],
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='domaine',
|
||||
name='responsable',
|
||||
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Enseignant'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='competence',
|
||||
name='processus',
|
||||
field=models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='cms.Processus'),
|
||||
),
|
||||
]
|
||||
32
cms/migrations/0002_auto_20161224_0929.py
Normal file
32
cms/migrations/0002_auto_20161224_0929.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 09:29
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='domaine',
|
||||
options={'ordering': ('code',)},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='enseignant',
|
||||
options={'ordering': ('nom',)},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='processus',
|
||||
options={'ordering': ('code',)},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='competence',
|
||||
name='tyoe',
|
||||
field=models.CharField(blank=True, default='', max_length=35),
|
||||
),
|
||||
]
|
||||
20
cms/migrations/0003_auto_20161224_0929.py
Normal file
20
cms/migrations/0003_auto_20161224_0929.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 09:29
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0002_auto_20161224_0929'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='competence',
|
||||
old_name='tyoe',
|
||||
new_name='type',
|
||||
),
|
||||
]
|
||||
23
cms/migrations/0004_auto_20161224_1234.py
Normal file
23
cms/migrations/0004_auto_20161224_1234.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 12:34
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0003_auto_20161224_0929'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='competence',
|
||||
options={'ordering': ('code',)},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='souscompetence',
|
||||
options={'ordering': ('code',)},
|
||||
),
|
||||
]
|
||||
36
cms/migrations/0005_auto_20161224_1236.py
Normal file
36
cms/migrations/0005_auto_20161224_1236.py
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 12:36
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0004_auto_20161224_1234'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='module',
|
||||
name='didactique',
|
||||
field=models.TextField(default=''),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='module',
|
||||
name='pratique_prof',
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='module',
|
||||
name='processus',
|
||||
field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='cms.Processus'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='module',
|
||||
name='evaluation',
|
||||
field=models.TextField(default=''),
|
||||
),
|
||||
]
|
||||
24
cms/migrations/0006_auto_20161224_1339.py
Normal file
24
cms/migrations/0006_auto_20161224_1339.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-24 13:39
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0005_auto_20161224_1236'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='module',
|
||||
options={'ordering': ('code',)},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='module',
|
||||
name='nom',
|
||||
field=models.CharField(default='Nom du module', max_length=100),
|
||||
),
|
||||
]
|
||||
25
cms/migrations/0007_auto_20161225_1951.py
Normal file
25
cms/migrations/0007_auto_20161225_1951.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-25 19:51
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0006_auto_20161224_1339'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='competence',
|
||||
name='libelle',
|
||||
field=models.CharField(max_length=250),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='souscompetence',
|
||||
name='libelle',
|
||||
field=models.CharField(max_length=250),
|
||||
),
|
||||
]
|
||||
22
cms/migrations/0008_document.py
Normal file
22
cms/migrations/0008_document.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2016-12-26 08:47
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0007_auto_20161225_1951'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Document',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('docfile', models.FileField(upload_to='media')),
|
||||
],
|
||||
),
|
||||
]
|
||||
20
cms/migrations/0009_module_description.py
Normal file
20
cms/migrations/0009_module_description.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2017-01-04 12:47
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0008_document'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='module',
|
||||
name='description',
|
||||
field=models.TextField(blank=True, default=''),
|
||||
),
|
||||
]
|
||||
20
cms/migrations/0010_auto_20170104_1251.py
Normal file
20
cms/migrations/0010_auto_20170104_1251.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2017-01-04 12:51
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0009_module_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='module',
|
||||
name='description',
|
||||
field=models.TextField(),
|
||||
),
|
||||
]
|
||||
20
cms/migrations/0011_processus_description.py
Normal file
20
cms/migrations/0011_processus_description.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2017-01-04 12:52
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0010_auto_20170104_1251'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='processus',
|
||||
name='description',
|
||||
field=models.TextField(default=''),
|
||||
),
|
||||
]
|
||||
24
cms/migrations/0012_auto_20170104_1347.py
Normal file
24
cms/migrations/0012_auto_20170104_1347.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.4 on 2017-01-04 13:47
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cms', '0011_processus_description'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='objectif',
|
||||
name='type',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='ressource',
|
||||
name='type',
|
||||
field=models.CharField(choices=[('Savoir', 'savoir'), ('Savoir méthodologique', 'savoir méthodologique'), ('Savoir relationnel', 'savoir relationnel')], default='Savoir', max_length=30),
|
||||
),
|
||||
]
|
||||
0
cms/migrations/__init__.py
Normal file
0
cms/migrations/__init__.py
Normal file
164
cms/models.py
Normal file
164
cms/models.py
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
'''
|
||||
Created on 17 nov. 2012
|
||||
|
||||
@author: alzo
|
||||
'''
|
||||
from django.db import models
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
CHOIX_TYPE_SAVOIR = (
|
||||
('Savoir','savoir'),
|
||||
('Savoir méthodologique','savoir méthodologique'),
|
||||
('Savoir relationnel','savoir relationnel'),
|
||||
)
|
||||
|
||||
CHOIX_TYPE_MODULE = (
|
||||
('Spécifique', 'spécifique'),
|
||||
('Transversal', 'transversal'),
|
||||
)
|
||||
|
||||
class Enseignant(models.Model):
|
||||
sigle = models.CharField(max_length= 5, blank=True, default='')
|
||||
nom = models.CharField(max_length=20, blank=True, default='')
|
||||
prenom = models.CharField(max_length=20, blank=True, default='')
|
||||
email = models.EmailField(blank=True, default='')
|
||||
|
||||
class Meta:
|
||||
ordering =('nom',)
|
||||
|
||||
def __str__(self):
|
||||
return '{0} {1}'.format(self.nom, self.prenom)
|
||||
|
||||
|
||||
class Domaine(models.Model):
|
||||
code = models.CharField(max_length=20, blank=True)
|
||||
libelle = models.CharField(max_length=200, blank=False)
|
||||
responsable = models.ForeignKey(Enseignant, null=True, default=None)
|
||||
|
||||
class Meta:
|
||||
ordering = ('code',)
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.code, self.libelle)
|
||||
|
||||
def url(self):
|
||||
return "<a href='/domaine/{0}'>{1}</a>".format(self.id, self.__str__())
|
||||
|
||||
|
||||
class Processus(models.Model):
|
||||
code = models.CharField(max_length=20, blank=True)
|
||||
libelle = models.CharField(max_length=200, blank=False)
|
||||
domaine = models.ForeignKey(Domaine, null=False)
|
||||
description = models.TextField(default='')
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ('code',)
|
||||
verbose_name_plural = 'processus'
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.code, self.libelle)
|
||||
|
||||
def url(self):
|
||||
return "<a href='/processus/{0}'>{1}</a>".format(self.id, self.__str__())
|
||||
|
||||
|
||||
class Module(models.Model):
|
||||
|
||||
code = models.CharField(max_length=10, blank=False, default='Code')
|
||||
nom = models.CharField(max_length=100, blank=False, default='Nom du module')
|
||||
description = models.TextField()
|
||||
type = models.CharField(max_length=20, choices= CHOIX_TYPE_MODULE)
|
||||
competences = models.ManyToManyField('Competence')
|
||||
situation = models.TextField()
|
||||
evaluation = models.TextField()
|
||||
contenu = models.TextField()
|
||||
periode_presentiel = models.IntegerField()
|
||||
travail_perso = models.IntegerField()
|
||||
pratique_prof = models.IntegerField(default=0)
|
||||
didactique = models.TextField(default='')
|
||||
evaluation = models.TextField(default='')
|
||||
sem1 = models.IntegerField(default=0)
|
||||
sem2 = models.IntegerField(default=0)
|
||||
sem3 = models.IntegerField(default=0)
|
||||
sem4 = models.IntegerField(default=0)
|
||||
sem5 = models.IntegerField(default=0)
|
||||
sem6 = models.IntegerField(default=0)
|
||||
semestre = models.CharField(max_length=15, default='', blank=False)
|
||||
processus = models.ForeignKey(Processus, null=False, default=None)
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ('code',)
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.code, self.nom)
|
||||
|
||||
def url(self):
|
||||
return "<a href='/module/{0}'>{1}</a>".format(self.id, self.__str__())
|
||||
|
||||
def url_code(self):
|
||||
return "<a href='/module/{0}'>{1}</a>".format(self.id, self.code)
|
||||
|
||||
|
||||
class Competence(models.Model):
|
||||
code = models.CharField(max_length=20, blank=True)
|
||||
libelle = models.CharField(max_length=250, blank=False)
|
||||
type = models.CharField(max_length=35, blank=True, default='')
|
||||
processus = models.ForeignKey(Processus, null=True, default=None)
|
||||
|
||||
class Meta:
|
||||
ordering = ('code',)
|
||||
verbose_name = 'compétence'
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.code, self.libelle)
|
||||
|
||||
|
||||
|
||||
class SousCompetence(models.Model):
|
||||
code = models.CharField(max_length=20, blank=True)
|
||||
libelle = models.CharField(max_length=250, blank=False)
|
||||
competence = models.ForeignKey(Competence, null=False)
|
||||
|
||||
class Meta:
|
||||
ordering = ('code',)
|
||||
verbose_name = 'sous-compétence'
|
||||
|
||||
def __str__(self):
|
||||
return '{0} - {1}'.format(self.code, self.libelle)
|
||||
|
||||
|
||||
class Ressource(models.Model):
|
||||
libelle = models.CharField(max_length=200, blank=False)
|
||||
type = models.CharField(max_length=30, choices = CHOIX_TYPE_SAVOIR, default='Savoir')
|
||||
module=models.ForeignKey(Module, null=True, default=None)
|
||||
|
||||
def __str__(self):
|
||||
return '{0}'.format(self.libelle)
|
||||
|
||||
class Objectif(models.Model):
|
||||
libelle = models.CharField(max_length=200, blank=False)
|
||||
#type = models.CharField(max_length=30, choices = CHOIX_TYPE_SAVOIR)
|
||||
module=models.ForeignKey(Module, null=True, default=None)
|
||||
|
||||
def __str__(self):
|
||||
return '{0}'.format(self.libelle)
|
||||
|
||||
|
||||
class Document(models.Model):
|
||||
docfile = models.FileField(upload_to='media')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
214
cms/static/css/main.css
Normal file
214
cms/static/css/main.css
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
@CHARSET "UTF-8";
|
||||
|
||||
#submenu {
|
||||
width:100%;
|
||||
background: #79aec8;
|
||||
padding: 10px 40px;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
color: #c4dce8;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
.dashboard #content {
|
||||
width:1200px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
}
|
||||
|
||||
#plan a:link {
|
||||
color:black;
|
||||
}
|
||||
|
||||
#plan a:visited {
|
||||
color:black;
|
||||
}
|
||||
|
||||
#plan a:hover {
|
||||
text-decoration:underline;
|
||||
}
|
||||
|
||||
#plan {
|
||||
border-collapse: separate;
|
||||
border-spacing: 5px 10px;
|
||||
|
||||
}
|
||||
|
||||
table th {
|
||||
font-size:120%;
|
||||
}
|
||||
|
||||
ul, ul li {
|
||||
list-style-type: none;
|
||||
float:left;
|
||||
}
|
||||
|
||||
ul li {
|
||||
/*)
|
||||
list-style-type:none;
|
||||
*/
|
||||
}
|
||||
|
||||
.liste-table {
|
||||
list-style-type:square;
|
||||
margin-left:0px;
|
||||
padding:0px;
|
||||
}
|
||||
.clear-booth {
|
||||
float:none;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.liste-verticale li {
|
||||
float:none;
|
||||
clear:both;
|
||||
list-style-type:square;
|
||||
margin-left:0px;
|
||||
padding:0px;
|
||||
}
|
||||
|
||||
|
||||
.l1 {
|
||||
background-color:#fcaf3e;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
|
||||
}
|
||||
|
||||
.l2 {
|
||||
background-color:#cc0000;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
.l3 {
|
||||
background-color:#ef896b;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
.l4 {
|
||||
background-color:#ad7fa8;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
.l5 {
|
||||
background-color:#729fcf;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
.l6 {
|
||||
background-color:#73d216;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.l7 {
|
||||
background-color:#ffffff;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
.l8 {
|
||||
background-color:#babdb6;
|
||||
padding:5px;
|
||||
-moz-border-radius:10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
|
||||
.d {
|
||||
border:1px solid black;
|
||||
vertical-align:middle;
|
||||
font-weight:bold;
|
||||
font-size:105%;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.p {
|
||||
border:1px solid black;
|
||||
font-size:105%;
|
||||
vertical-align:middle;
|
||||
}
|
||||
|
||||
.m {
|
||||
border:1px solid black;
|
||||
font-size:105%;
|
||||
text-align:center;
|
||||
vertical-align:middle;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
/* Affiche des infos dans la page DOMAINE */
|
||||
.processus {
|
||||
margin-left: 50px;
|
||||
line-height:2em;
|
||||
}
|
||||
|
||||
.module {
|
||||
margin-left:100px;
|
||||
margin-bottom:0px;
|
||||
line-height:2em;
|
||||
}
|
||||
|
||||
.competence {
|
||||
margin-left: 150px;
|
||||
line-height:2em;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* BREADCRUMBS */
|
||||
|
||||
div.breadcrumbs {
|
||||
background: #79aec8;
|
||||
padding: 15px 0px;
|
||||
border: none;
|
||||
font-size: 14px;
|
||||
color: #c4dce8;
|
||||
text-align: left;
|
||||
|
||||
}
|
||||
|
||||
div.breadcrumbs ul {
|
||||
text-indent: 0px;
|
||||
}
|
||||
|
||||
div.breadcrumbs ul li {
|
||||
line-height:0px;
|
||||
text-indent:0px;
|
||||
margin-left:0px;
|
||||
padding-left:0px;
|
||||
padding-right:30px;
|
||||
float:left;
|
||||
|
||||
}
|
||||
|
||||
div.breadcrumbs a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
div.breadcrumbs a:focus, div.breadcrumbs a:hover {
|
||||
color: #c4dce8;
|
||||
}
|
||||
|
||||
|
||||
|
||||
3
cms/tests.py
Normal file
3
cms/tests.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
118
cms/views.py
Normal file
118
cms/views.py
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
'''
|
||||
Created on 4 déc. 2012
|
||||
|
||||
@author: alzo
|
||||
'''
|
||||
import os
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import ListView, TemplateView, DetailView
|
||||
from .models import Domaine, Processus, Module, Document, Document
|
||||
from django.db.models import F, Sum
|
||||
from django.conf import settings
|
||||
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.http import HttpResponse
|
||||
from .forms import DocumentForm
|
||||
|
||||
# Create your views here.
|
||||
|
||||
class HomeView(TemplateView):
|
||||
template_name = 'cms/index.html'
|
||||
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(HomeView, self).get_context_data(**kwargs)
|
||||
for d in Domaine.objects.all().order_by('code'):
|
||||
context[d.code] = d
|
||||
|
||||
for c in Processus.objects.all().order_by('code'):
|
||||
context[c.code] = c
|
||||
|
||||
for m in Module.objects.all().order_by('code'):
|
||||
context[m.code] = m
|
||||
|
||||
return context
|
||||
|
||||
|
||||
|
||||
class DomaineDetailView(DetailView):
|
||||
template_name = 'cms/domaine_detail.html'
|
||||
model = Domaine
|
||||
|
||||
|
||||
class DomaineListView(ListView):
|
||||
template_name = 'cms/domaine_list.html'
|
||||
model = Domaine
|
||||
|
||||
|
||||
class ProcessusDetailView(DetailView):
|
||||
template_name = 'cms/processus_detail.html'
|
||||
model = Processus
|
||||
|
||||
|
||||
class ProcessusListView(ListView):
|
||||
template_name = 'cms/processus_list.html'
|
||||
model = Processus
|
||||
|
||||
|
||||
class ModuleDetailView(DetailView):
|
||||
template_name = 'cms/module_detail.html'
|
||||
model = Module
|
||||
|
||||
|
||||
class ModuleListView(ListView):
|
||||
template_name = 'cms/module_list.html'
|
||||
model = Module
|
||||
|
||||
|
||||
|
||||
|
||||
class PeriodeView(TemplateView):
|
||||
template_name = 'cms/periodes.html'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = TemplateView.get_context_data(self, **kwargs)
|
||||
liste = Module.objects.exclude(periode_presentiel = 0)
|
||||
context['tot'] = liste.aggregate(Sum(F('periode_presentiel')))
|
||||
context['sem1'] = liste.exclude(sem1 = 0)
|
||||
context['tot1'] = liste.aggregate(Sum(F('sem1')))
|
||||
context['sem2'] = liste.exclude(sem2 = 0)
|
||||
context['tot2'] = liste.aggregate(Sum(F('sem2')))
|
||||
context['sem3'] = liste.exclude(sem3 = 0)
|
||||
context['tot3'] = liste.aggregate(Sum(F('sem3')))
|
||||
context['sem4'] = liste.exclude(sem4 = 0)
|
||||
context['tot4'] = liste.aggregate(Sum(F('sem4')))
|
||||
context['sem5'] = liste.exclude(sem5 = 0)
|
||||
context['tot5'] = liste.aggregate(Sum(F('sem5')))
|
||||
context['sem6'] = liste.exclude(sem6 = 0)
|
||||
context['tot6'] = liste.aggregate(Sum(F('sem6')))
|
||||
|
||||
return context
|
||||
|
||||
|
||||
|
||||
|
||||
def AddDoc(request):
|
||||
if request.method == 'POST':
|
||||
form = DocumentForm(request.POST, request.FILES)
|
||||
if form.is_valid():
|
||||
newdoc = Document(docfile = request.FILES['docfile'])
|
||||
newdoc.save()
|
||||
return HttpResponseRedirect('')
|
||||
else:
|
||||
form = DocumentForm()
|
||||
|
||||
documents = Document.objects.all()
|
||||
return render (request, 'cms/upload.html', {'documents': documents,'form': form})
|
||||
|
||||
|
||||
def Download(request, file_name):
|
||||
f = os.path.join(settings.MEDIA_ROOT, file_name)
|
||||
response = HttpResponse(content_type='application/pdf')
|
||||
response['Content-Disposition'] = 'attachment; filename={0}'.format(file_name)
|
||||
response['Content-Length'] = os.stat(f).st_size
|
||||
return response
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue