commit dc05952f76f341622065f127de2c13d0ee7063cb Author: alazo Date: Thu Jan 5 07:09:33 2017 +0100 First commit diff --git a/cms/__init__.py b/cms/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cms/admin.py b/cms/admin.py new file mode 100644 index 0000000..941635b --- /dev/null +++ b/cms/admin.py @@ -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) diff --git a/cms/apps.py b/cms/apps.py new file mode 100644 index 0000000..5da2273 --- /dev/null +++ b/cms/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class EvalConfig(AppConfig): + name = 'cms' diff --git a/cms/forms.py b/cms/forms.py new file mode 100644 index 0000000..dbc3d80 --- /dev/null +++ b/cms/forms.py @@ -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') \ No newline at end of file diff --git a/cms/migrations/0001_initial.py b/cms/migrations/0001_initial.py new file mode 100644 index 0000000..97118e7 --- /dev/null +++ b/cms/migrations/0001_initial.py @@ -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'), + ), + ] diff --git a/cms/migrations/0002_auto_20161224_0929.py b/cms/migrations/0002_auto_20161224_0929.py new file mode 100644 index 0000000..ee598f9 --- /dev/null +++ b/cms/migrations/0002_auto_20161224_0929.py @@ -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), + ), + ] diff --git a/cms/migrations/0003_auto_20161224_0929.py b/cms/migrations/0003_auto_20161224_0929.py new file mode 100644 index 0000000..10a351a --- /dev/null +++ b/cms/migrations/0003_auto_20161224_0929.py @@ -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', + ), + ] diff --git a/cms/migrations/0004_auto_20161224_1234.py b/cms/migrations/0004_auto_20161224_1234.py new file mode 100644 index 0000000..d41282c --- /dev/null +++ b/cms/migrations/0004_auto_20161224_1234.py @@ -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',)}, + ), + ] diff --git a/cms/migrations/0005_auto_20161224_1236.py b/cms/migrations/0005_auto_20161224_1236.py new file mode 100644 index 0000000..0f72189 --- /dev/null +++ b/cms/migrations/0005_auto_20161224_1236.py @@ -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=''), + ), + ] diff --git a/cms/migrations/0006_auto_20161224_1339.py b/cms/migrations/0006_auto_20161224_1339.py new file mode 100644 index 0000000..9fec91d --- /dev/null +++ b/cms/migrations/0006_auto_20161224_1339.py @@ -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), + ), + ] diff --git a/cms/migrations/0007_auto_20161225_1951.py b/cms/migrations/0007_auto_20161225_1951.py new file mode 100644 index 0000000..f2ce7be --- /dev/null +++ b/cms/migrations/0007_auto_20161225_1951.py @@ -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), + ), + ] diff --git a/cms/migrations/0008_document.py b/cms/migrations/0008_document.py new file mode 100644 index 0000000..3836742 --- /dev/null +++ b/cms/migrations/0008_document.py @@ -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')), + ], + ), + ] diff --git a/cms/migrations/0009_module_description.py b/cms/migrations/0009_module_description.py new file mode 100644 index 0000000..9cd8b0f --- /dev/null +++ b/cms/migrations/0009_module_description.py @@ -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=''), + ), + ] diff --git a/cms/migrations/0010_auto_20170104_1251.py b/cms/migrations/0010_auto_20170104_1251.py new file mode 100644 index 0000000..143ded5 --- /dev/null +++ b/cms/migrations/0010_auto_20170104_1251.py @@ -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(), + ), + ] diff --git a/cms/migrations/0011_processus_description.py b/cms/migrations/0011_processus_description.py new file mode 100644 index 0000000..8f36e2f --- /dev/null +++ b/cms/migrations/0011_processus_description.py @@ -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=''), + ), + ] diff --git a/cms/migrations/0012_auto_20170104_1347.py b/cms/migrations/0012_auto_20170104_1347.py new file mode 100644 index 0000000..9ec5c60 --- /dev/null +++ b/cms/migrations/0012_auto_20170104_1347.py @@ -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), + ), + ] diff --git a/cms/migrations/__init__.py b/cms/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cms/models.py b/cms/models.py new file mode 100644 index 0000000..501d586 --- /dev/null +++ b/cms/models.py @@ -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 "{1}".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 "{1}".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 "{1}".format(self.id, self.__str__()) + + def url_code(self): + return "{1}".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') + + + + + + + + + + \ No newline at end of file diff --git a/cms/static/css/main.css b/cms/static/css/main.css new file mode 100644 index 0000000..80bb59e --- /dev/null +++ b/cms/static/css/main.css @@ -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; +} + + + diff --git a/cms/tests.py b/cms/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/cms/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/cms/views.py b/cms/views.py new file mode 100644 index 0000000..644f8f4 --- /dev/null +++ b/cms/views.py @@ -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 + + + \ No newline at end of file diff --git a/common/__init__.py b/common/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/common/settings.py b/common/settings.py new file mode 100644 index 0000000..67167b9 --- /dev/null +++ b/common/settings.py @@ -0,0 +1,120 @@ +# -*- encoding: utf-8 -*- +# Django settings for histone project. +""" +Django settings for eds project. + +Generated by 'django-admin startproject' using Django 1.10.4. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/1.10/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ + + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'cms', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'common.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [os.path.join(BASE_DIR, 'templates/')], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'common.wsgi.application' + + + + +# Password validation +# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/1.10/topics/i18n/ + +LANGUAGE_CODE = 'fr-fr' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/1.10/howto/static-files/ + +STATIC_URL = '/static/' +#STATIC_ROOT = os.path.join(BASE_DIR, 'static/') + +MEDIA_URL = '/media/' +MEDIA_ROOT = os.path.join(BASE_DIR, 'media') + +from .local_settings import * + + diff --git a/common/urls.py b/common/urls.py new file mode 100644 index 0000000..6224abf --- /dev/null +++ b/common/urls.py @@ -0,0 +1,34 @@ +"""eds URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/1.10/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.conf.urls import url, include + 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) +""" +from django.conf.urls import url +from django.contrib import admin +from cms import views +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns = [ + url(r'^$', views.HomeView.as_view(), name='home'), + url(r'^admin/', admin.site.urls), + url(r'^domaine/(?P\d+)$', views.DomaineDetailView.as_view(), name='domaine-detail'), + url(r'^domaines/$', views.DomaineListView.as_view(), name='domaine-list'), + url(r'^processus/(?P\d+)$', views.ProcessusDetailView.as_view(), name='processus-detail'), + url(r'^processus/$', views.ProcessusListView.as_view(), name='processus-list'), + url(r'^module/(?P\d+)$', views.ModuleDetailView.as_view(), name='module-detail'), + url(r'^modules/$', views.ModuleListView.as_view(), name='module-list'), + url(r'^periode$', views.PeriodeView.as_view(), name='periode'), + url(r'^upload$', views.AddDoc, name='upload'), + url(r'^download/(?P.+)$', views.Download, name='download'), +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/common/wsgi.py b/common/wsgi.py new file mode 100644 index 0000000..3fd83d1 --- /dev/null +++ b/common/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for eds project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eds.settings") + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..e07b5fe --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/home/alzo/.virtualenv/eds/bin/ python3 +import os +import sys + +if __name__ == "__main__": + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "common.settings") + try: + from django.core.management import execute_from_command_line + except ImportError: + # The above import may fail for some other reason. Ensure that the + # issue is really that Django is missing to avoid masking other + # exceptions on Python 2. + try: + import django + except ImportError: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) + raise + execute_from_command_line(sys.argv) diff --git a/media/media/EDS_Calendrier_2017.pdf b/media/media/EDS_Calendrier_2017.pdf new file mode 100644 index 0000000..009fe9f Binary files /dev/null and b/media/media/EDS_Calendrier_2017.pdf differ diff --git a/media/media/EDS_Calendrier_2018.pdf b/media/media/EDS_Calendrier_2018.pdf new file mode 100644 index 0000000..d4e17eb Binary files /dev/null and b/media/media/EDS_Calendrier_2018.pdf differ diff --git a/media/media/EDS_Calendrier_2019.pdf b/media/media/EDS_Calendrier_2019.pdf new file mode 100644 index 0000000..5c56a69 Binary files /dev/null and b/media/media/EDS_Calendrier_2019.pdf differ diff --git a/media/media/LotEtiquettes.pdf b/media/media/LotEtiquettes.pdf new file mode 100644 index 0000000..f2d1290 Binary files /dev/null and b/media/media/LotEtiquettes.pdf differ diff --git a/static/css/main.css b/static/css/main.css new file mode 100644 index 0000000..c54c70b --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,7 @@ +@CHARSET "UTF-8"; + +#titre_col ul li { + list-style-type:none; +} + + diff --git a/templates/admin/base.html b/templates/admin/base.html new file mode 100644 index 0000000..dc82cae --- /dev/null +++ b/templates/admin/base.html @@ -0,0 +1,88 @@ +{% load i18n static %} +{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} + + +{% block title %}{% endblock %} + +{% block extrastyle %}{% endblock %} +{% if LANGUAGE_BIDI %}{% endif %} +{% block extrahead %}{% endblock %} +{% block blockbots %}{% endblock %} + +{% load i18n %} + + + + +
+ + {% if not is_popup %} + + + + {% block breadcrumbs %} + + {% endblock %} + {% endif %} + + {% block messages %} + {% if messages %} +
    {% for message in messages %} + {{ message|capfirst }} + {% endfor %}
+ {% endif %} + {% endblock messages %} + + +
+ {% block pretitle %}{% endblock %} + {% block content_title %}{% if title %}

{{ title }}

{% endif %}{% endblock %} + {% block content %} + {% block object-tools %}{% endblock %} + {{ content }} + {% endblock %} + {% block sidebar %}{% endblock %} +
+
+ + + {% block footer %}{% endblock %} +
+ + + + diff --git a/templates/admin/base_site.html b/templates/admin/base_site.html new file mode 100644 index 0000000..c03230f --- /dev/null +++ b/templates/admin/base_site.html @@ -0,0 +1,15 @@ +{% extends "admin/base.html" %} + +{% block title %}EDS{% endblock %} + +{% block branding %} +

{{ site_header|default:_('Django administration') }}

+{% endblock %} + +{% block nav-global %}{% endblock %} +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/admin/cms/processus/edit_inline/tabular.html b/templates/admin/cms/processus/edit_inline/tabular.html new file mode 100644 index 0000000..baf0941 --- /dev/null +++ b/templates/admin/cms/processus/edit_inline/tabular.html @@ -0,0 +1 @@ +helle \ No newline at end of file diff --git a/templates/cms/base.html b/templates/cms/base.html new file mode 100644 index 0000000..1f257fd --- /dev/null +++ b/templates/cms/base.html @@ -0,0 +1,89 @@ +{% load i18n static %} +{% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %} + + +{% block title %}{% endblock %} + + + +{% block extrastyle %}{% endblock %} +{% if LANGUAGE_BIDI %}{% endif %} +{% block extrahead %}{% endblock %} +{% block blockbots %}{% endblock %} + +{% load i18n %} + + + + +
+ + {% if not is_popup %} + + + + {% block breadcrumbs %} + {% endblock %} + {% endif %} + + {% block messages %} + {% if messages %} +
    {% for message in messages %} + {{ message|capfirst }} + {% endfor %}
+ {% endif %} + {% endblock messages %} + + +
+ {% block pretitle %}{% endblock %} + {% block content_title %}{% if title %}

{{ title }}

{% endif %}{% endblock %} + {% block content %} + {% block object-tools %}{% endblock %} + {{ content }} + {% endblock %} + {% block sidebar %}{% endblock %} +
+
+ + + {% block footer %}{% endblock %} +
+ + + + diff --git a/templates/cms/base_site.html b/templates/cms/base_site.html new file mode 100644 index 0000000..0df6da7 --- /dev/null +++ b/templates/cms/base_site.html @@ -0,0 +1,21 @@ +{% extends "./base.html" %} + +{% block title %}EDS{% endblock %} + +{% block branding %}

Formation EDS

{% endblock %} +{% block usertools %}{% endblock %} +{% block nav-global %}{% endblock %} +{% block breadcrumbs %} + +{% endblock %} diff --git a/templates/cms/documents.html b/templates/cms/documents.html new file mode 100644 index 0000000..7948359 --- /dev/null +++ b/templates/cms/documents.html @@ -0,0 +1,29 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block extrastyle %}{{ block.super }} +{% endblock %} + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }} dashboard{% endblock %} + +{% block breadcrumbs %} + + {% endblock %} + +{% block content %} + +
+

Documents utiles

+
+{% endblock %} + + diff --git a/templates/cms/domaine_detail.html b/templates/cms/domaine_detail.html new file mode 100644 index 0000000..a40b273 --- /dev/null +++ b/templates/cms/domaine_detail.html @@ -0,0 +1,26 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block coltype %}colMS{% endblock %} + + + +{% block content %} + + +{% endblock %} + + diff --git a/templates/cms/domaine_list.html b/templates/cms/domaine_list.html new file mode 100644 index 0000000..016e07b --- /dev/null +++ b/templates/cms/domaine_list.html @@ -0,0 +1,31 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + + + + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }}{% endblock %} + +{% block content %} + +
+

Liste des domaines

+ +{% for d in object_list %} + +{% for p in d.processus_set.all %} + +{% for m in p.module_set.all %} + +{% endfor %} +{% endfor %} +{% endfor %} +
{{d}}
 {{p}}
 {{m}}
+ + +
+{% endblock %} + + diff --git a/templates/cms/index.html b/templates/cms/index.html new file mode 100644 index 0000000..18bb301 --- /dev/null +++ b/templates/cms/index.html @@ -0,0 +1,103 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block coltype %}colMS{% endblock %} + +{% block content %} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DomainesProcessusSem1Sem2Sem3Sem4Sem5Sem6
{{D1.url|safe}}{{P01.url|safe}}{{M01.url_code|safe}}     
{{M02.url_code|safe}}     
{{P02.url|safe}}{{M03.url_code|safe}}    
{{M04.url_code|safe}}    
{{D2.url|safe}}{{P03.url|safe}}{{M05.url_code|safe}} {{M06.url_code|safe}}   
{{P04.url|safe}}   {{M07.url_code|safe}}{{M09.url_code|safe}}
   {{M08.url_code|safe}} 
{{D3.url|safe}}{{P05.url|safe}}  {{M10.url_code|safe}}{{M12.url_code|safe}} 
{{P06.url|safe}}  {{M11.url_code|safe}}  
{{D4.url|safe}}{{P07.url|safe}}  {{M13.url_code|safe}}  {{M14.url_code|safe}}
{{D5.url|safe}}{{P08.url|safe}}{{M15.url_code|safe}}
{{D6.url|safe}}{{P09.url|safe}}{{M16_1a.url_code|safe}} - {{M16_1b.url_code|safe}} - {{M16_1c.url_code|safe}}{{M16_2a.url_code|safe}} - {{M16_2b.url_code|safe}} - {{M16_2c.url_code|safe}}{{M16_3a.url_code|safe}} - {{M16_3b.url_code|safe}} - {{M16_3c.url_code|safe}}
{{D7.url|safe}}{{P10.url|safe}}{{M17_1.url_code|safe}}{{M17_2.url_code|safe}}{{M17_3.url_code|safe}}
{{D8.url|safe}}{{P11.url|safe}}{{MACC.url_code|safe}}
+
+{% endblock %} + + diff --git a/templates/cms/module_detail.html b/templates/cms/module_detail.html new file mode 100644 index 0000000..85c4677 --- /dev/null +++ b/templates/cms/module_detail.html @@ -0,0 +1,38 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block coltype %}colMS{% endblock %} + +{% block content %} + +
+

{{object}}

+ + + + + + + + + + + +{% if object.periode_presentiel > 0 %} + +{% endif %} +{% if object.pratique_prof > 0 %} + +{% endif %} +{% if object.travail_perso > 0 %} + +{% endif %} + +
Domaine{{object.processus.domaine.url|safe}}
Processus{{object.processus.url|safe}}
Situation emblématique{{object.situation}}
Compétences visées

L'éducateur social, l'éducatrice sociale

+{% for c in object.competences.all %}- {{c.libelle}} ({{c.code}})
{% endfor %}
Ressources{% for c in object.ressource_set.all %}- {{c}}
{% endfor %}
Objectifs{% for c in object.objectif_set.all %}- {{c}}
{% endfor %}
Contenu{{object.contenu}}
Evaluation{{object.evaluation}}
Type{{object.type}}
Semestre{{object.semestre}}
Présentiel{{object.periode_presentiel}} heures
Pratique prof.{{object.pratique_prof}} heures
Travail perso.{{object.travail_perso}} heures
Responsable{{object.processus.domaine.responsable}} ({{object.processus.domaine.responsable.email}})
+ + +
+{% endblock %} + + diff --git a/templates/cms/module_list.html b/templates/cms/module_list.html new file mode 100644 index 0000000..9aaeb18 --- /dev/null +++ b/templates/cms/module_list.html @@ -0,0 +1,25 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + + + + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }}{% endblock %} + +{% block content %} + +
+

Liste des modules

+ +{% for m in object_list %} + +{% endfor %} +
{{m.code}}{{m.nom}}
+ + +
+{% endblock %} + + diff --git a/templates/cms/periodes.html b/templates/cms/periodes.html new file mode 100644 index 0000000..8609849 --- /dev/null +++ b/templates/cms/periodes.html @@ -0,0 +1,48 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block extrastyle %}{{ block.super }} +{% endblock %} + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }} dashboard{% endblock %} + +{% block breadcrumbs %}{% endblock %} + +{% block content %} + +
+

Périodes de formation

+ + +{% for s in sem1 %} + +{% endfor %} + +{% for s in sem2 %} + +{% endfor %} + +{% for s in sem3 %} + +{% endfor %} + +{% for s in sem4 %} + +{% endfor %} + +{% for s in sem5 %} + +{% endfor %} + +{% for s in sem6 %} + +{% endfor %} +
Semestre 1{{tot1.sem1__sum}}h.
{{s}}{{s.sem1}} h.
Semestre 2{{tot2.sem2__sum}}h.
{{s}}{{s.sem2}} h.
Semestre 3{{tot3.sem3__sum}}h.
{{s}}{{s.sem3}} h.
Semestre 4{{tot4.sem4__sum}}h.
{{s}}{{s.sem4}} h.
Semestre 5{{tot5.sem5__sum}}h.
{{s}}{{s.sem5}} h.
Semestre 6{{tot6.sem6__sum}}h.
{{s}}{{s.sem6}} h.
+{{tot.tot__sum}} + +
+{% endblock %} + + diff --git a/templates/cms/processus_detail.html b/templates/cms/processus_detail.html new file mode 100644 index 0000000..bc89180 --- /dev/null +++ b/templates/cms/processus_detail.html @@ -0,0 +1,30 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }} dashboard{% endblock %} + + +{% block content %} + +
+

{{object}}

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

L'éducateur social, l'éducatrice sociale

+{% for m in object.module_set.all %}{% for c in m.competences.all %} +- {{c.libelle}} ({{c.code}})
{% endfor %}{% endfor %}
Domaine{{object.domaine.url|safe}}
Responsable{{object.domaine.responsable}} ({{object.domaine.responsable.email}})
Modules concernés{% for m in object.module_set.all %}{{m.url|safe}}
{% endfor %}
+ + +
+{% endblock %} + + diff --git a/templates/cms/processus_list.html b/templates/cms/processus_list.html new file mode 100644 index 0000000..d3d59fd --- /dev/null +++ b/templates/cms/processus_list.html @@ -0,0 +1,28 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + + + + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }}{% endblock %} + +{% block content %} + +
+

Liste des processus

+ +{% for p in object_list %} + +{% for m in p.module_set.all %} + +{% endfor %} +{% endfor %} +
{{p.code}}{{p.libelle}}
 {{m}}
+ + +
+{% endblock %} + + diff --git a/templates/cms/upload.html b/templates/cms/upload.html new file mode 100644 index 0000000..70e4f34 --- /dev/null +++ b/templates/cms/upload.html @@ -0,0 +1,49 @@ +{% extends "./base_site.html" %} +{% load i18n static %} + +{% block extrastyle %}{{ block.super }} +{% endblock %} + +{% block coltype %}colMS{% endblock %} + +{% block bodyclass %}{{ block.super }} dashboard{% endblock %} + +{% block breadcrumbs %} + + {% endblock %} + +{% block content %} + +
+

Enregistrements de documents

+{% if documents %} + + {% else %} +

No documents.

+ {% endif %} + +
  +
+ {% csrf_token %} +

{{ form.non_field_errors }}

+

{{ form.docfile.label_tag }} {{ form.docfile.help_text }}

+

+ {{ form.docfile.errors }} + {{ form.docfile }} +

+ +

+
+
+
+{% endblock %} + + +