Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-smartbase-admin"
version = "1.0.35"
version = "1.0.36"
description = ""
authors = ["SmartBase <info@smartbase.sk>"]
readme = "README.md"
Expand Down
5 changes: 5 additions & 0 deletions src/django_smartbase_admin/engine/admin_base_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class SBAdminBaseView(object):
global_filter_data_map = None
field_cache = None
sbadmin_detail_actions = None
add_label = None
delete_confirmation_template = "sb_admin/actions/delete_confirmation.html"

def init_view_static(self, configuration, model, admin_site):
Expand Down Expand Up @@ -221,13 +222,17 @@ def get_color_scheme_context(self, request):
"color_scheme_form": color_scheme_form,
}

def get_add_label(self, request, object_id: int | str | None = None):
return self.add_label

def get_global_context(
self, request, object_id: int | str | None = None
) -> dict[str, Any]:
return {
"view_id": self.get_id(),
"configuration": request.request_data.configuration,
"request_data": request.request_data,
"add_label": self.get_add_label(request, object_id),
"DETAIL_STRUCTURE_RIGHT_CLASS": DETAIL_STRUCTURE_RIGHT_CLASS,
"OVERRIDE_CONTENT_OF_NOTIFICATION": OVERRIDE_CONTENT_OF_NOTIFICATION,
"username_data": self.get_username_data(request),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1 class="text-24 md:text-30 text-dark-900 font-bold font-heading line-clamp-1
<svg class="w-20 h-20 md:mr-8">
<use xlink:href="#Plus"></use>
</svg>
<span>{% trans 'Add' %} {{ model_name }}</span>
<span>{% trans 'Add' %}{% if add_label %} {{ add_label }}{% endif %}</span>
</a>
</li>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% load i18n %}

{% if add %}
{% blocktrans with name=opts.verbose_name %}Add {{ name }}{% endblocktrans %}
{% trans 'Add' %}{% if add_label %} {{ add_label }}{% endif %}
{% else %}
{{ original|truncatewords:"18" }}
{% endif %}