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

Make locations (and sub-locations) available in navbar #23

Open
fwolfst opened this issue Mar 6, 2020 · 4 comments
Open

Make locations (and sub-locations) available in navbar #23

fwolfst opened this issue Mar 6, 2020 · 4 comments
Assignees
Labels
difficulty: easy Probably relatively easy to solve enhancement New feature or request

Comments

@fwolfst
Copy link
Member

fwolfst commented Mar 6, 2020

The "Locations" menu entry in the navbar could have submenus (in the "form" of the locations) to access the locations directly. Maybe cropped to .. 6? entries, a bit like this:

building1
  |- floor1
    |-- room 1
    |-- server room
      |-- rack1
      |-- rack 2
  |- floor2
building3
  |- room X
building4
building5
building6
...(more) all locations

The quick and dirty solution would be to fetch the Locations from the view. The clean solution would be to subclass ApplicationController and get all the locations in a before_action (actually only if the reqest is not a XHR/json request, but we do not use these anyway) and then subclass all custom controllers from there. The reason would be that the DeviseController (login/forgot password etc) does not need to fetch the locations because it does not show the navbar.

@fwolfst fwolfst added difficulty: easy Probably relatively easy to solve enhancement New feature or request labels Mar 6, 2020
@TheRealSyler TheRealSyler self-assigned this Mar 10, 2020
@fwolfst
Copy link
Member Author

fwolfst commented Mar 13, 2020

@TheRealSyler Need any help or pointers in the right direction?

@TheRealSyler
Copy link
Contributor

@fwolfst i got stuck on making a sub controller, the rest is pretty much done or easy to do.

@fwolfst
Copy link
Member Author

fwolfst commented Mar 13, 2020

@fwolfst i got stuck on making a sub controller, the rest is pretty much done or easy to do.

@TheRealSyler Feel free to push something. Although maybe the subcontroller approach is somewhat more difficult than what we need. I'd happily explore the different paths with you. In any way, it should result in relatively few lines of code that can easily be moved araound.

@TheRealSyler
Copy link
Contributor

@fwolfst 552f09e, i will also add a function to get a tree like structure in the subemenu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy Probably relatively easy to solve enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants