{# The app chrome — the kit's .mgf-console operator shell (mgf/console.html,
   M1 P4.2: every MGF operator app shares one shell) with the cloud console's
   resource nav in the rail. The shell markup/CSS live in mgf-brand-web (one
   source of truth); only cloud-web content lives in the blocks. #}
{% extends "mgf/console.html" %}

{% block title %}mgf-cloud-web{% endblock %}
{% block mark_title %}mgf-cloud{% endblock %}
{% block mark_sub %}local cloud console{% endblock %}

{% block body_attrs %} hx-boost="true"{% endblock %}

{% block rail_label %}Cloud resources{% endblock %}
{% block rail %}
      {% set path = request.url.path %}
      {% set items = [
        ("/", "Dashboard", "overview + est. cost"),
        ("/vms", "VMs", "servers"),
        ("/volumes", "Volumes", "block storage"),
        ("/floating-ips", "Floating IPs", "public addresses"),
        ("/security-groups", "Security groups", "firewall rules"),
        ("/keypairs", "Keypairs", "ssh access"),
        ("/objects", "Object storage", "containers"),
      ] %}
      <div class="mgf-console__rail-h">Resources</div>
      {% for href, label, kind in items %}
      {% set active = (path == href) if href == "/" else path.startswith(href) %}
      <a class="mgf-console__nav {% if active %}mgf-console__nav--on{% endif %}" href="{{ href }}"{% if active %} aria-current="page"{% endif %}>
        <span class="mgf-console__nav-main">
          <span class="mgf-console__nav-name">{{ label }}</span>
          <span class="mgf-console__nav-kind">{{ kind }}</span>
        </span>
      </a>
      {% endfor %}
{% endblock %}

{% block main %}
  <div class="container">
    {% block content %}{% endblock %}
  </div>
  <footer class="app-footer">
    <div class="container">
      <span>mgf-cloud-web · local cloud console</span>
      <span>Magogi Foundation</span>
    </div>
  </footer>
{% endblock %}

{% block scripts %}
<script src="/static/vendor/htmx.min.js" defer></script>
{% endblock %}
