From b44bd152cd5f36694626db54f01da855c08f68b7 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Fri, 29 Jan 2016 07:16:31 +0100
Subject: [PATCH] Trying to get MathJax to work

---
 .../templates/commentaries/commentary_detail.html     |  3 ---
 scipost/static/scipost/SciPost.css                    |  2 +-
 scipost/templates/scipost/base.html                   |  5 +++++
 scipost/templates/scipost/personal_page.html          | 11 +++++++++++
 scipost/views.py                                      |  3 ++-
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/commentaries/templates/commentaries/commentary_detail.html b/commentaries/templates/commentaries/commentary_detail.html
index 80a53f4f2..ce339e1b8 100644
--- a/commentaries/templates/commentaries/commentary_detail.html
+++ b/commentaries/templates/commentaries/commentary_detail.html
@@ -16,9 +16,6 @@
   });
 </script>
 
-<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
-<script type="text/javascript">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true}});</script>
-
 
 {% endblock headsup %}
 
diff --git a/scipost/static/scipost/SciPost.css b/scipost/static/scipost/SciPost.css
index 914eb04da..130363d3a 100644
--- a/scipost/static/scipost/SciPost.css
+++ b/scipost/static/scipost/SciPost.css
@@ -270,7 +270,7 @@ nav a:active {
 }
 nav p {
   display: inline-block;
-  margin: 0px;
+  margin: 10px;
   padding: 0px;
 }
 nav form {
diff --git a/scipost/templates/scipost/base.html b/scipost/templates/scipost/base.html
index c10153ebb..0699a9f25 100644
--- a/scipost/templates/scipost/base.html
+++ b/scipost/templates/scipost/base.html
@@ -5,6 +5,11 @@
     <link rel="stylesheet" type="text/css" href="{% static 'scipost/SciPost.css' %}" />
 
     <script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
+
+    <script type="text/x-mathjax-config">
+      MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
+    </script>
+    <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
     
     <title>SciPost{% block pagetitle %}{% endblock pagetitle %}</title>
 
diff --git a/scipost/templates/scipost/personal_page.html b/scipost/templates/scipost/personal_page.html
index 7dc275c8f..319d2d57f 100644
--- a/scipost/templates/scipost/personal_page.html
+++ b/scipost/templates/scipost/personal_page.html
@@ -125,4 +125,15 @@
 </section>
 {% endif %}
 
+{% if own_comments %}
+<section>
+  <h1>Your Comments</h1>
+  <ul>
+    {% for own_comment in own_comments %}
+    <li>{{ own_comment.comment_text }}</li>
+    {% endfor %}
+  </ul>
+</section>
+{% endif %}
+
 {% endblock bodysup %}
diff --git a/scipost/views.py b/scipost/views.py
index 2b0c94e9d..b86c4af97 100644
--- a/scipost/views.py
+++ b/scipost/views.py
@@ -282,7 +282,8 @@ def personal_page(request):
             nr_comments_to_vet = Comment.objects.filter(status=0).count()
             nr_author_replies_to_vet = AuthorReply.objects.filter(status=0).count()
             nr_reports_to_vet = Report.objects.filter(status=0).count()
-        context = {'contributor': contributor, 'nr_reg_to_vet': nr_reg_to_vet, 'nr_reg_awaiting_validation': nr_reg_awaiting_validation, 'nr_commentary_page_requests_to_vet': nr_commentary_page_requests_to_vet, 'nr_comments_to_vet': nr_comments_to_vet, 'nr_author_replies_to_vet': nr_author_replies_to_vet, 'nr_reports_to_vet': nr_reports_to_vet, 'nr_submissions_to_process': nr_submissions_to_process }
+        own_comments = Comment.objects.filter(author=contributor)
+        context = {'contributor': contributor, 'nr_reg_to_vet': nr_reg_to_vet, 'nr_reg_awaiting_validation': nr_reg_awaiting_validation, 'nr_commentary_page_requests_to_vet': nr_commentary_page_requests_to_vet, 'nr_comments_to_vet': nr_comments_to_vet, 'nr_author_replies_to_vet': nr_author_replies_to_vet, 'nr_reports_to_vet': nr_reports_to_vet, 'nr_submissions_to_process': nr_submissions_to_process, 'own_comments': own_comments}
         return render(request, 'scipost/personal_page.html', context)
     else:
         form = AuthenticationForm()
-- 
GitLab