{#
_image_header.html - shared header + tabs for every GE Aerospace image page.
CONTRACT (image-shell; used by the Overview, Drivers, Unattend and OS and
Packages tabs):
Use it as the first thing inside {% block content %}:
{% set header_actions %}
{% endset %}
{% set header_subtitle = 'Deploy/FlatUnattendW10.xml' %}
{% include "_image_header.html" %}
Variables it reads from the template context:
image_type required. Image key, e.g. "gea-standard".
active_tab optional. One of "overview", "drivers", "unattend", "os".
When missing it is worked out from request.endpoint
(image_tab_for_endpoint), so a route need not pass it.
header_actions optional. HTML for the right side of the title row
(Save / Review / Undo buttons). Build it with a
{% set header_actions %}...{% endset %} block.
header_subtitle optional. Plain text appended to the meta line
(file path, last save time, ...).
Globals it uses (context processor in app.py):
image_tabs services/image_pages.IMAGE_TABS: id, label, icon,
endpoint for each tab, in display order.
image_tab_url(t, tab) URL of a tab; use it for links and redirects
(in Python: services.image_pages.tab_url).
image_header_info(t) friendly_name, os_label, driver_count,
package_count, has_unattend.
Tab endpoints (change a row of IMAGE_TABS if a page moves):
overview images.overview GET /images/ views/images.py
drivers images_drivers.page GET /images//drivers views/images_drivers.py
unattend unattend_editor GET /images//unattend app.py
os images.os_packages GET /images//os views/images.py
Old URLs: /images//config redirects to the Overview (or ?tab=).
The sidebar marks an image active whenever active_tab is set (or the
endpoint maps to a tab) and image_type matches, so any page that includes
this partial highlights the right sidebar entry.
It also loads static/image-pages.js and the shared review modal
(#imageReviewModal). For a "Review changes" step call
PxeImage.reviewAndSave({previewUrl, saveUrl, body, title})
where previewUrl answers {"files": [control_files.public(plan), ...]}
and saveUrl takes the same body plus "expect": {name: sha_before} and
answers {"ok": true} (it flashes; the page reloads) or {"error": "..."}.
PxeImage.renderDiff(el, files) draws the same diff anywhere.
#}
{% set _tab = active_tab if active_tab is defined and active_tab else image_tab_for_endpoint(request.endpoint) %}
{% set _hdr = image_header_info(image_type) %}
{{ image_type }}
{% if _hdr.os_label %}|{{ _hdr.os_label }}{% endif %}
{% if header_subtitle is defined and header_subtitle %}|{{ header_subtitle }}{% endif %}
{% if header_actions is defined and header_actions %}
{{ header_actions }}
{% endif %}
{# Shared review step: filled by PxeImage.reviewAndSave (static/image-pages.js) #}
Review changes
This is exactly what will be written. Each changed file is backed up next to itself
(.bak-<date>-webui) first, and the save can be undone from this page.