Runique Admin

Admin template system

3-level hierarchy

admin_template.html   ← level 1: contract (defined blocks, fixed elements)
        ↓ extends
admin_base.html            ← level 2: default visual layout
        ↓ extends
list.html / create.html …  ← level 3: CRUD components

Level 1 — admin_template.html: elements outside blocks guaranteed (CSRF, messages). Do not override directly.

Level 2 — admin_base.html: default layout (sidebar, topbar, styles). This is the file the developer replaces to change the appearance.

Level 3 — components: CRUD pages that extend level 2 and fill {% block content %}.


Available blocks

BlockRole
{% block title %}Page title (<title>)
{% block extra_css %}Additional CSS in <head>
{% block layout %}Wraps the entire layout (sidebar + main)
{% block sidebar %}Navigation sidebar
{% block topbar %}Top bar (breadcrumb, logout)
{% block breadcrumb %}Breadcrumb (defined in admin_base)
{% block messages %}Flash message area — contains {% messages %} by default
{% block content %}Main page content
{% block extra_js %}Additional JS scripts before </body>

Elements outside blocks (always present)

Written directly in admin_template.htmlcannot be removed by overriding:

  • <meta name="csrf-token" content="{{ csrf_token }}"> in <head>
  • <script src="{{ "js/csrf.js" | runique_static }}" defer></script> before </body>

Sub-sections

SectionDescription
Context keysVariables injected by the backend into each template
OverrideReplace the layout or a CRUD component
CSRFCSRF token, csrf.js, custom login checklist

Back to menu