From d2a35adf70d1b429877f4462b4823a23a16f46e7 Mon Sep 17 00:00:00 2001 From: Anders Pearson Date: Wed, 8 Feb 2023 11:39:44 +0000 Subject: [PATCH] add csrf tokens --- mithras/templates/abraxas/add_post.html | 5 +- mithras/templates/abraxas/comment.html | 9 +- mithras/templates/abraxas/edit_post.html | 3 +- mithras/templates/abraxas/node.html | 98 +++++++++---------- .../abraxas/node_confirm_delete.html | 1 + mithras/templates/abraxas/pending.html | 5 +- mithras/templates/abraxas/preview.html | 9 +- 7 files changed, 68 insertions(+), 62 deletions(-) diff --git a/mithras/templates/abraxas/add_post.html b/mithras/templates/abraxas/add_post.html index de5f5c88..ff90be00 100644 --- a/mithras/templates/abraxas/add_post.html +++ b/mithras/templates/abraxas/add_post.html @@ -12,8 +12,9 @@ {% block content %} -
-{% if node_id %}{% endif %} + + {% csrf_token %} + {% if node_id %}{% endif %} diff --git a/mithras/templates/abraxas/comment.html b/mithras/templates/abraxas/comment.html index c4587bc9..75f9a841 100644 --- a/mithras/templates/abraxas/comment.html +++ b/mithras/templates/abraxas/comment.html @@ -21,10 +21,11 @@

Reply to: {{ node.title }}

{% if node.comments_allowed %} -
- - +
+ + {% csrf_token %} +

formatting is with Markdown syntax. diff --git a/mithras/templates/abraxas/edit_post.html b/mithras/templates/abraxas/edit_post.html index 020537be..2c9a9c63 100644 --- a/mithras/templates/abraxas/edit_post.html +++ b/mithras/templates/abraxas/edit_post.html @@ -13,7 +13,8 @@ Delete - + + {% csrf_token %}

title
diff --git a/mithras/templates/abraxas/node.html b/mithras/templates/abraxas/node.html index 7c1691c9..942a0032 100644 --- a/mithras/templates/abraxas/node.html +++ b/mithras/templates/abraxas/node.html @@ -6,14 +6,14 @@ {% block breadcrumbs %} -//thraxil.org/users/{{ node.user.username }}/{{ node.type }}s/{{ node.created.year }}/{{ node.created.month}}/{{ node.created.day }}/{{node.slug}}/ + //thraxil.org/users/{{ node.user.username }}/{{ node.type }}s/{{ node.created.year }}/{{ node.created.month}}/{{ node.created.day }}/{{node.slug}}/ {% endblock %} {% block nav %} -{% if not request.user.is_anonymous %} -edit| -{% endif %} -history + {% if not request.user.is_anonymous %} + edit| + {% endif %} + history {% endblock %} {% block content %} @@ -56,50 +56,50 @@

comments

{{ comment.body|cmarkdown:"codehilite"|safe }} -{% if comment.has_replies %} -{{ comment.replies_html|safe }} -{% endif %} - - -{% endfor %} - -{% endif %} - -{% if node.comments_allowed %} -
- - - - -
-

formatting is - with Markdown syntax. Comments are not displayed until they are approved by a - moderator. Moderators will not approve unless the comment - contributes value to the discussion.

-
title
- - - - -
namerequired
emailrequired
url
-remember info? -

- -
- -
-{% endif %} - - + {% if comment.has_replies %} + {{ comment.replies_html|safe }} + {% endif %} + + + {% endfor %} + + {% endif %} + + {% if node.comments_allowed %} +
+
+ {% csrf_token %} + + +
+

formatting is + with Markdown syntax. Comments are not displayed until they are approved by a + moderator. Moderators will not approve unless the comment + contributes value to the discussion.

+ + + + + +
namerequired
emailrequired
url
+ remember info? +

+ +
+
+
+ {% endif %} + + {% endblock %} diff --git a/mithras/templates/abraxas/node_confirm_delete.html b/mithras/templates/abraxas/node_confirm_delete.html index ee724e56..9d4ea2ea 100644 --- a/mithras/templates/abraxas/node_confirm_delete.html +++ b/mithras/templates/abraxas/node_confirm_delete.html @@ -1,4 +1,5 @@
{% csrf_token %} + {% csrf_token %}

Are you sure you want to delete "{{ object }}"?

diff --git a/mithras/templates/abraxas/pending.html b/mithras/templates/abraxas/pending.html index 09068f47..350ad2e6 100644 --- a/mithras/templates/abraxas/pending.html +++ b/mithras/templates/abraxas/pending.html @@ -9,8 +9,9 @@ {% endblock %} {% block content %} -
- + + {% csrf_token %} +
diff --git a/mithras/templates/abraxas/preview.html b/mithras/templates/abraxas/preview.html index 3a8ba1c8..faf3a9b9 100644 --- a/mithras/templates/abraxas/preview.html +++ b/mithras/templates/abraxas/preview.html @@ -12,10 +12,11 @@

Preview of Comment:

{{ content|cmarkdown:"codehilite"|safe }} -
-
- +
+ + {% csrf_token %} +