Refactored the way input fields are rendered to allow further customization

and easier support of custom fields like OffsetDateTime (#7).
This commit is contained in:
Francesco
2023-10-04 16:26:32 +02:00
parent 0620c3d2a5
commit bebc562961
7 changed files with 214 additions and 80 deletions

View File

@@ -90,13 +90,13 @@
<option th:value="${op}" th:each="op : ${field.getType().getCompareOperators()}"
th:text="${op.getDisplayName()}">
</select>
<input placeholder="NULL" th:type="${field.getType().getHTMLName()}"
name="filter_value"
class="form-control w-50" th:id="|__id_${field.getName()}|"
th:classAppend="${field.isPrimaryKey() && object != null ? 'disable' : ''}"
th:required="${!field.isNullable() && !field.isPrimaryKey()}"
step="any"
>
<input th:replace="~{fragments/inputs ::
__${field.getFragmentName()}__(
field=${field},
create=${create},
name='filter_value',
value=''
)}"></input>
</th:block>
<button class="ui-btn btn btn-primary"><i class="bi bi-search text-white"></i></button>
</div>