Skip to content

Commit 35791d2

Browse files
move default action css classes from template to action so it can be modified
1 parent acfad37 commit 35791d2

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/django_smartbase_admin/engine/actions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def __init__(
6060
self.view = view
6161
self.action_id = action_id
6262
self.action_modifier = action_modifier
63-
self.css_class = css_class
63+
self.css_class = css_class or "btn btn-empty"
6464
self.no_params = no_params
6565
self.open_in_modal = open_in_modal
6666
self.group = group

src/django_smartbase_admin/templates/sb_admin/actions/change_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ <h1 class="text-24 md:text-30 text-dark-900 font-bold font-heading line-clamp-1
9999
{% if detail_actions %}
100100
{% for action in detail_actions %}
101101
<li class="max-sm:hidden">
102-
<a {% if action.open_in_modal %}{% include 'sb_admin/actions/partials/open_modal_attrs.html' %}{% endif %} href="{{ action.url }}" class="btn {{ action.css_class|default_if_none:'' }}">
102+
<a {% if action.open_in_modal %}{% include 'sb_admin/actions/partials/open_modal_attrs.html' %}{% endif %} href="{{ action.url }}" class="{{ action.css_class|default_if_none:'' }}">
103103
{% if action.icon %}
104104
<svg class="w-16 h-16 mr-8">
105105
<use href="#{{ action.icon }}"></use>

src/django_smartbase_admin/templates/sb_admin/actions/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1 class="text-24 md:text-30 text-dark-900 font-bold font-heading line-clamp-1
7777
</div>
7878
{% else %}
7979
<li class="max-sm:hidden">
80-
{% include list_action.template with action=list_action view_id=view_id extra_classes="btn btn-empty" %}
80+
{% include list_action.template with action=list_action view_id=view_id %}
8181
</li>
8282
{% endif %}
8383
{% endfor %}

0 commit comments

Comments
 (0)