erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Navigation Overhaul #68

Closed MisterJames closed 11 years ago

MisterJames commented 11 years ago

Built in support for the concept of "NavigationRouteOptions" to clean up the code smell of "ShouldBreakAfter". Refactored the navigation list builder to support groups. Added support for "pull-right" on menu group ULs. Moved area information into the NavigationRouteOptions class. Updated and added tests as necessary. Updated samples, added comments and example route filter to sample project.

MisterJames commented 11 years ago

This is a bigger one, likely further evidence that NavigationRoutes should be broken out to their own home.

Biggest change is in cleaning up how we were passing in params to the route overloads...any additional options would have to - again and again - be refactored into the overloads. I created a "NavigationRouteOptions" class for this to compensate, example use in the sample project.

The pull-right support...I added this so that a user would be able to, say, put links relevant to the logged in user into a menu group and pull them over to the right. I'll add a quick sample to this sometime soon.

erichexter commented 11 years ago

Totally agree that nav routes needs to be broken out and included as an assembly rather then code. The biggest feature request thats been asked for at this point is an example and an api for applying filters. There is a unit test demonstrating the concept but no api for adding filters

MisterJames commented 11 years ago

Yeah...API would be cool. It's not really an API at this point...I'd like to work a bit further and expose a FilterCollection or something with some smarts.

As an example of where I can see this being used - and how I'm using it - is in having a plugin-type approach where the plugins can register routes. Of course, that means there would be some "admin" type functions that should be grouped under existing menus, as in, "I want to add my 'Configure My Plugin' link under the 'Administration' menu item."

Also, not sure how you feel about the FilterToken, but I needed a way to get more information about the state of a menu item when the filters were being execute, but I wanted to keep it simple as well. Open to feedback there.