deplacement module
This commit is contained in:
parent
4c2549e8a4
commit
c92c0425ec
3 changed files with 18 additions and 34 deletions
|
|
@ -47,25 +47,7 @@ class Enseignant(models.Model):
|
||||||
return '{0} {1}'.format(self.nom, self.prenom)
|
return '{0} {1}'.format(self.nom, self.prenom)
|
||||||
|
|
||||||
def descr(self):
|
def descr(self):
|
||||||
return '{0} ({1})'.format(self.__str__(), self.email)
|
return '{0} ({1})'.format(self.__str__(), self.email)
|
||||||
|
|
||||||
|
|
||||||
class SVG_Domaine:
|
|
||||||
compteur = 0
|
|
||||||
x = 30
|
|
||||||
y = 10
|
|
||||||
width = 200
|
|
||||||
svg = '<rect x="20" y="{0}" rx="5" ry="5" width="60" height="{1}" fill="{3}" stroke="black" stroke-width="2" />'
|
|
||||||
txt = '<text x="25" y="{0}" style="stroke:#000000;font-size:12;">{1}</text>'
|
|
||||||
|
|
||||||
def get_svg(self):
|
|
||||||
return '{0}{1}'.format(self.svg, self.txt)
|
|
||||||
|
|
||||||
def __init__(self, domaine):
|
|
||||||
SVG_Domaine.compteur += 1
|
|
||||||
self.svg = self.svg.format(20, 100, settings.DOMAINE_COULEUR[domaine.code])
|
|
||||||
self.txt = self.txt.format(20, domaine.__str__())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Domaine(models.Model):
|
class Domaine(models.Model):
|
||||||
|
|
@ -73,6 +55,8 @@ class Domaine(models.Model):
|
||||||
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:
|
class Meta:
|
||||||
ordering = ('code',)
|
ordering = ('code',)
|
||||||
|
|
||||||
|
|
@ -83,10 +67,14 @@ class Domaine(models.Model):
|
||||||
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):
|
def svg(self):
|
||||||
svg = '<rect x="20" y="{0}" rx="5" ry="5" width="200" height="{1}" fill="{2}" stroke="black" stroke-width="1" />'
|
processus = self.processus_set.all()
|
||||||
txt = '<text x="25" y="{0}" style="stroke:#000000;font-size:10;">{1}</text>'
|
|
||||||
|
|
||||||
return svg.format(20, 100, settings.DOMAINE_COULEURS[self.code]) + txt.format(50, self.__str__())
|
|
||||||
|
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__())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ ROOT_URLCONF = 'common.urls'
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [os.path.join(BASE_DIR, 'templates/')],
|
'DIRS': [os.path.join(BASE_DIR, 'templates')],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
|
|
@ -97,7 +97,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||||
|
|
||||||
LANGUAGE_CODE = 'fr-fr'
|
LANGUAGE_CODE = 'fr-fr'
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
TIME_ZONE = 'Europe/Zurich'
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
|
|
@ -109,11 +109,11 @@ USE_TZ = True
|
||||||
# Static files (CSS, JavaScript, Images)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
||||||
|
|
||||||
STATIC_URL = '/static/'
|
STATIC_URL = '/cms/static/'
|
||||||
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
|
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
|
||||||
|
|
||||||
MEDIA_URL = '/media/'
|
MEDIA_URL = '/media/'
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
|
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
|
||||||
|
|
||||||
STUDENT_IMPORT_MAPPING = {
|
STUDENT_IMPORT_MAPPING = {
|
||||||
'Num élève': 'id_ext',
|
'Num élève': 'id_ext',
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@
|
||||||
<td></td><td> </td><td> </td><td> </td><td class="l2 m">{{M07.url_code|safe}}</td><td class="l2 m">{{M09.url_code|safe}}</td>
|
<td></td><td> </td><td> </td><td> </td><td class="l2 m">{{M07.url_code|safe}}</td><td class="l2 m">{{M09.url_code|safe}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td></td><td> </td><td> </td><td> </td><td class="l2 m">{{M08.url_code|safe}}</td><td> </td>
|
<td></td><td> </td><td> </td><td> </td><td class="l2 m">{{M08.url_code|safe}}</td><td> </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
@ -79,9 +78,9 @@
|
||||||
<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_1.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_2.url_code|safe}}</td>
|
<td colspan="2" class="l6 m">{{M16_2a.url_code|safe}}</td>
|
||||||
<td colspan="2" class="l6 m">{{M16_3.url_code|safe}}</td>
|
<td colspan="2" class="l6 m">{{M16_3a.url_code|safe}} / {{M16_3b.url_code|safe}} / {{M16_3c.url_code|safe}} / {{M16_3d.url_code|safe}} / {{M16_3e.url_code|safe}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- Ligne 7 -->
|
<!-- Ligne 7 -->
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -102,9 +101,6 @@
|
||||||
<br/>
|
<br/>
|
||||||
<a href="{% url 'plan-pdf' %}">Imprimer en PDF</a>
|
<a href="{% url 'plan-pdf' %}">Imprimer en PDF</a>
|
||||||
</div>
|
</div>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg">
|
|
||||||
{{D1.svg|safe}}
|
|
||||||
</svg>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue