From 24fb4d3450fd540d7c5bc123b897e12bf7eceb6b Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Mon, 25 Apr 2016 10:11:08 +0200
Subject: [PATCH] Change Comments printed-out headers

---
 comments/models.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/comments/models.py b/comments/models.py
index 4bc3d9b50..a30e21de7 100644
--- a/comments/models.py
+++ b/comments/models.py
@@ -210,6 +210,11 @@ class Comment(models.Model):
         context['text_cut'] = text_cut
         context['date_submitted'] = self.date_submitted.strftime("%Y-%m-%d")
         header += ': '
+        if not self.anonymous:
+            header += ' <a href="/contributor/{{ author_id }}">{{ first_name }} {{ last_name }}</a>, '
+            context['author_id'] = self.author.id
+            context['first_name'] = self.author.user.first_name
+            context['last_name'] = self.author.user.last_name
         if self.submission is not None:
             header += ('<a href="/submission/{{ submission_id }}#comment_id{{ id }}"> \"{{ text_cut }}\"</a>' + 
                        '<p>submitted on {{ date_submitted }}')
@@ -248,8 +253,11 @@ class Comment(models.Model):
         if len(self.comment_text) > 30:
             text_cut += '...'
         context['text_cut'] = text_cut
-        context['name'] = self.author.user.first_name + ' ' + self.author.user.last_name
-        header += '{{ name }}, '
+        if not self.anonymous:
+            header += ' <a href="/contributor/{{ author_id }}">{{ first_name }} {{ last_name }}</a>, '
+            context['author_id'] = self.author.id
+            context['first_name'] = self.author.user.first_name
+            context['last_name'] = self.author.user.last_name
         if self.submission is not None:
             header += '<a href="/submission/{{ submission_id }}#comment_id{{ id }}"> \"{{ text_cut }}\"</a>'
             header += (' in submission on <a href="/submission/{{ submission_id }}" class="pubtitleli">' + 
-- 
GitLab