]> git.parisson.com Git - mezzo.git/commitdiff
Task #290: Brief > add style
authorEmilie <zawadzki@ircam.fr>
Fri, 21 Oct 2016 15:39:58 +0000 (17:39 +0200)
committerEmilie <zawadzki@ircam.fr>
Fri, 21 Oct 2016 15:39:58 +0000 (17:39 +0200)
app/organization/magazine/migrations/0014_brief_style.py [new file with mode: 0644]
app/organization/magazine/models.py
app/templates/magazine/brief/inc/brief_card.html

diff --git a/app/organization/magazine/migrations/0014_brief_style.py b/app/organization/magazine/migrations/0014_brief_style.py
new file mode 100644 (file)
index 0000000..cc9753c
--- /dev/null
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.10 on 2016-10-21 15:35
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-magazine', '0013_auto_20161013_2353'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='brief',
+            name='style',
+            field=models.CharField(choices=[('grey', 'grey'), ('yellow', 'yellow'), ('black', 'black')], default='', max_length=16, verbose_name='style'),
+            preserve_default=False,
+        ),
+    ]
index 302d7be570b3e7b7d8a624511974c0a59d1263be..fad057f21496972a9629f6814b89444ae051b1f3 100644 (file)
@@ -16,6 +16,11 @@ from organization.media.models import *
 from organization.core.models import *
 from organization.magazine.apps import *
 
+BRIEF_STYLE_CHOICES = [
+    ('grey', _('grey')),
+    ('yellow', _('yellow')),
+    ('black', _('black'))
+]
 
 class Article(BlogPost, SubTitled):
 
@@ -47,6 +52,7 @@ class ArticlePlaylist(PlaylistRelated):
 
 class Brief(Displayable, RichText):
 
+    style = models.CharField(_('style'), max_length=16, choices=BRIEF_STYLE_CHOICES)
     text_button = models.CharField(blank=True, max_length=150, null=False, verbose_name=_('text button'))
     external_content = models.URLField(blank=True, max_length=1000, null=False, verbose_name=_('external content'))
 
index efe6b363a227389a77f30a9c9126ebbc69f7c438..2953f9697ec65fd69b1bdaedff0bfce94b3416b1 100644 (file)
@@ -1,11 +1,11 @@
 {% load i18n mezzanine_tags %}
 
 <div class="brief-box">
-    
+    {{ content.content_object.style }}
+
     <div class="brief-box__head">
         {% trans 'Brief !' %}
     </div>
-
     <h3 class="brief-box__title">{{content.content_object.title }}</h3>
     <div class="brief-box__desc">
         {{content.content_object.content|richtext_filters|safe|truncatechars_html:150 }}