Skip to content

Commit

Permalink
nm, let's be strict and assume tool.button_type exists
Browse files Browse the repository at this point in the history
  • Loading branch information
crccheck committed Sep 9, 2024
1 parent 2d80a5b commit 1983b93
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{% load add_preserved_filters from admin_urls %}

{% if tool.button_type == 'form' %}
{% if tool.button_type == 'a' %}
<a href="{% add_preserved_filters action_url %}"
title="{{ tool.standard_attrs.title }}"
{% for k, v in tool.custom_attrs.items %}
{{ k }}="{{ v }}"
{% endfor %}
class="{{ tool.standard_attrs.class }}"
>{{ tool.label|capfirst }}</a>
{% elif tool.button_type == 'form' %}
<form method="post" action="{% add_preserved_filters action_url %}">
{% csrf_token %}
<a href="#" onclick="this.parentNode.submit(); return false;"
Expand All @@ -11,12 +19,4 @@
class="{{ tool.standard_attrs.class }}"
>{{ tool.label|capfirst }}</a>
</form>
{% else %}
<a href="{% add_preserved_filters action_url %}"
title="{{ tool.standard_attrs.title }}"
{% for k, v in tool.custom_attrs.items %}
{{ k }}="{{ v }}"
{% endfor %}
class="{{ tool.standard_attrs.class }}"
>{{ tool.label|capfirst }}</a>
{% endif %}

0 comments on commit 1983b93

Please sign in to comment.