ChiliProject is not maintained anymore. Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.
More dynamic Menus (Feature #731)
Description
The current implementation of the MenuManager does only allow to add menu items statically during start up. Creating menus that have a dynamically defined list of items (e.g. a menu that contains items for each instance of a model) is not possible, because adding instances of the model does not result in a changed menu until the Redmine process is restarted and menus are regenerated.
Consider this example:
Redmine::MenuManager.map(:project_menu) do |menu| Project.all.each |project| menu.push project.title, link_to(project) end end
I adapted the implementation of the MenuManager to defer the evaluation of the block given to the map method until the menu is rendered (i.e. in the items call).
My patch makes sure not to introduce any breaking changes.