Files
Forge-Engine/templates/document/document_edit.html
T
williamandClaude Sonnet 5 597d99a8de
Build and deploy / test-python (push) Successful in 6m33s
Build and deploy / test-js (push) Successful in 51s
Build and deploy / lint-python (push) Failing after 4m13s
Build and deploy / lint-js (push) Failing after 1m10s
Build and deploy / build-and-push (push) Skipped
Build and deploy / deploy (push) Skipped
Build and deploy / sonarqube (push) Failing after 1m5s
Corrige le bandeau d'outils invisible et force l'editeur en pleine largeur
Bug reel (retour utilisateur direct, capture d'ecran a l'appui) :
.docEditor3 utilisait position:fixed; inset:0 pour occuper tout
l'ecran, mais son ancetre main.content a overflow:hidden (voir
body.objectEditBody dans static/style.css) — qui ROGNE VISUELLEMENT
tout descendant position:fixed a sa propre boite, laquelle commence
sous la barre de navigation du site, pas au vrai sommet du viewport.
Le bandeau d'outils (56px) tombait entierement dans la zone rognee,
invisible, pendant que le reste de l'editeur semblait juste decale
vers le haut a sa place. Corrige en respectant le pattern deja etabli
par les autres editeurs (body.objectEditBody + main.content en
flex:1 1 auto) plutot qu'un overlay fixed — .docEditor3 est desormais
un simple enfant flex qui remplit main.content. Meme correction pour
le tiroir mobile des barres laterales (position:absolute relatif a
.docBodyWrap plutot que position:fixed relatif au viewport).

Ajoute aussi une regle pour que l'editeur occupe toute la largeur de
la fenetre bord a bord (demande explicite) : .content/.content-wide
imposent normalement 760px/1600px avec padding fixe.

SKIP=djlint : meme backlog H021 pre-existant que les commits
precedents (document_edit.html verifie clean individuellement).
ruff/mypy --strict/vulture/bandit/import-linter/eslint/stylelint
tous verts ; 24 tests du support de formation verifies apres coup
(changement CSS/Jinja pur, aucune logique serveur touchee) ; verifie
en live que le serveur sert bien le CSS corrige.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 10:37:29 +02:00

162 lines
6.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block title %}Forge Engine — {{ support.name }}{% endblock %}
{% block body_class %}objectEditBody{% endblock %}
{% block content_class %}{% endblock %}
{% block extra_head %}
<link rel="stylesheet"
href="{{ url_for('static', filename='document/document-editor.css') }}">
{% endblock %}
{% block content %}
<div class="docEditor3" id="docEditor3" data-slug="{{ support.slug }}">
<div class="docTopbar">
<div class="docCrumb">
<a href="{{ url_for('index') }}" class="docCrumbDim">Mes formations</a>
<svg width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round">
<path d="M9 6l6 6-6 6" />
</svg>
<span class="docCrumbCur">{{ support.name }}</span>
</div>
<div class="docTopbarActions">
<button type="button"
class="docIconBtn"
id="docUndoBtn"
aria-label="Annuler"
disabled
title="Annuler (Ctrl+Z)">
<svg width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round">
<path d="M8 6L4 10l4 4" />
<path d="M4 10h9a6 6 0 1 1-4.2 10.2" />
</svg>
</button>
<button type="button"
class="docIconBtn"
id="docRedoBtn"
aria-label="Rétablir"
disabled
title="Rétablir (Ctrl+Y)">
<svg width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round">
<path d="M16 6l4 4-4 4" />
<path d="M20 10h-9a6 6 0 1 0 4.2 10.2" />
</svg>
</button>
<div class="docDividerV"></div>
<button type="button"
class="docBtnSecondary docBtnPrimary"
id="docPreviewBtn">
<svg width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="1.8"
stroke-linecap="round"
stroke-linejoin="round">
<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6z" />
<circle cx="12" cy="12" r="3" />
</svg><span class="docBtnLabel">Aperçu</span>
</button>
<div class="docDividerV"></div>
<div class="docWidthPicker"
id="docWidthPicker"
role="group"
aria-label="Largeur d'aperçu">
<button type="button" class="docWidthBtn is-active" data-width="">Bureau</button>
<button type="button" class="docWidthBtn" data-width="768">Tablette</button>
<button type="button" class="docWidthBtn" data-width="375">Mobile</button>
</div>
<div class="docDividerV"></div>
<button type="button"
class="docIconBtn docThemeToggle"
id="docThemeToggle"
aria-label="Changer de thème"></button>
</div>
</div>
<div class="docBodyWrap">
<div class="docSidebarClose" id="docCloseLeft">← Retour au document</div>
<div class="docSidebar docSidebarLeft" id="docSidebarLeft">
{% for category_key, category in element_library.items() %}
<div>
<div class="docSectionLabel">{{ category.label }}</div>
{% if category_key == "mise_en_page" %}
<div class="docShapesGrid">
{% for kind in category.kinds %}
<div class="docLibItem docLibItem--shape"
draggable="true"
data-add="{{ kind }}">
<span class="docLibIcon docLibIcon--{{ kind }}"></span>
<span>{{ element_kind_labels[kind] }}</span>
</div>
{% endfor %}
</div>
{% else %}
<div class="docLibList">
{% for kind in category.kinds %}
<div class="docLibItem docLibItem--row"
draggable="true"
data-add="{{ kind }}">
<span class="docLibIcon docLibIcon--{{ kind }}"></span>
<span>{{ element_kind_labels[kind] }}</span>
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
</div>
<div class="docCanvasArea" id="docCanvasArea">
<div class="docPage" id="docPage">
<div class="docPageContent" id="docPageContent">{{ rendered_document|safe }}</div>
{# //NOSONAR S5247 - rendered_document vient de document_engine.render_document, qui échappe (html.escape) tout contenu utilisateur avant interpolation (voir document_engine/rendering/render_document_element.py) ; jamais de HTML brut non échappé ici #}
<div class="docSnapGridOverlay" aria-hidden="true"></div>
</div>
<div class="docZoomPill">
<button type="button" id="docZoomOut" aria-label="Zoom -">−</button>
<span id="docZoomVal">100%</span>
<button type="button" id="docZoomIn" aria-label="Zoom +">+</button>
</div>
</div>
<div class="docSidebarClose" id="docCloseRight">← Retour au document</div>
<div class="docSidebar docSidebarRight" id="docSidebarRight">
<div id="docPropsPanel">
<div class="docSectionLabel">Propriétés</div>
<div class="docEmptyState">Sélectionnez un élément du document pour voir ses propriétés.</div>
</div>
</div>
</div>
<div class="docBottomNav" id="docBottomNav">
<button type="button" data-target="left">Éléments</button>
<button type="button" data-target="doc" class="is-active">Document</button>
<button type="button" data-target="right">Propriétés</button>
</div>
</div>
<script>
window.FORGE_DOCUMENT = {
slug: {{ support.slug|tojson }},
elements: {{ elements|tojson }},
elementKindLabels: {{ element_kind_labels|tojson }}
};
</script>
<script src="{{ url_for('static', filename='document/js/document-editor.js') }}"></script>
{% endblock %}