context_processor
utilities.frontend_menu.context_processor
¤
Functions¤
get_menu(user)
¤
Generate the user menu in HTML, depending on its permissions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user
|
User
|
The user to generate the menu for. |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
An HTML string with the menu items. |
Source code in utilities/functions.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
menu(request)
¤
Context processor for creating the menus.
Using this processor is indicated in the TEMPLATES section of settings.py.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
HttpRequest
|
The request to process, including the 'user'. |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
Dict[str, str]: A dictionary with the menu items. |
Source code in utilities/frontend_menu/context_processor.py
19 20 21 22 23 24 25 26 27 28 29 30 |
|