Add Description to bottom of rolls (#19)

Changes:
 + Add helper to strip Html
 + add description of items to bottom of roll
This commit is contained in:
Byroks 2023-11-30 18:13:04 +01:00 committed by GitHub
parent 250fc499ae
commit 48883c3102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View File

@ -81,6 +81,11 @@ Hooks.once("init", async () => {
return false;
});
Handlebars.registerHelper("stripHtml", function (param) {
var regex = /(<([^>]+)>)/gi;
return param.replace(regex, "");
});
// Default Sheet für Items definieren und das Standardsheet deaktivieren
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("midgard5", M5ItemSheet, { makeDefault: true });

View File

@ -7,6 +7,14 @@
font-size: 1.3rem;
}
.roll-description-header {
text-align: start;
vertical-align: middle;
padding: 0.3rem 0 0.1rem 0;
font-weight: bold;
font-size: 1.2rem;
}
.roll-spell-details {
text-align: right;
padding-right: 1rem;

View File

@ -90,5 +90,11 @@
{{/each}}
</tbody>
</table>
{{#if i.description}}
<tr>
<h2 class="roll-description-header">Beschreibung:</h2>
<span>{{stripHtml i.description}}</span>
</tr>
{{/if}}
</div>
</div>