From dfe716cdc12b3950a65e5bfed2c6c2b3baac0fea Mon Sep 17 00:00:00 2001 From: "Ludovico O. Russo" Date: Mon, 1 May 2017 16:43:30 +0200 Subject: [PATCH] add right option to flask-bootstrap --- flask_bootstrap/nav.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flask_bootstrap/nav.py b/flask_bootstrap/nav.py index 1f3ca5b2..da375975 100644 --- a/flask_bootstrap/nav.py +++ b/flask_bootstrap/nav.py @@ -48,10 +48,14 @@ def visit_Navbar(self, node): id=node_id, )) bar_list = bar.add(tags.ul(_class='nav navbar-nav')) + bar_list_right = bar.add(tags.ul(_class='nav navbar-nav navbar-right')) for item in node.items: - bar_list.add(self.visit(item)) - + if hasattr(item, 'right'): + bar_list_right.add(self.visit(item)) + else: + bar_list.add(self.visit(item)) + return root def visit_Text(self, node):