Skip to content

Commit 0537273

Browse files
authored
feat: header breadcrumbs (#1480)
1 parent dae00fd commit 0537273

File tree

30 files changed

+153
-417
lines changed

30 files changed

+153
-417
lines changed

docs/actions/action-form-example.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ Template displaying the form. Please note that breadcrumbs are empty in this cas
8181

8282
{% load i18n unfold %}
8383

84-
{% block breadcrumbs %}{% endblock %}
85-
8684
{% block extrahead %}
8785
{{ block.super }}
8886
<script src="{% url 'admin:jsi18n' %}"></script>

docs/configuration/custom-pages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CustomAdmin(ModelAdmin):
4343

4444
The template is straightforward, extend from `unfold/layouts/base.html` and the UI will display all Unfold components like header or sidebar with all menu items. Then all content needs to be located in `content` block. Below you can find full example from the Formula project implementing additional components:
4545

46-
- Breadcrumbs: it is up to developer to construct own breadcrumbs
46+
- Breadcrumbs: it is up to developer to construct own breadcrumbs (version 0.64+ does not contain breadcrumbs)
4747
- Tab list: in case your project has dynamic tabs, you can use `tab_list` helper to display them
4848

4949
```html

docs/configuration/dashboard.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ TEMPLATES = [
2828

2929
{% load i18n %}
3030

31-
{% block breadcrumbs %}{% endblock %}
32-
3331
{% block title %}
3432
{% if subtitle %}
3533
{{ subtitle }} |

src/unfold/contrib/constance/templates/admin/constance/change_list.html

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@
1010
<script type="text/javascript" src="{% static 'admin/js/constance.js' %}"></script>
1111
{% endblock %}
1212

13-
{% block breadcrumbs %}
14-
<div class="px-4">
15-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
16-
<ul class="flex flex-wrap">
17-
{% url 'admin:index' as link %}
18-
{% trans 'Home' as name %}
19-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
20-
21-
{% url 'admin:app_list' app_label=opts.app_label as link %}
22-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
23-
24-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=opts.verbose_name_plural|capfirst %}
25-
</ul>
26-
</div>
27-
</div>
28-
{% endblock %}
29-
30-
3113
{% block content %}
3214
<div id="content-main" class="constance">
3315
<div id="changelist" class="flex flex-col gap-8 w-full">

src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage.html

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@
22

33
{% load admin_urls i18n guardian_tags %}
44

5-
{% block breadcrumbs %}{% if not is_popup %}
6-
<div class="px-4">
7-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
8-
<ul class="flex flex-wrap">
9-
{% url 'admin:index' as link %}
10-
{% trans 'Home' as name %}
11-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
12-
13-
{% url 'admin:app_list' app_label=opts.app_label as link %}
14-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
15-
16-
{% url opts|admin_urlname:'changelist' as link %}
17-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
18-
19-
{% url opts|admin_urlname:'change' object.pk|admin_urlquote as link %}
20-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=original|truncatewords:'18' %}
21-
22-
{% trans 'Object permissions' as name %}
23-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=name %}
24-
</ul>
25-
</div>
26-
</div>
27-
{% endif %}{% endblock %}
28-
295
{% block content %}
306
{% include "unfold/guardian/user_form.html" %}
317

src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_group.html

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,6 @@
55
{{ form.media }}
66
{% endblock %}
77

8-
{% block breadcrumbs %}{% if not is_popup %}
9-
<div class="px-4">
10-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
11-
<ul class="flex flex-wrap">
12-
{% url 'admin:index' as link %}
13-
{% trans 'Home' as name %}
14-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
15-
16-
{% url 'admin:app_list' app_label=opts.app_label as link %}
17-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
18-
19-
{% url opts|admin_urlname:'changelist' as link %}
20-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
21-
22-
{% url opts|admin_urlname:'change' object.pk|admin_urlquote as link %}
23-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=original|truncatewords:'18' %}
24-
25-
{% trans 'Object permissions' as name %}
26-
{% include 'unfold/helpers/breadcrumb_item.html' with link="../../" name=name %}
27-
28-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=group_obj|truncatewords:"18" %}
29-
</ul>
30-
</div>
31-
</div>
32-
{% endif %}{% endblock %}
33-
348
{% block content %}
359
<div class="border border-base-200 overflow-hidden rounded-default p-3 shadow-xs dark:border-base-800">
3610
<form method="post">

src/unfold/contrib/guardian/templates/admin/guardian/model/obj_perms_manage_user.html

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,6 @@
66
{{ form.media }}
77
{% endblock %}
88

9-
{% block breadcrumbs %}{% if not is_popup %}
10-
<div class="px-4">
11-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
12-
<ul class="flex flex-wrap">
13-
{% url 'admin:index' as link %}
14-
{% trans 'Home' as name %}
15-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
16-
17-
{% url 'admin:app_list' app_label=opts.app_label as link %}
18-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
19-
20-
{% url opts|admin_urlname:'changelist' as link %}
21-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
22-
23-
{% url opts|admin_urlname:'change' object.pk|admin_urlquote as link %}
24-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=original|truncatewords:'18' %}
25-
26-
{% trans 'Object permissions' as name %}
27-
{% include 'unfold/helpers/breadcrumb_item.html' with link="../../" name=name %}
28-
29-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=user_obj|truncatewords:"18" %}
30-
</ul>
31-
</div>
32-
</div>
33-
{% endif %}{% endblock %}
34-
359
{% block content %}
3610
<div class="border border-base-200 overflow-hidden rounded-default p-3 shadow-xs dark:border-base-800">
3711
<form method="post">

src/unfold/contrib/import_export/templates/admin/import_export/export.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,6 @@
99
{{ form.media }}
1010
{% endblock %}
1111

12-
{% block breadcrumbs %}
13-
<div class="px-4">
14-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
15-
<ul class="flex flex-wrap">
16-
{% url 'admin:index' as link %}
17-
{% trans 'Home' as name %}
18-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
19-
20-
{% url 'admin:app_list' app_label=opts.app_label as link %}
21-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
22-
23-
{% url opts|admin_urlname:'changelist' as link %}
24-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
25-
26-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=cl.opts.verbose_name_plural|capfirst %}
27-
28-
{% trans 'Export' as name %}
29-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=name %}
30-
</ul>
31-
</div>
32-
</div>
33-
{% endblock %}
34-
3512
{% block content %}
3613
<form action="{{ export_url }}" method="POST">
3714
{% csrf_token %}

src/unfold/contrib/import_export/templates/admin/import_export/import.html

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,6 @@
2020
{% endif %}
2121
{% endblock %}
2222

23-
{% block breadcrumbs %}
24-
<div class="px-4">
25-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
26-
<ul class="flex flex-wrap">
27-
{% url 'admin:index' as link %}
28-
{% trans 'Home' as name %}
29-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
30-
31-
{% url 'admin:app_list' app_label=opts.app_label as link %}
32-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
33-
34-
{% url opts|admin_urlname:'changelist' as link %}
35-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.verbose_name_plural|capfirst %}
36-
37-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=cl.opts.verbose_name_plural|capfirst %}
38-
39-
{% trans 'Import' as name %}
40-
{% include 'unfold/helpers/breadcrumb_item.html' with link='' name=name %}
41-
</ul>
42-
</div>
43-
</div>
44-
{% endblock %}
45-
4623
{% block content %}
4724
{% if confirm_form %}
4825
{% include "admin/import_export/import_confirm.html" %}

src/unfold/contrib/simple_history/templates/simple_history/object_history_form.html

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
11
{% extends "admin/change_form.html" %}
22

3-
{% load admin_urls i18n %}
4-
{% load url from simple_history_compat %}
5-
6-
{% block breadcrumbs %}
7-
<div class="px-4">
8-
<div class="container mb-6 mx-auto -my-3 lg:mb-12">
9-
<ul class="flex flex-wrap">
10-
{% url 'admin:index' as link %}
11-
{% trans 'Home' as name %}
12-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %}
13-
14-
{% url 'admin:app_list' app_label=opts.app_label as link %}
15-
{% include 'unfold/helpers/breadcrumb_item.html' with link=link name=opts.app_config.verbose_name %}
16-
17-
{% include 'unfold/helpers/breadcrumb_item.html' with link=changelist_url name=opts.verbose_name_plural|capfirst %}
18-
19-
{% include 'unfold/helpers/breadcrumb_item.html' with link=change_url name=original|truncatewords:'18' %}
20-
21-
{% url opts|admin_urlname:'change' object.pk|admin_urlquote as link %}
22-
{% trans 'History' as name %}
23-
{% include 'unfold/helpers/breadcrumb_item.html' with link="../" name=name %}
24-
25-
{% if revert_disabled %}
26-
{% trans "View" as name %}
27-
{% include 'unfold/helpers/breadcrumb_item.html' with link="" name=name %}
28-
{% else %}
29-
{% trans "Revert" as name %}
30-
{% include 'unfold/helpers/breadcrumb_item.html' with link="" name=name %}
31-
{% endif %}
32-
</ul>
33-
</div>
34-
</div>
35-
{% endblock %}
3+
{% load admin_urls i18n url from simple_history_compat %}
364

375
{% block submit_buttons_top %}
386
{% include "simple_history/submit_line.html" %}

0 commit comments

Comments
 (0)