From 97d7d5f7b378465f89957978e36acefa2eb932df Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Sun, 13 Jan 2019 19:43:10 +0100
Subject: [PATCH] Add nomination and election statuses to potfel

---
 colleges/constants.py                         |  6 +++++
 .../migrations/0011_auto_20190113_1942.py     | 24 +++++++++++++++++++
 colleges/templatetags/colleges_extras.py      | 10 +++++++-
 3 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 colleges/migrations/0011_auto_20190113_1942.py

diff --git a/colleges/constants.py b/colleges/constants.py
index 54746abcf..4b51b5c37 100644
--- a/colleges/constants.py
+++ b/colleges/constants.py
@@ -3,6 +3,9 @@ __license__ = "AGPL v3"
 
 
 POTENTIAL_FELLOWSHIP_IDENTIFIED = 'identified'
+POTENTIAL_FELLOWSHIP_NOMINATED = 'nominated'
+POTENTIAL_FELLOWSHIP_ELECTED = 'elected'
+POTENTIAL_FELLOWSHIP_NOT_ELECTED = 'notelected'
 POTENTIAL_FELLOWSHIP_INVITED = 'invited'
 POTENTIAL_FELLOWSHIP_REINVITED = 'reinvited'
 POTENTIAL_FELLOWSHIP_MULTIPLY_REINVITED = 'multiplyreinvited'
@@ -17,6 +20,9 @@ POTENTIAL_FELLOWSHIP_SCIPOST_EMERITUS = 'emeritus'
 
 POTENTIAL_FELLOWSHIP_STATUSES = (
     (POTENTIAL_FELLOWSHIP_IDENTIFIED, 'Identified as potential Fellow'),
+    (POTENTIAL_FELLOWSHIP_NOMINATED, 'Nominated for Fellowship'),
+    (POTENTIAL_FELLOWSHIP_ELECTED, 'Elected by the College'),
+    (POTENTIAL_FELLOWSHIP_NOT_ELECTED, 'Not elected by the College'),
     (POTENTIAL_FELLOWSHIP_INVITED, 'Invited to become Fellow'),
     (POTENTIAL_FELLOWSHIP_REINVITED, 'Reinvited after initial invitation'),
     (POTENTIAL_FELLOWSHIP_MULTIPLY_REINVITED, 'Multiply reinvited'),
diff --git a/colleges/migrations/0011_auto_20190113_1942.py b/colleges/migrations/0011_auto_20190113_1942.py
new file mode 100644
index 000000000..0db9bd1d5
--- /dev/null
+++ b/colleges/migrations/0011_auto_20190113_1942.py
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.4 on 2019-01-13 18:42
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('colleges', '0010_auto_20180917_2117'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='potentialfellowship',
+            options={'ordering': ['profile__last_name']},
+        ),
+        migrations.AlterField(
+            model_name='potentialfellowship',
+            name='status',
+            field=models.CharField(choices=[('identified', 'Identified as potential Fellow'), ('nominated', 'Nominated for Fellowship'), ('elected', 'Elected by the College'), ('notelected', 'Not elected by the College'), ('invited', 'Invited to become Fellow'), ('reinvited', 'Reinvited after initial invitation'), ('multiplyreinvited', 'Multiply reinvited'), ('declined', 'Declined the invitation'), ('unresponsive', 'Marked as unresponsive'), ('retired', 'Retired'), ('deceased', 'Deceased'), ('interested', 'Marked as interested, Fellowship being set up'), ('registered', 'Registered as Contributor'), ('activeincollege', 'Currently active in a College'), ('emeritus', 'SciPost Emeritus')], default='identified', max_length=32),
+        ),
+    ]
diff --git a/colleges/templatetags/colleges_extras.py b/colleges/templatetags/colleges_extras.py
index b94789c25..06347a2cf 100644
--- a/colleges/templatetags/colleges_extras.py
+++ b/colleges/templatetags/colleges_extras.py
@@ -5,7 +5,9 @@ __license__ = "AGPL v3"
 from django import template
 
 from ..constants import (
-    POTENTIAL_FELLOWSHIP_IDENTIFIED, POTENTIAL_FELLOWSHIP_INVITED, POTENTIAL_FELLOWSHIP_REINVITED,
+    POTENTIAL_FELLOWSHIP_IDENTIFIED, POTENTIAL_FELLOWSHIP_NOMINATED,
+    POTENTIAL_FELLOWSHIP_ELECTED, POTENTIAL_FELLOWSHIP_NOT_ELECTED,
+    POTENTIAL_FELLOWSHIP_INVITED, POTENTIAL_FELLOWSHIP_REINVITED,
     POTENTIAL_FELLOWSHIP_MULTIPLY_REINVITED, POTENTIAL_FELLOWSHIP_DECLINED,
     POTENTIAL_FELLOWSHIP_UNRESPONSIVE, POTENTIAL_FELLOWSHIP_RETIRED, POTENTIAL_FELLOWSHIP_DECEASED,
     POTENTIAL_FELLOWSHIP_INTERESTED, POTENTIAL_FELLOWSHIP_REGISTERED,
@@ -23,6 +25,12 @@ def potfelstatuscolor(status):
     color = '#333333'
     if status == POTENTIAL_FELLOWSHIP_IDENTIFIED:
         color = hslColorWheel(12, 8)
+    elif status == POTENTIAL_FELLOWSHIP_NOMINATED:
+        color = 'Orange'
+    elif status == POTENTIAL_FELLOWSHIP_ELECTED:
+        color = 'MediumSeaGreen'
+    elif status == POTENTIAL_FELLOWSHIP_NOT_ELECTED:
+        color = 'Tomato'
     elif status == POTENTIAL_FELLOWSHIP_INVITED:
         color = hslColorWheel(12, 9)
     elif status == POTENTIAL_FELLOWSHIP_REINVITED:
-- 
GitLab