def nav_dd_icon(icon_class="fa fa-envelope-o", label_class="label label-success", label_text=""): link = Link(href="#", css_classes="dropdown-toggle", data_toggle="dropdown") icon = Icon(icon_class) span = Span(label_class, label_text) icon.append_widget(span) link.append_widget(icon) return link
def _compose_user_panel(self): userpanel = ZenWidget("div", {"class": "user-panel"}) userimagediv = ZenWidget("div", {"class": "pull-left image"}) userpanel.append_widget(userimagediv) userimg = Image(self.user_info["src"], self.user_info["css_classes"], self.user_info["alt"]) userimagediv.append_widget(userimg) usernamediv = ZenWidget("div", {"class": "pull-left info"}) p = ZenWidget("p") p.append_text(self.user_info["username"]) userimagediv.append_widget(p) userstatus = Link("#") userstatusicon = Icon("fa fa-circle text-success") userstatusicon.append_text(self.user_info["userstatus"]) userstatus.append_widget(userstatusicon) userimagediv.append_widget(userstatus) userpanel.append_widget(userstatus) return userpanel
def nav_toggle_button(): btn = Link("#", "sidebar-toggle", "offcanvas", "button") btn.append_widget(Span("sr-only", "Toggle navigation")) return btn