Skip to content

Commit

Permalink
fix: breadcrumbs links
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Nov 23, 2022
1 parent d0d9d57 commit e8b788d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/unfold/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.validators import EMPTY_VALUES
from django.http import HttpResponse
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.urls import path, reverse, reverse_lazy
from django.utils.module_loading import import_string
Expand Down Expand Up @@ -215,9 +214,6 @@ def _get_is_active(link):

return results

def app_index(self, request, app_label, extra_context=None):
return redirect("admin:index")

def _get_value(self, instance, *args):
if instance is None:
return None
Expand Down
7 changes: 4 additions & 3 deletions src/unfold/templates/admin/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
{% trans 'Home' as name %}
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}

{% url 'admin:app_list' app_label=cl.opts.app_label as link %}
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=cl.opts.app_config.verbose_name %}
{% url 'admin:app_list' app_label=opts.app_label as link %}
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}

{% if has_view_permission %}
{% include 'unfold/helpers/breadcrumb_item.html' with link=opts|admin_urlname:'changelist' name=opts.verbose_name_plural|capfirst %}
{% url opts|admin_urlname:'changelist' as link %}
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
{% else %}
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=opts.verbose_name_plural|capfirst %}
{% endif %}
Expand Down

0 comments on commit e8b788d

Please sign in to comment.