{% extends "core/base.jinja" %}

{% block title %}
  {{ page.get_display_name() }}
{% endblock %}

{% block metatags %}
  <meta property="og:url" content="{{ request.build_absolute_uri(page.get_absolute_url()) }}" />
  <meta property="og:type" content="article" />
  <meta property="article:section" content="{% trans %}Page{% endtrans %}" />
  <meta property="og:title" content="{{ page.get_display_name() }}" />
  <meta property="og:image" content="{{ request.build_absolute_uri(static("core/img/logo_no_text.png")) }}" />
{% endblock %}

{%- macro print_page_name(page) -%}
  {%- if page -%}
    {{ print_page_name(page.parent) }} >
    <a href="{{ url('core:page', page_name=page.get_full_name()) }}">{{ page.get_display_name() }}</a>
  {%- endif -%}
{%- endmacro -%}

{% block content %}
  {{ print_page_name(page) }}
  <div class="tool_bar">
    <div class="tools">
      {% if page.club %}
        <a href="{{ url('club:club_view', club_id=page.club.id) }}">{% trans %}Return to club management{% endtrans %}</a>
      {% else %}
        <a href="{{ url('core:page', page.get_full_name()) }}">{% trans %}View{% endtrans %}</a>
      {% endif %}
      <a href="{{ url('core:page_hist', page_name=page.get_full_name()) }}">{% trans %}History{% endtrans %}</a>
      {% if can_edit(page, user) %}
        <a href="{{ url('core:page_edit', page_name=page.get_full_name()) }}">{% trans %}Edit{% endtrans %}</a>
      {% endif %}
      {% if can_edit_prop(page, user) and not page.is_club_page %}
        <a href="{{ url('core:page_prop', page_name=page.get_full_name()) }}">{% trans %}Prop{% endtrans %}</a>
      {% endif %}
    </div>
  </div>
  <hr>

  {% block page %}
  {% endblock %}
{% endblock %}
