From f1f7c1f0f61fa211151d4a2a9b7a947c338a8eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B0=D1=81=D0=B8=D0=BD=20=D0=90=D0=BD=D1=82=D0=BE?= =?UTF-8?q?=D0=BD?= Date: Thu, 18 Apr 2019 16:49:10 +0300 Subject: [PATCH 01/33] #97 cancel button edited --- src/main/resources/templates/projects/project.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index 3d356a7..437927a 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -88,8 +88,8 @@ class="alert alert-danger">Incorrect title

- +
@@ -107,7 +107,9 @@ type="submit"> Сохранить -
From 9da227ab34ae7a8b9ab38843b645cd4618025f32 Mon Sep 17 00:00:00 2001 From: ASH Date: Thu, 18 Apr 2019 21:38:55 +0400 Subject: [PATCH 02/33] #76 fixing dashboard --- src/main/resources/templates/students/dashboard.html | 7 +++---- .../templates/students/fragments/taskStatusFragment.html | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/resources/templates/students/dashboard.html b/src/main/resources/templates/students/dashboard.html index 94ea121..78e749c 100644 --- a/src/main/resources/templates/students/dashboard.html +++ b/src/main/resources/templates/students/dashboard.html @@ -14,10 +14,9 @@
-
- - - + +
+
diff --git a/src/main/resources/templates/students/fragments/taskStatusFragment.html b/src/main/resources/templates/students/fragments/taskStatusFragment.html index 77fd529..d8ef4f4 100644 --- a/src/main/resources/templates/students/fragments/taskStatusFragment.html +++ b/src/main/resources/templates/students/fragments/taskStatusFragment.html @@ -6,9 +6,6 @@ - - -
From 59887e5141b343d578f9f391d9fb457c8180aa77 Mon Sep 17 00:00:00 2001 From: ASH Date: Thu, 18 Apr 2019 21:57:56 +0400 Subject: [PATCH 03/33] #76 delete function added --- .../java/ru/ulstu/students/controller/TaskController.java | 7 +++++++ src/main/java/ru/ulstu/students/service/TaskService.java | 6 ++++-- src/main/resources/public/js/tasks.js | 2 +- src/main/resources/templates/students/tasks.html | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/ru/ulstu/students/controller/TaskController.java b/src/main/java/ru/ulstu/students/controller/TaskController.java index 8fd9575..ef602e2 100644 --- a/src/main/java/ru/ulstu/students/controller/TaskController.java +++ b/src/main/java/ru/ulstu/students/controller/TaskController.java @@ -71,6 +71,13 @@ public class TaskController { return TASK_PAGE; } + @GetMapping("/delete/{task-id}") + public String delete(@PathVariable("task-id") Integer taskId) throws IOException { + taskService.delete(taskId); + return String.format(REDIRECT_TO, TASKS_PAGE); + } + + @ModelAttribute("allStatuses") public List getTaskStatuses() { return taskService.getTaskStatuses(); diff --git a/src/main/java/ru/ulstu/students/service/TaskService.java b/src/main/java/ru/ulstu/students/service/TaskService.java index 7b67a44..d400fa6 100644 --- a/src/main/java/ru/ulstu/students/service/TaskService.java +++ b/src/main/java/ru/ulstu/students/service/TaskService.java @@ -76,8 +76,10 @@ public class TaskService { @Transactional public void delete(Integer taskId) throws IOException { - Task task = taskRepository.findOne(taskId); - taskRepository.delete(task); + if (taskRepository.exists(taskId)) { + taskRepository.delete(taskId); + } + } public void save(TaskDto taskDto) throws IOException { diff --git a/src/main/resources/public/js/tasks.js b/src/main/resources/public/js/tasks.js index b333c31..f756199 100644 --- a/src/main/resources/public/js/tasks.js +++ b/src/main/resources/public/js/tasks.js @@ -90,7 +90,7 @@ $(document).ready(function () { '