nitc :: DocTopMenu :: defaultinit
# Top menu bar template
class DocTopMenu
super UnorderedList
# Brand link to display in first position of the top menu
#
# This is where you want to put your logo.
var brand: nullable Link is noinit, writable
# Active menu item
#
# Depends on the current page, this allows to hilighted the current item.
var active_item: nullable ListItem is noinit, writable
redef fun rendering do
addn "<nav class='navbar navbar-default navbar-fixed-top'>"
addn " <div class='container-fluid'>"
addn " <div class='navbar-header'>"
add " <button type='button' class='navbar-toggle' "
addn " data-toggle='collapse' data-target='#topmenu-collapse'>"
addn " <span class='sr-only'>Toggle menu</span>"
addn " <span class='icon-bar'></span>"
addn " <span class='icon-bar'></span>"
addn " <span class='icon-bar'></span>"
addn " </button>"
var brand = self.brand
if brand != null then
add "<span class='navbar-brand'>"
add brand
add "</span>"
end
addn " </div>"
addn " <div class='collapse navbar-collapse' id='topmenu-collapse'>"
addn " <ul class='nav navbar-nav'>"
for item in items do
if item == active_item then item.css_classes.add "active"
add item.write_to_string
end
addn " </ul>"
addn " <div id='search-placeholder'>"
addn " </div>"
addn " </div>"
addn " </div>"
addn "</nav>"
end
end
src/doc/static/static_html.nit:272,1--317,3