#21 -- Fix report indicator description
This commit is contained in:
parent
0ec47113d1
commit
7d40a52f19
@ -13,6 +13,7 @@ import ru.ulstu.indicator.model.Indicator;
|
||||
import ru.ulstu.model.OffsetablePageRequest;
|
||||
import ru.ulstu.report.model.Report;
|
||||
import ru.ulstu.report.model.ReportListForm;
|
||||
import ru.ulstu.report.model.ReportPeriod;
|
||||
import ru.ulstu.report.service.ReportPeriodService;
|
||||
import ru.ulstu.report.service.ReportService;
|
||||
|
||||
@ -42,17 +43,19 @@ public class ReportController {
|
||||
@GetMapping("reportList")
|
||||
public String getReportPeriods(Model model) {
|
||||
model.addAttribute("reportListForm", new ReportListForm());
|
||||
model.addAttribute("reportPeriods", reportPeriodService.getReportPeriods());
|
||||
model.addAttribute("canCreate", false);
|
||||
List<ReportPeriod> periods = reportPeriodService.getReportPeriods();
|
||||
model.addAttribute("reportPeriods", periods);
|
||||
model.addAttribute("canCreate", !periods.isEmpty() && reportService.canCreateReport(periods.getFirst()));
|
||||
return "report/reportList";
|
||||
}
|
||||
|
||||
@PostMapping("reportList")
|
||||
public String getReportPeriods(ReportListForm reportListForm, Model model) {
|
||||
model.addAttribute("reportListForm", reportListForm);
|
||||
model.addAttribute("reportPeriods", reportPeriodService.getReportPeriods());
|
||||
model.addAttribute("reports", reportService.getReports(reportListForm.getReportPeriod()));
|
||||
model.addAttribute("canCreate", reportService.canCreateReport(reportListForm.getReportPeriod()));
|
||||
List<ReportPeriod> periods = reportPeriodService.getReportPeriods();
|
||||
model.addAttribute("reportPeriods", periods);
|
||||
model.addAttribute("canCreate", !periods.isEmpty() && reportService.canCreateReport(periods.getFirst()));
|
||||
return "report/reportList";
|
||||
}
|
||||
|
||||
|
@ -2,14 +2,16 @@
|
||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
||||
layout:decorate="~{default}">
|
||||
<div class="container" layout:fragment="content">
|
||||
<h3 th:text="${'Редактирование отчета аспиранта '} +${report.createDate}"></h3>
|
||||
<h3 th:text="${'Редактирование отчета аспиранта от '} +${#calendars.format(report.createDate, 'dd.MM.yyyy HH:mm')}"></h3>
|
||||
<form action="#" th:action="@{/report/saveReport}"
|
||||
th:object="${report}"
|
||||
method="post">
|
||||
<input type="hidden" th:field="*{id}">
|
||||
|
||||
<div class="form-group" th:each="i, ind : ${indicators}">
|
||||
<label th:text="${i.name}"></label>
|
||||
<p th:text="${i.name}"></p>
|
||||
<p th:text="${i.proofDocuments}"></p>
|
||||
<p th:text="'Максимальное количество баллов за показатель: '+ ${i.max}"></p>
|
||||
<div class="form-group">
|
||||
<button class="form-control btn btn-danger" type="button" onclick="deleteAllFiles();">Удалить все
|
||||
документы
|
||||
@ -99,11 +101,11 @@
|
||||
<a href="/report/reportList" class="btn btn-outline-dark">Отмена</a>
|
||||
</form>
|
||||
<div th:if="${indicators.totalPages > 0}" class="pagination">
|
||||
<span style="float: left; padding: 5px 5px;">Страницы:</span>
|
||||
<span style="float: left; padding: 5px 5px;">Показатели:</span>
|
||||
</div>
|
||||
<div th:if="${indicators.totalPages > 0}" class="pagination"
|
||||
th:each="pageNumber : ${pageNumbers}">
|
||||
<a th:href="@{/report/editReport(size=${indicators.size}, page=${pageNumber})}"
|
||||
<a th:href="@{'/report/editReport/' + ${report.id}+'(size=${indicators.size}, page=${pageNumber})'}"
|
||||
th:text=${pageNumber}
|
||||
th:class="${pageNumber == indicators.number+1} ? active"></a>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user