- Added inline functions (new) from picea

This commit is contained in:
mcndave committed 2026-11-25 21:08:55 +00:00
1 parent d71fac0f88
commit 23b84f149f
5 files changed
+4 -7

No files matched your search

+2 -2
View File
@@ -32,11 +32,11 @@
%}
{% endfunction %}
{% function yesOrNo(bool $toggle) : void %}
{% function.overwrite yesOrNo(bool $toggle) : void %}
<span style="color: {{ $toggle ? 'green' : '#ac1b1b' }}">{{ $toggle ? 'oui' : 'non' }}</span>
{% endfunction %}
{% function length(int|null|string $length): void %}
{% function.overwrite length(int|null|string $length): void %}
<span style="color:{{ $length ? 'black' : 'gray' }}">{{ $length ?? "non-défini" }}</span>
{% endfunction %}
+2 -2
View File
@@ -1,6 +1,6 @@
{% language.set "lean.api.descriptor.form" %}
{% function yesOrNo(bool $toggle) : void %}
{% function.inline yesOrNo(bool $toggle) : void %}
<span style="color: {{ $toggle ? 'green' : '#ac1b1b' }}">{{ $toggle ? 'oui' : 'non' }}</span>
{% endfunction %}
@@ -30,7 +30,7 @@
<div class="field-desc" style="margin-top:10px;;background:#fff;padding:5px;font-size:0.9em">
<div><u>Variable POST / champ JSON</u> : {{ $field['name'] }}</div>
<div><u>Type(s)</u> : {{ implode(' | ', array_map(fn($e) => $e->type, $field['type'])) }}</div>
<div><u>Nullable</u> : {{ yesOrNo($field['allowNulls']) }}</div>
<div><u>Nullable</u> : {{ $yesOrNo($field['allowNulls']) }}</div>
{% if $field['regexPattern'] !== null %}
<div><u>Pattern regex</u> : {{ $field['regexPattern'] }}</div>
{% endif %}