django_fhadmin 2.3.0__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.
- django_fhadmin-2.3.0/LICENSE +27 -0
- django_fhadmin-2.3.0/MANIFEST.in +5 -0
- django_fhadmin-2.3.0/PKG-INFO +65 -0
- django_fhadmin-2.3.0/README.rst +43 -0
- django_fhadmin-2.3.0/django_fhadmin.egg-info/PKG-INFO +65 -0
- django_fhadmin-2.3.0/django_fhadmin.egg-info/SOURCES.txt +22 -0
- django_fhadmin-2.3.0/django_fhadmin.egg-info/dependency_links.txt +1 -0
- django_fhadmin-2.3.0/django_fhadmin.egg-info/requires.txt +4 -0
- django_fhadmin-2.3.0/django_fhadmin.egg-info/top_level.txt +1 -0
- django_fhadmin-2.3.0/fhadmin/__init__.py +4 -0
- django_fhadmin-2.3.0/fhadmin/apps.py +10 -0
- django_fhadmin-2.3.0/fhadmin/locale/de/LC_MESSAGES/django.mo +0 -0
- django_fhadmin-2.3.0/fhadmin/locale/de/LC_MESSAGES/django.po +45 -0
- django_fhadmin-2.3.0/fhadmin/models.py +0 -0
- django_fhadmin-2.3.0/fhadmin/static/fhadmin/fhadmin.css +110 -0
- django_fhadmin-2.3.0/fhadmin/static/fhadmin/fhadmin.js +15 -0
- django_fhadmin-2.3.0/fhadmin/templates/admin/base_site.html +17 -0
- django_fhadmin-2.3.0/fhadmin/templates/admin/group_list.html +12 -0
- django_fhadmin-2.3.0/fhadmin/templates/admin/index.html +7 -0
- django_fhadmin-2.3.0/fhadmin/templatetags/__init__.py +0 -0
- django_fhadmin-2.3.0/fhadmin/templatetags/fhadmin_groups.py +110 -0
- django_fhadmin-2.3.0/setup.cfg +49 -0
- django_fhadmin-2.3.0/setup.py +5 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright (c) 2011-2012, FEINHEIT GmbH and individual contributors.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
5
|
+
are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
8
|
+
this list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer in the
|
|
12
|
+
documentation and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
3. Neither the name of FEINHEIT GmbH nor the names of its contributors
|
|
15
|
+
may be used to endorse or promote products derived from this software
|
|
16
|
+
without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
19
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
22
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
24
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
25
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
27
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: django_fhadmin
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
|
|
5
|
+
Home-page: http://github.com/feinheit/django-fhadmin/
|
|
6
|
+
Author: Matthias Kestenholz
|
|
7
|
+
Author-email: mk@feinheit.ch
|
|
8
|
+
License: BSD-3-Clause
|
|
9
|
+
Platform: OS Independent
|
|
10
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/x-rst
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: Django>=3.2
|
|
20
|
+
Provides-Extra: tests
|
|
21
|
+
Requires-Dist: coverage; extra == "tests"
|
|
22
|
+
|
|
23
|
+
Django-FHAdmin
|
|
24
|
+
==============
|
|
25
|
+
|
|
26
|
+
Modifies the stock Django-Administration interface to fit our ideas a little
|
|
27
|
+
bit better.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Dashboard and global navigation extension
|
|
31
|
+
-----------------------------------------
|
|
32
|
+
|
|
33
|
+
Allows grouping of apps on the dashboard and offers the same view on each
|
|
34
|
+
admin page when clicking the main title of the Django admin interface.
|
|
35
|
+
|
|
36
|
+
App label entries without a matching app are ignored. A configuration example
|
|
37
|
+
follows:
|
|
38
|
+
|
|
39
|
+
.. code-block:: python
|
|
40
|
+
|
|
41
|
+
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
42
|
+
_ = lambda x: x
|
|
43
|
+
|
|
44
|
+
FHADMIN_GROUPS = [
|
|
45
|
+
(_('Main content'), ('page', 'medialibrary', 'blog')),
|
|
46
|
+
(_('Modules'), ('links', FHADMIN_GROUPS_REMAINING)),
|
|
47
|
+
(_('Preferences'), ('auth', 'rosetta', 'external', 'sites')),
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
The extension is activated by inserting ``fhadmin`` before
|
|
52
|
+
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Merging apps
|
|
56
|
+
------------
|
|
57
|
+
|
|
58
|
+
Merging apps is possible as follows:
|
|
59
|
+
|
|
60
|
+
.. code-block:: python
|
|
61
|
+
|
|
62
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
63
|
+
|
|
64
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
65
|
+
heading. Entries where source and target do not exist are ignored.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Django-FHAdmin
|
|
2
|
+
==============
|
|
3
|
+
|
|
4
|
+
Modifies the stock Django-Administration interface to fit our ideas a little
|
|
5
|
+
bit better.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Dashboard and global navigation extension
|
|
9
|
+
-----------------------------------------
|
|
10
|
+
|
|
11
|
+
Allows grouping of apps on the dashboard and offers the same view on each
|
|
12
|
+
admin page when clicking the main title of the Django admin interface.
|
|
13
|
+
|
|
14
|
+
App label entries without a matching app are ignored. A configuration example
|
|
15
|
+
follows:
|
|
16
|
+
|
|
17
|
+
.. code-block:: python
|
|
18
|
+
|
|
19
|
+
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
20
|
+
_ = lambda x: x
|
|
21
|
+
|
|
22
|
+
FHADMIN_GROUPS = [
|
|
23
|
+
(_('Main content'), ('page', 'medialibrary', 'blog')),
|
|
24
|
+
(_('Modules'), ('links', FHADMIN_GROUPS_REMAINING)),
|
|
25
|
+
(_('Preferences'), ('auth', 'rosetta', 'external', 'sites')),
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
The extension is activated by inserting ``fhadmin`` before
|
|
30
|
+
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
Merging apps
|
|
34
|
+
------------
|
|
35
|
+
|
|
36
|
+
Merging apps is possible as follows:
|
|
37
|
+
|
|
38
|
+
.. code-block:: python
|
|
39
|
+
|
|
40
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
41
|
+
|
|
42
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
43
|
+
heading. Entries where source and target do not exist are ignored.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: django_fhadmin
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: Modifies the stock Django-Administration interface to fit our ideas a little bit better.
|
|
5
|
+
Home-page: http://github.com/feinheit/django-fhadmin/
|
|
6
|
+
Author: Matthias Kestenholz
|
|
7
|
+
Author-email: mk@feinheit.ch
|
|
8
|
+
License: BSD-3-Clause
|
|
9
|
+
Platform: OS Independent
|
|
10
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/x-rst
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: Django>=3.2
|
|
20
|
+
Provides-Extra: tests
|
|
21
|
+
Requires-Dist: coverage; extra == "tests"
|
|
22
|
+
|
|
23
|
+
Django-FHAdmin
|
|
24
|
+
==============
|
|
25
|
+
|
|
26
|
+
Modifies the stock Django-Administration interface to fit our ideas a little
|
|
27
|
+
bit better.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Dashboard and global navigation extension
|
|
31
|
+
-----------------------------------------
|
|
32
|
+
|
|
33
|
+
Allows grouping of apps on the dashboard and offers the same view on each
|
|
34
|
+
admin page when clicking the main title of the Django admin interface.
|
|
35
|
+
|
|
36
|
+
App label entries without a matching app are ignored. A configuration example
|
|
37
|
+
follows:
|
|
38
|
+
|
|
39
|
+
.. code-block:: python
|
|
40
|
+
|
|
41
|
+
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
42
|
+
_ = lambda x: x
|
|
43
|
+
|
|
44
|
+
FHADMIN_GROUPS = [
|
|
45
|
+
(_('Main content'), ('page', 'medialibrary', 'blog')),
|
|
46
|
+
(_('Modules'), ('links', FHADMIN_GROUPS_REMAINING)),
|
|
47
|
+
(_('Preferences'), ('auth', 'rosetta', 'external', 'sites')),
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
The extension is activated by inserting ``fhadmin`` before
|
|
52
|
+
``django.contrib.admin`` in ``INSTALLED_APPS``.
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
Merging apps
|
|
56
|
+
------------
|
|
57
|
+
|
|
58
|
+
Merging apps is possible as follows:
|
|
59
|
+
|
|
60
|
+
.. code-block:: python
|
|
61
|
+
|
|
62
|
+
FHADMIN_MERGE = {"accounts": "auth"}
|
|
63
|
+
|
|
64
|
+
This example moves all models from the ``accounts`` app to the ``auth``
|
|
65
|
+
heading. Entries where source and target do not exist are ignored.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.rst
|
|
4
|
+
setup.cfg
|
|
5
|
+
setup.py
|
|
6
|
+
django_fhadmin.egg-info/PKG-INFO
|
|
7
|
+
django_fhadmin.egg-info/SOURCES.txt
|
|
8
|
+
django_fhadmin.egg-info/dependency_links.txt
|
|
9
|
+
django_fhadmin.egg-info/requires.txt
|
|
10
|
+
django_fhadmin.egg-info/top_level.txt
|
|
11
|
+
fhadmin/__init__.py
|
|
12
|
+
fhadmin/apps.py
|
|
13
|
+
fhadmin/models.py
|
|
14
|
+
fhadmin/locale/de/LC_MESSAGES/django.mo
|
|
15
|
+
fhadmin/locale/de/LC_MESSAGES/django.po
|
|
16
|
+
fhadmin/static/fhadmin/fhadmin.css
|
|
17
|
+
fhadmin/static/fhadmin/fhadmin.js
|
|
18
|
+
fhadmin/templates/admin/base_site.html
|
|
19
|
+
fhadmin/templates/admin/group_list.html
|
|
20
|
+
fhadmin/templates/admin/index.html
|
|
21
|
+
fhadmin/templatetags/__init__.py
|
|
22
|
+
fhadmin/templatetags/fhadmin_groups.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fhadmin
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# SOME DESCRIPTIVE TITLE.
|
|
2
|
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
|
3
|
+
# This file is distributed under the same license as the PACKAGE package.
|
|
4
|
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
5
|
+
#
|
|
6
|
+
#, fuzzy
|
|
7
|
+
msgid ""
|
|
8
|
+
msgstr ""
|
|
9
|
+
"Project-Id-Version: PACKAGE VERSION\n"
|
|
10
|
+
"Report-Msgid-Bugs-To: \n"
|
|
11
|
+
"POT-Creation-Date: 2022-02-26 19:19+0100\n"
|
|
12
|
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
13
|
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
14
|
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
15
|
+
"Language: \n"
|
|
16
|
+
"MIME-Version: 1.0\n"
|
|
17
|
+
"Content-Type: text/plain; charset=UTF-8\n"
|
|
18
|
+
"Content-Transfer-Encoding: 8bit\n"
|
|
19
|
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
|
20
|
+
|
|
21
|
+
#: templates/admin/base_site.html:10
|
|
22
|
+
msgid "Django administration"
|
|
23
|
+
msgstr "Django-Verwaltung"
|
|
24
|
+
|
|
25
|
+
#: templates/admin/group_list.html:11
|
|
26
|
+
msgid "You don’t have permission to view or edit anything."
|
|
27
|
+
msgstr ""
|
|
28
|
+
"Das Benutzerkonto besitzt nicht die nötigen Rechte, um etwas anzusehen oder "
|
|
29
|
+
"zu ändern."
|
|
30
|
+
|
|
31
|
+
#: templatetags/fhadmin_groups.py:17
|
|
32
|
+
msgid "Main content"
|
|
33
|
+
msgstr "Hauptinhalt"
|
|
34
|
+
|
|
35
|
+
#: templatetags/fhadmin_groups.py:28
|
|
36
|
+
msgid "Modules"
|
|
37
|
+
msgstr "Module"
|
|
38
|
+
|
|
39
|
+
#: templatetags/fhadmin_groups.py:37
|
|
40
|
+
msgid "Preferences"
|
|
41
|
+
msgstr "Einstellungen"
|
|
42
|
+
|
|
43
|
+
#: templatetags/fhadmin_groups.py:51
|
|
44
|
+
msgid "Collections"
|
|
45
|
+
msgstr "Kollektionen"
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
@media (min-width: 1024px) {
|
|
2
|
+
#header {
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dashboard #content {
|
|
8
|
+
width: auto;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.dashboard #content.colMS {
|
|
12
|
+
margin-right: 0 !important;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#content-related {
|
|
16
|
+
clear: both;
|
|
17
|
+
float: left;
|
|
18
|
+
width: 100%;
|
|
19
|
+
margin-top: 20px;
|
|
20
|
+
padding-bottom: 1px; /* contain the margin */
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.qp-active #branding h1 {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.qp-active #branding h1::after {
|
|
28
|
+
content: "▲";
|
|
29
|
+
font-size: 0.6em;
|
|
30
|
+
display: inline-block;
|
|
31
|
+
position: relative;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0.5em;
|
|
34
|
+
transform: rotate(180deg);
|
|
35
|
+
transition: 0.2s;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.qp-open #branding h1::after {
|
|
39
|
+
transform: none;
|
|
40
|
+
top: -0.2em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.groups {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: repeat(auto-fill, clamp(225px, 20vw, 350px));
|
|
46
|
+
gap: 30px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.group h2 {
|
|
50
|
+
color: var(--body-quiet-color);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#quickpanel {
|
|
54
|
+
display: none;
|
|
55
|
+
line-height: normal;
|
|
56
|
+
flex-basis: 100%;
|
|
57
|
+
align-self: stretch;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.qp-open #quickpanel {
|
|
61
|
+
display: block;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#quickpanel .group h2 {
|
|
65
|
+
color: var(--body-bg);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#quickpanel .module {
|
|
69
|
+
background: inherit;
|
|
70
|
+
color: var(--body-bg);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
#quickpanel a {
|
|
74
|
+
color: var(--secondary) !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#quickpanel a.section {
|
|
78
|
+
color: var(--body-bg) !important;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (prefers-color-scheme: dark) {
|
|
82
|
+
#quickpanel .group h2,
|
|
83
|
+
#quickpanel a,
|
|
84
|
+
#quickpanel a.section {
|
|
85
|
+
color: var(--body-fg) !important;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
#quickpanel th,
|
|
90
|
+
#quickpanel td {
|
|
91
|
+
border-color: var(--border-color);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
#quickpanel .module table th {
|
|
95
|
+
width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#quickpanel tr:last-child td,
|
|
99
|
+
#quickpanel tr:last-child th {
|
|
100
|
+
border-bottom: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#quickpanel caption {
|
|
104
|
+
background: var(--breadcrumbs-bg);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.groups a.addlink {
|
|
108
|
+
position: relative;
|
|
109
|
+
right: -4px;
|
|
110
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
2
|
+
for (const el of document.querySelectorAll(".groups a.addlink")) {
|
|
3
|
+
el.innerText = ""
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const quickpanel = document.getElementById("quickpanel")
|
|
7
|
+
const header = document.querySelector("#header h1")
|
|
8
|
+
if (quickpanel && header) {
|
|
9
|
+
document.body.classList.add("qp-active")
|
|
10
|
+
header.addEventListener("click", (e) => {
|
|
11
|
+
e.preventDefault()
|
|
12
|
+
document.body.classList.toggle("qp-open")
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{% extends "admin/base_site.html" %}
|
|
2
|
+
{% load i18n static %}
|
|
3
|
+
|
|
4
|
+
{% block extrahead %}{{ block.super }}
|
|
5
|
+
<link rel="stylesheet" href="{% static 'fhadmin/fhadmin.css' %}" />
|
|
6
|
+
<script src="{% static 'fhadmin/fhadmin.js' %}"></script>
|
|
7
|
+
{% endblock %}
|
|
8
|
+
|
|
9
|
+
{% block branding %}
|
|
10
|
+
<h1 id="site-name">{{ site_header|default:_('Django administration') }}</h1>
|
|
11
|
+
{% endblock %}
|
|
12
|
+
|
|
13
|
+
{% block nav-global %}
|
|
14
|
+
<div id="quickpanel">
|
|
15
|
+
{% include "admin/group_list.html" %}
|
|
16
|
+
</div>
|
|
17
|
+
{% endblock %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% load fhadmin_groups i18n %}
|
|
2
|
+
{% fhadmin_group_list request as group_list %}
|
|
3
|
+
{% for group, app_list in group_list %}
|
|
4
|
+
{% if forloop.first %}<div class="groups">{% endif %}
|
|
5
|
+
<div class="group">
|
|
6
|
+
<h2>{{ group }}</h2>
|
|
7
|
+
{% include 'admin/app_list.html' with show_changelinks=False %}
|
|
8
|
+
</div>
|
|
9
|
+
{% if forloop.last %}</div>{% endif %}
|
|
10
|
+
{% empty %}
|
|
11
|
+
<p>{% translate 'You don’t have permission to view or edit anything.' %}</p>
|
|
12
|
+
{% endfor %}
|
|
File without changes
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import operator
|
|
2
|
+
from functools import reduce
|
|
3
|
+
|
|
4
|
+
from django import template
|
|
5
|
+
from django.conf import settings
|
|
6
|
+
from django.contrib import admin
|
|
7
|
+
from django.core.exceptions import ImproperlyConfigured
|
|
8
|
+
from django.utils.translation import gettext_lazy as _
|
|
9
|
+
|
|
10
|
+
from fhadmin import FHADMIN_GROUPS_REMAINING
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
register = template.Library()
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
FHADMIN_GROUPS_DEFAULT = [
|
|
17
|
+
(
|
|
18
|
+
_("Main content"),
|
|
19
|
+
(
|
|
20
|
+
"page",
|
|
21
|
+
"medialibrary",
|
|
22
|
+
"elephantblog",
|
|
23
|
+
"pages",
|
|
24
|
+
"articles",
|
|
25
|
+
"cabinet",
|
|
26
|
+
),
|
|
27
|
+
),
|
|
28
|
+
(
|
|
29
|
+
_("Modules"),
|
|
30
|
+
(
|
|
31
|
+
"gallery",
|
|
32
|
+
"agenda",
|
|
33
|
+
"links",
|
|
34
|
+
FHADMIN_GROUPS_REMAINING,
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
(
|
|
38
|
+
_("Preferences"),
|
|
39
|
+
(
|
|
40
|
+
"auth",
|
|
41
|
+
"little_auth",
|
|
42
|
+
"accounts",
|
|
43
|
+
"admin_sso",
|
|
44
|
+
"sites",
|
|
45
|
+
"pinging",
|
|
46
|
+
"feincms3_cookiecontrol",
|
|
47
|
+
"feincms3_sites",
|
|
48
|
+
"simple_redirects",
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
(
|
|
52
|
+
_("Collections"),
|
|
53
|
+
(
|
|
54
|
+
"external",
|
|
55
|
+
"sharing",
|
|
56
|
+
"newsletter",
|
|
57
|
+
"form_designer",
|
|
58
|
+
),
|
|
59
|
+
),
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def generate_group_list(admin_site, request, *, only_app_label=None):
|
|
64
|
+
app_dict = {a["app_label"]: a for a in admin_site.get_app_list(request)}
|
|
65
|
+
|
|
66
|
+
if merge := getattr(settings, "FHADMIN_MERGE", {}):
|
|
67
|
+
for app_label, merge_into in merge.items():
|
|
68
|
+
if app_label in app_dict and merge_into in app_dict:
|
|
69
|
+
app_dict[merge_into]["models"] = sorted(
|
|
70
|
+
app_dict[merge_into]["models"] + app_dict.pop(app_label)["models"],
|
|
71
|
+
key=lambda row: row["name"],
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
if only_app_label is not None:
|
|
75
|
+
for key in list(app_dict):
|
|
76
|
+
if key != only_app_label:
|
|
77
|
+
app_dict.pop(key)
|
|
78
|
+
|
|
79
|
+
fhadmin_groups = getattr(settings, "FHADMIN_GROUPS", FHADMIN_GROUPS_DEFAULT)
|
|
80
|
+
all_configured = reduce(
|
|
81
|
+
operator.or_, (set(apps) for title, apps in fhadmin_groups), set()
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
seen_remaining = False
|
|
85
|
+
for title, apps in fhadmin_groups:
|
|
86
|
+
group_apps = []
|
|
87
|
+
for app in apps:
|
|
88
|
+
if app == FHADMIN_GROUPS_REMAINING:
|
|
89
|
+
group_apps.extend(
|
|
90
|
+
a for a in app_dict.values() if a["app_label"] not in all_configured
|
|
91
|
+
)
|
|
92
|
+
seen_remaining = True
|
|
93
|
+
elif app in app_dict:
|
|
94
|
+
group_apps.append(app_dict[app])
|
|
95
|
+
|
|
96
|
+
if group_apps:
|
|
97
|
+
yield title, group_apps
|
|
98
|
+
|
|
99
|
+
if not seen_remaining:
|
|
100
|
+
raise ImproperlyConfigured(
|
|
101
|
+
"Your FHADMIN_GROUPS override is missing FHADMIN_GROUPS_REMAINING."
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@register.simple_tag(takes_context=True)
|
|
106
|
+
def fhadmin_group_list(context, request):
|
|
107
|
+
only_app_label = None
|
|
108
|
+
if context.get("apply_app_label_filtering"):
|
|
109
|
+
only_app_label = context.get("app_label")
|
|
110
|
+
return generate_group_list(admin.sites.site, request, only_app_label=only_app_label)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[metadata]
|
|
2
|
+
name = django_fhadmin
|
|
3
|
+
version = attr: fhadmin.__version__
|
|
4
|
+
description = Modifies the stock Django-Administration interface to fit our ideas a little bit better.
|
|
5
|
+
long_description = file: README.rst
|
|
6
|
+
long_description_content_type = text/x-rst
|
|
7
|
+
url = http://github.com/feinheit/django-fhadmin/
|
|
8
|
+
author = Matthias Kestenholz
|
|
9
|
+
author_email = mk@feinheit.ch
|
|
10
|
+
license = BSD-3-Clause
|
|
11
|
+
license_file = LICENSE
|
|
12
|
+
platforms = OS Independent
|
|
13
|
+
classifiers =
|
|
14
|
+
License :: OSI Approved :: BSD License
|
|
15
|
+
Programming Language :: Python :: 3
|
|
16
|
+
Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Programming Language :: Python :: 3.10
|
|
18
|
+
Programming Language :: Python :: 3.11
|
|
19
|
+
Programming Language :: Python :: 3.12
|
|
20
|
+
|
|
21
|
+
[options]
|
|
22
|
+
packages = find:
|
|
23
|
+
install_requires =
|
|
24
|
+
Django>=3.2
|
|
25
|
+
python_requires = >=3.10
|
|
26
|
+
include_package_data = True
|
|
27
|
+
|
|
28
|
+
[options.extras_require]
|
|
29
|
+
tests =
|
|
30
|
+
coverage
|
|
31
|
+
|
|
32
|
+
[options.packages.find]
|
|
33
|
+
exclude =
|
|
34
|
+
tests
|
|
35
|
+
tests.*
|
|
36
|
+
|
|
37
|
+
[coverage:run]
|
|
38
|
+
branch = True
|
|
39
|
+
include =
|
|
40
|
+
*fhadmin*
|
|
41
|
+
*testapp*
|
|
42
|
+
omit =
|
|
43
|
+
*migrations*
|
|
44
|
+
*.tox*
|
|
45
|
+
|
|
46
|
+
[egg_info]
|
|
47
|
+
tag_build =
|
|
48
|
+
tag_date = 0
|
|
49
|
+
|