<!DOCTYPE html>
<html>
<head>

<meta charset="utf-8"/>
<title>SACRUD</title>
<meta name="author" content="Uralbash"/>
<link rel="shortcut icon" href="{{ request.static_url('sacrud:static/favicon.ico') }}"/>
<link rel="stylesheet" href="{{ request.static_url('sacrud:static/style/style.css') }}"/>

{% block extrascript %}
{% endblock %}

{% block userspace %}
{% endblock %}
</head>

<body>
<div class="sa_head">
  {% block menu %}
    <ul id="sa_head_menu">
      <a href="{{ request.route_url('sa_home') }}"><li>Home</li></a>
      <a href="https://github.com/uralbash/sacrud" target="_blank">
        <li style="width:90px">ver: {{ sacrud_ver }}</li>
      </a>
    </ul>
  {% endblock %}
</div>

<div class="sa_breadcrumbs">
  {% if breadcrumbs %}
    <div class="sa_breadcrumbs_row">
      {% for crumb in breadcrumbs %}
        {% if not loop.last %}
          <a {% if crumb.visible %}href=
               "{{ request.route_path(crumb.view, **crumb.param) }}"
             {% endif %}>{{ crumb.name }}</a> &rarr;
        {% else %}{{ crumb.name }}{% endif %}
      {% endfor %}
    </div>
  {% endif %}
</div>

{% block flash_message %}
  {% if request.session %}
    {% if request.session.peek_flash() %}
      <div id="flash">
        {% set flash = request.session.pop_flash() %}
        {% for message in flash %}
          {{ message }}<br>
        {% endfor %}
      </div>
    {% endif %}
  {% endif %}
{% endblock %}

<div id="page">
  {% block sa_body %}{% endblock %}
  {% block paginator %}
    {% if 'row' in sa_crud %}
      {% set paginator = sa_crud['row'] %}
      {% if paginator.items %}
        <div class="paginator">
          {{ paginator.pager() }}
        </div>
      {% endif %}
    {% endif %}
  {% endblock %}
</div>

</body>
</html>
