-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1378] Updated new menus to use dynamic pages
- Loading branch information
Bart van der Schoor
committed
May 11, 2023
1 parent
9ddb4d1
commit 8c4e177
Showing
7 changed files
with
48 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.db.models import Q | ||
|
||
from cms.models import Page | ||
|
||
|
||
def active_apphooks(request): | ||
""" | ||
add lookup of active CMS apps to context | ||
"cms_apps": { | ||
"ProfileApphook": True, | ||
"profile": True, | ||
} | ||
""" | ||
active_app_hooks = ( | ||
Page.objects.published() | ||
.exclude(Q(application_urls="") | Q(application_urls__isnull=True)) | ||
.values_list("application_urls", "application_namespace") | ||
) | ||
|
||
lookup = dict() | ||
|
||
for classname, namespace in active_app_hooks: | ||
lookup[classname] = True | ||
lookup[namespace] = True | ||
|
||
context = {"cms_apps": lookup} | ||
|
||
return context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters