nitc :: DocTopMenu
nitc :: DocTopMenu :: _brand
Brand link to display in first position of the top menunitc :: DocTopMenu :: active_item=
Active menu itemnitc :: DocTopMenu :: brand
Brand link to display in first position of the top menunitc :: DocTopMenu :: brand=
Brand link to display in first position of the top menunitc :: DocTopMenu :: defaultinit
nitc $ DocTopMenu :: SELF
Type of this instance, automatically specialized in every classnitc $ DocTopMenu :: rendering
Service used to render the content of the template.nitc :: DocTopMenu :: _brand
Brand link to display in first position of the top menuhtml :: BSComponent :: _css_classes
CSS classes to add on this element.template :: Template :: _is_frozen
Is the template allowing more modification (add
)
template :: Template :: _is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: _render_done
Flag to avoid multiple renderingnitc :: DocTopMenu :: active_item=
Active menu itemnitc :: DocTopMenu :: brand
Brand link to display in first position of the top menunitc :: DocTopMenu :: brand=
Brand link to display in first position of the top menucore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
html :: BSComponent :: css_classes
CSS classes to add on this element.html :: BSComponent :: css_classes=
CSS classes to add on this element.html :: UnorderedList :: defaultinit
html :: HTMLList :: defaultinit
html :: BSComponent :: defaultinit
nitc :: DocTopMenu :: defaultinit
template :: Template :: defaultinit
core :: Object :: defaultinit
core :: Writable :: defaultinit
template :: Template :: is_frozen=
Is the template allowing more modification (add
)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
template :: Template :: is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: is_writing=
Flag to avoid infinite recursivity if a template contains itselfcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).html :: BSComponent :: render_css_classes
Renderself
css clases as a class
attribute.
template :: Template :: render_done=
Flag to avoid multiple renderingcore :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
# 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