#55 added delete input style
This commit is contained in:
parent
34499abd60
commit
8cfc64ea85
@ -52,8 +52,9 @@ public class ConferenceController {
|
||||
@PostMapping(value = "/conference", params = "save")
|
||||
public String save(@Valid ConferenceDto conferenceDto, Errors errors) throws IOException {
|
||||
filterEmptyDeadlines(conferenceDto);
|
||||
if (errors.hasErrors())
|
||||
if (errors.hasErrors()) {
|
||||
return CONFERENCE_PAGE;
|
||||
}
|
||||
conferenceService.save(conferenceDto);
|
||||
return String.format(REDIRECT_TO, CONFERENCES_PAGE);
|
||||
|
||||
@ -62,8 +63,9 @@ public class ConferenceController {
|
||||
@PostMapping(value = "/conference", params = "addDeadline")
|
||||
public String addDeadline(@Valid ConferenceDto conferenceDto, Errors errors) {
|
||||
filterEmptyDeadlines(conferenceDto);
|
||||
if (errors.hasErrors())
|
||||
if (errors.hasErrors()) {
|
||||
return CONFERENCE_PAGE;
|
||||
}
|
||||
conferenceDto.getDeadlines().add(new Deadline());
|
||||
return CONFERENCE_PAGE;
|
||||
}
|
||||
@ -71,13 +73,10 @@ public class ConferenceController {
|
||||
@PostMapping(value = "/conference", params = "removeDeadline")
|
||||
public String removeDeadline(@Valid ConferenceDto conferenceDto, Errors errors,
|
||||
@RequestParam(value = "removeDeadline") Integer deadlineIndex) throws IOException {
|
||||
if (errors.hasErrors())
|
||||
if (errors.hasErrors()) {
|
||||
return CONFERENCE_PAGE;
|
||||
conferenceService.removeDeadline(conferenceDto, deadlineIndex);
|
||||
if (conferenceDto.getDeadlines().get(deadlineIndex).getId() != null) {
|
||||
conferenceDto.getRemovedDeadlineIds().add(conferenceDto.getDeadlines().get(deadlineIndex).getId());
|
||||
}
|
||||
conferenceDto.getDeadlines().remove(conferenceDto.getDeadlines().get(deadlineIndex));
|
||||
conferenceService.removeDeadline(conferenceDto, deadlineIndex);
|
||||
return CONFERENCE_PAGE;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,10 @@ public class ConferenceService {
|
||||
}
|
||||
|
||||
public void removeDeadline(ConferenceDto conferenceDto, Integer deadlineIndex) throws IOException {
|
||||
|
||||
if (conferenceDto.getDeadlines().get(deadlineIndex).getId() != null) {
|
||||
conferenceDto.getRemovedDeadlineIds().add(conferenceDto.getDeadlines().get(deadlineIndex).getId());
|
||||
}
|
||||
conferenceDto.getDeadlines().remove(conferenceDto.getDeadlines().get(deadlineIndex));
|
||||
}
|
||||
|
||||
private Conference copyFromDto(Conference conference, ConferenceDto conferenceDto) throws IOException {
|
||||
|
@ -19,6 +19,7 @@ body {
|
||||
.deadline {
|
||||
margin: 0;
|
||||
height: 40px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.deadline-text {
|
||||
@ -63,6 +64,9 @@ body {
|
||||
|
||||
.icon-delete {
|
||||
background-color: #f44;
|
||||
background-image: url(/img/conference/delete.png);
|
||||
background-repeat: round;
|
||||
color: transparent !important;
|
||||
}
|
||||
|
||||
.icon-delete:hover {
|
||||
|
Loading…
Reference in New Issue
Block a user