From 517118c27db6f0d0e3d737d3fa01d0d06a69a8e3 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Wed, 28 Feb 2018 16:27:26 +0000
Subject: [PATCH] Add the comment list to the submission page

---
 .../activity/templates/activity/include/comment_list.html  | 7 +++++++
 opentech/apply/activity/views.py                           | 1 +
 .../templates/funds/applicationsubmission_detail.html      | 1 +
 3 files changed, 9 insertions(+)
 create mode 100644 opentech/apply/activity/templates/activity/include/comment_list.html

diff --git a/opentech/apply/activity/templates/activity/include/comment_list.html b/opentech/apply/activity/templates/activity/include/comment_list.html
new file mode 100644
index 000000000..9217e3013
--- /dev/null
+++ b/opentech/apply/activity/templates/activity/include/comment_list.html
@@ -0,0 +1,7 @@
+{% for comment in comments %}
+<div>
+    <p>{{ comment.timestamp }}</p>
+    <p>{{ comment.user }}</p>
+    <p>{{ comment.message }}</p>
+</div>
+{% endfor %}
diff --git a/opentech/apply/activity/views.py b/opentech/apply/activity/views.py
index 7e63e460e..58b252da1 100644
--- a/opentech/apply/activity/views.py
+++ b/opentech/apply/activity/views.py
@@ -8,6 +8,7 @@ class CommentContextMixin:
     # Adds the comment form to the context
     def get_context_data(self, **kwargs):
         extra = {
+            'comments': Activity.objects.filter(application=self.object),
             CommentFormView.context_name: CommentFormView.form_class(),
         }
 
diff --git a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html
index ade19e16d..fd87b677c 100644
--- a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html
+++ b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html
@@ -60,6 +60,7 @@
                 </div>
             {% endif %}
             {% include "activity/include/comment_form.html" %}
+            {% include "activity/include/comment_list.html" %}
         </aside>
     </div>
 </div>
-- 
GitLab