Merge branch '80-no-records-message' into 'dev'

Resolve "Добавить сообщения на пустые страницы"

Closes #80

See merge request romanov73/ng-tracker!37
This commit is contained in:
Anton Romanov 2019-03-28 10:39:06 +00:00
commit 7269f45662
8 changed files with 27 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import ru.ulstu.deadline.model.Deadline;
import ru.ulstu.grant.model.Grant;
import ru.ulstu.grant.model.GrantDto;
import ru.ulstu.grant.service.GrantService;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.io.IOException;
@ -28,6 +29,7 @@ import static ru.ulstu.grant.controller.Navigation.hasErrors;
@Controller()
@RequestMapping(value = "/grants")
@ApiIgnore
public class GrantController {
private final GrantService grantService;

View File

@ -6,9 +6,11 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import ru.ulstu.core.controller.AdviceController;
import ru.ulstu.user.service.UserService;
import springfox.documentation.annotations.ApiIgnore;
@Controller()
@RequestMapping(value = "/index")
@ApiIgnore
public class IndexController extends AdviceController {
public IndexController(UserService userService) {
super(userService);

View File

@ -15,6 +15,7 @@ import ru.ulstu.paper.model.PaperDto;
import ru.ulstu.paper.model.PaperFilterDto;
import ru.ulstu.paper.service.PaperService;
import ru.ulstu.user.model.User;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.io.IOException;
@ -28,6 +29,7 @@ import static org.springframework.util.StringUtils.isEmpty;
@Controller()
@RequestMapping(value = "/papers")
@ApiIgnore
public class PaperController {
private final PaperService paperService;

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="headerfiles">
<meta charset="UTF-8"/>
</head>
<body>
<div th:fragment="noRecords(entities, noRecordsMessage, url)" class="col-12 text-center"
style="background-color: white;">
<div th:if="*{#lists.isEmpty(entities)}">
<div th:text="'Еще не создано ни'+${noRecordsMessage}"/>
<a th:href="@{${url}+'?id=0'}">
Перейдите по ссылке, чтобы добавить
</a>
</div>
</div>
</body>
</html>

View File

@ -17,6 +17,7 @@
<div th:replace="grants/fragments/grantDashboardFragment :: grantDashboard(grant=${grant})"/>
</th:block>
</div>
<div th:replace="fragments/noRecordsFragment :: noRecords(entities=${grants}, noRecordsMessage=' одного гранта', url='grant')"/>
</div>
</section>
</div>

View File

@ -24,6 +24,7 @@
</div>
<div class="col-md-3 col-sm-12">
</div>
<div th:replace="fragments/noRecordsFragment :: noRecords(entities=${grants}, noRecordsMessage=' одного гранта', url='grant')"/>
</div>
</div>
</section>

View File

@ -18,6 +18,7 @@
<div th:replace="papers/fragments/paperDashboardFragment :: paperDashboard(paper=${paper})"/>
</th:block>
</div>
<div th:replace="fragments/noRecordsFragment :: noRecords(entities=${papers}, noRecordsMessage=' одной статьи', url='paper')"/>
</div>
</section>
</div>

View File

@ -43,6 +43,7 @@
</div>
</div>
</div>
<div th:replace="fragments/noRecordsFragment :: noRecords(entities=${filteredPapers.papers}, noRecordsMessage=' одной статьи', url='paper')"/>
</div>
</section>