Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom menu definition support #241

Closed
wants to merge 17 commits into from
Closed

Custom menu definition support #241

wants to merge 17 commits into from

Conversation

farridav
Copy link
Owner

@farridav farridav commented Dec 22, 2020

Closes: #195

Aims to allow an entirely custom menu using an app-> model list mapping

e.g "custom_menu": {"auth": ["books.book"], "any_name": ["auth.user", "auth.group"]}

@djpretzel .. I have not forgotten about this, let me know if it supports your use case

TODO:

  • Finish test
  • Update documentation

@farridav farridav added the work in progress Still a work in progress label Dec 22, 2020
@djpretzel
Copy link

@farridav Many thanks for remembering! Looks good, two questions:

  1. Is it possible to nest an "arbitrary" (non-app) menu item under another one, or under a traditional app menu item for that matter? Right now the menu model is basically two levels, but this would allow for a third (when using the custom menu option) or even fourth, which I believe AdminLTE will support? In other words, envisioned as a tree, it would be nice to have these arbitrary groupings available not only at the very top level, but also one (or potentially 2/3) levels down - if that makes sense?

  2. Will it cause issues for the "model_str" property if the "arbitrary name" text value is prefixed onto the model name, e.g. "arbitrary name.user" on line 213?

@farridav
Copy link
Owner Author

  1. No, currently nested groups are not supported. this would require additional work, if this PR adds value right now, id suggest we move forwards with it, and follow up with something that allows for nesting, as i see this ending up a lot more complicated

  2. I have not spotted any issues so far, model_str is used for lookups in jazzmin config, e.g

    "icons": {
        "auth.user": "fas fa-user",
        "Arbitrary Name.user": "fas fa-user",
        ...
      }

Supporting N levels of nesting is definitely something that needs scoping out

@ghost
Copy link

ghost commented Sep 3, 2021

Hi! I just discovered django-jazzmin and love it. This PR seems to be only feature that I am actually missing out on. Are there any plans to move forward with this ?

@farridav
Copy link
Owner Author

farridav commented Sep 3, 2021

I've got a building list of things to take care of here, and my other maintainer is currently unavailable, so it's been tricky getting it all done, along with my other work.

This ticket is definitely one I want to get finished up, hopefully within the next few weeks if possible.

@RyanLoil
Copy link

I wonder if it is possible to add a apps group design in this feature as it is quite necessary for a project with a series of apps.
I'm working with a project with a design of 12 apps devided into two different groups, and I really feel messy to look through the side menu.
Using prefix in appconfig verbose name and order_respect_to is a replacement solution but my colleague said it was a really stupid way to deal with this problem hah :D.

@Pijuli
Copy link
Contributor

Pijuli commented Dec 16, 2021

It's not a push, but just a question.
How is this feature going? Can anyone give some help to get it finished?
Thank you so much!

@chaleyct
Copy link

chaleyct commented Jun 6, 2022

Hey just checking to see if this feature still has a path forward. Thanks for the hard work!

@farridav
Copy link
Owner Author

farridav commented Jun 6, 2022 via email

@katiam2 katiam2 removed the work in progress Still a work in progress label Nov 27, 2024
)

User = get_user_model()
register = Library()
logger = logging.getLogger(__name__)


def _process_models(app_label: str, models: List[Dict], options: Dict) -> List[Dict]:
Copy link
Collaborator

@katiam2 katiam2 Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a simple extraction to satisfy ruff requirements. Tests were added to the original message first and then the refactoring followed.

@katiam2
Copy link
Collaborator

katiam2 commented Dec 1, 2024

Already implemented

@katiam2 katiam2 closed this Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intermediate Grouping/Categorization of Menu Items
6 participants