#21 -- Fix UI for files upload
This commit is contained in:
parent
f5c89b0897
commit
691ccca54b
@ -1,8 +1,10 @@
|
|||||||
package ru.ulstu.report.model;
|
package ru.ulstu.report.model;
|
||||||
|
|
||||||
|
import jakarta.persistence.CascadeType;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.EnumType;
|
import jakarta.persistence.EnumType;
|
||||||
import jakarta.persistence.Enumerated;
|
import jakarta.persistence.Enumerated;
|
||||||
|
import jakarta.persistence.FetchType;
|
||||||
import jakarta.persistence.ManyToOne;
|
import jakarta.persistence.ManyToOne;
|
||||||
import jakarta.persistence.OneToMany;
|
import jakarta.persistence.OneToMany;
|
||||||
import jakarta.persistence.Temporal;
|
import jakarta.persistence.Temporal;
|
||||||
@ -19,7 +21,7 @@ public class Report extends BaseEntity {
|
|||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date createDate = new Date();
|
private Date createDate = new Date();
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
private List<ReportValue> values = new ArrayList<>();
|
private List<ReportValue> values = new ArrayList<>();
|
||||||
|
|
||||||
@ManyToOne
|
@ManyToOne
|
||||||
|
@ -24,13 +24,13 @@
|
|||||||
th:field="*{files[__${rowStat.index}__].name}"/>
|
th:field="*{files[__${rowStat.index}__].name}"/>
|
||||||
<input type="hidden"
|
<input type="hidden"
|
||||||
th:field="*{files[__${rowStat.index}__].tmpFileName}"/>
|
th:field="*{files[__${rowStat.index}__].tmpFileName}"/>
|
||||||
<div class="col-2">
|
<div class="col col-md-2">
|
||||||
<a class="btn btn-danger float-right"
|
<a class="btn btn-danger float-right"
|
||||||
th:onclick="|$('#files${rowStat.index}\\.deleted').val('true'); $('#files${rowStat.index}').hide(); |">
|
th:onclick="|$('#files${rowStat.index}\\.deleted').val('true'); $('#files${rowStat.index}').hide(); |">
|
||||||
<span aria-hidden="true"><i class="fa fa-times"/></span>
|
<span><i class="fa fa-times"></i></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-10">
|
<div class="col col-md-8">
|
||||||
<a th:if="${file.id != null}"
|
<a th:if="${file.id != null}"
|
||||||
th:onclick="downloadFile(null, [[${file.id}]], [[${file.name}]])"
|
th:onclick="downloadFile(null, [[${file.id}]], [[${file.name}]])"
|
||||||
href="javascript:void(0)"
|
href="javascript:void(0)"
|
||||||
@ -44,6 +44,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="loader">Загрузить файл:</label>
|
<label for="loader">Загрузить файл:</label>
|
||||||
<div id="loader">
|
<div id="loader">
|
||||||
@ -51,6 +53,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
||||||
<button name="delete"
|
<button name="delete"
|
||||||
@ -77,7 +81,6 @@
|
|||||||
addNewFile(response, $("#files-list"));
|
addNewFile(response, $("#files-list"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('.selectpicker').selectpicker();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/*]]>*/
|
/*]]>*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user