{%- macro breadcrumb(content, href, initial) -%} {{ ui.breadcrumb_divider() if not initial }} {{ ui.link(content, href, **kwargs) }} {%- endmacro %} {%- macro nav_item(content, href, active) -%} {%- if active %} {{ ui.link(content, href, **kwargs) }} {%- else -%} {{ ui.link(content, href, **kwargs) }} {%- endif %} {%- endmacro %} {%- macro main_nav_item(content, href, active) -%}{{ ui.nav_item(content, href, active, **kwargs) }}{%- endmacro %} {%- macro sidebar_nav_item(content, href, active) -%}{{ ui.nav_item(content, href, active, **kwargs) }}{%- endmacro %} {%- macro account_nav_item(content, href, active) -%}{{ ui.nav_item(content, href, active, **kwargs) }}{%- endmacro %} {%- macro content_nav_item(content, href, active) -%}{{ ui.tab(content, href, active, **kwargs) }}{%- endmacro %} {%- macro page_action(content, href) -%}{{ ui.button(content, href=href, **kwargs) }}{%- endmacro %} {%- macro content_action(content, href) -%}{{ ui.button(content, href=href, **kwargs) }}{%- endmacro %} {%- macro pagination(page=1, total=1, url_generator=h.pager_url, padding=2, hide_edges=false, hide_siblings=false, start_label=null, end_label=null, previous_label=_("Previous"), next_label=_("Next"), padding_label="...", url_params={}) -%} {%- if total > 1 %} {%- call ui.util.call(ui.pagination_wrapper, **kwargs) -%} {%- if page > 1 and not hide_siblings %} {{ ui.link(previous_label, href=url_generator(page=page - 1, **url_params), aria={"label": _("Go to previous page")}) }} {%- endif %} {%- if page - 1 > padding %} {%- if not hide_edges -%} {{ ui.link((start_label or 1), href=url_generator(page=1, **url_params), aria={"label": _("Go to first page")}) }} {%- endif %} {%- endif %} {%- for i in range([page - padding, 1]|max, [page + padding, total]|min + 1) %} {%- if i == page %} {{ i }} {%- else %} {{ ui.link(i, href=url_generator(page=i, **url_params), aria={"label": _("Go to page {num}".format(num=i))}) }} {%- endif %} {%- endfor %} {%- if total - page > padding %} {%- if not hide_edges -%} {{ ui.link((end_label or total), href=url_generator(page=total, **url_params), aria={"label": _("Go to last page")}) }} {%- endif %} {%- endif %} {%- if page < total and not hide_siblings %} {{ ui.link(next_label, href=url_generator(page=page + 1, **url_params), aria={"label": _("Go to next page")}) }} {%- endif %} {%- endcall %} {%- endif %} {%- endmacro %} {%- macro pagination_item(content, href) -%} {{ ui.link(content, href=href, aria={"label": kwargs.label or "Go to page {}".format(content) }) }} {%- endmacro %} {%- macro dropdown_item(content, href="#") -%}
  • {{ ui.link(content, href=href, role="menuitem", **kwargs) }}
  • {%- endmacro %}