#21 -- Fix buttons

This commit is contained in:
Anton Romanov 2025-04-15 22:03:28 +04:00
parent 6d36ac3416
commit 93829f21ef
4 changed files with 6 additions and 52 deletions

View File

@ -31,7 +31,7 @@ public class Report extends BaseEntity {
private Aspirant aspirant; private Aspirant aspirant;
@Enumerated(EnumType.STRING) @Enumerated(EnumType.STRING)
private ReportStatus status; private ReportStatus status = ReportStatus.NEW;
public Report() { public Report() {
} }

View File

@ -12,8 +12,10 @@
<input type="hidden" th:field="*{status}"> <input type="hidden" th:field="*{status}">
<div class="form-group" th:each="rv, ind : *{reportValues}"> <div class="form-group" th:each="rv, ind : *{reportValues}">
<a th:href="${'/report-value/edit-report-value/'+report.id + '/' + rv.indicator.id}" <a th:if="${report.id != null}"
th:href="${'/report-value/edit-report-value/'+report.id + '/' + rv.indicator.id}"
th:text="${rv.indicator.name}"></a> th:text="${rv.indicator.name}"></a>
<p th:if="${report.id == null}" th:text="${rv.indicator.name}"></p>
<p th:text="${rv.indicator.proofDocuments}"></p> <p th:text="${rv.indicator.proofDocuments}"></p>
<p th:text="'Максимальное количество баллов за показатель: '+ ${rv.indicator.max}"></p> <p th:text="'Максимальное количество баллов за показатель: '+ ${rv.indicator.max}"></p>
</div> </div>
@ -22,6 +24,7 @@
<button name="delete" <button name="delete"
type="submit" type="submit"
class="btn btn-outline-dark" class="btn btn-outline-dark"
th:if="${report.id != null}"
onclick="return confirm('Удалить запись?')"> onclick="return confirm('Удалить запись?')">
Удалить Удалить
</button> </button>

View File

@ -58,13 +58,7 @@
<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" <a th:href="${'/report/edit-report/' + reportValue.reportId}" class="btn btn-outline-dark">Отмена</a>
type="submit"
class="btn btn-outline-dark"
onclick="return confirm('Удалить запись?')">
Удалить
</button>
<a href="${'/report/edit-report/' + reportValue.reportId}" class="btn btn-outline-dark">Отмена</a>
</form> </form>

View File

@ -1,43 +0,0 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"/>
</head>
<body>
<div th:fragment="filesList">
<th:block th:each="file, rowStat : ${rv.files}">
<div class="row" th:id="|files${rowStat.index}|"
th:style="${file.deleted} ? 'display: none;' :''">
<input type="hidden" th:field="*{files[__${rowStat.index}__].id}"/>
<input type="hidden"
th:field="*{files[__${rowStat.index}__].deleted}"/>
<input type="hidden"
th:field="*{files[__${rowStat.index}__].name}"/>
<input type="hidden"
th:field="*{files[__${rowStat.index}__].tmpFileName}"/>
<div class="col-2">
<a class="btn btn-danger float-right"
th:onclick="|$('#files${rowStat.index}\\.deleted').val('true'); $('#files${rowStat.index}').hide(); |">
<span aria-hidden="true"><i class="fa fa-times"/></span>
</a>
</div>
<div class="col-10">
<a th:onclick="${file.id==null} ? 'downloadFile('+${file.tmpFileName}+',null,\''+${file.name}+'\')':
'downloadFile(null,'+${file.id}+',\''+${file.name}+'\')' "
href="javascript:void(0)"
th:text="*{files[__${rowStat.index}__].name}">
</a>
</div>
</div>
</th:block>
<div class="form-group">
<label for="loader">Загрузить файл:</label>
<div id="loader">
</div>
</div>
</div>
</body>
</html>