Skip to content

Conversation

@ludusrusso
Copy link

@ludusrusso ludusrusso commented May 1, 2017

Put flask-nav element to the right of the navbar.

Here is an example:

@nav.navigation()
def main_nav():
    navbar = Navbar('Blog')
    navbar.items.append(View('Home', 'main.index'))
    if current_user.is_authenticated:
        usergrp = []
        usergrp.append(current_user.email)
        if current_user.has_role('admin'):
            usergrp.append(View('Admin', 'admin.index'))
        usergrp.append(View('Logout', 'security.logout'))
        grp = Subgroup(*usergrp)
        grp.right = True #Goes on the right bar
        navbar.items.append(grp)
    return navbar

schermata 2017-05-01 alle 16 49 44

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.

1 participant