diff --git a/src/main/java/ru/ulstu/grant/model/GrantDto.java b/src/main/java/ru/ulstu/grant/model/GrantDto.java index 9ad9d21..aa8634b 100644 --- a/src/main/java/ru/ulstu/grant/model/GrantDto.java +++ b/src/main/java/ru/ulstu/grant/model/GrantDto.java @@ -30,8 +30,8 @@ public class GrantDto { private Set authors; private Integer leaderId; private boolean wasLeader; - private boolean birthDate; - private boolean degree; + private boolean hasAge; + private boolean hasDegree; public GrantDto() { deadlines.add(new Deadline()); @@ -48,8 +48,8 @@ public class GrantDto { @JsonProperty("authors") Set authors, @JsonProperty("leader") Integer leaderId, @JsonProperty("wasLeader") boolean wasLeader, - @JsonProperty("birthDate") boolean birthDate, - @JsonProperty("degree") boolean degree) { + @JsonProperty("hasAge") boolean hasAge, + @JsonProperty("hasDegree") boolean hasDegree) { this.id = id; this.title = title; this.status = status; @@ -60,8 +60,8 @@ public class GrantDto { this.authors = authors; this.leaderId = leaderId; this.wasLeader = wasLeader; - this.birthDate = birthDate; - this.degree = degree; + this.hasAge = hasAge; + this.hasDegree = hasDegree; } public GrantDto(Grant grant) { @@ -76,8 +76,8 @@ public class GrantDto { this.authors = convert(grant.getAuthors(), UserDto::new); this.leaderId = grant.getLeader().getId(); this.wasLeader = false; - this.birthDate = false; - this.degree = false; + this.hasAge = false; + this.hasDegree = false; } public Integer getId() { @@ -175,19 +175,19 @@ public class GrantDto { this.wasLeader = wasLeader; } - public boolean isBirthDate() { - return birthDate; + public boolean isHasAge() { + return hasAge; } - public void setBirthDate(boolean birthDate) { - this.birthDate = birthDate; + public void setHasAge(boolean hasAge) { + this.hasAge = hasAge; } - public boolean isDegree() { - return degree; + public boolean isHasDegree() { + return hasDegree; } - public void setDegree(boolean degree) { - this.degree = degree; + public void setHasDegree(boolean hasDegree) { + this.hasDegree = hasDegree; } } diff --git a/src/main/java/ru/ulstu/grant/service/GrantService.java b/src/main/java/ru/ulstu/grant/service/GrantService.java index 98b95c3..8427da3 100644 --- a/src/main/java/ru/ulstu/grant/service/GrantService.java +++ b/src/main/java/ru/ulstu/grant/service/GrantService.java @@ -140,7 +140,7 @@ public class GrantService { } public List getGrantAuthors(GrantDto grantDto) { - List filteredUsers = userService.filterByAgeAndDegree(grantDto.isBirthDate(), grantDto.isDegree()); + List filteredUsers = userService.filterByAgeAndDegree(grantDto.isHasAge(), grantDto.isHasDegree()); if (grantDto.isWasLeader()) { filteredUsers = filteredUsers .stream() diff --git a/src/main/resources/templates/grants/grant.html b/src/main/resources/templates/grants/grant.html index 91a9c6d..86dbde1 100644 --- a/src/main/resources/templates/grants/grant.html +++ b/src/main/resources/templates/grants/grant.html @@ -87,7 +87,7 @@ aria-expanded="false" aria-controls="collapse-filter">Фильтр рабочей группы -
@@ -97,14 +97,14 @@
+ th:field="*{hasAge}" th:onclick="|$('#filter').click();|"/>
+ th:field="*{hasDegree}" th:onclick="|$('#filter').click();|"/>