#76 adding style to filters

This commit is contained in:
ASH 2019-04-21 19:02:27 +04:00
parent 8400c5d40d
commit 6876d09557
3 changed files with 24 additions and 2 deletions

View File

@ -41,6 +41,15 @@ public class TaskController {
modelMap.put("filteredTasks", new TaskFilterDto(taskService.findAllDto(), null, null)); modelMap.put("filteredTasks", new TaskFilterDto(taskService.findAllDto(), null, null));
} }
@GetMapping("/task")
public void getTask(ModelMap modelMap, @RequestParam(value = "id") Integer id) {
if (id != null && id > 0) {
modelMap.put("taskDto", taskService.findOneDto(id));
} else {
modelMap.put("taskDto", new TaskDto());
}
}
@PostMapping("/tasks") @PostMapping("/tasks")
public void filterTasks(@Valid TaskFilterDto taskFilterDto, ModelMap modelMap) { public void filterTasks(@Valid TaskFilterDto taskFilterDto, ModelMap modelMap) {
modelMap.put("filteredTasks", new TaskFilterDto(taskService.filter(taskFilterDto), modelMap.put("filteredTasks", new TaskFilterDto(taskService.filter(taskFilterDto),

View File

@ -13,6 +13,17 @@
cursor: text; cursor: text;
} }
.filter .bootstrap-select{
margin-bottom: 10px;
}
.filter-option-inner-inner{
font-size: 12px;
text-transform: uppercase;
font-weight: normal;
line-height: 25px;
}
.input-tag-name { .input-tag-name {
border: none; border: none;
box-shadow: none; box-shadow: none;

View File

@ -27,7 +27,8 @@
<div class="col-md-3 col-sm-12"> <div class="col-md-3 col-sm-12">
<div class="filter"> <div class="filter">
<h5>Фильтр:</h5> <h5>Фильтр:</h5>
<select class="form-control" th:field="${filteredTasks.status}" id="status" <select class="form-control selectpicker" size="auto" th:field="${filteredTasks.status}"
id="status"
onchange="this.form.submit();"> onchange="this.form.submit();">
<option value="">Все статусы</option> <option value="">Все статусы</option>
<option th:each="status: ${allStatuses}" th:value="${status}" <option th:each="status: ${allStatuses}" th:value="${status}"
@ -35,7 +36,8 @@
status status
</option> </option>
</select> </select>
<select class="form-control" th:field="${filteredTasks.tag}" id="tags" <select class="form-control selectpicker" size="auto" data-live-search="true"
th:field="${filteredTasks.tag}" id="tags"
onchange="this.form.submit();"> onchange="this.form.submit();">
<option value="">Все теги</option> <option value="">Все теги</option>
<option th:each="tag: ${allTags}" th:value="${tag.id}" <option th:each="tag: ${allTags}" th:value="${tag.id}"