]> git.parisson.com Git - mezzo.git/commitdiff
Add more translations, add date to person lists
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 18 Oct 2016 10:06:57 +0000 (12:06 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 18 Oct 2016 10:06:57 +0000 (12:06 +0200)
app/organization/core/models.py
app/organization/network/admin.py
app/organization/network/migrations/0040_auto_20161018_1203.py [new file with mode: 0644]
app/organization/network/models.py
app/organization/network/translation.py
app/templates/pages/menus/header_tree_primary.html

index c02bc6d8bfdb6fae754cb37de0a98f39e3bf1917..3c821c77d6364888aed44e3f4e521e1563f7a001 100644 (file)
@@ -226,3 +226,12 @@ class AdminThumbRelatedMixin(object):
         return "<img src='%s%s'>" % (settings.MEDIA_URL, thumb_url)
     admin_thumb.allow_tags = True
     admin_thumb.short_description = ""
+
+
+class Dated(models.Model):
+
+    date_created = models.DateTimeField(_('creation date'), auto_now_add=True)
+    date_modified = models.DateTimeField(_('last modification date'), auto_now=True)
+
+    class Meta:
+        abstract = True
index 65d6881cf959629e22e4003d4625234b9a5bf318..a26421d799ff3bc76c805c00bc36045aa8b53385 100644 (file)
@@ -129,6 +129,7 @@ class PersonListBlockInlineAdmin(TabularDynamicInlineAdmin):
 class PersonListBlockAdmin(admin.ModelAdmin):
 
     inlines = [PersonListBlockInlineAdmin,]
+    list_display = ['title', 'description', 'date_created', 'date_modified']
 
 
 class ActivityFunctionAdmin(BaseTranslationModelAdmin):
diff --git a/app/organization/network/migrations/0040_auto_20161018_1203.py b/app/organization/network/migrations/0040_auto_20161018_1203.py
new file mode 100644 (file)
index 0000000..fd0a7d0
--- /dev/null
@@ -0,0 +1,38 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-18 10:03
+from __future__ import unicode_literals
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-network', '0039_auto_20161014_0002'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='person',
+            name='description_en',
+            field=models.TextField(blank=True, null=True, verbose_name='Description'),
+        ),
+        migrations.AddField(
+            model_name='person',
+            name='description_fr',
+            field=models.TextField(blank=True, null=True, verbose_name='Description'),
+        ),
+        migrations.AddField(
+            model_name='personlistblock',
+            name='date_created',
+            field=models.DateTimeField(auto_now_add=True, default=datetime.datetime(2016, 10, 18, 12, 3, 24, 592756), verbose_name='creation date'),
+            preserve_default=False,
+        ),
+        migrations.AddField(
+            model_name='personlistblock',
+            name='date_modified',
+            field=models.DateTimeField(auto_now=True, default=datetime.datetime(2016, 10, 18, 12, 3, 30, 482037), verbose_name='last modification date'),
+            preserve_default=False,
+        ),
+    ]
index 333fd0ad5b12973244e6ae1d9090ad28de86741f..bdf73c91efa7ebd19624925542b4852415caf0dc 100644 (file)
@@ -305,7 +305,7 @@ class PageCustomPersonListBlockInline(Titled):
         return self.title
 
 
-class PersonListBlock(Titled):
+class PersonListBlock(Titled, Dated):
 
     style = models.CharField(_('style'), max_length=16, choices=PERSON_LIST_STYLE_CHOICES)
 
index 7d763d0178afe246c62f11b7fc3fe317d65b79ed..a6a231e75188d25116b33e0f3d2dc2d18e4e1f29 100644 (file)
@@ -36,7 +36,7 @@ class TeamTranslationOptions(TranslationOptions):
 @register(Person)
 class PersonTranslationOptions(TranslationOptions):
 
-    fields = ('bio',)
+    fields = ('description','bio',)
 
 
 @register(PersonActivity)
index 05f6f4c919033c1950ae4f00e1774909034ce964..bc679137935d48ca859636959871edb3ea108ce8 100644 (file)
@@ -7,7 +7,7 @@
         <div class="row">
             <div class="col-md-12">
                 <p>
-                    {{ page.departmentpage.sub_title }}
+                    {{ page.departmentpage.description }}
                 </p>
             </div>
         </div>