#112 base ping activities

This commit is contained in:
Artem.Arefev 2019-05-27 00:42:43 +04:00
parent eba3592410
commit 482e2b3595
21 changed files with 436 additions and 12 deletions

View File

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import ru.ulstu.deadline.model.Deadline;
import ru.ulstu.grant.model.Grant;
import ru.ulstu.grant.model.GrantDto;
@ -139,4 +140,10 @@ public class GrantController {
.filter(dto -> dto.getDate() != null || !isEmpty(dto.getDescription()))
.collect(Collectors.toList()));
}
@ResponseBody
@PostMapping(value = "/ping")
public void ping(@RequestParam("grantId") int grantId) throws IOException {
grantService.ping(grantId);
}
}

View File

@ -13,6 +13,7 @@ import ru.ulstu.grant.repository.GrantRepository;
import ru.ulstu.paper.model.Paper;
import ru.ulstu.paper.model.PaperDto;
import ru.ulstu.paper.service.PaperService;
import ru.ulstu.ping.service.PingService;
import ru.ulstu.project.model.Project;
import ru.ulstu.project.model.ProjectDto;
import ru.ulstu.project.service.ProjectService;
@ -45,6 +46,7 @@ public class GrantService {
private final PaperService paperService;
private final EventService eventService;
private final GrantNotificationService grantNotificationService;
private final PingService pingService;
public GrantService(GrantRepository grantRepository,
FileService fileService,
@ -53,7 +55,8 @@ public class GrantService {
UserService userService,
PaperService paperService,
EventService eventService,
GrantNotificationService grantNotificationService) {
GrantNotificationService grantNotificationService,
PingService pingService) {
this.grantRepository = grantRepository;
this.fileService = fileService;
this.deadlineService = deadlineService;
@ -62,6 +65,7 @@ public class GrantService {
this.paperService = paperService;
this.eventService = eventService;
this.grantNotificationService = grantNotificationService;
this.pingService = pingService;
}
public List<Grant> findAll() {
@ -261,4 +265,13 @@ public class GrantService {
.filter(author -> Collections.frequency(authors, author) > 3)
.collect(toList());
}
public Grant findById(Integer id) {
return grantRepository.findOne(id);
}
@Transactional
public void ping(int grantId) throws IOException {
pingService.addPing(findById(grantId));
}
}

View File

@ -7,6 +7,7 @@ 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.Response;
@ -72,4 +73,9 @@ public class PaperRestController {
public Response<String> getFormattedReference(@RequestBody @Valid ReferenceDto referenceDto) {
return new Response<>(paperService.getFormattedReference(referenceDto));
}
@PostMapping(value = "/ping")
public void ping(@RequestParam("paperId") int paperId) throws IOException {
paperService.ping(paperId);
}
}

View File

@ -1,5 +1,6 @@
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;
@ -15,6 +16,7 @@ import ru.ulstu.paper.model.Reference;
import ru.ulstu.paper.model.ReferenceDto;
import ru.ulstu.paper.repository.PaperRepository;
import ru.ulstu.paper.repository.ReferenceRepository;
import ru.ulstu.ping.service.PingService;
import ru.ulstu.timeline.service.EventService;
import ru.ulstu.user.model.User;
import ru.ulstu.user.service.UserService;
@ -54,6 +56,7 @@ public class PaperService {
private final FileService fileService;
private final EventService eventService;
private final ReferenceRepository referenceRepository;
private final PingService pingService;
public PaperService(PaperRepository paperRepository,
ReferenceRepository referenceRepository,
@ -61,7 +64,8 @@ public class PaperService {
PaperNotificationService paperNotificationService,
UserService userService,
DeadlineService deadlineService,
EventService eventService) {
EventService eventService,
PingService pingService) {
this.paperRepository = paperRepository;
this.referenceRepository = referenceRepository;
this.fileService = fileService;
@ -69,6 +73,7 @@ public class PaperService {
this.userService = userService;
this.deadlineService = deadlineService;
this.eventService = eventService;
this.pingService = pingService;
}
public List<Paper> findAll() {
@ -386,4 +391,9 @@ public class PaperService {
autoCompleteData.setPublishers(referenceRepository.findDistinctPublishers());
return autoCompleteData;
}
@Transactional
public void ping(int paperId) throws IOException {
pingService.addPing(findPaperById(paperId));
}
}

View File

@ -4,6 +4,9 @@ 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.grant.model.Grant;
import ru.ulstu.paper.model.Paper;
import ru.ulstu.project.model.Project;
import ru.ulstu.user.model.User;
import javax.persistence.Entity;
@ -25,10 +28,22 @@ public class Ping extends BaseEntity {
@JoinColumn(name = "users_id")
private User user;
@ManyToOne(optional = false)
@ManyToOne()
@JoinColumn(name = "conference_id")
private Conference conference;
@ManyToOne()
@JoinColumn(name = "paper_id")
private Paper paper;
@ManyToOne()
@JoinColumn(name = "grant_id")
private Grant grant;
@ManyToOne()
@JoinColumn(name = "project_id")
private Project project;
public Ping() {
}
@ -70,4 +85,40 @@ public class Ping extends BaseEntity {
public void setConference(Conference conference) {
this.conference = conference;
}
public Paper getPaper() {
return paper;
}
public void setPaper(Paper paper) {
this.paper = paper;
}
public Grant getGrant() {
return grant;
}
public void setGrant(Grant grant) {
this.grant = grant;
}
public Project getProject() {
return project;
}
public void setProject(Project project) {
this.project = project;
}
public <T> void setActivity(T object) {
if (object.getClass() == Conference.class) {
this.conference = (Conference) object;
} else if (object.getClass() == Project.class) {
this.project = (Project) object;
} else if (object.getClass() == Grant.class) {
this.grant = (Grant) object;
} else if (object.getClass() == Paper.class) {
this.paper = (Paper) object;
}
}
}

View File

@ -6,8 +6,16 @@ import org.springframework.data.repository.query.Param;
import ru.ulstu.conference.model.Conference;
import ru.ulstu.ping.model.Ping;
import java.util.List;
public interface PingRepository extends JpaRepository<Ping, Integer> {
@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<Ping> getPings(@Param("user") Integer user,
@Param("activity") String activity);
}

View File

@ -10,6 +10,7 @@ import ru.ulstu.user.service.UserService;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
@Service
public class PingService {
@ -23,9 +24,9 @@ public class PingService {
}
@Transactional
public Ping addPing(Conference conference) throws IOException {
public<T> Ping addPing(T activity) throws IOException {
Ping newPing = new Ping(new Date(), userService.getCurrentUser());
newPing.setConference(conference);
newPing.setActivity(activity);
return pingRepository.save(newPing);
}
@ -33,4 +34,8 @@ public class PingService {
return Math.toIntExact(pingRepository.countByConferenceAndDate(conference, calendar.get(Calendar.DAY_OF_MONTH),
calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.YEAR)));
}
public List<Ping> getPings(Integer userId, String activity) {
return pingRepository.getPings(userId, activity);
}
}

View File

@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import ru.ulstu.deadline.model.Deadline;
import ru.ulstu.project.model.Project;
import ru.ulstu.project.model.ProjectDto;
@ -90,4 +91,10 @@ public class ProjectController {
.filter(dto -> dto.getDate() != null || !isEmpty(dto.getDescription()))
.collect(Collectors.toList()));
}
@ResponseBody
@PostMapping(value = "/ping")
public void ping(@RequestParam("projectId") int projectId) throws IOException {
projectService.ping(projectId);
}
}

View File

@ -6,6 +6,7 @@ import org.thymeleaf.util.StringUtils;
import ru.ulstu.deadline.service.DeadlineService;
import ru.ulstu.file.service.FileService;
import ru.ulstu.grant.repository.GrantRepository;
import ru.ulstu.ping.service.PingService;
import ru.ulstu.project.model.Project;
import ru.ulstu.project.model.ProjectDto;
import ru.ulstu.project.repository.ProjectRepository;
@ -26,15 +27,18 @@ public class ProjectService {
private final DeadlineService deadlineService;
private final GrantRepository grantRepository;
private final FileService fileService;
private final PingService pingService;
public ProjectService(ProjectRepository projectRepository,
DeadlineService deadlineService,
GrantRepository grantRepository,
FileService fileService) {
FileService fileService,
PingService pingService) {
this.projectRepository = projectRepository;
this.deadlineService = deadlineService;
this.grantRepository = grantRepository;
this.fileService = fileService;
this.pingService = pingService;
}
public List<Project> findAll() {
@ -108,4 +112,8 @@ public class ProjectService {
return projectRepository.findOne(id);
}
@Transactional
public void ping(int projectId) throws IOException {
pingService.addPing(findById(projectId));
}
}

View File

@ -20,6 +20,7 @@ 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;
@ -34,6 +35,7 @@ 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;
@ -171,4 +173,10 @@ public class UserController extends OdinController<UserListDto, UserDto> {
public void inviteUser(@RequestParam("email") String email) {
userService.inviteUser(email);
}
@GetMapping("/activities/pings")
public Response<List<DiagramElement>> getActivitesStats(@RequestParam(value = "userId", required = false) Integer userId,
@RequestParam(value = "activity", required = false) String activity) {
return new Response<>(userService.getActivitiesPings(userId, activity));
}
}

View File

@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import ru.ulstu.configuration.Constants;
@ -17,6 +18,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;
@Controller
@RequestMapping(value = "/users")
@ -48,4 +51,19 @@ public class UserMvcController extends OdinController<UserListDto, UserDto> {
User user = userSessionService.getUserBySessionId(sessionId);
modelMap.addAttribute("userDto", userService.updateUserInformation(user, userDto));
}
@ModelAttribute("allUsers")
public List<User> getAllUsers() {
return userService.findAll();
}
@ModelAttribute("allActivities")
public List<String> getAllActivites() {
return new ArrayList<String>() {{
add("papers");
add("projects");
add("grants");
add("conferences");
}};
}
}

View File

@ -0,0 +1,86 @@
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 ++;
}
}
}

View File

@ -3,6 +3,7 @@ package ru.ulstu.user.service;
import com.google.common.collect.ImmutableMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;
import org.springframework.mail.MailException;
@ -18,6 +19,8 @@ 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.ping.model.Ping;
import ru.ulstu.ping.service.PingService;
import ru.ulstu.user.error.UserActivationError;
import ru.ulstu.user.error.UserEmailExistsException;
import ru.ulstu.user.error.UserIdExistsException;
@ -28,6 +31,7 @@ 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;
@ -40,6 +44,7 @@ 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;
@ -62,19 +67,22 @@ public class UserService implements UserDetailsService {
private final UserMapper userMapper;
private final MailService mailService;
private final ApplicationProperties applicationProperties;
private final PingService pingService;
public UserService(UserRepository userRepository,
PasswordEncoder passwordEncoder,
UserRoleRepository userRoleRepository,
UserMapper userMapper,
MailService mailService,
ApplicationProperties applicationProperties) {
ApplicationProperties applicationProperties,
@Lazy PingService pingService) {
this.userRepository = userRepository;
this.passwordEncoder = passwordEncoder;
this.userRoleRepository = userRoleRepository;
this.userMapper = userMapper;
this.mailService = mailService;
this.applicationProperties = applicationProperties;
this.pingService = pingService;
}
private User getUserByEmail(String email) {
@ -236,7 +244,7 @@ public class UserService implements UserDetailsService {
mailService.sendChangePasswordMail(user);
}
public boolean requestUserPasswordReset(String email) {
public boolean requestUserPasswordReset(String email) {
User user = userRepository.findOneByEmailIgnoreCase(email);
if (user == null) {
throw new UserNotFoundException(email);
@ -348,4 +356,20 @@ public class UserService implements UserDetailsService {
throw new UserSendingMailException(email);
}
}
public List<DiagramElement> getActivitiesPings(Integer userId,
String activity) {
List<Ping> pings = pingService.getPings(userId, activity);
List<DiagramElement> 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);
}
return diagramElements;
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet author="arefyev" id="20190525_000000-1">
<addColumn tableName="ping">
<column name="paper_id" type="integer"/>
<column name="grant_id" type="integer"/>
<column name="project_id" type="integer"/>
</addColumn>
<addForeignKeyConstraint baseTableName="ping" baseColumnNames="paper_id" constraintName="paper_fk" referencedTableName="paper"
referencedColumnNames="id"/>
<addForeignKeyConstraint baseTableName="ping" baseColumnNames="grant_id" constraintName="grant_fk" referencedTableName="grants"
referencedColumnNames="id"/>
<addForeignKeyConstraint baseTableName="ping" baseColumnNames="project_id" constraintName="project_fk" referencedTableName="project"
referencedColumnNames="id"/>
</changeSet>
</databaseChangeLog>

View File

@ -43,4 +43,5 @@
<include file="db/changelog-20190507_000001-schema.xml"/>
<include file="db/changelog-20190511_000000-schema.xml"/>
<include file="db/changelog-20190523_000000-schema.xml"/>
<include file="db/changelog-20190525_000000-schema.xml"/>
</databaseChangeLog>

View File

@ -124,4 +124,42 @@ function resetPassword() {
function isEmailValid(email) {
re = /\S+@\S+\.\S+/;
return re.test(email)
}
function drawChart() {
userId = $('#author :selected').val()
activity = $('#activity :selected').val()
$.ajax({
url:`/api/1.0/users/activities?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}`]])
})
}
var data = google.visualization.arrayToDataTable(array);
var options = {
title: 'Активность',
is3D: true,
pieResidueSliceLabel: 'Остальное'
};
var chart = new google.visualization.PieChart(document.getElementById('air'));
chart.draw(data, options);
},
error: function(errorData) {
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
}
})
}

View File

@ -23,7 +23,7 @@
th:object="${grantDto}">
<div class="row">
<div class="col-md-6 col-sm-12">
<input type="hidden" name="id" th:field="*{id}"/>
<input type="hidden" id="grantId" name="id" th:field="*{id}"/>
<div class="form-group">
<label for="title">Название:</label>
<input class="form-control" id="title" type="text"
@ -238,6 +238,12 @@
</div>
<input type = "hidden" th:field="*{project.id}"/>
</div>
<div class="form-group">
<button id="pingButton" class="btn btn-primary text-uppercase"
type="button" onclick="sendPing()">
Ping авторам
</button>
</div>
</div>
<div class="clearfix"></div>
<div class="col-lg-12">
@ -367,6 +373,22 @@
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)
}
})
}
</script>
</div>
</body>

View File

@ -43,7 +43,7 @@
<div class="tab-content" id="nav-tabContent">
<div class="tab-pane fade show active" id="nav-main" role="tabpanel"
aria-labelledby="nav-main-tab">
<input type="hidden" name="id" th:field="*{id}"/>
<input type="hidden" id="paperId" name="id" th:field="*{id}"/>
<div class="form-group">
<label for="title">Название:</label>
<input class="form-control" id="title" type="text"
@ -326,7 +326,7 @@
</div>
<div class="form-group">
<button id="pingButton" class="btn btn-primary text-uppercase"
type="button">
type="button" onclick="sendPing()">
Ping авторам
</button>
</div>
@ -562,7 +562,21 @@
$(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)
}
})
}
/*]]>*/
</script>
</div>

View File

@ -24,7 +24,7 @@
th:object="${projectDto}">
<div class="row">
<div class="col-md-6 col-sm-12">
<input type="hidden" name="id" th:field="*{id}"/>
<input type="hidden" id="projectId" name="id" th:field="*{id}"/>
<div class="form-group">
<label for="title">Название:</label>
<input class="form-control" id="title" type="text"
@ -104,6 +104,12 @@
</div>
</div>
<div class="form-group">
<button id="pingButton" class="btn btn-primary text-uppercase"
type="button" onclick="sendPing()">
Ping авторам
</button>
</div>
</div>
<div class="clearfix"></div>
@ -142,6 +148,22 @@
});
$('.selectpicker').selectpicker();
});
function sendPing() {
id = document.getElementById("projectId").value
$.ajax({
url:"/projects/ping?projectId=" + id,
contentType: "application/json; charset=utf-8",
method: "POST",
success: function() {
showFeedbackMessage("Пароль был обновлен", MessageTypesEnum.SUCCESS)
},
error: function(errorData) {
showFeedbackMessage(errorData.responseJSON.error.message, MessageTypesEnum.WARNING)
}
})
}
/*]]>*/

View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
<link rel="stylesheet" href="../css/grant.css"/>
<script src="https://www.google.com/jsapi"></script>
<script src="/js/users.js"></script>
<script src="/js/core.js"></script>
<script>
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
</script>
</head>
<body>
<div class="container" layout:fragment="content">
<section id="ewrq">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading text-uppercase">Личный кабинет</h2>
</div>
</div>
</div>
<div class="col-md-3 col-sm-12">
<div class="filter">
<h5>Фильтр:</h5>
<select class="form-control" id="author"
onchange="drawChart();">
<option value="">Все авторы</option>
<option th:each="user: ${allUsers}" th:value="${user.id}"
th:text="${user.lastName}">lastName
</option>
</select>
<br />
<select class="form-control" id="activity"
onchange="drawChart();">
<option value="">Все активности</option>
<option th:each="activity: ${allActivities}" th:value="${activity}"
th:text="${activity}">year
</option>
</select>
</div>
<div id="air" style="width: 500px; height: 400px;"></div>
</div>
</section>
</div>
</body>
</html>

View File

@ -4,6 +4,13 @@
layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
<link rel="stylesheet" href="../css/grant.css"/>
<script src="js/users.js"></script>
<script src="js/core.js"></script>
<script src="https://www.google.com/jsapi"></script>
<script>
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
</script>
</head>
<body>