From 23d81b3f2d5672cbf3398a92eaec1ff43d87c1cf Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 16 Dec 2016 17:30:40 +0100 Subject: [PATCH] Use generic service template, the app is now FULLY generic ! :P --- .../core/templatetags/organization_tags.py | 2 +- .../migrations/0068_auto_20161216_1639.py | 25 +++++++ .../migrations/0069_auto_20161216_1649.py | 25 +++++++ app/organization/network/models.py | 18 +++++ app/templates/home/inc/bio.html | 2 +- app/templates/home/inc/service.html | 13 ++++ app/templates/home/inc/services.html | 71 ++----------------- var | 2 +- 8 files changed, 91 insertions(+), 67 deletions(-) create mode 100644 app/organization/network/migrations/0068_auto_20161216_1639.py create mode 100644 app/organization/network/migrations/0069_auto_20161216_1649.py create mode 100644 app/templates/home/inc/service.html diff --git a/app/organization/core/templatetags/organization_tags.py b/app/organization/core/templatetags/organization_tags.py index 0596a544..0cda8e9d 100644 --- a/app/organization/core/templatetags/organization_tags.py +++ b/app/organization/core/templatetags/organization_tags.py @@ -176,7 +176,7 @@ def slice_ng(qs, indexes): index_2 = 0 if len(index_split) > 1: index_2 = int(index_split[1]) - if index_1 > 0 and index_2: + if index_1 >= 0 and index_2: return list[index_1:index_2] else: return [list[index_1]] diff --git a/app/organization/network/migrations/0068_auto_20161216_1639.py b/app/organization/network/migrations/0068_auto_20161216_1639.py new file mode 100644 index 00000000..dfe2a447 --- /dev/null +++ b/app/organization/network/migrations/0068_auto_20161216_1639.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2016-12-16 15:39 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-network', '0067_auto_20161216_1606'), + ] + + operations = [ + migrations.AddField( + model_name='organizationservice', + name='box_size', + field=models.IntegerField(choices=[(3, 3), (6, 6)], default=3, verbose_name='box size'), + ), + migrations.AddField( + model_name='organizationservice', + name='css_color', + field=models.CharField(blank=True, choices=[('orange', 'orange'), ('blue', 'blue'), ('green', 'green')], help_text='Determine color on home.', max_length=64, null=True, verbose_name='class color'), + ), + ] diff --git a/app/organization/network/migrations/0069_auto_20161216_1649.py b/app/organization/network/migrations/0069_auto_20161216_1649.py new file mode 100644 index 00000000..a18f1159 --- /dev/null +++ b/app/organization/network/migrations/0069_auto_20161216_1649.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.11 on 2016-12-16 15:49 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organization-network', '0068_auto_20161216_1639'), + ] + + operations = [ + migrations.AddField( + model_name='organizationservice', + name='css_banner_type', + field=models.CharField(blank=True, choices=[('fsxxl', 'fsxxl'), ('fsxxxl', 'fsxxxl')], max_length=64, null=True, verbose_name='css banner type'), + ), + migrations.AlterField( + model_name='organizationservice', + name='css_color', + field=models.CharField(blank=True, choices=[('orange', 'orange'), ('blue', 'blue'), ('green', 'green')], max_length=64, null=True, verbose_name='css color'), + ), + ] diff --git a/app/organization/network/models.py b/app/organization/network/models.py index 31ff7a8f..5e391257 100644 --- a/app/organization/network/models.py +++ b/app/organization/network/models.py @@ -80,6 +80,21 @@ PATTERN_CHOICES = [ ALIGNMENT_CHOICES = (('left', _('left')), ('left', _('left')), ('right', _('right'))) +CSS_COLOR_CHOICES = [ + ('orange', _('orange')), + ('blue', _('blue')), + ('green', _('green')), +] + +CSS_BANNER_CHOICES = [ + ('fsxxl', 'fsxxl'), + ('fsxxxl', 'fsxxxl'), +] + +BOX_SIZE_CHOICES = [ + (3, 3), + (6, 6), +] class Organization(Named, Address, URL, AdminThumbRelatedMixin, Orderable): """(Organization description)""" @@ -180,6 +195,9 @@ class OrganizationService(Named, URL, Orderable): organization = models.ForeignKey(Organization, verbose_name=_('organization'), related_name='services', blank=True, null=True, on_delete=models.SET_NULL) image = FileField(_("Image"), max_length=1024, format="Image", upload_to="images") + css_color = models.CharField(_('css color'), max_length=64, blank=True, null=True, choices=CSS_COLOR_CHOICES) + css_banner_type = models.CharField(_('css banner type'), max_length=64, blank=True, null=True, choices=CSS_BANNER_CHOICES) + box_size = models.IntegerField(_('box size'), default=3, choices=BOX_SIZE_CHOICES) class OrganizationType(Named): diff --git a/app/templates/home/inc/bio.html b/app/templates/home/inc/bio.html index d0e89a3c..bd7fd283 100644 --- a/app/templates/home/inc/bio.html +++ b/app/templates/home/inc/bio.html @@ -3,7 +3,7 @@
- {% blocktrans %}IRCAM, the Institute for Research and Coordination in Acoustics/Music is one of the world’s largest public research centers dedicated to musical creation and scientific research. A unique venue where artistic vision converges with scientific and technological innovation, the institute directed by Frank Madlener brings together over 160 collaborators. IRCAM hosts the UMR9912 STMS Ircam-CNRS-UPMC science and technologies research lab.{% endblocktrans %} + {{ host_organization.bio|safe }}
diff --git a/app/templates/home/inc/service.html b/app/templates/home/inc/service.html new file mode 100644 index 00000000..d6648f9a --- /dev/null +++ b/app/templates/home/inc/service.html @@ -0,0 +1,13 @@ +{% load staticfiles i18n organization_tags %} +
+ +
diff --git a/app/templates/home/inc/services.html b/app/templates/home/inc/services.html index d3631767..6b851a4e 100644 --- a/app/templates/home/inc/services.html +++ b/app/templates/home/inc/services.html @@ -1,72 +1,15 @@ -{% load staticfiles i18n %} +{% load staticfiles i18n organization_tags %}
diff --git a/var b/var index 46bd4824..a4284e57 160000 --- a/var +++ b/var @@ -1 +1 @@ -Subproject commit 46bd4824cda178e8771f50d747d8d547fe326391 +Subproject commit a4284e579c4db28bc5c709f7b9372c41730de6c0 -- 2.39.5