From a1853ac8b337028040d1d0b148e5bb1d2163423e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:34:42 +0000 Subject: [PATCH 1/6] Initial plan From 2f4e16990a39d8ff11edf518b553fded0b7cb15b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:36:29 +0000 Subject: [PATCH 2/6] feat: add missing core Django template snippets --- README.md | 5 ++++ snippets/django-snippets.json | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/README.md b/README.md index d878e46..529af60 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,11 @@ All snippets use the `pt` prefix (short for "Python Template"). Here's the compl | `ptd-stat` | Static file | `{% static 'path/to/file' %}` | | `ptd-inc` | Include template | `{% include 'template.html' %}` | | `ptd-firstof` | First of variables | `{% firstof var1 var2 %}` | +| `ptd-csrf` | CSRF token | `{% csrf_token %}` | +| `ptd-sup` | Block super | `{{ block.super }}` | +| `ptd-com` | Comment block | `{% comment "note" %}...{% endcomment %}` | +| `ptd-ver` | Verbatim block | `{% verbatim %}...{% endverbatim %}` | +| `ptd-trans` | Translate string | `{% translate "..." %}` | --- diff --git a/snippets/django-snippets.json b/snippets/django-snippets.json index e499dd7..c234360 100644 --- a/snippets/django-snippets.json +++ b/snippets/django-snippets.json @@ -32,5 +32,48 @@ "prefix": "ptd-firstof", "body": ["{% firstof $1 $2 %}$0"], "description": "Adds Firstof Block" + }, + + "Django - CSRF Token": { + "scope": "html", + "prefix": "ptd-csrf", + "body": ["{% csrf_token %}$0"], + "description": "Adds CSRF Token block" + }, + + "Django - Block Super": { + "scope": "html", + "prefix": "ptd-sup", + "body": ["{{ block.super }}$0"], + "description": "Access parent block content" + }, + + "Django - Comment Block": { + "scope": "html", + "prefix": "ptd-com", + "body": [ + "{% comment \"$1\" %}", + "\t$0", + "{% endcomment %}" + ], + "description": "Adds Django comment block" + }, + + "Django - Verbatim Block": { + "scope": "html", + "prefix": "ptd-ver", + "body": [ + "{% verbatim %}", + "\t$0", + "{% endverbatim %}" + ], + "description": "Prevents Django from rendering contents (useful for JS frameworks)" + }, + + "Django - Translate": { + "scope": "html", + "prefix": "ptd-trans", + "body": ["{% translate \"$1\" %}$0"], + "description": "Translate string" } } From 6fe6ee7c84878283b0d0315f23874eda50f89fcc Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 21 Jul 2026 20:00:27 -0400 Subject: [PATCH 3/6] fix: string literals Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- snippets/django-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/django-snippets.json b/snippets/django-snippets.json index c234360..ad90bc7 100644 --- a/snippets/django-snippets.json +++ b/snippets/django-snippets.json @@ -52,7 +52,7 @@ "scope": "html", "prefix": "ptd-com", "body": [ - "{% comment \"$1\" %}", + "{% comment '$1' %}", "\t$0", "{% endcomment %}" ], From fa1ed55a931789dac4fb0c8157f18c52d95d5e82 Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 21 Jul 2026 20:00:48 -0400 Subject: [PATCH 4/6] fix: string literals Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 529af60..8ffe92d 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ All snippets use the `pt` prefix (short for "Python Template"). Here's the compl | `ptd-firstof` | First of variables | `{% firstof var1 var2 %}` | | `ptd-csrf` | CSRF token | `{% csrf_token %}` | | `ptd-sup` | Block super | `{{ block.super }}` | -| `ptd-com` | Comment block | `{% comment "note" %}...{% endcomment %}` | +| `ptd-com` | Comment block | `{% comment 'note' %}...{% endcomment %}` | | `ptd-ver` | Verbatim block | `{% verbatim %}...{% endverbatim %}` | | `ptd-trans` | Translate string | `{% translate "..." %}` | From 739138e0483517617ca70196ba3b4c2a53ac3532 Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 21 Jul 2026 20:01:11 -0400 Subject: [PATCH 5/6] fix: string literals Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- snippets/django-snippets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/django-snippets.json b/snippets/django-snippets.json index ad90bc7..1ed8f15 100644 --- a/snippets/django-snippets.json +++ b/snippets/django-snippets.json @@ -73,7 +73,7 @@ "Django - Translate": { "scope": "html", "prefix": "ptd-trans", - "body": ["{% translate \"$1\" %}$0"], + "body": ["{% translate '$1' %}$0"], "description": "Translate string" } } From f6d8f75e7e4cd1872533e85101e3b4ad4990a5d9 Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 21 Jul 2026 20:01:39 -0400 Subject: [PATCH 6/6] fix: string literals Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ffe92d..1fdce02 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ All snippets use the `pt` prefix (short for "Python Template"). Here's the compl | `ptd-sup` | Block super | `{{ block.super }}` | | `ptd-com` | Comment block | `{% comment 'note' %}...{% endcomment %}` | | `ptd-ver` | Verbatim block | `{% verbatim %}...{% endverbatim %}` | -| `ptd-trans` | Translate string | `{% translate "..." %}` | +| `ptd-trans` | Translate string | `{% translate '...' %}` | ---