]> git.parisson.com Git - mezzo.git/commitdiff
Article : deleted related_article, replaced by dynamic content | fix article_card...
authorEmilie <zawadzki@ircam.fr>
Sat, 24 Sep 2016 09:46:50 +0000 (11:46 +0200)
committerEmilie <zawadzki@ircam.fr>
Sat, 24 Sep 2016 09:46:50 +0000 (11:46 +0200)
app/organization/magazine/admin.py
app/organization/magazine/migrations/0008_remove_article_related_articles.py [new file with mode: 0644]
app/organization/magazine/models.py
app/templates/magazine/brief/inc/brief_card.html
app/templates/pages/departmentpage.html

index 1891bc318e473eda8b516ca7e7254b5837302200..462c5b15d421e5f6f69e0da3dcd02e54115fcd4b 100644 (file)
@@ -38,7 +38,7 @@ class ArticleAdminDisplayable(DisplayableAdmin):
 
     fieldsets = deepcopy(ArticleAdmin.fieldsets)
     exclude = ('related_posts',)
-    filter_horizontal = ['categories', 'related_articles', ]
+    filter_horizontal = ['categories',]
     inlines = [ArticleImageInline,
               ArticlePersonAutocompleteInlineAdmin,
               DynamicContentArticleInline]
diff --git a/app/organization/magazine/migrations/0008_remove_article_related_articles.py b/app/organization/magazine/migrations/0008_remove_article_related_articles.py
new file mode 100644 (file)
index 0000000..a5e8add
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.9.7 on 2016-09-24 09:20
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('organization-magazine', '0007_auto_20160924_1058'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='article',
+            name='related_articles',
+        ),
+    ]
index d9276b2626e3ce16df20a1a323b5fb9f9f14f91e..993748b704151358d7b2411377de077db9a9bed3 100644 (file)
@@ -16,7 +16,6 @@ from organization.core.models import *
 
 class Article(BlogPost, SubTitled):
 
-    related_articles = models.ManyToManyField("self", verbose_name=_("Related articles"), blank=True)
     department = models.ForeignKey(Department, verbose_name=_('department'), related_name='articles', limit_choices_to=dict(id__in=Department.objects.all()), blank=True, null=True, on_delete=models.SET_NULL)
     topics = models.ManyToManyField("Topic", verbose_name=_('topics'), related_name="articles", blank=True)
 
index dc07fc385ece8c6844108c038e07817f8df26ccf..efe6b363a227389a77f30a9c9126ebbc69f7c438 100644 (file)
@@ -1,7 +1,7 @@
 {% load i18n mezzanine_tags %}
 
 <div class="brief-box">
-
+    
     <div class="brief-box__head">
         {% trans 'Brief !' %}
     </div>
index 343de4f4a9e1aad96f90574d6ab098a0ecf0a6db..f833a2eba8a61beb827e5801759cc20a73293003 100644 (file)
@@ -89,9 +89,7 @@
 {% endblock %}
 
 {% block page_related_content %}
-
-    {% if page.departmentpage.articles_related.all %}
-
+    {% if page.departmentpage.department.articles.all %}
         <div class="white-bg pb2">
             <div class="container">
                 <div class="row tac">
                     </div>
                 </div>
                 <div class="row tac">
-                    {% for article in page.departmentpage.articles_related.all %}
+                    {% for article in page.departmentpage.department.articles.all %}
                         <div class="col-lg-3 col-md-4 col-sm-4 col-xs-6">
                             {% include 'magazine/article/includes/article_card.html' %}
                         </div>