header.html 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {% load i18n wagtailadmin_tags %}
  2. {% comment %}
  3. Variables accepted by this template:
  4. - `title`
  5. - `subtitle`
  6. - `search_url` - if present, display a search box. This is a URL route name (taking no parameters) to be used as the action for that search box
  7. - `query_parameters` - a query string (without the '?') to be placed after the search URL
  8. - `icon` - name of an icon to place against the title
  9. - `tabbed` - if true, add the classname 'tab-merged'
  10. - `merged` - if true, add the classname 'merged'
  11. - `action_url` - if present, display an 'action' button. This is the URL to be used as the link URL for the button
  12. - `action_text` - text for the 'action' button
  13. - `action_icon` - icon for the 'action' button, default is 'icon-plus'
  14. {% endcomment %}
  15. <header class="{% if merged %}merged{% endif %} {% if tabbed %}tab-merged{% endif %} {% if search_form %}hasform{% endif %}">
  16. {% block breadcrumb %}{% endblock %}
  17. <div class="row{% if not tabbed %} nice-padding{% endif %}">
  18. <div class="left">
  19. <div class="col header-title">
  20. <h1>{% if icon %}{% icon name=icon class_name="header-title-icon" %}{% endif %}
  21. {{ title }}{% if subtitle %} <span>{{ subtitle }}</span>{% endif %}</h1>
  22. </div>
  23. {% if search_url %}
  24. <form class="col search-form" action="{% url search_url %}{% if query_parameters %}?{{ query_parameters }}{% endif %}" method="get" novalidate role="search">
  25. <ul class="fields">
  26. {% for field in search_form %}
  27. {% include "wagtailadmin/shared/field_as_li.html" with field=field field_classes="field-small iconfield" icon="search" %}
  28. {% endfor %}
  29. <li class="submit visuallyhidden"><input type="submit" value="Search" class="button" /></li>
  30. </ul>
  31. </form>
  32. {% endif %}
  33. </div>
  34. <div class="{% block right_column_classname %}right{% endblock %}">
  35. {% block right_column %}
  36. {% if action_url %}
  37. <div class="actionbutton">
  38. {% with action_icon|default:'plus' as action_icon_name %}
  39. <a href="{{ action_url }}" class="button bicolor button--icon">{% icon name=action_icon_name wrapped=1 %}{{ action_text }}</a>
  40. {% endwith %}
  41. </div>
  42. {% endif %}
  43. {% endblock %}
  44. </div>
  45. </div>
  46. {% block extra_rows %}{% endblock %}
  47. </header>