Resolve "Прикрепление статьи" #181

Merged
VladimirZarayskiy merged 1 commits from 66-attach-exist-article into dev 2019-04-16 13:34:00 +04:00
4 changed files with 32 additions and 10 deletions

View File

@ -48,11 +48,12 @@ public class ConferenceController {
public void getConference(ModelMap modelMap, @RequestParam(value = "id") Integer id) {
if (id != null && id > 0) {
ConferenceDto conferenceDto = conferenceService.findOneDto(id);
conferenceDto.setNotSelectedPapers(getNotSelectPapers(conferenceDto.getPaperIds()));
modelMap.put("conferenceDto", conferenceDto);
modelMap.put("allPapers", getAllPapers(conferenceDto.getPaperIds()));
} else {
modelMap.put("conferenceDto", new ConferenceDto());
modelMap.put("allPapers", getAllPapers(new ArrayList<Integer>()));
ConferenceDto conferenceDto = new ConferenceDto();
conferenceDto.setNotSelectedPapers(getNotSelectPapers(new ArrayList<Integer>()));
modelMap.put("conferenceDto", conferenceDto);
}
}
@ -93,7 +94,7 @@ public class ConferenceController {
return CONFERENCE_PAGE;
}
public List<Paper> getAllPapers(List<Integer> paperIds) {
public List<Paper> getNotSelectPapers(List<Integer> paperIds) {
return conferenceService.getConferencePapers(paperIds);
}

View File

@ -41,6 +41,9 @@ public class ConferenceDto {
private Set<Integer> userIds = new HashSet<>();
private List<Integer> paperIds = new ArrayList<>();
private List<Paper> papers = new ArrayList<>();
private List<Paper> notSelectedPapers = new ArrayList<>();
private Set<UserDto> users = new HashSet<>();
private Integer filterUserId;
@ -59,7 +62,8 @@ public class ConferenceDto {
@JsonProperty("userIds") Set<Integer> userIds,
@JsonProperty("paperIds") List<Integer> paperIds,
@JsonProperty("users") Set<UserDto> users,
@JsonProperty("papers") List<Paper> papers) {
@JsonProperty("papers") List<Paper> papers,
@JsonProperty("notSelectedPapers") List<Paper> notSelectedPapers) {
this.id = id;
this.title = title;
this.description = description;
@ -72,6 +76,7 @@ public class ConferenceDto {
this.paperIds = paperIds;
this.users = users;
this.papers = papers;
this.notSelectedPapers = notSelectedPapers;
}
public ConferenceDto(Conference conference) {
@ -202,4 +207,12 @@ public class ConferenceDto {
this.removedDeadlineIds = removedDeadlineIds;
}
public List<Paper> getNotSelectedPapers() {
return notSelectedPapers;
}
public void setNotSelectedPapers(List<Paper> notSelectedPapers) {
this.notSelectedPapers = notSelectedPapers;
}
}

View File

@ -7,6 +7,10 @@ body {
border-radius: .25rem;
}
.filter-option-inner-inner {
color: white;
}
@ -49,6 +53,8 @@ body {
.paper {
margin: 0;
min-height: 40px;
height: 40px;
}
.paper-name {
@ -104,13 +110,14 @@ body {
float: right;
}
@media (max-width: 1199px) {
@media (max-width: 1199px) and (min-width: 768px){
.paper-control {
display: block!important;
}
}
@media (max-width: 991px) {
.dates-panel {
display: block!important;
}

View File

@ -62,7 +62,6 @@
<input type="submit" class="icon icon-delete grey-border"
alt="Удалить" name="removeDeadline" th:value="${rowStat.index}"
/>
<!--th:onclick="|$(this).parent().remove();|"-->
</div>
</div>
</div>
@ -136,6 +135,7 @@
<div class="form-group">
<label for="papers">Статьи:</label>
<div class="paper-list form-control list-group" id="papers">
<input th:type="hidden" th:field="*{papers}"/>
<div class="paper d-flex list-group-item p-0"
th:each="paper, rowStat : *{papers}">
<a class="paper-name"
@ -145,16 +145,17 @@
</span>
<img class="icon-paper" src="/img/conference/paper.png"/>
</a>
<img class="icon grey-border icon-delete" src="/img/conference/delete.png"
alt="Удалить"/>
<input type="submit" class="icon icon-delete grey-border"
alt="Удалить"/>
</div>
</div>
</div>
<div class="paper-control form-group d-flex justify-content-end">
<input th:type="hidden" th:field="*{notSelectedPapers}"/>
<select class="selectpicker form-control" multiple="true" data-live-search="true"
title="Прикрепить статью" data-style="btn-primary" data-size="5"
th:field="*{paperIds}">
<option th:each="paper: ${allPapers}" th:value="${paper.id}"
<option th:each="paper: *{notSelectedPapers}" th:value="${paper.id}"
th:text="${paper.title}">Status
</option>
</select>