]> git.parisson.com Git - mezzo.git/commitdiff
Add OrganizationService and bio
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 16 Dec 2016 15:09:21 +0000 (16:09 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Fri, 16 Dec 2016 15:09:21 +0000 (16:09 +0100)
README.rst
app/organization/network/admin.py
app/organization/network/migrations/0066_auto_20161216_1603.py [new file with mode: 0644]
app/organization/network/migrations/0067_auto_20161216_1606.py [new file with mode: 0644]
app/organization/network/models.py
app/organization/network/translation.py
app/templates/projects/project_detail.html

index bc501a1915035aff0817de6cf3fece4ad45153b7..c3dd471758c47d3a6080e6429baef8b812196d67 100644 (file)
@@ -2,7 +2,7 @@
 Mezzanine-organization
 ======================
 
-Mezzanine-organization is a complete CMS for organizations with complex workflows
+Mezzanine-organization is a complete CMS for organizations with complex activities
 
 It is based on Mezzanine_ and Django_.
 
index 951469042ada4879a3f5b5fc0796854b777cf922..fcbbb1d0a50bbe0e20567a5c8152e14b81d6d477 100644 (file)
@@ -77,10 +77,16 @@ class OrganizationBlockInline(StackedDynamicInlineAdmin):
     model = OrganizationBlock
 
 
+class OrganizationServiceInline(StackedDynamicInlineAdmin):
+
+    model = OrganizationService
+
+
 class OrganizationAdmin(BaseTranslationOrderedModelAdmin):
 
     model = Organization
-    inlines = [ OrganizationPlaylistInline,
+    inlines = [ OrganizationServiceInline,
+                OrganizationPlaylistInline,
                 OrganizationImageInline,
                 OrganizationBlockInline,
                 OrganizationLinkInline,
diff --git a/app/organization/network/migrations/0066_auto_20161216_1603.py b/app/organization/network/migrations/0066_auto_20161216_1603.py
new file mode 100644 (file)
index 0000000..ff05ef2
--- /dev/null
@@ -0,0 +1,55 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2016-12-16 15:03
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-network', '0065_auto_20161208_1244'),
+    ]
+
+    operations = [
+        migrations.CreateModel(
+            name='OrganizationService',
+            fields=[
+                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+                ('name', models.CharField(max_length=512, verbose_name='name')),
+                ('name_fr', models.CharField(max_length=512, null=True, verbose_name='name')),
+                ('name_en', models.CharField(max_length=512, null=True, verbose_name='name')),
+                ('description', models.TextField(blank=True, verbose_name='description')),
+                ('description_fr', models.TextField(blank=True, null=True, verbose_name='description')),
+                ('description_en', models.TextField(blank=True, null=True, verbose_name='description')),
+                ('url', models.URLField(blank=True, max_length=512, verbose_name='URL')),
+                ('image', mezzanine.core.fields.FileField(max_length=1024, verbose_name='Image')),
+            ],
+            options={
+                'ordering': ['name'],
+                'abstract': False,
+            },
+        ),
+        migrations.AddField(
+            model_name='organization',
+            name='bio',
+            field=models.TextField(blank=True, verbose_name='bio'),
+        ),
+        migrations.AddField(
+            model_name='organization',
+            name='bio_en',
+            field=models.TextField(blank=True, null=True, verbose_name='bio'),
+        ),
+        migrations.AddField(
+            model_name='organization',
+            name='bio_fr',
+            field=models.TextField(blank=True, null=True, verbose_name='bio'),
+        ),
+        migrations.AddField(
+            model_name='organizationservice',
+            name='organization',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='services', to='organization-network.Organization', verbose_name='organization'),
+        ),
+    ]
diff --git a/app/organization/network/migrations/0067_auto_20161216_1606.py b/app/organization/network/migrations/0067_auto_20161216_1606.py
new file mode 100644 (file)
index 0000000..49312e3
--- /dev/null
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.11 on 2016-12-16 15:06
+from __future__ import unicode_literals
+
+from django.db import migrations
+import mezzanine.core.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-network', '0066_auto_20161216_1603'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='organizationservice',
+            options={'ordering': ('_order',)},
+        ),
+        migrations.AddField(
+            model_name='organizationservice',
+            name='_order',
+            field=mezzanine.core.fields.OrderField(null=True, verbose_name='Order'),
+        ),
+    ]
index 39ef81fdbbdcfdfc0241f40033a0193381bd39e5..31ff7a8f88c7f51263139062b6bfc177ccb9d541 100644 (file)
@@ -94,6 +94,7 @@ class Organization(Named, Address, URL, AdminThumbRelatedMixin, Orderable):
     telephone = models.CharField(_('telephone'), max_length=64, blank=True, null=True)
     opening_times = models.TextField(_('opening times'), blank=True)
     subway_access = models.TextField(_('subway access'), blank=True)
+    bio = models.TextField(_('bio'), blank=True)
     admin_thumb_type = 'logo'
 
     class Meta:
@@ -175,6 +176,12 @@ class OrganizationBlock(Block):
     organization = models.ForeignKey(Organization, verbose_name=_('organization'), related_name='blocks', blank=True, null=True, on_delete=models.SET_NULL)
 
 
+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")
+
+
 class OrganizationType(Named):
     """(OrganizationType description)"""
 
index 83b211c1e0eb74992ff18c2d8d99365eaf19b47b..d1bcb30c46e1ed3d3b9715a2bd98d35cfdf6d16f 100644 (file)
@@ -27,7 +27,7 @@ from organization.network.models import *
 @register(Organization)
 class OrganizationTranslationOptions(TranslationOptions):
 
-    fields = ('description', 'opening_times', 'subway_access')
+    fields = ('description', 'opening_times', 'subway_access', 'bio')
 
 
 @register(Department)
@@ -126,6 +126,12 @@ class OrganizationBlockTranslationOptions(TranslationOptions):
     pass
 
 
+@register(OrganizationService)
+class OrganizationServiceTranslationOptions(TranslationOptions):
+
+    fields = ('name', 'description')
+
+
 @register(PersonListBlock)
 class PersonListBlockTranslationOptions(TranslationOptions):
 
index e5e1dfa46650d6d79d08c4ffe81f2c6549569b16..07137d544ead3f11e35f6c18668f5f23b9786146 100644 (file)
                                                 </div>
 
                                                 <div class="project-details__item-title">
-                                                    {% trans "Ircam teams" %}
+                                                    {% trans "teams" %} ({{ host_organization }})
                                                 </div>
                                                 <div class="project-details__item-desc">
                                                     {% for team in project.teams.all %}