#9 ✓resolved
davesag (at gmail)

Clean up navigation in footers of haml templates

Reported by davesag (at gmail) | September 24th, 2010 @ 02:31 AM | in v1.0

need to conditionally unlink the page that the user is currently browsing.

Comments and changes to this ticket

  • davesag (at gmail)

    davesag (at gmail) September 24th, 2010 @ 11:39 AM

    • State changed from “new” to “open”

    One solution is to simply supply the haml template a NavBar array {name, link} and if the link is nil then its not active.

    then it becomes the handler's job to specify what the navigation options are from this point on. That's probably not what a UI designer wants to hear.

    another option is for the handler to pass the haml template a 'navigation_tag' which can simply be used conditionally to delink the nav bar items.

    eg a template's footer page could contain this sort of snippet.

      -if navigation_tag == 'home'

    %p{:class => "navigation_thispage"}Home
    %a{:href =&gt; &quot;/&quot;, :class =&gt; &quot;navigation_otherpage&quot;}Home</code>

    It seems a bit clutzy but it has the advantage that the handler can simply tell a page it is the home page and so please don't show the link.

  • davesag (at gmail)

    davesag (at gmail) September 24th, 2010 @ 12:07 PM

    • State changed from “open” to “resolved”

    This is now working in v0.9.4

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Frank is intended to be a very simple but feature complete web-app built on top of Sinatra that provides simple user login, password reminder, and user email verification with support for simple roles. It is intended to be used by other developers as both a well documented example of Sinatra in use, and a starting point for others wishing to implement simple web apps very quickly.

Shared Ticket Bins

People watching this ticket