Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Resint
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Resint
Commits
c7062ff2
Verified
Commit
c7062ff2
authored
3 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Correctly lazy-wrap menu genration through duck typing
parent
7ed0d381
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!37
Resolve "Poster group not showing up in menu"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.rst
+1
-0
1 addition, 0 deletions
CHANGELOG.rst
aleksis/apps/resint/menus.py
+48
-47
48 additions, 47 deletions
aleksis/apps/resint/menus.py
with
49 additions
and
47 deletions
CHANGELOG.rst
+
1
−
0
View file @
c7062ff2
...
...
@@ -18,6 +18,7 @@ Fixed
~~~~~
* Live documents table showed two "Actions" columns.
* Menu was not correctly re-generated after creating or editing poster groups
`2.0`_ - 2021-12-27
-------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/resint/menus.py
+
48
−
47
View file @
c7062ff2
...
...
@@ -2,7 +2,6 @@ from typing import Any, Dict, List
from
django.apps
import
apps
from
django.urls
import
reverse
from
django.utils.functional
import
lazy
from
django.utils.translation
import
ugettext_lazy
as
_
...
...
@@ -30,57 +29,59 @@ def _get_menu_entries() -> List[Dict[str, Any]]:
]
get_menu_entries_lazy
=
lazy
(
_get_menu_entries
,
list
)
MENUS
=
{
"
NAV_MENU_CORE
"
:
[
{
"
name
"
:
_
(
"
Documents
"
),
"
url
"
:
"
#
"
,
"
icon
"
:
"
open_in_browser
"
,
"
root
"
:
True
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_poster_menu
"
,
),
],
"
submenu
"
:
[
{
"
name
"
:
_
(
"
Manage posters
"
),
"
url
"
:
"
poster_index
"
,
"
icon
"
:
"
file_upload
"
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_posters_rule
"
,
),
],
},
class
MENUS
:
def
get
(
menu_name
,
default
=
None
):
menus
=
{
"
NAV_MENU_CORE
"
:
[
{
"
name
"
:
_
(
"
Poster groups
"
),
"
url
"
:
"
poster_group_list
"
,
"
icon
"
:
"
topic
"
,
"
name
"
:
_
(
"
Documents
"
),
"
url
"
:
"
#
"
,
"
icon
"
:
"
open_in_browser
"
,
"
root
"
:
True
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_poster
groups_rule
"
,
"
resint.view_poster
_menu
"
,
),
],
},
{
"
name
"
:
_
(
"
Live documents
"
),
"
url
"
:
"
live_documents
"
,
"
icon
"
:
"
update
"
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_livedocuments_rule
"
,
),
"
submenu
"
:
[
{
"
name
"
:
_
(
"
Manage posters
"
),
"
url
"
:
"
poster_index
"
,
"
icon
"
:
"
file_upload
"
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_posters_rule
"
,
),
],
},
{
"
name
"
:
_
(
"
Poster groups
"
),
"
url
"
:
"
poster_group_list
"
,
"
icon
"
:
"
topic
"
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_postergroups_rule
"
,
),
],
},
{
"
name
"
:
_
(
"
Live documents
"
),
"
url
"
:
"
live_documents
"
,
"
icon
"
:
"
update
"
,
"
validators
"
:
[
(
"
aleksis.core.util.predicates.permission_validator
"
,
"
resint.view_livedocuments_rule
"
,
),
],
},
],
},
],
}
]
+
_get_menu_entries
(),
}
]
+
get_menu_entries_lazy
(),
}
return
menus
.
get
(
menu_name
,
default
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment