Merge branch '35-' into 'master'
Resolve "Создать контроллер грантов" Closes #35 See merge request romanov73/ng-tracker!24master
commit
7a490ef7a5
@ -0,0 +1,8 @@
|
|||||||
|
package ru.ulstu.grant.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import ru.ulstu.grant.model.Grant;
|
||||||
|
|
||||||
|
public interface GrantRepository extends JpaRepository<Grant, Integer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,128 @@
|
|||||||
|
package ru.ulstu.grant.service;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import ru.ulstu.deadline.model.Deadline;
|
||||||
|
import ru.ulstu.deadline.service.DeadlineService;
|
||||||
|
import ru.ulstu.file.service.FileService;
|
||||||
|
import ru.ulstu.grant.model.Grant;
|
||||||
|
import ru.ulstu.grant.model.GrantDto;
|
||||||
|
import ru.ulstu.grant.repository.GrantRepository;
|
||||||
|
import ru.ulstu.project.model.Project;
|
||||||
|
import ru.ulstu.project.model.ProjectDto;
|
||||||
|
import ru.ulstu.project.service.ProjectService;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.springframework.util.ObjectUtils.isEmpty;
|
||||||
|
import static ru.ulstu.core.util.StreamApiUtils.convert;
|
||||||
|
import static ru.ulstu.grant.model.Grant.GrantStatus.APPLICATION;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class GrantService {
|
||||||
|
private final static int MAX_DISPLAY_SIZE = 40;
|
||||||
|
|
||||||
|
private final GrantRepository grantRepository;
|
||||||
|
private final ProjectService projectService;
|
||||||
|
private final DeadlineService deadlineService;
|
||||||
|
private final FileService fileService;
|
||||||
|
|
||||||
|
public GrantService(GrantRepository grantRepository,
|
||||||
|
FileService fileService,
|
||||||
|
DeadlineService deadlineService,
|
||||||
|
ProjectService projectService) {
|
||||||
|
this.grantRepository = grantRepository;
|
||||||
|
this.projectService = projectService;
|
||||||
|
this.fileService = fileService;
|
||||||
|
this.deadlineService = deadlineService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Grant> findAll() {
|
||||||
|
return grantRepository.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GrantDto> findAllDto() {
|
||||||
|
List<GrantDto> grants = convert(findAll(), GrantDto::new);
|
||||||
|
grants.forEach(grantDto -> grantDto.setTitle(StringUtils.abbreviate(grantDto.getTitle(), MAX_DISPLAY_SIZE)));
|
||||||
|
return grants;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GrantDto findOneDto(Integer id) {
|
||||||
|
return new GrantDto(grantRepository.findOne(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Integer create(GrantDto grantDto) throws IOException {
|
||||||
|
Grant newGrant = copyFromDto(new Grant(), grantDto);
|
||||||
|
newGrant = grantRepository.save(newGrant);
|
||||||
|
return newGrant.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Grant copyFromDto(Grant grant, GrantDto grantDto) throws IOException {
|
||||||
|
grant.setComment(grantDto.getComment());
|
||||||
|
grant.setStatus(grantDto.getStatus() == null ? APPLICATION : grantDto.getStatus());
|
||||||
|
grant.setTitle(grantDto.getTitle());
|
||||||
|
if (grantDto.getProject() != null && grantDto.getProject().getId() != null) {
|
||||||
|
grant.setProject(projectService.findById(grantDto.getProject().getId()));
|
||||||
|
}
|
||||||
|
grant.setDeadlines(deadlineService.saveOrCreate(grantDto.getDeadlines()));
|
||||||
|
if (grantDto.getApplicationFileName() != null) {
|
||||||
|
grant.setApplication(fileService.createFileFromTmp(grantDto.getApplicationFileName()));
|
||||||
|
}
|
||||||
|
return grant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void createProject(GrantDto grantDto) {
|
||||||
|
grantDto.setProject(
|
||||||
|
new ProjectDto(projectService.save(new ProjectDto(grantDto.getTitle()))));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Integer update(GrantDto grantDto) throws IOException {
|
||||||
|
Grant grant = grantRepository.findOne(grantDto.getId());
|
||||||
|
Grant.GrantStatus oldStatus = grant.getStatus();
|
||||||
|
if (grantDto.getApplicationFileName() != null && grant.getApplication() != null) {
|
||||||
|
fileService.deleteFile(grant.getApplication());
|
||||||
|
}
|
||||||
|
grantRepository.save(copyFromDto(grant, grantDto));
|
||||||
|
return grant.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void delete(Integer grantId) throws IOException {
|
||||||
|
Grant grant = grantRepository.findOne(grantId);
|
||||||
|
if (grant.getApplication() != null) {
|
||||||
|
fileService.deleteFile(grant.getApplication());
|
||||||
|
}
|
||||||
|
//возможно при удалении гранта будет удаляться и проект, к нему привязанный
|
||||||
|
grantRepository.delete(grant);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Grant.GrantStatus> getGrantStatuses() {
|
||||||
|
return Arrays.asList(Grant.GrantStatus.values());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Grant create(String title, Project project_id, Date deadlineDate) {
|
||||||
|
Grant grant = new Grant();
|
||||||
|
grant.setTitle(title);
|
||||||
|
grant.setComment("Комментарий к гранту 1");
|
||||||
|
grant.setProject(project_id);
|
||||||
|
grant.setStatus(APPLICATION);
|
||||||
|
grant.getDeadlines().add(new Deadline(deadlineDate, "первый дедлайн"));
|
||||||
|
grant = grantRepository.save(grant);
|
||||||
|
return grant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void save(GrantDto grantDto) throws IOException {
|
||||||
|
if (isEmpty(grantDto.getId())) {
|
||||||
|
create(grantDto);
|
||||||
|
} else {
|
||||||
|
update(grantDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package ru.ulstu.project.repository;
|
||||||
|
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
import ru.ulstu.project.model.Project;
|
||||||
|
|
||||||
|
public interface ProjectRepository extends JpaRepository<Project, Integer> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package ru.ulstu.project.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import ru.ulstu.deadline.service.DeadlineService;
|
||||||
|
import ru.ulstu.project.model.Project;
|
||||||
|
import ru.ulstu.project.model.ProjectDto;
|
||||||
|
import ru.ulstu.project.repository.ProjectRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.springframework.util.ObjectUtils.isEmpty;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ProjectService {
|
||||||
|
|
||||||
|
private final ProjectRepository projectRepository;
|
||||||
|
private final DeadlineService deadlineService;
|
||||||
|
|
||||||
|
public ProjectService(ProjectRepository projectRepository,
|
||||||
|
DeadlineService deadlineService) {
|
||||||
|
this.projectRepository = projectRepository;
|
||||||
|
this.deadlineService = deadlineService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Project> findAll() {
|
||||||
|
return projectRepository.findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public Project create(ProjectDto projectDto) {
|
||||||
|
Project newProject = copyFromDto(new Project(), projectDto);
|
||||||
|
newProject = projectRepository.save(newProject);
|
||||||
|
return newProject;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Project copyFromDto(Project project, ProjectDto projectDto) {
|
||||||
|
project.setTitle(projectDto.getTitle());
|
||||||
|
project.setDeadlines(deadlineService.saveOrCreate(projectDto.getDeadlines()));
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Project save(ProjectDto projectDto) {
|
||||||
|
if (isEmpty(projectDto.getId())) {
|
||||||
|
return create(projectDto);
|
||||||
|
} else {
|
||||||
|
return update(projectDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Project update(ProjectDto projectDto) {
|
||||||
|
throw new RuntimeException("not implemented yet");
|
||||||
|
}
|
||||||
|
|
||||||
|
public Project findById(Integer id) {
|
||||||
|
return projectRepository.findOne(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<?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="tanya" id="20181224_000000-1">
|
||||||
|
<renameTable oldTableName="grant"
|
||||||
|
newTableName="grants"/>
|
||||||
|
</changeSet>
|
||||||
|
</databaseChangeLog>
|
@ -0,0 +1,42 @@
|
|||||||
|
/*<![CDATA[*/
|
||||||
|
$(document).ready(function () {
|
||||||
|
$(".grant-row").mouseenter(function (event) {
|
||||||
|
var grantRow = $(event.target).closest(".grant-row");
|
||||||
|
$(grantRow).css("background-color", "#f8f9fa");
|
||||||
|
$(grantRow).find(".remove-paper").removeClass("d-none");
|
||||||
|
|
||||||
|
});
|
||||||
|
$(".grant-row").mouseleave(function (event) {
|
||||||
|
var grantRow = $(event.target).closest(".grant-row");
|
||||||
|
$(grantRow).css("background-color", "white");
|
||||||
|
$(grantRow).closest(".grant-row").find(".remove-grant").addClass("d-none");
|
||||||
|
});
|
||||||
|
|
||||||
|
$('a[data-confirm]').click(function(ev) {
|
||||||
|
var href = $(this).attr('href');
|
||||||
|
if (!$('#dataConfirmModal').length) {
|
||||||
|
$('#modalDelete').append('<div class="modal fade" id="dataConfirmModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"\n' +
|
||||||
|
' >\n' +
|
||||||
|
' <div class="modal-dialog modal-sm">\n' +
|
||||||
|
' <div class="modal-content">\n' +
|
||||||
|
' <div class="modal-header">\n' +
|
||||||
|
' <h8 class="modal-title" id="myModalLabel">Удалить грант?</h8>\n' +
|
||||||
|
' <button type="button" class="close" data-dismiss="modal" aria-label="Закрыть"><span\n' +
|
||||||
|
' aria-hidden="true">×</span></button>\n' +
|
||||||
|
' </div>\n' +
|
||||||
|
|
||||||
|
' <div class="modal-footer">\n' +
|
||||||
|
' <a class="btn btn-primary" id="dataConfirmOK">Да</a>'+
|
||||||
|
' <button class="btn primary" data-dismiss="modal" aria-hidden="true">Нет</button>'+
|
||||||
|
' </div>\n' +
|
||||||
|
' </div>\n' +
|
||||||
|
' </div>\n' +
|
||||||
|
' </div>');
|
||||||
|
}
|
||||||
|
$('#dataConfirmModal').find('#myModalLabel').text($(this).attr('data-confirm'));
|
||||||
|
$('#dataConfirmOK').attr('href', href);
|
||||||
|
$('#dataConfirmModal').modal({show:true});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
/*]]>*/
|
@ -1,177 +1,24 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en"
|
<html lang="en"
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
layout:decorator="default">
|
layout:decorator="default" xmlns:th="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div class="container" layout:fragment="content">
|
<div class="container" layout:fragment="content">
|
||||||
<!-- Services -->
|
|
||||||
<section id="services">
|
<section id="services">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="col-lg-12 text-center">
|
||||||
<div class="col-lg-12 text-center">
|
<h2 class="section-heading text-uppercase">Гранты</h2>
|
||||||
<h2 class="section-heading text-uppercase">Dashboard</h2>
|
<div th:replace="grants/fragments/grantNavigationFragment"/>
|
||||||
<div class="row justify-content-center">
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
|
||||||
<a href="./grants" class="btn btn-light toolbar-button"><i class="fa fa-list-alt"></i>
|
|
||||||
Список</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
|
||||||
<a href="./dashboard" class="btn btn-light toolbar-button"><i class="fa fa-newspaper-o"
|
|
||||||
aria-hidden="true"></i> Панель управления</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
|
||||||
<a href="./grant" class="btn btn-light toolbar-button"><i class="fa fa-plus-circle" aria-hidden="true"></i>
|
|
||||||
Добавить грант</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center" id="dashboard">
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
<th:block th:each="grant : ${grants}">
|
||||||
<div class="row">
|
<div th:replace="grants/fragments/grantDashboardFragment :: grantDashboard(grant=${grant})"/>
|
||||||
<div class="col-2">
|
</th:block>
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading"><a href="./grant">Название гранта</a></h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-2">
|
|
||||||
<span class="fa-stack fa-1x">
|
|
||||||
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
|
||||||
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col col-10 text-right">
|
|
||||||
<h7 class="service-heading">Название гранта</h7>
|
|
||||||
<p class="text-muted">Краткое описание</p>
|
|
||||||
<p class="text-muted">Статус: статус</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -0,0 +1,19 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head th:fragment="headerfiles">
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:fragment="grantDashboard (grant)" class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3 dashboard-card">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
<span th:replace="grants/fragments/grantStatusFragment :: grantStatus(grantStatus=${grant.status})"/>
|
||||||
|
</div>
|
||||||
|
<div class="col col-10 text-right">
|
||||||
|
<h7 class="service-heading" th:text="${grant.title}"> title</h7>
|
||||||
|
<p class="text-muted" th:text="${grant.status.statusName}"> status</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head th:fragment="headerfiles">
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div th:fragment="grantLine (grant)" class="row text-left grant-row" style="background-color: white;">
|
||||||
|
<div class="col">
|
||||||
|
<span th:replace="grants/fragments/grantStatusFragment :: grantStatus(grantStatus=${grant.status})"/>
|
||||||
|
<a th:href="@{'grant?id='+${grant.id}}">
|
||||||
|
<span class="h6" th:text="${grant.title}"/>
|
||||||
|
<span class="text-muted" th:text="${grant.comment}"/>
|
||||||
|
</a>
|
||||||
|
<input class="id-class" type="hidden" th:value="${grant.id}"/>
|
||||||
|
<a class="remove-paper pull-right d-none" th:href="@{'/grants/delete/'+${grant.id}}"
|
||||||
|
data-confirm="Удалить грант?">
|
||||||
|
<i class="fa fa-trash" aria-hidden="true"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,26 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head th:fragment="headerfiles">
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||||
|
<a href="./grants" class="btn btn-light toolbar-button"><i class="fa fa-list-alt"></i>
|
||||||
|
Список</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||||
|
<a href="./dashboard" class="btn btn-light toolbar-button"><i class="fa fa-newspaper-o"
|
||||||
|
aria-hidden="true"></i> Панель
|
||||||
|
управления</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12 col-sm-12 col-md-12 col-lg-4 col-xl-3">
|
||||||
|
<a href="./grant?id=0" class="btn btn-light toolbar-button"><i class="fa fa-plus-circle"
|
||||||
|
aria-hidden="true"></i>
|
||||||
|
Добавить грант</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head th:fragment="headerfiles">
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span th:fragment="paperStatus (paperStatus)" class="fa-stack fa-1x">
|
||||||
|
<th:block th:switch="${grantStatus.name()}">
|
||||||
|
<div th:case="'APPLICATION'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-draft"></i>
|
||||||
|
</div>
|
||||||
|
<div th:case="'ON_COMPETITION'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-review"></i>
|
||||||
|
</div>
|
||||||
|
<div th:case="'SUCCESSFUL_PASSAGE'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-accepted"></i>
|
||||||
|
</div>
|
||||||
|
<div th:case="'IN_WORK'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-primary"></i>
|
||||||
|
</div>
|
||||||
|
<div th:case="'COMPLETED'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-success"></i>
|
||||||
|
</div>
|
||||||
|
<div th:case="'FAILED'">
|
||||||
|
<i class="fa fa-circle fa-stack-2x text-failed"></i>
|
||||||
|
</div>
|
||||||
|
</th:block>
|
||||||
|
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
|
||||||
|
</span>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en"
|
||||||
|
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
layout:decorator="default" xmlns:th="">
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container" layout:fragment="content">
|
||||||
|
<form id="grants-form" method="post" th:action="@{'/grants/grants'}">
|
||||||
|
<input th:type="hidden" name="grantDeleteId" id="grantDeleteId"/>
|
||||||
|
<section id="grants">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row" id="grant-list">
|
||||||
|
<div class="col-lg-12 text-center">
|
||||||
|
<h2 class="section-heading text-uppercase">Гранты</h2>
|
||||||
|
<div th:replace="grants/fragments/grantNavigationFragment"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-9 col-sm-12">
|
||||||
|
<th:block th:each="grant : ${grants}">
|
||||||
|
<div th:replace="grants/fragments/grantLineFragment :: grantLine(grant=${grant})"/>
|
||||||
|
</th:block>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3 col-sm-12">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<div id="modalDelete"/>
|
||||||
|
</form>
|
||||||
|
<script src="/js/grants.js"></script>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue