mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-08-13 15:11:14 +00:00
@ReadOnly fields (#4)
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
class="form-control" th:id="|__id_${field.getName()}|"
|
||||
th:required="${!field.isNullable() && !field.isPrimaryKey()}"
|
||||
rows="5"
|
||||
th:classAppend="${field.isReadOnly() && !create ? 'disable' : ''}"
|
||||
></textarea>
|
||||
</th:block>
|
||||
<th:block th:if="${!field.isText()}">
|
||||
@@ -65,7 +66,8 @@
|
||||
${create ? (params != null ? params.getOrDefault(field.getName(), '') : '')
|
||||
: (object != null ? object.get(field).getValue() : '' )}
|
||||
"
|
||||
class="form-control" th:id="|__id_${field.getName()}|"
|
||||
th:class="|form-control ${field.isReadOnly() && !create ? 'disable' : ''}|"
|
||||
th:id="|__id_${field.getName()}|"
|
||||
th:classAppend="${field.isPrimaryKey() && object != null ? 'disable' : ''}"
|
||||
th:required="${!field.isNullable() && !field.isPrimaryKey()}"
|
||||
step="any"
|
||||
@@ -81,17 +83,21 @@
|
||||
th:data-fieldname="${field.getName()}"
|
||||
th:id="|__keep_${field.getName()}|"
|
||||
checked
|
||||
th:classAppend="${field.isReadOnly() && !create ? 'disable' : ''}"
|
||||
th:name="|__keep_${field.getName()}|">
|
||||
<span>Keep current data</span>
|
||||
<div th:if="${field.isImage()}" class="mb-2">
|
||||
<img class="thumb-image" th:id="|__thumb_${field.getName()}|"
|
||||
<img class="thumb-image"
|
||||
th:id="|__thumb_${field.getName()}|"
|
||||
th:src="|/${baseUrl}/download/${schema.getClassName()}/${field.getJavaName()}/${object.getPrimaryKeyValue()}/image|">
|
||||
</div>
|
||||
</div>
|
||||
<!--/*--> File input <!--*/-->
|
||||
<input th:if="${field.isBinary()}" placeholder="NULL" th:type="${field.getType().getHTMLName()}"
|
||||
<input
|
||||
th:if="${field.isBinary()}" placeholder="NULL" th:type="${field.getType().getHTMLName()}"
|
||||
th:name="${field.getName()}"
|
||||
class="form-control mt-2" th:id="|__id_${field.getName()}|"
|
||||
th:class="|form-control mt-2 ${field.isReadOnly() && !create ? 'disable' : ''}|"
|
||||
th:id="|__id_${field.getName()}|"
|
||||
th:required="${!field.isNullable()}"
|
||||
>
|
||||
</th:block>
|
||||
|
Reference in New Issue
Block a user