From de79fead660d477aa316ec4d0b66efb1ab3b66ee Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Fri, 4 May 2018 21:52:37 +0200
Subject: [PATCH] Put back affiliations on about page.

---
 scipost/models.py                                 | 7 ++++++-
 scipost/templates/scipost/_contributor_short.html | 4 ++--
 scipost/templates/scipost/about.html              | 3 +--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/scipost/models.py b/scipost/models.py
index b99afdeac..e6c4d4df1 100644
--- a/scipost/models.py
+++ b/scipost/models.py
@@ -285,7 +285,10 @@ class PrecookedEmail(models.Model):
 ######################
 
 class EditorialCollege(models.Model):
-    """A SciPost Editorial College for a specific discipline."""
+    """A SciPost Editorial College for a specific discipline.
+
+    DEPRECATED. To be removed.
+    """
     discipline = models.CharField(max_length=255, unique=True)
 
     def __str__(self):
@@ -296,6 +299,8 @@ class EditorialCollegeFellowship(TimeStampedModel):
     """
     Editorial College Fellowship connecting Editorial College and Contributors,
     maybe with a limiting start/until date.
+
+    DEPRECATED. To be removed.
     """
     contributor = models.ForeignKey('scipost.Contributor', on_delete=models.CASCADE,
                                     related_name='+')
diff --git a/scipost/templates/scipost/_contributor_short.html b/scipost/templates/scipost/_contributor_short.html
index 153b4f8e5..3b517c051 100644
--- a/scipost/templates/scipost/_contributor_short.html
+++ b/scipost/templates/scipost/_contributor_short.html
@@ -12,8 +12,8 @@
     {% endif %}
 </p>
 
-{% if fellowship.affiliation %}
-    <span class="text-muted">({{fellowship.affiliation}})</span>
+{% if fellowship.contributor.affiliations.active.first %}
+    <span class="text-muted">({{ fellowship.contributor.affiliations.active.first.institution.name }})</span>
 {% endif %}
 <div>
     {% for expertise in fellowship.contributor.expertises %}
diff --git a/scipost/templates/scipost/about.html b/scipost/templates/scipost/about.html
index 1840b0a4d..13813ae32 100644
--- a/scipost/templates/scipost/about.html
+++ b/scipost/templates/scipost/about.html
@@ -126,7 +126,6 @@
 <hr>
 
 {% for discipline,fellowships in disciplines.items %}
-{#{% for college, codes in object_list %}#}
     <h2 class="highlight" id="editorial_college_{{ discipline|lower }}">Editorial College ({{ discipline }})</h2>
 
     <div class="row">
@@ -160,7 +159,7 @@
             <div class="card-columns">
                 {% for fellowship in fellowships.0 %}
                     <div class="card bg-white contributor mb-1">
-                        {% include 'scipost/_contributor_short.html' with contributor=fellowship.contributor %}
+                        {% include 'scipost/_contributor_short.html' with fellowship=fellowship %}
                     </div>
                 {% endfor %}
             </div>
-- 
GitLab