{% extends "base.html" %}
{% load actions djblets_utils i18n pipeline rbadmintags static %}

{% block js-page-view-type %}RB.Admin.PageView{% endblock %}

{# Disable theme support for the administration UI, until implemented. #}

{% block title %}{% block page_title %}{{title}}{% endblock %} | {% trans "Administration" %}{% endblock %}

{% block scripts %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
<script type="text/javascript" src="{% url 'admin:jsi18n' %}"></script>
{% endblock %}

{% block scripts-post %}
{{block.super}}
{%  javascript "3rdparty-admin" %}
{%  javascript "djblets-config-forms" %}
{%  javascript "oauth-edit" %}
{%  javascript "widgets" %}
{%  javascript "admin" %}
{%  block admin_scripts_post %}{% endblock %}
{% endblock %}

{% block extrahead %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
{{block.super}}
{% endblock %}

{% block css %}
{%  block extrastyle %}{% endblock %}
{%  if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
{%  stylesheet "admin" %}
{%  stylesheet "djblets-config-forms" %}
{{block.super}}
{% endblock css %}


{% block page_class %}admin admin-page{% endblock %}


{% block bodytag %}
<body class="{% if is_popup %}popup {% elif user.is_authenticated %}-has-sidebar {% endif %}{% block bodyclass %}{% endblock %} {{page_class}}" data-admin-utc-offset="{% now "Z" %}">
{% endblock %}


{% block sidebar %}
{%  if user.is_authenticated and not is_popup %}
{%   actions_html "admin-nav" %}
{%  endif %}
{% endblock sidebar %}


{% block main_content %}
{%  block messages %}
{%   if messages %}
{%    for message in messages %}
<div class="rb-c-alert {% alert_css_classes_for_message message %}">
 <div class="rb-c-alert__content">
  {{message}}
 </div>
</div>
{%    endfor %}
{%   endif %}
{%  endblock %}

{%  block pretitle %}{% endblock %}

{%  block content_title %}
{%   definevar "title" %}{% block form_title %}{{title}}{% endblock %}{% enddefinevar %}
{%   if title %}
<header class="rb-c-content-header -is-main">
 <h1 class="rb-c-content-header__title">{{title}}</h1>

 <div class="rb-c-content-header__actions">
{%    block object-tools %}{% endblock %}
 </div>
</header>
{%   endif %}
{%  endblock content_title %}

{%  block content %}
{{content}}
{%  endblock content %}
{% endblock main_content %}

{% block navbar %}
{%  if user.is_authenticated %}
<ul id="navbar"></ul>
{%   block subnavbar %}{% endblock %}
{%  endif %}
{% endblock %}
