Skip to content

Commit

Permalink
making saves-settings.hbs template more generic.
Browse files Browse the repository at this point in the history
fixed required attribute bug for when it is passed into the template as false (it was correct for values of true).
orffen#69
  • Loading branch information
DC23 committed Nov 27, 2024
1 parent 343027a commit fc58096
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion module/settings/saves-settings.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SavesSettings extends FormApplication {
return foundry.utils.mergeObject(super.defaultOptions, {
popOut: true,
width: 400,
template: `systems/${SYSTEM_ID}/templates/settings/saves-settings.hbs`,
template: `systems/${SYSTEM_ID}/templates/settings/string-array-settings.hbs`,
id: SETTINGS.SAVES_MENU,
title: 'BASICFANTASYRPG.Settings.SavesMenu.name',
})
Expand All @@ -55,6 +55,7 @@ class SavesSettings extends FormApplication {
id: v,
label: SavesSettings.defaultSaves[v],
value: initialValues[v],
required: true,
}
})
return data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{{#*inline "savePartial"}}
{{!-- fa
--}}

{{#*inline "stringFieldPartial"}}
<div class="form-row flexrow">
<label for="{{id}}">{{label}}:</label>
<input name="{{id}}" required=true value="{{value}}" />
<input name="{{id}}" {{#if required}}required="true"{{/if}} value="{{value}}" />
</div>
{{/inline}}

{{log this}}
<form class="form-group flexcol">
<fieldset>
<legend>{{localize "BASICFANTASYRPG.Settings.SavesMenu.name"}}:</legend>
{{#each this}}
{{> savePartial}}
{{/each}}
</fieldset>
{{#each this}}
{{> stringFieldPartial}}
{{/each}}

<footer class="sheet-footer flexrow button-container">
<button class="reset-all" type="button" name="reset" data-action="reset">
Expand Down

0 comments on commit fc58096

Please sign in to comment.