From e3b248778c2e9ffd0ab716d79ba196c74c4a61b5 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 10 Nov 2018 21:43:52 +0400 Subject: [PATCH 01/25] add route --- src/main/java/ru/ulstu/configuration/MvcConfiguration.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ru/ulstu/configuration/MvcConfiguration.java b/src/main/java/ru/ulstu/configuration/MvcConfiguration.java index 14e6337..8543847 100644 --- a/src/main/java/ru/ulstu/configuration/MvcConfiguration.java +++ b/src/main/java/ru/ulstu/configuration/MvcConfiguration.java @@ -12,6 +12,7 @@ public class MvcConfiguration extends WebMvcConfigurerAdapter { registry.addViewController("/{articlename:\\w+}"); //registry.addViewController("/admin/{articlename:\\w+}"); registry.addViewController("/papers/{articlename:\\w+}"); + registry.addViewController("/grants/{articlename:\\w+}"); registry.addRedirectViewController("/", "/index"); registry.addRedirectViewController("/default", "/index"); } From 4da039f9b0952b19c323308265d114b320624aae Mon Sep 17 00:00:00 2001 From: T-Midnight Date: Sat, 10 Nov 2018 21:55:09 +0400 Subject: [PATCH 02/25] Create dashboard for grants --- .../resources/templates/grants/dashboard.html | 152 ++++++++++++++++++ src/main/resources/templates/index.html | 2 +- 2 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/templates/grants/dashboard.html diff --git a/src/main/resources/templates/grants/dashboard.html b/src/main/resources/templates/grants/dashboard.html new file mode 100644 index 0000000..7db3ef4 --- /dev/null +++ b/src/main/resources/templates/grants/dashboard.html @@ -0,0 +1,152 @@ + + + + + + +
+ +
+
+
+
+

Dashboard

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ + + + +
+
+ Название гранта +

Краткое описание

+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 155ec6a..0f83f3f 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -32,7 +32,7 @@
- +
" + + "'>" + (index+1) + ". " + paper.title + "
" + "
" + "" + "" + @@ -75,4 +75,25 @@ function getPaperStatusClass(status) { default: return ""; } +} + +function showPaperDashboard(dashboardElement) { + getFromRest(urlPapers, function (paperList) { + paperList.forEach(function (paper, index) { + $(dashboardElement).append("
" + + "
" + + "
" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "" + paper.title + "" + + "

" + paper.authorsString + "

" + + "
" + + "
" + + "
"); + }); + }); } \ No newline at end of file diff --git a/src/main/resources/templates/papers/dashboard.html b/src/main/resources/templates/papers/dashboard.html index b4e18d7..2549c17 100644 --- a/src/main/resources/templates/papers/dashboard.html +++ b/src/main/resources/templates/papers/dashboard.html @@ -15,137 +15,17 @@

Dashboard

-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
-
-
-
- - - - -
-
- Название статьи -

Список авторов И.О.

-
-
-
+
+
- + + From 112958a70b85f196014dbeeeda3e655b2acb0e7a Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 15:18:22 +0400 Subject: [PATCH 04/25] fix code --- .../ulstu/user/controller/UserController.java | 18 ++++++++++--- src/main/java/ru/ulstu/user/model/User.java | 9 ++++++- .../ru/ulstu/user/service/UserMapper.java | 13 +++++++--- .../ru/ulstu/user/service/UserService.java | 26 ++++++++++++++++--- .../user/service/UserSessionService.java | 2 +- 5 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/main/java/ru/ulstu/user/controller/UserController.java b/src/main/java/ru/ulstu/user/controller/UserController.java index f9f49e3..d7db909 100644 --- a/src/main/java/ru/ulstu/user/controller/UserController.java +++ b/src/main/java/ru/ulstu/user/controller/UserController.java @@ -3,7 +3,15 @@ package ru.ulstu.user.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.access.annotation.Secured; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import ru.ulstu.configuration.Constants; import ru.ulstu.core.model.response.PageableItems; import ru.ulstu.core.model.response.Response; @@ -11,10 +19,14 @@ import ru.ulstu.odin.controller.OdinController; import ru.ulstu.odin.model.OdinMetadata; import ru.ulstu.odin.model.OdinVoid; import ru.ulstu.odin.service.OdinService; -import ru.ulstu.user.model.*; +import ru.ulstu.user.model.UserDto; +import ru.ulstu.user.model.UserListDto; +import ru.ulstu.user.model.UserResetPasswordDto; +import ru.ulstu.user.model.UserRoleConstants; +import ru.ulstu.user.model.UserRoleDto; +import ru.ulstu.user.model.UserSessionListDto; import ru.ulstu.user.service.UserService; import ru.ulstu.user.service.UserSessionService; -import ru.ulstu.user.model.*; import javax.validation.Valid; diff --git a/src/main/java/ru/ulstu/user/model/User.java b/src/main/java/ru/ulstu/user/model/User.java index 8d5bce8..16a873b 100644 --- a/src/main/java/ru/ulstu/user/model/User.java +++ b/src/main/java/ru/ulstu/user/model/User.java @@ -5,7 +5,14 @@ import org.hibernate.validator.constraints.Email; import ru.ulstu.configuration.Constants; import ru.ulstu.core.model.BaseEntity; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; diff --git a/src/main/java/ru/ulstu/user/service/UserMapper.java b/src/main/java/ru/ulstu/user/service/UserMapper.java index 5607a26..7359bba 100644 --- a/src/main/java/ru/ulstu/user/service/UserMapper.java +++ b/src/main/java/ru/ulstu/user/service/UserMapper.java @@ -1,11 +1,18 @@ package ru.ulstu.user.service; import org.springframework.stereotype.Service; -import ru.ulstu.user.model.*; -import ru.ulstu.user.model.*; +import ru.ulstu.user.model.User; +import ru.ulstu.user.model.UserDto; +import ru.ulstu.user.model.UserListDto; +import ru.ulstu.user.model.UserRole; +import ru.ulstu.user.model.UserRoleDto; import ru.ulstu.user.repository.UserRoleRepository; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; @Service diff --git a/src/main/java/ru/ulstu/user/service/UserService.java b/src/main/java/ru/ulstu/user/service/UserService.java index e6fca9f..d8d29a5 100644 --- a/src/main/java/ru/ulstu/user/service/UserService.java +++ b/src/main/java/ru/ulstu/user/service/UserService.java @@ -16,13 +16,33 @@ import ru.ulstu.core.error.EntityIdIsNullException; import ru.ulstu.core.jpa.OffsetablePageRequest; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.core.model.response.PageableItems; -import ru.ulstu.user.error.*; -import ru.ulstu.user.model.*; +import ru.ulstu.user.error.UserActivationError; +import ru.ulstu.user.error.UserEmailExistsException; +import ru.ulstu.user.error.UserIdExistsException; +import ru.ulstu.user.error.UserIsUndeadException; +import ru.ulstu.user.error.UserLoginExistsException; +import ru.ulstu.user.error.UserNotActivatedException; +import ru.ulstu.user.error.UserNotFoundException; +import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException; +import ru.ulstu.user.error.UserResetKeyError; +import ru.ulstu.user.model.User; +import ru.ulstu.user.model.UserDto; +import ru.ulstu.user.model.UserListDto; +import ru.ulstu.user.model.UserResetPasswordDto; +import ru.ulstu.user.model.UserRole; +import ru.ulstu.user.model.UserRoleConstants; +import ru.ulstu.user.model.UserRoleDto; import ru.ulstu.user.repository.UserRepository; import ru.ulstu.user.repository.UserRoleRepository; import ru.ulstu.user.util.UserUtils; -import java.util.*; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; @Service diff --git a/src/main/java/ru/ulstu/user/service/UserSessionService.java b/src/main/java/ru/ulstu/user/service/UserSessionService.java index 36479a9..0d985cd 100644 --- a/src/main/java/ru/ulstu/user/service/UserSessionService.java +++ b/src/main/java/ru/ulstu/user/service/UserSessionService.java @@ -6,8 +6,8 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Sort; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import ru.ulstu.core.model.response.PageableItems; import ru.ulstu.core.jpa.OffsetablePageRequest; +import ru.ulstu.core.model.response.PageableItems; import ru.ulstu.user.error.UserNotFoundException; import ru.ulstu.user.model.User; import ru.ulstu.user.model.UserSession; From f587f80eb692458654bbcf622bf9b902febff68c Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 17:03:22 +0400 Subject: [PATCH 05/25] fix code --- .../core/controller/AdviceController.java | 11 ++++++-- .../ru/ulstu/odin/service/OdinService.java | 19 +++++++++++-- .../ru/ulstu/timeline/model/EventDto.java | 8 ++++-- .../ru/ulstu/timeline/model/PeriodEvent.java | 28 ++++++++++--------- 4 files changed, 46 insertions(+), 20 deletions(-) diff --git a/src/main/java/ru/ulstu/core/controller/AdviceController.java b/src/main/java/ru/ulstu/core/controller/AdviceController.java index 916359a..2fe853e 100644 --- a/src/main/java/ru/ulstu/core/controller/AdviceController.java +++ b/src/main/java/ru/ulstu/core/controller/AdviceController.java @@ -11,8 +11,15 @@ import ru.ulstu.core.error.EntityIdIsNullException; import ru.ulstu.core.model.ErrorConstants; import ru.ulstu.core.model.response.Response; import ru.ulstu.core.model.response.ResponseExtended; -import ru.ulstu.user.error.*; -import ru.ulstu.user.error.*; +import ru.ulstu.user.error.UserActivationError; +import ru.ulstu.user.error.UserEmailExistsException; +import ru.ulstu.user.error.UserIdExistsException; +import ru.ulstu.user.error.UserIsUndeadException; +import ru.ulstu.user.error.UserLoginExistsException; +import ru.ulstu.user.error.UserNotActivatedException; +import ru.ulstu.user.error.UserNotFoundException; +import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException; +import ru.ulstu.user.error.UserResetKeyError; import java.util.Set; import java.util.stream.Collectors; diff --git a/src/main/java/ru/ulstu/odin/service/OdinService.java b/src/main/java/ru/ulstu/odin/service/OdinService.java index 9de2426..d1c9081 100644 --- a/src/main/java/ru/ulstu/odin/service/OdinService.java +++ b/src/main/java/ru/ulstu/odin/service/OdinService.java @@ -5,12 +5,25 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import ru.ulstu.core.error.OdinException; -import ru.ulstu.odin.model.*; -import ru.ulstu.odin.model.*; +import ru.ulstu.odin.model.OdinBooleanField; +import ru.ulstu.odin.model.OdinCollectionField; +import ru.ulstu.odin.model.OdinDateField; +import ru.ulstu.odin.model.OdinDto; +import ru.ulstu.odin.model.OdinField; +import ru.ulstu.odin.model.OdinMetadata; +import ru.ulstu.odin.model.OdinNumericField; +import ru.ulstu.odin.model.OdinObjectField; +import ru.ulstu.odin.model.OdinStringField; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; @Service diff --git a/src/main/java/ru/ulstu/timeline/model/EventDto.java b/src/main/java/ru/ulstu/timeline/model/EventDto.java index 0ec07ea..9e70a9d 100644 --- a/src/main/java/ru/ulstu/timeline/model/EventDto.java +++ b/src/main/java/ru/ulstu/timeline/model/EventDto.java @@ -65,9 +65,13 @@ public class EventDto { return title; } - public PeriodEvent getPeriod() { return period; } + public PeriodEvent getPeriod() { + return period; + } - public Event.EventStatus getStatus() { return status; } + public Event.EventStatus getStatus() { + return status; + } public Date getCreateDate() { return createDate; diff --git a/src/main/java/ru/ulstu/timeline/model/PeriodEvent.java b/src/main/java/ru/ulstu/timeline/model/PeriodEvent.java index b5e73b8..c25528e 100644 --- a/src/main/java/ru/ulstu/timeline/model/PeriodEvent.java +++ b/src/main/java/ru/ulstu/timeline/model/PeriodEvent.java @@ -3,22 +3,24 @@ package ru.ulstu.timeline.model; import java.time.Period; public enum PeriodEvent { - EVERY_YEAR(Period.ofYears(1), "Каждый год"), - EVERY_MONTH(Period.ofMonths(1), "Каждый месяц"), - EVERY_WEEK(Period.ofWeeks(1), "Каждую неделю"), - EVERY_DAY(Period.ofDays(1), "Каждый день"); + EVERY_YEAR(Period.ofYears(1), "Каждый год"), + EVERY_MONTH(Period.ofMonths(1), "Каждый месяц"), + EVERY_WEEK(Period.ofWeeks(1), "Каждую неделю"), + EVERY_DAY(Period.ofDays(1), "Каждый день"); - private Period period; - private String message; + private Period period; + private String message; PeriodEvent(Period period, String message) { - this.period = period; - this.message = message; - } + this.period = period; + this.message = message; + } - public Period getPeriod() { return period; } + public Period getPeriod() { + return period; + } - public String getMessage() { - return message; - } + public String getMessage() { + return message; + } } From 863991953ce790f1d72b14e98a2ad459cea20e42 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 17:04:13 +0400 Subject: [PATCH 06/25] show paper status --- src/main/resources/public/js/papers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index 4523d4c..70b9f8b 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -12,7 +12,7 @@ function showPapers(papersElement, paperRowClass) { " " + " " + " " + (index+1) + ". " + paper.title + "" + + "'>" + (index + 1) + ". " + paper.title + "" + "
" + "" + "" + @@ -84,7 +84,7 @@ function showPaperDashboard(dashboardElement) { "
" + "
" + "" + - "" + + "" + "" + "" + "
" + From 74d9c5cd20c8f4ceef13617e8bbedec7114ec0f3 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 17:04:29 +0400 Subject: [PATCH 07/25] show toolbar buttons --- src/main/resources/templates/papers/papers.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/templates/papers/papers.html b/src/main/resources/templates/papers/papers.html index 1c5322a..3f440cd 100644 --- a/src/main/resources/templates/papers/papers.html +++ b/src/main/resources/templates/papers/papers.html @@ -14,10 +14,15 @@

Статьи

+ +
Добавить статью From ec9009be1041ffc70c3205c815bc101668e71b87 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 17:04:40 +0400 Subject: [PATCH 08/25] show toolbar buttons --- .../resources/templates/papers/dashboard.html | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/papers/dashboard.html b/src/main/resources/templates/papers/dashboard.html index 2549c17..5e6708f 100644 --- a/src/main/resources/templates/papers/dashboard.html +++ b/src/main/resources/templates/papers/dashboard.html @@ -10,9 +10,22 @@
-
-
-

Dashboard

+
From c774820d95d8ba3c8e96c55346c7a3b4d5f9008f Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 14 Nov 2018 17:14:56 +0400 Subject: [PATCH 09/25] fix build script for netbeans --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index a858707..d09505e 100644 --- a/build.gradle +++ b/build.gradle @@ -16,11 +16,14 @@ buildscript { group 'ru.ulstu' version '0.1.0-SNAPSHOT' +apply plugin: 'application' apply plugin: 'java' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' apply plugin: 'checkstyle' +mainClassName = 'ru.ulstu.NgTrackerApplication' + build.dependsOn checkstyleMain bootRun.dependsOn checkstyleMain From 2d78753b069dd4850375849d50dd0a15fc3451b0 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 17 Nov 2018 11:56:52 +0400 Subject: [PATCH 10/25] show events --- .../timeline/controller/EventController.java | 5 ++ .../timeline/repository/EventRepository.java | 2 +- .../ulstu/timeline/service/EventService.java | 4 + src/main/resources/public/js/timeline.js | 27 ++++++ src/main/resources/templates/timeline.html | 87 ++----------------- 5 files changed, 44 insertions(+), 81 deletions(-) create mode 100644 src/main/resources/public/js/timeline.js diff --git a/src/main/java/ru/ulstu/timeline/controller/EventController.java b/src/main/java/ru/ulstu/timeline/controller/EventController.java index b2e4a23..77cb118 100644 --- a/src/main/java/ru/ulstu/timeline/controller/EventController.java +++ b/src/main/java/ru/ulstu/timeline/controller/EventController.java @@ -34,6 +34,11 @@ public class EventController { return new Response<>(eventService.findAllDto()); } + @GetMapping("/future") + public Response> getFutureEvents() { + return new Response<>(eventService.findAllFutureDto()); + } + @PostMapping public Response createEvent(@RequestBody @Valid EventDto timelineDto) { return new Response(eventService.create(timelineDto)); diff --git a/src/main/java/ru/ulstu/timeline/repository/EventRepository.java b/src/main/java/ru/ulstu/timeline/repository/EventRepository.java index 2829261..4848e12 100644 --- a/src/main/java/ru/ulstu/timeline/repository/EventRepository.java +++ b/src/main/java/ru/ulstu/timeline/repository/EventRepository.java @@ -10,6 +10,6 @@ public interface EventRepository extends JpaRepository { @Query("SELECT e FROM Event e WHERE e.executeDate = CURRENT_DATE") List findByCurrentDate(); - @Query("SELECT e FROM Event e WHERE e.executeDate > CURRENT_DATE") + @Query("SELECT e FROM Event e WHERE e.executeDate > CURRENT_DATE ORDER BY e.executeDate") List findAllFuture(); } diff --git a/src/main/java/ru/ulstu/timeline/service/EventService.java b/src/main/java/ru/ulstu/timeline/service/EventService.java index 602e7aa..da32474 100644 --- a/src/main/java/ru/ulstu/timeline/service/EventService.java +++ b/src/main/java/ru/ulstu/timeline/service/EventService.java @@ -90,4 +90,8 @@ public class EventService { public List findAllFuture() { return eventRepository.findAllFuture(); } + + public List findAllFutureDto() { + return convert(findAllFuture(), EventDto::new); + } } diff --git a/src/main/resources/public/js/timeline.js b/src/main/resources/public/js/timeline.js new file mode 100644 index 0000000..6f2b52f --- /dev/null +++ b/src/main/resources/public/js/timeline.js @@ -0,0 +1,27 @@ +var urlTimeline = "/api/1.0/events/future"; + +function showTimeline(timelineElement) { + $(timelineElement).empty(); + getFromRest(urlTimeline, function (eventList) { + eventList.forEach(function (event, index) { + var date = new Date(event.executeDate); + var formated_date = date.toLocaleDateString(); + + $(timelineElement).append("
  • " + + "


    " + formated_date + "

    " + + "
    " + + "
    " + + "

    " + event.title + "

    " + + "
    " + + "
    " + + "

    " + event.description + "

    " + + "
    " + + "
    " + + "
  • "); + }); + }); +} + +function eventInverted(index) { + return index % 2 == 1 ? "timeline-inverted" : ""; +} \ No newline at end of file diff --git a/src/main/resources/templates/timeline.html b/src/main/resources/templates/timeline.html index 1109686..5eda9f3 100644 --- a/src/main/resources/templates/timeline.html +++ b/src/main/resources/templates/timeline.html @@ -17,94 +17,21 @@
      -
    • -
      -

      -
      - 02.07.2018 -

      -
      -
      -
      -

      Уход в отпуск

      -
      -
      -

      Наконец-то!

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      March 2011

      -

      An Agency is Born

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt - ut - voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae - sit - vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      December 2012

      -

      Transition to Full Service

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt - ut - voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae - sit - vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

      -
      -
      -
    • -
    • -
      - -
      -
      -
      -

      July 2014

      -

      Phase Two Expansion

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sunt - ut - voluptatum eius sapiente, totam reiciendis temporibus qui quibusdam, recusandae - sit - vero unde, sed, incidunt et ea quo dolore laudantium consectetur!

      -
      -
      -
    • -
    • -
      -

      Be Part -
      Of Our -
      Story!

      -
      -
    • +
    - - - + +
    From 9a0fa5a1705547a0d722ebd35f6fa9f3bb3b6146 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sat, 17 Nov 2018 12:31:22 +0400 Subject: [PATCH 11/25] fix delete button --- src/main/resources/public/js/papers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index 70b9f8b..bd0c116 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -6,14 +6,14 @@ function showPapers(papersElement, paperRowClass) { getFromRest(urlPapers, function (paperList) { paperList.forEach(function (paper, index) { $(papersElement).parent().append("
    " + - "
    " + + "
    " + " \n" + " " + " " + " " + " " + (index + 1) + ". " + paper.title + "
    " + - "
    " + + "
    " + "" + "" + "
    "); From 6adc96761b6a0d7c2b1d3878314030e7d37a9d52 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Sun, 18 Nov 2018 14:29:41 +0400 Subject: [PATCH 12/25] fix delete button --- src/main/resources/public/js/papers.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index bd0c116..3ed6d6e 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -6,17 +6,16 @@ function showPapers(papersElement, paperRowClass) { getFromRest(urlPapers, function (paperList) { paperList.forEach(function (paper, index) { $(papersElement).parent().append("
    " + - "
    " + + "
    " + " \n" + " " + " " + " " + " " + (index + 1) + ". " + paper.title + "
    " + - "
    " + - "" + + "'>" + (index + 1) + ". " + paper.title + "" + + "" + "" + - "
    "); + "
    "); }); $(paperRowClass).mouseenter(function (event) { From 2dc0b4e27c8476f0d8ddbf5af92c55732273ecf8 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 19 Nov 2018 07:46:02 +0400 Subject: [PATCH 13/25] fix event create conditions --- src/main/java/ru/ulstu/timeline/service/EventScheduler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/ulstu/timeline/service/EventScheduler.java b/src/main/java/ru/ulstu/timeline/service/EventScheduler.java index 7a0bc66..6df7fcb 100644 --- a/src/main/java/ru/ulstu/timeline/service/EventScheduler.java +++ b/src/main/java/ru/ulstu/timeline/service/EventScheduler.java @@ -40,7 +40,8 @@ public class EventScheduler { @Scheduled(cron = "0 0 * * * ?") public void checkPeriodEvents() { log.debug("EventScheduler.checkPeriodEvents started"); - for (Event event : eventService.findAllFuture()) { + //TODO: filter + for (Event event : eventService.findAll()) { if (halfOfThePeriodHasPassed(event)) { eventService.createBasedOn(event, DateUtils.addDays(event.getExecuteDate(), getShiftInDays(event.getPeriod()))); } @@ -67,6 +68,6 @@ public class EventScheduler { private boolean halfOfThePeriodHasPassed(Event event) { return event.getPeriod() != null && event.getChild() == null && new Date().after( - DateUtils.addDays(event.getExecuteDate(), (int) -Math.round((double) getShiftInDays(event.getPeriod()) / 2))); + DateUtils.addDays(event.getExecuteDate(), (int) Math.round((double) getShiftInDays(event.getPeriod()) / 2))); } } From 58299d749dc600b3dc64a67acfae1c19a8b44749 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Mon, 19 Nov 2018 08:21:22 +0400 Subject: [PATCH 14/25] fix for remove event --- src/main/java/ru/ulstu/timeline/model/Event.java | 13 +++++++++++++ .../ru/ulstu/timeline/service/EventService.java | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/ulstu/timeline/model/Event.java b/src/main/java/ru/ulstu/timeline/model/Event.java index 7ae715d..290f136 100644 --- a/src/main/java/ru/ulstu/timeline/model/Event.java +++ b/src/main/java/ru/ulstu/timeline/model/Event.java @@ -4,6 +4,7 @@ import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; import ru.ulstu.user.model.User; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -66,6 +67,10 @@ public class Event extends BaseEntity { @JoinColumn(name = "child_id") private Event child; + @OneToMany(cascade = CascadeType.ALL) + @JoinColumn(name = "child_id") + private List parents; + public String getTitle() { return title; } @@ -137,4 +142,12 @@ public class Event extends BaseEntity { public void setChild(Event child) { this.child = child; } + + public List getParents() { + return parents; + } + + public void setParents(List parents) { + this.parents = parents; + } } diff --git a/src/main/java/ru/ulstu/timeline/service/EventService.java b/src/main/java/ru/ulstu/timeline/service/EventService.java index da32474..ca95b9a 100644 --- a/src/main/java/ru/ulstu/timeline/service/EventService.java +++ b/src/main/java/ru/ulstu/timeline/service/EventService.java @@ -57,8 +57,9 @@ public class EventService { } @Transactional - public void delete(Integer timelineId) { - Event event = eventRepository.findOne(timelineId); + public void delete(Integer eventId) { + Event event = eventRepository.findOne(eventId); + event.setParents(null); eventRepository.delete(event); } From d13644d67dd2c2b158e9324cba168fef37694b65 Mon Sep 17 00:00:00 2001 From: T-Midnight Date: Mon, 19 Nov 2018 12:16:39 +0400 Subject: [PATCH 15/25] Update dashboard for grants --- .../resources/templates/grants/dashboard.html | 131 ++++++++++-------- 1 file changed, 71 insertions(+), 60 deletions(-) diff --git a/src/main/resources/templates/grants/dashboard.html b/src/main/resources/templates/grants/dashboard.html index 7db3ef4..3a1570b 100644 --- a/src/main/resources/templates/grants/dashboard.html +++ b/src/main/resources/templates/grants/dashboard.html @@ -19,70 +19,77 @@
    - - - - -
    -
    - Название гранта -

    Краткое описание

    -
    -
    -
    -
    -
    -
    - - - - -
    -
    - Название гранта -

    Краткое описание

    -
    -
    -
    -
    -
    -
    - - - - -
    -
    - Название гранта -

    Краткое описание

    -
    -
    -
    -
    -
    -
    - - - - -
    -
    - Название гранта -

    Краткое описание

    -
    -
    -
    -
    -
    -
    - - - - + + + + +
    + +
    + Название гранта +

    Краткое описание

    +

    Статус: статус

    +
    + +
    +
    +
    +
    +
    + + + +
    Название гранта

    Краткое описание

    +

    Статус: статус

    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + Название гранта +

    Краткое описание

    +

    Статус: статус

    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + Название гранта +

    Краткое описание

    +

    Статус: статус

    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + Название гранта +

    Краткое описание

    +

    Статус: статус

    @@ -97,6 +104,7 @@
    Название гранта

    Краткое описание

    +

    Статус: статус

    @@ -111,6 +119,7 @@
    Название гранта

    Краткое описание

    +

    Статус: статус

    @@ -125,6 +134,7 @@
    Название гранта

    Краткое описание

    +

    Статус: статус

    @@ -139,6 +149,7 @@
    Название гранта

    Краткое описание

    +

    Статус: статус

    From 6314ca6ec56079762c0b1390aa94b51458a0a988 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 21 Nov 2018 12:46:27 +0400 Subject: [PATCH 16/25] notify if paper deadline in future --- .../java/ru/ulstu/paper/service/PaperNotificationService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java index 736ae87..05f9c2a 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java @@ -31,7 +31,8 @@ public class PaperNotificationService { private boolean needToSendDeadlineNotification(Paper paper, Date compareDate, boolean isDeadlineBeforeWeek) { return (paper.getDeadlineDate() != null) && (compareDate.after(paper.getDeadlineDate()) && isDeadlineBeforeWeek - || compareDate.before(paper.getDeadlineDate()) && !isDeadlineBeforeWeek); + || compareDate.before(paper.getDeadlineDate()) && !isDeadlineBeforeWeek) + && paper.getDeadlineDate().after(new Date()); } private void sendMessageDeadline(Paper paper) { From f6647d67525d00e4d98b7bc43265f387a7eb8812 Mon Sep 17 00:00:00 2001 From: T-Midnight Date: Wed, 21 Nov 2018 15:28:41 +0400 Subject: [PATCH 17/25] Create grant page --- .../resources/templates/grants/grant.html | 187 ++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 src/main/resources/templates/grants/grant.html diff --git a/src/main/resources/templates/grants/grant.html b/src/main/resources/templates/grants/grant.html new file mode 100644 index 0000000..52be346 --- /dev/null +++ b/src/main/resources/templates/grants/grant.html @@ -0,0 +1,187 @@ + + + + + + + +
    + +
    +
    +
    +
    +

    Редактирование гранта

    +
    +
    +
    +
    +
    +
    +
    +
    + + +

    +
    + +
    + + +
    + +
    + + +
    +
    + + +
    +
    + +
    + +
    +
    +
    + +

    Добавить статью

    +
    + +
    + +

    Добавить проект

    +
    +
    + +

    Добавить показатель

    +
    +
    + +

    Добавить показатель

    +
    +
    + + +
    +

    Редактировать + участников гранта

    + +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    + + + +
    + + From 29586c9313f3bbbd21fa05d383e4479753db3166 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 21 Nov 2018 15:40:20 +0400 Subject: [PATCH 18/25] close failed papers --- src/main/java/ru/ulstu/paper/model/Paper.java | 6 ++++- .../service/PaperNotificationService.java | 7 ++++++ ...lineScheduler.java => PaperScheduler.java} | 23 +++++++++++------- .../ru/ulstu/paper/service/PaperService.java | 24 +++++++++++++++++-- .../paperFailedNotification.html | 22 +++++++++++++++++ 5 files changed, 71 insertions(+), 11 deletions(-) rename src/main/java/ru/ulstu/paper/service/{DeadlineScheduler.java => PaperScheduler.java} (55%) create mode 100644 src/main/resources/mail_templates/paperFailedNotification.html diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index e9cc92c..b7511d6 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -23,7 +23,11 @@ import java.util.Set; @Entity public class Paper extends BaseEntity implements UserContainer { public enum PaperStatus { - ATTENTION("Обратить внимание"), ON_PREPARATION("На подготовке"), DRAFT("Черновик"), COMPLETED("Завершена"); + ATTENTION("Обратить внимание"), + ON_PREPARATION("На подготовке"), + DRAFT("Черновик"), + COMPLETED("Завершена"), + FAILED("Провалены сроки"); private String name; diff --git a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java index 05f9c2a..99e0c86 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperNotificationService.java @@ -55,4 +55,11 @@ public class PaperNotificationService { mailService.sendEmailFromTemplate(variables, author, "paperStatusChangeNotification", "Изменился статус статьи"); }); } + + public void sendFailedNotification(Paper paper, Paper.PaperStatus oldStatus) { + Map variables = ImmutableMap.of("paper", paper, "oldStatus", oldStatus); + paper.getAuthors().forEach(author -> { + mailService.sendEmailFromTemplate(variables, author, "paperFailedNotification", "Статья провалена"); + }); + } } diff --git a/src/main/java/ru/ulstu/paper/service/DeadlineScheduler.java b/src/main/java/ru/ulstu/paper/service/PaperScheduler.java similarity index 55% rename from src/main/java/ru/ulstu/paper/service/DeadlineScheduler.java rename to src/main/java/ru/ulstu/paper/service/PaperScheduler.java index d6d9852..ed035d9 100644 --- a/src/main/java/ru/ulstu/paper/service/DeadlineScheduler.java +++ b/src/main/java/ru/ulstu/paper/service/PaperScheduler.java @@ -6,16 +6,16 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; @Service -public class DeadlineScheduler { +public class PaperScheduler { private final static boolean IS_DEADLINE_NOTIFICATION_BEFORE_WEEK = true; - private final Logger log = LoggerFactory.getLogger(DeadlineScheduler.class); + private final Logger log = LoggerFactory.getLogger(PaperScheduler.class); private final PaperNotificationService paperNotificationService; private final PaperService paperService; - public DeadlineScheduler(PaperNotificationService paperNotificationService, - PaperService paperService) { + public PaperScheduler(PaperNotificationService paperNotificationService, + PaperService paperService) { this.paperNotificationService = paperNotificationService; this.paperService = paperService; } @@ -23,15 +23,22 @@ public class DeadlineScheduler { @Scheduled(cron = "0 0 8 * 1 ?") public void checkDeadlineBeforeWeek() { - log.debug("DeadlineScheduler.checkDeadlineBeforeWeek started"); + log.debug("PaperScheduler.checkDeadlineBeforeWeek started"); paperNotificationService.sendDeadlineNotifications(paperService.findAll(), !IS_DEADLINE_NOTIFICATION_BEFORE_WEEK); - log.debug("DeadlineScheduler.checkDeadlineBeforeWeek finished"); + log.debug("PaperScheduler.checkDeadlineBeforeWeek finished"); } @Scheduled(cron = "0 0 8 * * ?") public void checkDeadlineAfterWeek() { - log.debug("DeadlineScheduler.checkDeadlineAfterWeek started"); + log.debug("PaperScheduler.checkDeadlineAfterWeek started"); paperNotificationService.sendDeadlineNotifications(paperService.findAll(), IS_DEADLINE_NOTIFICATION_BEFORE_WEEK); - log.debug("DeadlineScheduler.checkDeadlineAfterWeek finished"); + log.debug("PaperScheduler.checkDeadlineAfterWeek finished"); + } + + @Scheduled(cron = "0 0 6 * * ?") + public void closeFailedPapers() { + log.debug("PaperScheduler.closeFailedPapers started"); + paperService.closeFailedPapers(); + log.debug("PaperScheduler.closeFailedPapers finished"); } } diff --git a/src/main/java/ru/ulstu/paper/service/PaperService.java b/src/main/java/ru/ulstu/paper/service/PaperService.java index a75592b..0e1abbc 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperService.java @@ -18,6 +18,9 @@ import java.util.List; import java.util.stream.Collectors; import static ru.ulstu.core.util.StreamApiUtils.convert; +import static ru.ulstu.paper.model.Paper.PaperStatus.ATTENTION; +import static ru.ulstu.paper.model.Paper.PaperStatus.DRAFT; +import static ru.ulstu.paper.model.Paper.PaperStatus.ON_PREPARATION; @Service public class PaperService { @@ -65,7 +68,7 @@ public class PaperService { paper.setComment(paperDto.getComment()); paper.setCreateDate(paper.getCreateDate() == null ? new Date() : paper.getCreateDate()); paper.setLocked(paperDto.getLocked()); - paper.setStatus(paperDto.getStatus() == null ? Paper.PaperStatus.DRAFT : paperDto.getStatus()); + paper.setStatus(paperDto.getStatus() == null ? DRAFT : paperDto.getStatus()); paper.setTitle(paperDto.getTitle()); paper.setUpdateDate(new Date()); paper.setDeadlineDate(paperDto.getDeadlineDate()); @@ -115,7 +118,7 @@ public class PaperService { paper.setDeadlineDate(deadlineDate); paper.setCreateDate(new Date()); paper.setUpdateDate(new Date()); - paper.setStatus(Paper.PaperStatus.DRAFT); + paper.setStatus(DRAFT); paper = paperRepository.save(paper); paperNotificationService.sendCreateNotification(paper); @@ -126,4 +129,21 @@ public class PaperService { public List filter(PaperFilterDto filterDto) { return convert(paperRepository.filter(userService.findById(filterDto.getAuthorId()), filterDto.getYear()), PaperDto::new); } + + public void closeFailedPapers() { + List papers = paperRepository.findAll() + .stream() + .filter(paper -> paper.getDeadlineDate() != null + && (paper.getStatus() == ON_PREPARATION + || paper.getStatus() == DRAFT + || paper.getStatus() == ATTENTION) + && paper.getDeadlineDate().before(new Date())) + .collect(Collectors.toList()); + papers.forEach(paper -> { + Paper.PaperStatus oldStatus = paper.getStatus(); + paper.setStatus(Paper.PaperStatus.FAILED); + paperRepository.save(paper); + paperNotificationService.sendFailedNotification(paper, oldStatus); + }); + } } diff --git a/src/main/resources/mail_templates/paperFailedNotification.html b/src/main/resources/mail_templates/paperFailedNotification.html new file mode 100644 index 0000000..cacc7e9 --- /dev/null +++ b/src/main/resources/mail_templates/paperFailedNotification.html @@ -0,0 +1,22 @@ + + + + Уведомление о провале статьи + + + + +

    + Уважаемый(ая) Ivan Ivanov +

    +

    + Статья "Title" провалена. + Предыдущий статус - "oldStatus". +

    +

    + Regards, +
    + NG-tracker. +

    + + From 161fab55de6da1fd6d94ce972778a619faaf09ce Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 21 Nov 2018 15:47:14 +0400 Subject: [PATCH 19/25] add toolbar --- src/main/resources/templates/grants/dashboard.html | 14 ++++++++++++++ src/main/resources/templates/grants/grant.html | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/main/resources/templates/grants/dashboard.html b/src/main/resources/templates/grants/dashboard.html index 3a1570b..afadb51 100644 --- a/src/main/resources/templates/grants/dashboard.html +++ b/src/main/resources/templates/grants/dashboard.html @@ -13,6 +13,20 @@
    diff --git a/src/main/resources/templates/grants/grant.html b/src/main/resources/templates/grants/grant.html index 52be346..a77b856 100644 --- a/src/main/resources/templates/grants/grant.html +++ b/src/main/resources/templates/grants/grant.html @@ -14,6 +14,20 @@

    Редактирование гранта

    +
    From 724dd6a78a46fbb2f993b965db6a88799094373c Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 21 Nov 2018 15:47:26 +0400 Subject: [PATCH 20/25] remove empty page --- .../resources/templates/papers/myPaper.html | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/main/resources/templates/papers/myPaper.html diff --git a/src/main/resources/templates/papers/myPaper.html b/src/main/resources/templates/papers/myPaper.html deleted file mode 100644 index 14fc771..0000000 --- a/src/main/resources/templates/papers/myPaper.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
    -
    -
    -
    -
    -

    Пустая страница

    -
    -
    -
    -
    -
    - - - From ccd07305ecf78366ba60c2332cf9307c3413ff4c Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 22 Nov 2018 11:19:50 +0400 Subject: [PATCH 21/25] add mertica --- src/main/resources/templates/default.html | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main/resources/templates/default.html b/src/main/resources/templates/default.html index 33884bf..b261b2f 100644 --- a/src/main/resources/templates/default.html +++ b/src/main/resources/templates/default.html @@ -91,6 +91,34 @@ + + + + From 4163276da3f1a57a623e07393f2a746a4faea368 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 22 Nov 2018 21:06:58 +0400 Subject: [PATCH 22/25] add paper status --- src/main/java/ru/ulstu/paper/model/Paper.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index b7511d6..c2a7f31 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -25,6 +25,7 @@ public class Paper extends BaseEntity implements UserContainer { public enum PaperStatus { ATTENTION("Обратить внимание"), ON_PREPARATION("На подготовке"), + ON_REVIEW("На проверке"), DRAFT("Черновик"), COMPLETED("Завершена"), FAILED("Провалены сроки"); From 7f1fb168e1a95d0596b0f8fc6c219ffcb6a51749 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 22 Nov 2018 21:31:41 +0400 Subject: [PATCH 23/25] fix colors --- src/main/resources/public/css/agency.css | 8 ++++++-- src/main/resources/public/js/papers.js | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/public/css/agency.css b/src/main/resources/public/css/agency.css index a754bc3..80102ba 100644 --- a/src/main/resources/public/css/agency.css +++ b/src/main/resources/public/css/agency.css @@ -20,17 +20,21 @@ a:hover { } .text-primary { - color: #fed136 !important; + color: #29c0ff !important; } .text-warning { - color: #fe4819 !important; + color: red !important; } .text-success { color: #00fe8e !important; } +.text-failed { + color: #A38831 !important; +} + h1, h2, h3, diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index 3ed6d6e..e6d1c5d 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -70,7 +70,9 @@ function getPaperStatusClass(status) { case 'COMPLETED': return "text-success"; case 'ATTENTION': - return "text-warning"; + return "text-warning"; + case 'FAILED': + return "text-failed"; default: return ""; } From e84e5423099451b50b03b0b45d9f6dfd4f07cbf5 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 22 Nov 2018 21:48:36 +0400 Subject: [PATCH 24/25] fix colors --- src/main/resources/public/js/papers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index e6d1c5d..e8cc7ed 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -67,10 +67,12 @@ function getPaperStatusClass(status) { return "text-draft" case 'ON_PREPARATION': return "text-primary"; + case 'ON_REVIEW': + return "text-primary"; case 'COMPLETED': return "text-success"; case 'ATTENTION': - return "text-warning"; + return "text-warning"; case 'FAILED': return "text-failed"; default: From 5eff1bac819190e6f2caf8ce67c179f785bbabdb Mon Sep 17 00:00:00 2001 From: Alyona Date: Fri, 23 Nov 2018 14:10:36 +0400 Subject: [PATCH 25/25] =?UTF-8?q?Merge=20branch=20'master'=20of=20C:\Users?= =?UTF-8?q?\=D0=BA=D0=B0=D1=82=D1=8F\IdeaProjects\ng-tracker=20with=20conf?= =?UTF-8?q?licts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/public/js/papers.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/resources/public/js/papers.js b/src/main/resources/public/js/papers.js index 3b78d8a..a06198e 100644 --- a/src/main/resources/public/js/papers.js +++ b/src/main/resources/public/js/papers.js @@ -62,6 +62,16 @@ function addPaper(title, status, comment, locked) { }); } +function filterPaper(authorId, year) { + var paperData = JSON.stringify({ + "authors": title, + "": status + }); + postToRest(urlPapers, paperData, function (data) { + alert(data); + }); +} + function getPaperStatusClass(status) { switch (status) { case 'DRAFT':