django_fhadmin 2.2.1__tar.gz → 2.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/PKG-INFO +1 -1
  2. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/PKG-INFO +1 -1
  3. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/__init__.py +1 -1
  4. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/templates/admin/group_list.html +2 -3
  5. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/templates/admin/index.html +1 -1
  6. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/templatetags/fhadmin_module_groups.py +12 -3
  7. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/LICENSE +0 -0
  8. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/MANIFEST.in +0 -0
  9. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/README.rst +0 -0
  10. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/SOURCES.txt +0 -0
  11. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/dependency_links.txt +0 -0
  12. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/requires.txt +0 -0
  13. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/django_fhadmin.egg-info/top_level.txt +0 -0
  14. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/locale/de/LC_MESSAGES/django.mo +0 -0
  15. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/locale/de/LC_MESSAGES/django.po +0 -0
  16. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/models.py +0 -0
  17. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/static/fhadmin/fhadmin.css +0 -0
  18. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/static/fhadmin/fhadmin.js +0 -0
  19. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/templates/admin/base_site.html +0 -0
  20. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/fhadmin/templatetags/__init__.py +0 -0
  21. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/setup.cfg +0 -0
  22. {django_fhadmin-2.2.1 → django_fhadmin-2.2.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django_fhadmin
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
5
5
  Home-page: http://github.com/feinheit/django-fhadmin/
6
6
  Author: Matthias Kestenholz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-fhadmin
3
- Version: 2.2.1
3
+ Version: 2.2.2
4
4
  Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
5
5
  Home-page: http://github.com/feinheit/django-fhadmin/
6
6
  Author: Matthias Kestenholz
@@ -1,4 +1,4 @@
1
- VERSION = (2, 2, 1)
1
+ VERSION = (2, 2, 2)
2
2
  __version__ = ".".join(map(str, VERSION))
3
3
 
4
4
  FHADMIN_GROUPS_REMAINING = "REMAINING"
@@ -1,12 +1,11 @@
1
1
  {% load fhadmin_module_groups i18n %}
2
- {% fhadmin_group_list request %}
3
-
2
+ {% fhadmin_group_list request as group_list %}
4
3
  {% if group_list %}
5
4
  <div class="groups">
6
5
  {% for group, app_list in group_list %}
7
6
  <div class="group">
8
7
  <h2>{{ group }}</h2>
9
- {% include 'admin/app_list.html' %}
8
+ {% include 'admin/app_list.html' with show_changelinks=False %}
10
9
  </div>
11
10
  {% endfor %}
12
11
  </div>
@@ -2,6 +2,6 @@
2
2
 
3
3
  {% block content %}
4
4
  <div id="content-main">
5
- {% include "admin/group_list.html" %}
5
+ {% include "admin/group_list.html" with apply_app_label_filtering=True %}
6
6
  </div>
7
7
  {% endblock %}
@@ -40,7 +40,7 @@ FHADMIN_GROUPS_DEFAULT = [
40
40
  ]
41
41
 
42
42
 
43
- def generate_group_list(admin_site, request):
43
+ def generate_group_list(admin_site, request, *, only_app_label=None):
44
44
  app_dict = {a["app_label"]: a for a in admin_site.get_app_list(request)}
45
45
 
46
46
  if merge := getattr(settings, "FHADMIN_MERGE", {}):
@@ -50,6 +50,11 @@ def generate_group_list(admin_site, request):
50
50
  key=lambda row: row["name"],
51
51
  )
52
52
 
53
+ if only_app_label is not None:
54
+ for key in list(app_dict):
55
+ if key != only_app_label:
56
+ app_dict.pop(key)
57
+
53
58
  fhadmin_groups = getattr(settings, "FHADMIN_GROUPS", FHADMIN_GROUPS_DEFAULT)
54
59
  all_configured = reduce(
55
60
  operator.or_, (set(apps) for title, apps in fhadmin_groups), set()
@@ -71,5 +76,9 @@ def generate_group_list(admin_site, request):
71
76
 
72
77
  @register.simple_tag(takes_context=True)
73
78
  def fhadmin_group_list(context, request):
74
- context["group_list"] = list(generate_group_list(admin.sites.site, request))
75
- return ""
79
+ only_app_label = None
80
+ if context.get("apply_app_label_filtering"):
81
+ only_app_label = context.get("app_label")
82
+ return list(
83
+ generate_group_list(admin.sites.site, request, only_app_label=only_app_label)
84
+ )
File without changes
File without changes
File without changes