Fix roll dialog CSS + JS: template <div> wrapper, moon-section, selectors

- Remplace <form class='roll-dialog celestopol'> par <div class='roll-dialog-content'>
  pour éviter les formulaires HTML imbriqués invalides (DialogV2 a son propre <form>)
- Corrige le sélecteur CSS de .roll-dialog.celestopol vers .application.roll-dialog .roll-dialog-content
- Remplace .form-group.form-moon par .moon-section (classe custom) pour éviter
  les conflits avec le CSS grid de FoundryVTT standard-form (label 130px de hauteur)
- Met à jour le script JS inline pour utiliser document.querySelector('.roll-dialog-content')
- Ajoute white-space: nowrap sur le label Destin pour éviter le wrapping sur 3 lignes
- Supprime .application.roll-dialog .window-content padding override (remplacé par dialog-content)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-28 17:21:18 +01:00
parent a581853f95
commit cff700bd3d
24 changed files with 1133 additions and 283 deletions

View File

@@ -65,35 +65,35 @@ Hooks.once("init", () => {
// ── Sheets: unregister core, register system sheets ─────────────────────
foundry.applications.sheets.ActorSheetV2.unregisterSheet?.("core", "Actor", { types: ["character", "npc"] })
Actors.unregisterSheet("core", ActorSheet)
Actors.registerSheet(SYSTEM_ID, CelestopolCharacterSheet, {
foundry.documents.collections.Actors.unregisterSheet("core", ActorSheet)
foundry.documents.collections.Actors.registerSheet(SYSTEM_ID, CelestopolCharacterSheet, {
types: ["character"],
makeDefault: true,
label: "CELESTOPOL.Sheet.character",
})
Actors.registerSheet(SYSTEM_ID, CelestopolNPCSheet, {
foundry.documents.collections.Actors.registerSheet(SYSTEM_ID, CelestopolNPCSheet, {
types: ["npc"],
makeDefault: true,
label: "CELESTOPOL.Sheet.npc",
})
Items.unregisterSheet("core", ItemSheet)
Items.registerSheet(SYSTEM_ID, CelestopolAnomalySheet, {
foundry.documents.collections.Items.unregisterSheet("core", ItemSheet)
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolAnomalySheet, {
types: ["anomaly"],
makeDefault: true,
label: "CELESTOPOL.Sheet.anomaly",
})
Items.registerSheet(SYSTEM_ID, CelestopolAspectSheet, {
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolAspectSheet, {
types: ["aspect"],
makeDefault: true,
label: "CELESTOPOL.Sheet.aspect",
})
Items.registerSheet(SYSTEM_ID, CelestopolAttributeSheet, {
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolAttributeSheet, {
types: ["attribute"],
makeDefault: true,
label: "CELESTOPOL.Sheet.attribute",
})
Items.registerSheet(SYSTEM_ID, CelestopolEquipmentSheet, {
foundry.documents.collections.Items.registerSheet(SYSTEM_ID, CelestopolEquipmentSheet, {
types: ["equipment"],
makeDefault: true,
label: "CELESTOPOL.Sheet.equipment",
@@ -144,7 +144,15 @@ function _registerHandlebarsHelpers() {
return args.reduce((acc, key) => (acc && acc[key] !== undefined ? acc[key] : undefined), obj)
})
// Helper : let (scope variable assignment inside template)
// Helper : negate a number (abs value helper)
Handlebars.registerHelper("neg", n => -n)
// Helper : absolute value
Handlebars.registerHelper("abs", n => Math.abs(n))
// Helper : add two numbers
Handlebars.registerHelper("add", (a, b) => a + b)
Handlebars.registerHelper("let", function(value, options) {
return options.fn({ value })
})