diff --git a/src/main/java/ru/ulstu/conference/model/Conference.java b/src/main/java/ru/ulstu/conference/model/Conference.java index 4df1a1f..0c3972d 100644 --- a/src/main/java/ru/ulstu/conference/model/Conference.java +++ b/src/main/java/ru/ulstu/conference/model/Conference.java @@ -5,8 +5,10 @@ import org.hibernate.annotations.FetchMode; import org.hibernate.validator.constraints.NotBlank; import org.springframework.format.annotation.DateTimeFormat; import ru.ulstu.core.model.BaseEntity; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.paper.model.Paper; +import ru.ulstu.user.model.User; import javax.persistence.CascadeType; import javax.persistence.Column; @@ -25,10 +27,12 @@ import java.util.Comparator; import java.util.Date; import java.util.List; import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; @Entity @Table(name = "conference") -public class Conference extends BaseEntity { +public class Conference extends BaseEntity implements UserActivity { @NotBlank private String title; @@ -147,4 +151,9 @@ public class Conference extends BaseEntity { .filter(d -> d.getDate().after(new Date())) .findFirst(); } + + @Override + public Set getActivityUsers() { + return getUsers().stream().map(ConferenceUser::getUser).collect(Collectors.toSet()); + } } diff --git a/src/main/java/ru/ulstu/core/model/UserContainer.java b/src/main/java/ru/ulstu/core/model/UserActivity.java similarity index 50% rename from src/main/java/ru/ulstu/core/model/UserContainer.java rename to src/main/java/ru/ulstu/core/model/UserActivity.java index 7f83cd3..8e4e270 100644 --- a/src/main/java/ru/ulstu/core/model/UserContainer.java +++ b/src/main/java/ru/ulstu/core/model/UserActivity.java @@ -4,6 +4,7 @@ import ru.ulstu.user.model.User; import java.util.Set; -public interface UserContainer { - Set getUsers(); +public interface UserActivity { + String getTitle(); + Set getActivityUsers(); } diff --git a/src/main/java/ru/ulstu/grant/model/Grant.java b/src/main/java/ru/ulstu/grant/model/Grant.java index 369568f..a653772 100644 --- a/src/main/java/ru/ulstu/grant/model/Grant.java +++ b/src/main/java/ru/ulstu/grant/model/Grant.java @@ -4,7 +4,7 @@ import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; -import ru.ulstu.core.model.UserContainer; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.file.model.FileData; import ru.ulstu.paper.model.Paper; @@ -35,7 +35,7 @@ import java.util.Set; @Entity @Table(name = "grants") -public class Grant extends BaseEntity implements UserContainer { +public class Grant extends BaseEntity implements UserActivity { public enum GrantStatus { APPLICATION("Заявка"), ON_COMPETITION("Отправлен на конкурс"), @@ -155,7 +155,7 @@ public class Grant extends BaseEntity implements UserContainer { } @Override - public Set getUsers() { + public Set getActivityUsers() { return getAuthors(); } diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index 413c5db..5d951a5 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -5,7 +5,7 @@ import org.hibernate.annotations.FetchMode; import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.conference.model.Conference; import ru.ulstu.core.model.BaseEntity; -import ru.ulstu.core.model.UserContainer; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.file.model.FileData; import ru.ulstu.grant.model.Grant; @@ -34,7 +34,7 @@ import java.util.Optional; import java.util.Set; @Entity -public class Paper extends BaseEntity implements UserContainer { +public class Paper extends BaseEntity implements UserActivity { public enum PaperStatus { ATTENTION("Обратить внимание"), ON_PREPARATION("На подготовке"), @@ -249,7 +249,7 @@ public class Paper extends BaseEntity implements UserContainer { } @Override - public Set getUsers() { + public Set getActivityUsers() { return getAuthors(); } diff --git a/src/main/java/ru/ulstu/paper/service/PaperService.java b/src/main/java/ru/ulstu/paper/service/PaperService.java index 912b85e..3be9aee 100644 --- a/src/main/java/ru/ulstu/paper/service/PaperService.java +++ b/src/main/java/ru/ulstu/paper/service/PaperService.java @@ -1,6 +1,5 @@ package ru.ulstu.paper.service; -import com.sun.deploy.pings.Pings; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/src/main/java/ru/ulstu/ping/model/Ping.java b/src/main/java/ru/ulstu/ping/model/Ping.java index d52bb07..82c9fe2 100644 --- a/src/main/java/ru/ulstu/ping/model/Ping.java +++ b/src/main/java/ru/ulstu/ping/model/Ping.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import org.springframework.format.annotation.DateTimeFormat; import ru.ulstu.conference.model.Conference; import ru.ulstu.core.model.BaseEntity; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.grant.model.Grant; import ru.ulstu.paper.model.Paper; import ru.ulstu.project.model.Project; @@ -121,4 +122,16 @@ public class Ping extends BaseEntity { this.paper = (Paper) object; } } + + public UserActivity getActivity() { + if (conference != null) { + return conference; + } else if (project != null) { + return project; + } else if (paper != null) { + return paper; + } else { + return grant; + } + } } diff --git a/src/main/java/ru/ulstu/ping/model/PingInfo.java b/src/main/java/ru/ulstu/ping/model/PingInfo.java new file mode 100644 index 0000000..e8b943b --- /dev/null +++ b/src/main/java/ru/ulstu/ping/model/PingInfo.java @@ -0,0 +1,35 @@ +package ru.ulstu.ping.model; + +import ru.ulstu.user.model.User; + +import java.util.ArrayList; +import java.util.List; + +public class PingInfo { + private User user; + private List pings = new ArrayList<>(); + + public PingInfo(User user) { + this.user = user; + } + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + public List getPings() { + return pings; + } + + public void setPings(List pings) { + this.pings = pings; + } + + public void addPing(Ping ping) { + this.pings.add(ping); + } +} diff --git a/src/main/java/ru/ulstu/ping/repository/PingRepository.java b/src/main/java/ru/ulstu/ping/repository/PingRepository.java index 0a97c31..116c4fc 100644 --- a/src/main/java/ru/ulstu/ping/repository/PingRepository.java +++ b/src/main/java/ru/ulstu/ping/repository/PingRepository.java @@ -6,6 +6,7 @@ import org.springframework.data.repository.query.Param; import ru.ulstu.conference.model.Conference; import ru.ulstu.ping.model.Ping; +import java.util.Date; import java.util.List; public interface PingRepository extends JpaRepository { @@ -13,9 +14,11 @@ public interface PingRepository extends JpaRepository { @Query("SELECT count(*) FROM Ping p WHERE (DAY(p.date) = :day) AND (MONTH(p.date) = :month) AND (YEAR(p.date) = :year) AND (p.conference = :conference)") long countByConferenceAndDate(@Param("conference") Conference conference, @Param("day") Integer day, @Param("month") Integer month, @Param("year") Integer year); - @Query("SELECT p FROM Ping p WHERE (:user IS NULL OR p.user.id = :user) " + - "AND (:activity != 'conferences' OR p.conference IS NOT NULL) AND (:activity != 'papers' OR p.paper IS NOT NULL) " + - "AND (:activity != 'projects' OR p.project IS NOT NULL) AND (:activity != 'grants' OR p.grant IS NOT NULL)") - List getPings(@Param("user") Integer user, - @Param("activity") String activity); + @Query("SELECT p FROM Ping p WHERE (:activity != 'conferences' OR p.conference IS NOT NULL) " + + "AND (:activity != 'papers' OR p.paper IS NOT NULL) AND (:activity != 'projects' OR p.project IS NOT NULL) " + + "AND (:activity != 'grants' OR p.grant IS NOT NULL)") + List getPings(@Param("activity") String activity); + + @Query("SELECT p FROM Ping p WHERE (:dateFrom < date)") + List findByDate(@Param("dateFrom") Date dateFrom); } diff --git a/src/main/java/ru/ulstu/ping/service/PingScheduler.java b/src/main/java/ru/ulstu/ping/service/PingScheduler.java new file mode 100644 index 0000000..a60e061 --- /dev/null +++ b/src/main/java/ru/ulstu/ping/service/PingScheduler.java @@ -0,0 +1,59 @@ +package ru.ulstu.ping.service; + +import com.google.common.collect.ImmutableMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; +import ru.ulstu.core.model.UserActivity; +import ru.ulstu.ping.model.Ping; +import ru.ulstu.ping.model.PingInfo; +import ru.ulstu.ping.repository.PingRepository; +import ru.ulstu.user.model.User; +import ru.ulstu.user.service.MailService; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +@Service +public class PingScheduler { + private final Logger log = LoggerFactory.getLogger(PingScheduler.class); + private final PingRepository pingRepository; + private final MailService mailService; + private final static String PING_MAIL_SUBJECT = "Ping статистика"; + + public PingScheduler(PingRepository pingRepository, MailService mailService) { + this.pingRepository = pingRepository; + this.mailService = mailService; + } + + + @Scheduled(cron = "0 0 * * 1 ?") + public void sendPingsInfo() { + log.debug("Scheduler.sendPingsInfo started"); + + List pingInfos = new ArrayList<>(); + + for (Ping ping : pingRepository.findByDate(java.sql.Date.valueOf(LocalDate.now().minusWeeks(1)))) { + UserActivity pingActivity = ping.getActivity(); + Set users = pingActivity.getActivityUsers(); + + for (User user : users) { + PingInfo userPing = pingInfos.stream().filter(u -> u.getUser() == user).findFirst().orElse(null); + if (userPing == null) { + userPing = new PingInfo(user); + pingInfos.add(userPing); + } + userPing.addPing(ping); + } + } + + for (PingInfo pingInfo : pingInfos) { + mailService.sendEmailFromTemplate(ImmutableMap.of("pings", pingInfo.getPings()), + pingInfo.getUser(), "pingsInfoWeekEmail", PING_MAIL_SUBJECT); + } + + } +} diff --git a/src/main/java/ru/ulstu/ping/service/PingService.java b/src/main/java/ru/ulstu/ping/service/PingService.java index de61422..97cc353 100644 --- a/src/main/java/ru/ulstu/ping/service/PingService.java +++ b/src/main/java/ru/ulstu/ping/service/PingService.java @@ -16,15 +16,19 @@ import java.util.List; public class PingService { private final PingRepository pingRepository; private final UserService userService; + private final PingScheduler pingScheduler; public PingService(PingRepository pingRepository, - UserService userService) { + UserService userService, + PingScheduler pingScheduler) { this.pingRepository = pingRepository; this.userService = userService; + this.pingScheduler = pingScheduler; } @Transactional - public Ping addPing(T activity) throws IOException { + public Ping addPing(T activity) throws IOException { + pingScheduler.sendPingsInfo(); Ping newPing = new Ping(new Date(), userService.getCurrentUser()); newPing.setActivity(activity); return pingRepository.save(newPing); @@ -35,7 +39,7 @@ public class PingService { calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.YEAR))); } - public List getPings(Integer userId, String activity) { - return pingRepository.getPings(userId, activity); + public List getPings(String activity) { + return pingRepository.getPings(activity); } } diff --git a/src/main/java/ru/ulstu/project/model/Project.java b/src/main/java/ru/ulstu/project/model/Project.java index c971c4b..08dfec2 100644 --- a/src/main/java/ru/ulstu/project/model/Project.java +++ b/src/main/java/ru/ulstu/project/model/Project.java @@ -2,9 +2,11 @@ package ru.ulstu.project.model; import org.hibernate.validator.constraints.NotBlank; import ru.ulstu.core.model.BaseEntity; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.deadline.model.Deadline; import ru.ulstu.file.model.FileData; import ru.ulstu.grant.model.Grant; +import ru.ulstu.user.model.User; import javax.persistence.CascadeType; import javax.persistence.Entity; @@ -15,10 +17,17 @@ import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.validation.constraints.NotNull; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; @Entity -public class Project extends BaseEntity { +public class Project extends BaseEntity implements UserActivity { + @Override + public Set getActivityUsers() { + return new HashSet<>(); + } + public enum ProjectStatus { APPLICATION("Заявка"), ON_COMPETITION("Отправлен на конкурс"), diff --git a/src/main/java/ru/ulstu/strategy/api/EntityCreateStrategy.java b/src/main/java/ru/ulstu/strategy/api/EntityCreateStrategy.java index 8449e10..8a14399 100644 --- a/src/main/java/ru/ulstu/strategy/api/EntityCreateStrategy.java +++ b/src/main/java/ru/ulstu/strategy/api/EntityCreateStrategy.java @@ -1,21 +1,21 @@ package ru.ulstu.strategy.api; -import ru.ulstu.core.model.UserContainer; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.user.model.User; import java.util.List; import java.util.stream.Collectors; -public abstract class EntityCreateStrategy { +public abstract class EntityCreateStrategy { protected abstract List getActiveEntities(); protected abstract void createEntity(User user); - protected void createDefaultEntityIfNeed(List allUsers, List entities) { + protected void createDefaultEntityIfNeed(List allUsers, List entities) { allUsers.forEach(user -> { if (entities .stream() - .filter(entity -> entity.getUsers().contains(user)) + .filter(entity -> entity.getActivityUsers().contains(user)) .collect(Collectors.toSet()).isEmpty()) { createEntity(user); } diff --git a/src/main/java/ru/ulstu/user/controller/UserController.java b/src/main/java/ru/ulstu/user/controller/UserController.java index 3487370..8e85d05 100644 --- a/src/main/java/ru/ulstu/user/controller/UserController.java +++ b/src/main/java/ru/ulstu/user/controller/UserController.java @@ -20,7 +20,6 @@ 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.DiagramElement; import ru.ulstu.user.model.User; import ru.ulstu.user.model.UserDto; import ru.ulstu.user.model.UserListDto; @@ -35,7 +34,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.validation.Valid; -import java.util.List; import java.util.Map; import static ru.ulstu.user.controller.UserController.URL; @@ -175,7 +173,7 @@ public class UserController extends OdinController { } @GetMapping("/activities/pings") - public Response> getActivitesStats(@RequestParam(value = "userId", required = false) Integer userId, + public Response> getActivitesStats(@RequestParam(value = "userId", required = false) Integer userId, @RequestParam(value = "activity", required = false) String activity) { return new Response<>(userService.getActivitiesPings(userId, activity)); } diff --git a/src/main/java/ru/ulstu/user/controller/UserMvcController.java b/src/main/java/ru/ulstu/user/controller/UserMvcController.java index ac8d955..8333175 100644 --- a/src/main/java/ru/ulstu/user/controller/UserMvcController.java +++ b/src/main/java/ru/ulstu/user/controller/UserMvcController.java @@ -1,5 +1,6 @@ package ru.ulstu.user.controller; +import com.google.common.collect.ImmutableMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -18,8 +19,8 @@ import ru.ulstu.user.service.UserSessionService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import java.util.ArrayList; import java.util.List; +import java.util.Map; @Controller @RequestMapping(value = "/users") @@ -58,12 +59,14 @@ public class UserMvcController extends OdinController { } @ModelAttribute("allActivities") - public List getAllActivites() { - return new ArrayList() {{ - add("papers"); - add("projects"); - add("grants"); - add("conferences"); - }}; + public Map getAllActivites() { + return ImmutableMap.of("papers", "Статьи", + "grants", "Гранты", + "projects", "Проекты", + "conferences", "Конференции"); + } + + @GetMapping("/pings") + public void getPings() { } } diff --git a/src/main/java/ru/ulstu/user/model/DiagramElement.java b/src/main/java/ru/ulstu/user/model/DiagramElement.java deleted file mode 100644 index 3509110..0000000 --- a/src/main/java/ru/ulstu/user/model/DiagramElement.java +++ /dev/null @@ -1,86 +0,0 @@ -package ru.ulstu.user.model; - -import ru.ulstu.ping.model.Ping; - -public class DiagramElement { - private User user; - private int conferences = 0; - private int projects = 0; - private int grants = 0; - private int papers = 0; - - public DiagramElement() { - } - - public DiagramElement(User user) { - this.user = user; - } - - public User getUser() { - return user; - } - - public void setUser(User user) { - this.user = user; - } - - public int getConferences() { - return conferences; - } - - public void setConferences(int conferences) { - this.conferences = conferences; - } - - public int getProjects() { - return projects; - } - - public void setProjects(int projects) { - this.projects = projects; - } - - public int getGrants() { - return grants; - } - - public void setGrants(int grants) { - this.grants = grants; - } - - public int getPapers() { - return papers; - } - - public void setPapers(int papers) { - this.papers = papers; - } - - public void incrementPapers(int value) { - this.papers ++; - } - - public void incrementProjects(int value) { - this.projects ++; - } - - public void incrementConferences(int value) { - this.conferences ++; - } - - public void incrementGrants(int value) { - this.grants ++; - } - - public void incrementActivity(Ping ping) { - if (ping.getConference() != null) { - this.conferences ++; - } else if(ping.getPaper() != null) { - this.papers ++; - } else if(ping.getProject() != null) { - this.projects ++; - } else if(ping.getGrant() != null) { - this.grants ++; - } - } -} diff --git a/src/main/java/ru/ulstu/user/service/UserService.java b/src/main/java/ru/ulstu/user/service/UserService.java index e86eebb..f5bcba6 100644 --- a/src/main/java/ru/ulstu/user/service/UserService.java +++ b/src/main/java/ru/ulstu/user/service/UserService.java @@ -18,6 +18,7 @@ import ru.ulstu.configuration.ApplicationProperties; import ru.ulstu.core.error.EntityIdIsNullException; import ru.ulstu.core.jpa.OffsetablePageRequest; import ru.ulstu.core.model.BaseEntity; +import ru.ulstu.core.model.UserActivity; import ru.ulstu.core.model.response.PageableItems; import ru.ulstu.ping.model.Ping; import ru.ulstu.ping.service.PingService; @@ -31,7 +32,6 @@ import ru.ulstu.user.error.UserNotFoundException; import ru.ulstu.user.error.UserPasswordsNotValidOrNotMatchException; import ru.ulstu.user.error.UserResetKeyError; import ru.ulstu.user.error.UserSendingMailException; -import ru.ulstu.user.model.DiagramElement; import ru.ulstu.user.model.User; import ru.ulstu.user.model.UserDto; import ru.ulstu.user.model.UserListDto; @@ -44,10 +44,10 @@ import ru.ulstu.user.repository.UserRoleRepository; import ru.ulstu.user.util.UserUtils; import javax.mail.MessagingException; -import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -361,19 +361,28 @@ public class UserService implements UserDetailsService { return userRepository.findOneByLoginIgnoreCase(login); } - public List getActivitiesPings(Integer userId, - String activity) { - List pings = pingService.getPings(userId, activity); - List diagramElements = new ArrayList<>(); - - for (Ping ping:pings) { - DiagramElement diagramElement = diagramElements.stream().filter(element -> element.getUser() == ping.getUser()).findFirst().orElse(null); - if(diagramElement == null) { - diagramElement = new DiagramElement(ping.getUser()); - diagramElements.add(diagramElement); - } - diagramElement.incrementActivity(ping); + public Map getActivitiesPings(Integer userId, + String activityName) { + User user = null; + if (userId != null) { + user = findById(userId); } - return diagramElements; + Map activitiesPings = new HashMap<>(); + + for (Ping ping : pingService.getPings(activityName)) { + UserActivity activity = ping.getActivity(); + + if (user != null && !activity.getActivityUsers().contains(user)) { + continue; + } + + if (activitiesPings.containsKey(activity.getTitle())) { + activitiesPings.put(activity.getTitle(), activitiesPings.get(activity.getTitle()) + 1); + } else { + activitiesPings.put(activity.getTitle(), 1); + } + + } + return activitiesPings; } } diff --git a/src/main/resources/mail_templates/pingsInfoWeekEmail.html b/src/main/resources/mail_templates/pingsInfoWeekEmail.html new file mode 100644 index 0000000..180ef3b --- /dev/null +++ b/src/main/resources/mail_templates/pingsInfoWeekEmail.html @@ -0,0 +1,23 @@ + + + + Уведомление о создании статьи + + + + +

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

+

+ Вы были отмечены в следующих задачах: +

+

+

+

+ Regards, +
+ NG-tracker. +

+ + diff --git a/src/main/resources/public/js/core.js b/src/main/resources/public/js/core.js index cc42258..d4eba0d 100644 --- a/src/main/resources/public/js/core.js +++ b/src/main/resources/public/js/core.js @@ -225,3 +225,19 @@ function getUrlVar(key) { var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); return result && decodeURIComponent(result[1]) || ""; } + +function sendPing(field, url) { + id = document.getElementById(field).value + + $.ajax({ + url:url + `?${field}=` + id, + contentType: "application/json; charset=utf-8", + method: "POST", + success: function() { + showFeedbackMessage("Ping был отправлен", MessageTypesEnum.SUCCESS) + }, + error: function(errorData) { + showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING) + } + }) +} \ No newline at end of file diff --git a/src/main/resources/public/js/users.js b/src/main/resources/public/js/users.js index d0c7c38..0de86d6 100644 --- a/src/main/resources/public/js/users.js +++ b/src/main/resources/public/js/users.js @@ -130,28 +130,22 @@ function drawChart() { userId = $('#author :selected').val() activity = $('#activity :selected').val() $.ajax({ - url:`/api/1.0/users/activities?userId=${userId}&activity=${activity}`, + url:`/api/1.0/users/activities/pings?userId=${userId}&activity=${activity}`, contentType: "application/json; charset=utf-8", method: "GET", success: function(response) { if (response.data.length == 0) { return; } - if(userId) { - array = [['Активность', 'Количество'], - ['Конференции', response.data[0].conferences], - ['Статьи', response.data[0].papers], - ['Проекты', response.data[0].projects], - ['Гранты', response.data[0].grants]] - } else { - array = [['Пользователи', 'Количество']] - response.data.forEach(function(element) { - array.push([element.user.firstName, element[`${activity}`]]) - }) - } + array = [['Активности', 'Количество']] + + Object.keys(response.data).forEach(function(key) { + console.table('Key : ' + key + ', Value : ' + response.data[key]) + array.push([key, response.data[key]]) + }) var data = google.visualization.arrayToDataTable(array); var options = { - title: 'Активность', + title: 'Активности', is3D: true, pieResidueSliceLabel: 'Остальное' }; diff --git a/src/main/resources/templates/grants/grant.html b/src/main/resources/templates/grants/grant.html index ff47f83..71f798a 100644 --- a/src/main/resources/templates/grants/grant.html +++ b/src/main/resources/templates/grants/grant.html @@ -200,7 +200,7 @@
@@ -333,22 +333,6 @@ var lid = $("#leaderId option:selected").val(); $("#authors [value='" + lid + "']").attr("disabled", "disabled"); } - - function sendPing() { - id = document.getElementById("grantId").value - - $.ajax({ - url:"/grants/ping?grantId=" + id, - contentType: "application/json; charset=utf-8", - method: "POST", - success: function() { - showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS) - }, - error: function(errorData) { - showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING) - } - }) - } diff --git a/src/main/resources/templates/papers/paper.html b/src/main/resources/templates/papers/paper.html index ea748ef..5c26d0f 100644 --- a/src/main/resources/templates/papers/paper.html +++ b/src/main/resources/templates/papers/paper.html @@ -326,7 +326,7 @@
@@ -562,21 +562,6 @@ $(this).autocomplete("search"); }); - function sendPing() { - id = document.getElementById("paperId").value - - $.ajax({ - url:"/api/1.0/papers/ping?paperId=" + id, - contentType: "application/json; charset=utf-8", - method: "POST", - success: function() { - showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS) - }, - error: function(errorData) { - showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING) - } - }) - } /*]]>*/ diff --git a/src/main/resources/templates/projects/project.html b/src/main/resources/templates/projects/project.html index c291ff8..92c6410 100644 --- a/src/main/resources/templates/projects/project.html +++ b/src/main/resources/templates/projects/project.html @@ -106,7 +106,7 @@
@@ -157,7 +157,7 @@ contentType: "application/json; charset=utf-8", method: "POST", success: function() { - showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS) + showFeedbackMessage("Ping был отправлен", MessageTypesEnum.SUCCESS) }, error: function(errorData) { showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING) diff --git a/src/main/resources/templates/users/activities.html b/src/main/resources/templates/users/activities.html deleted file mode 100644 index 1b93828..0000000 --- a/src/main/resources/templates/users/activities.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - -
-
-
-
-
-

Личный кабинет

-
-
-
-
-
-
Фильтр:
- -
- -
-
-
-
-
- - diff --git a/src/main/resources/templates/users/pings.html b/src/main/resources/templates/users/pings.html new file mode 100644 index 0000000..c0ed722 --- /dev/null +++ b/src/main/resources/templates/users/pings.html @@ -0,0 +1,53 @@ + + + + + + + + + + + + +
+
+
+
+
+

Ping активности

+
+
+
+
+
Фильтр:
+ +
+ +
+
+
+
+ +
+
+ + diff --git a/src/main/resources/templates/users/profile.html b/src/main/resources/templates/users/profile.html index 86fed78..93adfc7 100644 --- a/src/main/resources/templates/users/profile.html +++ b/src/main/resources/templates/users/profile.html @@ -4,13 +4,6 @@ layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html"> - - - -