]> git.parisson.com Git - mezzo.git/commitdiff
Department : adding pattern selector + slider block
authorEmilie <zawadzki@ircam.fr>
Fri, 12 Aug 2016 13:31:07 +0000 (15:31 +0200)
committerEmilie <zawadzki@ircam.fr>
Fri, 12 Aug 2016 13:31:07 +0000 (15:31 +0200)
app/organization/team/migrations/0016_auto_20160812_1521.py [new file with mode: 0644]
app/organization/team/models.py
app/templates/pages/department.html

diff --git a/app/organization/team/migrations/0016_auto_20160812_1521.py b/app/organization/team/migrations/0016_auto_20160812_1521.py
new file mode 100644 (file)
index 0000000..98a083d
--- /dev/null
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-08-12 13:21
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-team', '0015_auto_20160810_1829'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='department',
+            name='weaving_css_class',
+            field=models.CharField(blank=True, choices=[('pattern-bg--circles', 'circles'), ('pattern-bg--squares', 'squares'), ('pattern-bg--stripes', 'stripes'), ('pattern-bg--triangles', 'triangles')], max_length=64, verbose_name='background pattern'),
+        ),
+    ]
index 00bc198e06c4be1e8ce29a72d5914cc56d47382a..b8eec8600f5d6091133e5418d62c70088874b6fe 100644 (file)
@@ -44,6 +44,13 @@ TITLE_CHOICES = [
     ('Prof Dr', _('Prof Dr')),
 ]
 
+PATTERN_CHOICES = [
+    ('pattern-bg--circles', _('circles')),
+    ('pattern-bg--squares', _('squares')),
+    ('pattern-bg--stripes', _('stripes')),
+    ('pattern-bg--triangles', _('triangles')),
+]
+
 ALIGNMENT_CHOICES = (('left', _('left')), ('left', _('left')), ('right', _('right')))
 
 
@@ -84,7 +91,7 @@ class Department(Page, SubTitle, RichText, Photo):
 
     organization = models.ForeignKey('Organization', verbose_name=_('organization'))
     url = models.URLField(_('URL'), max_length=512, blank=True)
-    weaving_css_class = models.CharField(_('weaving CSS class'), max_length=64, blank=True)
+    weaving_css_class = models.CharField(_('background pattern'), choices=PATTERN_CHOICES, max_length=64, blank=True)
     articles_related = models.ManyToManyField(Article, verbose_name=_('Related articles'), blank=True)
 
     class Meta:
index c7e29562092adf60bfc3ba70d3fc19e710e119ae..f0887c97eee0c678d4168222f69efd0c070275d5 100644 (file)
@@ -20,7 +20,7 @@
 {% endblock %}
 
 {% block body_class %}
-    pattern pattern-bg pattern-bg--circles
+    pattern pattern-bg {{ page.department.weaving_css_class }}
 {% endblock %}
 
 {% block page_title %}
 
 {% endblock %}
 
+{% block page_slider %}
+  {% if page.department.pageimage_set.all %}
+    {% with page.department.pageimage_set.all as slider_images %}
+        {% include 'core/inc/slider.html' %}
+    {% endwith %}
+  {% endif %}
+{% endblock %}
+
 {% block page_sub_content %}
 
     {% if page.department.pageblock_set.all %}