Compare commits

...

32 Commits

Author SHA1 Message Date
04b3b311a9 Add pagination for indicators 2025-01-30 17:00:16 +04:00
55ff385407 Refactor packages 2025-01-30 16:46:27 +04:00
d36bdf6eca Partially add aspirant user 2025-01-30 16:40:36 +04:00
fc480dd559 Partially add file upload 2025-01-30 01:54:12 +04:00
1ac50fdd54 Add report models and controller 2025-01-30 01:35:06 +04:00
5155da2542 Add report form 2025-01-30 01:34:44 +04:00
290bec8f88 Add aspirant indicator read action 2025-01-30 00:44:48 +04:00
d4a797cfc3 Add menu item 2025-01-30 00:43:50 +04:00
ebb29d49d3 Fix 2025-01-29 20:17:39 +04:00
d04c61b683 Add aspirant manager 2025-01-29 20:17:11 +04:00
32d8779fd4 Add crud for manager 2025-01-29 19:56:56 +04:00
85936721aa Read additionally aspirant fields 2025-01-29 19:33:09 +04:00
f15a658f56 Add manager methods 2025-01-29 19:32:13 +04:00
4d1844d256 Add another aspirant fields 2025-01-29 19:31:52 +04:00
a503a36e8b Divide admin controllers and services 2025-01-29 14:14:48 +04:00
3b877050b7 Add aspirant edit templates 2025-01-29 14:14:22 +04:00
232dc68db4 Add aspirant edit templates 2025-01-29 14:14:06 +04:00
da65669c90 Add aspirant model 2025-01-29 14:13:47 +04:00
6ad4ea0083 Add aspirant model 2025-01-29 14:13:34 +04:00
10f65e11a2 Fix menu 2025-01-29 13:06:01 +04:00
a64c2772bd Add indicator courses 2025-01-29 12:54:07 +04:00
ec97b15c39 Add controller permissions 2025-01-29 10:35:08 +04:00
779ae11861 Add indicator proof docs description 2025-01-29 10:31:57 +04:00
bf57c20b96 Add indicator max value 2025-01-29 10:21:00 +04:00
8b8d64bd00 Add removing indicator 2025-01-29 09:25:39 +04:00
2ef33f1b68 Add indicator edit 2025-01-29 01:26:32 +04:00
5a4a968015 Show indicators list 2025-01-29 00:53:22 +04:00
405060152a Add dropdowns 2025-01-28 19:30:55 +04:00
7320f287c6 Create default users on start 2025-01-28 19:08:05 +04:00
595eb12607 Add roles and menu items 2025-01-28 18:53:26 +04:00
1e13c57938 Remove unused 2025-01-28 13:15:47 +04:00
b31dc27e7b Fix readme 2025-01-28 13:11:31 +04:00
57 changed files with 1629 additions and 102 deletions

View File

@ -1,9 +1,20 @@
# seminar
# Портал для аспирантов
JDK: https://download.oracle.com/java/17/archive/jdk-17.0.6_windows-x64_bin.exe
Порядок развертывания проекта разработчиками:
IDE: IntelliJIDEA community version https://www.jetbrains.com/ru-ru/idea/download/#section=windows
1. Скачать и установить JDK (используется 21 LTS
JDK): https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe
To run: run project and open http://localhost:8080/
2. Проверить установку, набрав в консоли команду "java -version"
Demo: http://seminar.athene.tech
3. Скачать и установить IDE: IntelliJIDEA Сommunity
version https://www.jetbrains.com/ru-ru/idea/download/#section=windows
4. Скачать и открыть проект в IDE:
![open.png](open.png)
5. Сформировать конфигурацию для запуска:
![run.png](run.png)
6. Запустить проект.
7. Открыть страницу в браузере http://localhost:8080/
8. Enjoy.

BIN
open.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
run.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -24,5 +24,8 @@ public class SeminarApplication {
public void doSomethingAfterStartup() {
System.out.println("hello world, I have just started up");
userService.initDefaultAdmin();
userService.initDefaultAspirant();
userService.initDefaultHead();
userService.initDefaultManager();
}
}

View File

@ -0,0 +1,51 @@
package ru.ulstu.admin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.RequestMapping;
import ru.ulstu.admin.model.AspirantForm;
import ru.ulstu.admin.service.AdminAspirantService;
import ru.ulstu.aspirant.model.Aspirant;
import ru.ulstu.indicator.model.Course;
@Controller
@RequestMapping("admin")
public class AdminAspirantController {
private final AdminAspirantService adminAspirantService;
public AdminAspirantController(AdminAspirantService adminAspirantService) {
this.adminAspirantService = adminAspirantService;
}
@GetMapping("aspirants")
public String getListOfAspirants(Model model) {
model.addAttribute("aspirants", adminAspirantService.getAspirants());
return "admin/aspirantsList";
}
@GetMapping("/editAspirant/{aspirantId}")
public String editAspirant(@PathVariable(value = "aspirantId") Integer id, Model model) {
model.addAttribute("aspirant",
new AspirantForm((id != null && id != 0)
? adminAspirantService.getAspirantById(id)
: new Aspirant()));
model.addAttribute("courses", Course.values());
model.addAttribute("managers", adminAspirantService.getManagers());
return "admin/editAspirant";
}
@PostMapping(value = "saveAspirant", params = "save")
public String saveAspirant(AspirantForm aspirantForm, Model model) {
adminAspirantService.saveAspirant(aspirantForm);
return "redirect:/admin/aspirants";
}
@PostMapping(value = "saveAspirant", params = "delete")
public String deleteIndicator(AspirantForm aspirantForm, Model model) {
adminAspirantService.deleteAspirant(aspirantForm);
return "redirect:/admin/aspirants";
}
}

View File

@ -0,0 +1,53 @@
package ru.ulstu.admin.controller;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.RequestMapping;
import ru.ulstu.admin.model.IndicatorForm;
import ru.ulstu.admin.service.AdminIndicatorService;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.model.UserRoleConstants;
@Controller
@RequestMapping("/admin")
@Secured({UserRoleConstants.ADMIN})
public class AdminIndicatorController {
private final AdminIndicatorService adminIndicatorService;
public AdminIndicatorController(AdminIndicatorService adminIndicatorService) {
this.adminIndicatorService = adminIndicatorService;
}
@GetMapping("indicators")
public String getListOfIndicators(Model model) {
model.addAttribute("indicators", adminIndicatorService.getIndicators());
return "admin/indicatorsList";
}
@GetMapping("/editIndicator/{indicatorId}")
public String editIndicator(@PathVariable(value = "indicatorId") Integer id, Model model) {
model.addAttribute("indicator",
(id != null && id != 0)
? adminIndicatorService.getIndicatorById(id)
: new Indicator());
model.addAttribute("courses", Course.values());
return "admin/editIndicator";
}
@PostMapping(value = "saveIndicator", params = "save")
public String saveIndicator(IndicatorForm indicatorForm, Model model) {
adminIndicatorService.saveIndicator(indicatorForm);
return "redirect:/admin/indicators";
}
@PostMapping(value = "saveIndicator", params = "delete")
public String deleteIndicator(IndicatorForm indicatorForm, Model model) {
adminIndicatorService.deleteIndicator(indicatorForm);
return "redirect:/admin/indicators";
}
}

View File

@ -0,0 +1,48 @@
package ru.ulstu.admin.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
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.RequestMapping;
import ru.ulstu.admin.model.ManagerForm;
import ru.ulstu.admin.service.AdminManagerService;
import ru.ulstu.manager.model.Manager;
@Controller
@RequestMapping("admin")
public class AdminManagerController {
private final AdminManagerService adminManagerService;
public AdminManagerController(AdminManagerService adminManagerService) {
this.adminManagerService = adminManagerService;
}
@GetMapping("managers")
public String getListOfManagers(Model model) {
model.addAttribute("managers", adminManagerService.getManagers());
return "admin/managersList";
}
@GetMapping("/editManager/{managerId}")
public String editManager(@PathVariable(value = "managerId") Integer id, Model model) {
model.addAttribute("manager",
(id != null && id != 0)
? adminManagerService.getManagerById(id)
: new Manager());
return "admin/editManager";
}
@PostMapping(value = "saveManager", params = "save")
public String saveManager(ManagerForm managerForm, Model model) {
adminManagerService.saveManager(managerForm);
return "redirect:/admin/managers";
}
@PostMapping(value = "saveManager", params = "delete")
public String deleteIndicator(ManagerForm managerForm, Model model) {
adminManagerService.deleteManager(managerForm);
return "redirect:/admin/managers";
}
}

View File

@ -0,0 +1,137 @@
package ru.ulstu.admin.model;
import ru.ulstu.aspirant.model.Aspirant;
import ru.ulstu.aspirant.model.Base;
import ru.ulstu.aspirant.model.Speciality;
import ru.ulstu.indicator.model.Course;
import java.util.Date;
public class AspirantForm {
private Integer id;
private String surname;
private String name;
private String patronymic;
private Course course;
private Integer managerId;
private Date birthDate;
private Speciality speciality;
private String theme;
private Base base;
private Integer userId;
private String email;
public AspirantForm() {
}
public AspirantForm(Aspirant aspirant) {
this.id = aspirant.getId();
this.name = aspirant.getName();
this.surname = aspirant.getSurname();
this.patronymic = aspirant.getPatronymic();
this.base = aspirant.getBase();
this.course = aspirant.getCourse();
this.managerId = aspirant.getManager() == null ? null : aspirant.getManager().getId();
this.birthDate = aspirant.getBirthDate();
this.speciality = aspirant.getSpeciality();
this.theme = aspirant.getTheme();
this.userId = aspirant.getUser() == null ? null : aspirant.getUser().getId();
this.email = aspirant.getUser() == null ? null : aspirant.getUser().getLogin();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPatronymic() {
return patronymic;
}
public void setPatronymic(String patronymic) {
this.patronymic = patronymic;
}
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public Integer getManagerId() {
return managerId;
}
public void setManagerId(Integer managerId) {
this.managerId = managerId;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Speciality getSpeciality() {
return speciality;
}
public void setSpeciality(Speciality speciality) {
this.speciality = speciality;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public Base getBase() {
return base;
}
public void setBase(Base base) {
this.base = base;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}

View File

@ -0,0 +1,69 @@
package ru.ulstu.admin.model;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.indicator.model.Indicator;
import java.util.ArrayList;
import java.util.List;
public class IndicatorForm {
private Integer id;
private String name;
private int max;
private String proofDocuments;
private List<Course> courses = new ArrayList<>();
public IndicatorForm() {
}
public IndicatorForm(Indicator indicator) {
this.name = indicator.getName();
this.max = indicator.getMax();
this.proofDocuments = indicator.getProofDocuments();
this.courses = indicator.getCourses();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public String getProofDocuments() {
return proofDocuments;
}
public void setProofDocuments(String proofDocuments) {
this.proofDocuments = proofDocuments;
}
public List<Course> getCourses() {
return courses;
}
public void setCourses(List<Course> courses) {
this.courses = courses;
}
}

View File

@ -0,0 +1,32 @@
package ru.ulstu.admin.model;
import ru.ulstu.manager.model.Manager;
public class ManagerForm {
private Integer id;
private String name;
public ManagerForm() {
}
public ManagerForm(Manager manager) {
this.id = manager.getId();
this.name = manager.getName();
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,66 @@
package ru.ulstu.admin.service;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.AspirantForm;
import ru.ulstu.aspirant.model.Aspirant;
import ru.ulstu.aspirant.service.AspirantService;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.manager.service.ManagerService;
import ru.ulstu.model.User;
import ru.ulstu.user.UserService;
import java.util.List;
@Service
public class AdminAspirantService {
private final AspirantService aspirantService;
private final ManagerService managerService;
private final UserService userService;
public AdminAspirantService(AspirantService aspirantService,
ManagerService managerService,
UserService userService) {
this.aspirantService = aspirantService;
this.managerService = managerService;
this.userService = userService;
}
public List<Aspirant> getAspirants() {
return aspirantService.getAspirants();
}
public Aspirant getAspirantById(Integer id) {
return aspirantService.getAspirantById(id);
}
public void saveAspirant(AspirantForm aspirantForm) {
Aspirant aspirant = aspirantForm.getId() == null
? new Aspirant()
: aspirantService.getAspirantById(aspirantForm.getId());
aspirant.setName(aspirantForm.getName());
aspirant.setSurname(aspirantForm.getSurname());
aspirant.setPatronymic(aspirantForm.getPatronymic());
aspirant.setBase(aspirantForm.getBase());
aspirant.setCourse(aspirantForm.getCourse());
aspirant.setManager(managerService.getManagerById(aspirantForm.getManagerId()));
aspirant.setBirthDate(aspirantForm.getBirthDate());
aspirant.setSpeciality(aspirantForm.getSpeciality());
aspirant.setTheme(aspirantForm.getTheme());
User user = userService.getUserById(aspirantForm.getUserId());
if (!user.getLogin().equals(aspirantForm.getEmail())) {
user.setLogin(aspirantForm.getEmail());
userService.createUser(user);
}
aspirant.setUser(user);
aspirantService.save(aspirant);
}
public void deleteAspirant(AspirantForm aspirantForm) {
aspirantService.deleteAspirant(aspirantForm);
}
public List<Manager> getManagers() {
return managerService.getManagers();
}
}

View File

@ -0,0 +1,40 @@
package ru.ulstu.admin.service;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.IndicatorForm;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.indicator.service.IndicatorService;
import java.util.List;
@Service
public class AdminIndicatorService {
private final IndicatorService indicatorService;
public AdminIndicatorService(IndicatorService indicatorService) {
this.indicatorService = indicatorService;
}
public List<Indicator> getIndicators() {
return indicatorService.getIndicatorList();
}
public void saveIndicator(IndicatorForm indicatorForm) {
Indicator indicator = indicatorForm.getId() == null
? new Indicator()
: indicatorService.getIndicatorById(indicatorForm.getId());
indicator.setName(indicatorForm.getName());
indicator.setMax(indicatorForm.getMax());
indicator.setProofDocuments(indicatorForm.getProofDocuments());
indicator.setCourses(indicatorForm.getCourses());
indicatorService.save(indicator);
}
public Indicator getIndicatorById(Integer id) {
return indicatorService.getIndicatorById(id);
}
public void deleteIndicator(IndicatorForm indicatorForm) {
indicatorService.deleteIndicator(indicatorForm);
}
}

View File

@ -0,0 +1,37 @@
package ru.ulstu.admin.service;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.ManagerForm;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.manager.service.ManagerService;
import java.util.List;
@Service
public class AdminManagerService {
private final ManagerService managerService;
public AdminManagerService(ManagerService managerService) {
this.managerService = managerService;
}
public List<Manager> getManagers() {
return managerService.getManagers();
}
public Manager getManagerById(Integer id) {
return managerService.getManagerById(id);
}
public void saveManager(ManagerForm managerForm) {
Manager manager = managerForm.getId() == null
? new Manager(managerForm)
: managerService.getManagerById(managerForm.getId());
manager.setName(managerForm.getName());
managerService.save(manager);
}
public void deleteManager(ManagerForm managerForm) {
managerService.deleteManager(managerForm);
}
}

View File

@ -0,0 +1,50 @@
package ru.ulstu.aspirant.controller;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ru.ulstu.aspirant.model.Report;
import ru.ulstu.aspirant.service.AspirantService;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.model.OffsetablePageRequest;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@Controller
@RequestMapping("aspirant")
public class AspirantController {
private static final Integer DEFAULT_PAGE_SIZE = 1;
private static final Integer DEFAULT_PAGE_NUMBER = 1;
private final AspirantService aspirantService;
public AspirantController(AspirantService aspirantService) {
this.aspirantService = aspirantService;
}
@GetMapping("aspirantReport")
public String createReport(Model model,
@RequestParam Optional<Integer> page,
@RequestParam Optional<Integer> size) {
int currentPage = page.orElse(DEFAULT_PAGE_NUMBER);
int pageSize = size.orElse(DEFAULT_PAGE_SIZE);
Page<Indicator> indicators = aspirantService.getIndicatorsByCourse(new OffsetablePageRequest(currentPage - 1, pageSize));
model.addAttribute("indicators", indicators);
int totalPages = indicators.getTotalPages();
if (totalPages > 0) {
List<Integer> pageNumbers = IntStream.rangeClosed(1, totalPages)
.boxed()
.collect(Collectors.toList());
model.addAttribute("pageNumbers", pageNumbers);
}
model.addAttribute("report", new Report());
return "aspirant/editReport";
}
}

View File

@ -0,0 +1,135 @@
package ru.ulstu.aspirant.model;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.model.BaseEntity;
import ru.ulstu.model.User;
import java.util.Date;
@Entity
public class Aspirant extends BaseEntity {
@NotEmpty
private String surname;
@NotEmpty
private String name;
private String patronymic;
@NotNull
private Course course;
@ManyToOne
private Manager manager;
@Temporal(TemporalType.DATE)
private Date birthDate;
@Enumerated(EnumType.STRING)
private Speciality speciality;
private String theme;
@Enumerated(EnumType.STRING)
private Base base;
@ManyToOne
private User user;
public Aspirant() {
}
public Aspirant(String name, Course course) {
this.name = name;
this.course = course;
}
public String getSurname() {
return surname;
}
public void setSurname(String surname) {
this.surname = surname;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPatronymic() {
return patronymic;
}
public void setPatronymic(String patronymic) {
this.patronymic = patronymic;
}
public Course getCourse() {
return course;
}
public void setCourse(Course course) {
this.course = course;
}
public Manager getManager() {
return manager;
}
public void setManager(Manager manager) {
this.manager = manager;
}
public Date getBirthDate() {
return birthDate;
}
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
}
public Speciality getSpeciality() {
return speciality;
}
public void setSpeciality(Speciality speciality) {
this.speciality = speciality;
}
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public Base getBase() {
return base;
}
public void setBase(Base base) {
this.base = base;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}

View File

@ -0,0 +1,15 @@
package ru.ulstu.aspirant.model;
public enum Base {
BUDGET("бюджет"), COMMERCE("коммерческая");
private final String name;
Base(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -0,0 +1,36 @@
package ru.ulstu.aspirant.model;
import jakarta.persistence.Entity;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import ru.ulstu.model.BaseEntity;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Entity
public class Report extends BaseEntity {
@Temporal(TemporalType.TIMESTAMP)
private Date createDate = new Date();
@OneToMany
private List<ReportValue> values = new ArrayList<>();
public List<ReportValue> getValues() {
return values;
}
public void setValues(List<ReportValue> values) {
this.values = values;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}

View File

@ -0,0 +1,30 @@
package ru.ulstu.aspirant.model;
import jakarta.persistence.Entity;
import jakarta.persistence.ManyToOne;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.model.BaseEntity;
@Entity
public class ReportValue extends BaseEntity {
@ManyToOne
private Indicator indicator;
private int indicatorValue;
public Indicator getIndicator() {
return indicator;
}
public void setIndicator(Indicator indicator) {
this.indicator = indicator;
}
public int getIndicatorValue() {
return indicatorValue;
}
public void setIndicatorValue(int indicatorValue) {
this.indicatorValue = indicatorValue;
}
}

View File

@ -0,0 +1,22 @@
package ru.ulstu.aspirant.model;
public enum Speciality {
S_2_3_7("2.3.7", "Системный анализ"),
S_2_3_1("2.3.1", "Автоматизация проектирования");
private final String code;
private final String name;
Speciality(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@ -0,0 +1,7 @@
package ru.ulstu.aspirant.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.ulstu.aspirant.model.Aspirant;
public interface AspirantRepository extends JpaRepository<Aspirant, Integer> {
}

View File

@ -0,0 +1,57 @@
package ru.ulstu.aspirant.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.AspirantForm;
import ru.ulstu.aspirant.model.Aspirant;
import ru.ulstu.aspirant.repository.AspirantRepository;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.indicator.service.IndicatorService;
import ru.ulstu.user.UserUtils;
import java.util.List;
@Service
public class AspirantService {
private final AspirantRepository aspirantRepository;
private final IndicatorService indicatorService;
public AspirantService(AspirantRepository aspirantRepository,
IndicatorService indicatorService) {
this.aspirantRepository = aspirantRepository;
this.indicatorService = indicatorService;
}
public List<Aspirant> getAspirants() {
return aspirantRepository.findAll();
}
public Aspirant getAspirantById(Integer id) {
return aspirantRepository.findById(id).orElseThrow(() -> new RuntimeException("Aspirant not found by id"));
}
public void save(Aspirant aspirant) {
aspirantRepository.save(aspirant);
}
public void deleteAspirant(AspirantForm aspirantForm) {
aspirantRepository.deleteById(aspirantForm.getId());
}
public Aspirant getAspirantByUser(String currentUserLogin) {
//return aspirantRepository.getAspirantByLogin();
//TODO: read aspirant
return aspirantRepository.findAll().stream().findAny().orElse(new Aspirant("default", Course.FIRST));
}
public List<Indicator> getIndicatorsByCourse() {
Aspirant aspirant = getAspirantByUser(UserUtils.getCurrentUserLogin());
return indicatorService.getIndicatorsByCourse(aspirant.getCourse());
}
public Page<Indicator> getIndicatorsByCourse(Pageable pageable) {
return indicatorService.getIndicatorsByCourse(pageable);
}
}

View File

@ -9,7 +9,7 @@ package ru.ulstu.controller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import ru.ulstu.news.NewsService;
import ru.ulstu.news.service.NewsService;
@Controller
public class IndexController {

View File

@ -0,0 +1,18 @@
package ru.ulstu.indicator.model;
public enum Course {
FIRST("первый"),
SECOND("второй"),
THIRD("третий"),
FOURTH("четвертый");
private final String name;
Course(String name) {
this.name = name;
}
public String getName() {
return name;
}
}

View File

@ -0,0 +1,70 @@
package ru.ulstu.indicator.model;
import jakarta.persistence.CollectionTable;
import jakarta.persistence.ElementCollection;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.Lob;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import ru.ulstu.model.BaseEntity;
import java.util.ArrayList;
import java.util.List;
@Entity
public class Indicator extends BaseEntity {
@NotBlank
private String name;
@Min(0)
@Max(30)
private int max;
@NotBlank
@Lob
private String proofDocuments;
@ElementCollection(targetClass = Course.class)
@CollectionTable
@Enumerated(EnumType.STRING)
private List<Course> courses = new ArrayList<>();
public Indicator() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMax() {
return max;
}
public void setMax(int max) {
this.max = max;
}
public String getProofDocuments() {
return proofDocuments;
}
public void setProofDocuments(String proofDocuments) {
this.proofDocuments = proofDocuments;
}
public List<Course> getCourses() {
return courses;
}
public void setCourses(List<Course> courses) {
this.courses = courses;
}
}

View File

@ -0,0 +1,16 @@
package ru.ulstu.indicator.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.indicator.model.Indicator;
import java.util.List;
public interface IndicatorRepository extends JpaRepository<Indicator, Integer> {
Indicator findByName(String name);
@Query("select i from Indicator i WHERE :course member of i.courses")
List<Indicator> findAllByCourse(@Param("course") Course course);
}

View File

@ -0,0 +1,48 @@
package ru.ulstu.indicator.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.IndicatorForm;
import ru.ulstu.indicator.model.Course;
import ru.ulstu.indicator.model.Indicator;
import ru.ulstu.indicator.repository.IndicatorRepository;
import java.util.List;
@Service
public class IndicatorService {
private final IndicatorRepository indicatorRepository;
public IndicatorService(IndicatorRepository indicatorRepository) {
this.indicatorRepository = indicatorRepository;
}
public List<Indicator> getIndicatorList() {
return indicatorRepository.findAll();
}
public void save(Indicator indicator) {
indicatorRepository.save(indicator);
}
public Indicator findByName(String name) {
return indicatorRepository.findByName(name);
}
public Indicator getIndicatorById(Integer id) {
return indicatorRepository.findById(id).orElseThrow(() -> new RuntimeException("Indicator not found"));
}
public void deleteIndicator(IndicatorForm indicatorForm) {
indicatorRepository.deleteById(indicatorForm.getId());
}
public List<Indicator> getIndicatorsByCourse(Course course) {
return indicatorRepository.findAllByCourse(course);
}
public Page<Indicator> getIndicatorsByCourse(Pageable pageable) {
return indicatorRepository.findAll(pageable);
}
}

View File

@ -0,0 +1,25 @@
package ru.ulstu.manager.model;
import jakarta.persistence.Entity;
import ru.ulstu.admin.model.ManagerForm;
import ru.ulstu.model.BaseEntity;
@Entity
public class Manager extends BaseEntity {
private String name;
public Manager() {
}
public Manager(ManagerForm managerForm) {
this.name = managerForm.getName();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@ -0,0 +1,7 @@
package ru.ulstu.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.ulstu.manager.model.Manager;
public interface ManagerRepository extends JpaRepository<Manager, Integer> {
}

View File

@ -0,0 +1,33 @@
package ru.ulstu.manager.service;
import org.springframework.stereotype.Service;
import ru.ulstu.admin.model.ManagerForm;
import ru.ulstu.manager.model.Manager;
import ru.ulstu.manager.repository.ManagerRepository;
import java.util.List;
@Service
public class ManagerService {
private final ManagerRepository managerRepository;
public ManagerService(ManagerRepository managerRepository) {
this.managerRepository = managerRepository;
}
public List<Manager> getManagers() {
return managerRepository.findAll();
}
public Manager getManagerById(Integer id) {
return managerRepository.findById(id).orElseThrow(() -> new RuntimeException("Manager not found by id"));
}
public void save(Manager manager) {
managerRepository.save(manager);
}
public void deleteManager(ManagerForm managerForm) {
managerRepository.deleteById(managerForm.getId());
}
}

View File

@ -9,7 +9,7 @@ import jakarta.persistence.Transient;
import jakarta.validation.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import ru.ulstu.model.BaseEntity;
import ru.ulstu.news.News;
import ru.ulstu.news.model.News;
import java.util.Date;

View File

@ -5,8 +5,8 @@ import jakarta.validation.constraints.NotNull;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import ru.ulstu.news.News;
import ru.ulstu.news.NewsService;
import ru.ulstu.news.model.News;
import ru.ulstu.news.service.NewsService;
@Service
public class MeetingService {

View File

@ -2,5 +2,7 @@ package ru.ulstu.model;
public class UserRoleConstants {
public static final String ADMIN = "ROLE_ADMIN";
public static final String USER = "ROLE_USER";
public static final String ASPIRANT = "ROLE_ASPIRANT";
public static final String MANAGER = "ROLE_MANAGER";
public static final String HEAD = "ROLE_HEAD";
}

View File

@ -4,7 +4,7 @@
*
*/
package ru.ulstu.news;
package ru.ulstu.news.controller;
import jakarta.validation.Valid;
import org.springframework.data.domain.Page;
@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import ru.ulstu.model.OffsetablePageRequest;
import ru.ulstu.model.UserRoleConstants;
import ru.ulstu.news.model.News;
import ru.ulstu.news.service.NewsService;
import java.util.List;
import java.util.Optional;

View File

@ -1,4 +1,4 @@
package ru.ulstu.news;
package ru.ulstu.news.model;
import jakarta.persistence.Entity;
import jakarta.persistence.Lob;

View File

@ -1,8 +1,9 @@
package ru.ulstu.news;
package ru.ulstu.news.repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import ru.ulstu.news.model.News;
import java.util.List;

View File

@ -1,4 +1,4 @@
package ru.ulstu.news;
package ru.ulstu.news.service;
import jakarta.transaction.Transactional;
import jakarta.validation.constraints.NotNull;
@ -6,6 +6,8 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import ru.ulstu.meeting.Meeting;
import ru.ulstu.news.model.News;
import ru.ulstu.news.repository.NewsRepository;
import java.util.Date;
import java.util.List;

View File

@ -57,18 +57,41 @@ public class UserService implements UserDetailsService {
if (getUserByLogin(user.getLogin()) != null) {
throw new RuntimeException(user.getLogin());
}
User dbUser = (user.getId() == null)
? user
: getUserById(user.getId());
//user.setRoles(Collections.singleton(new UserRole(UserRoleConstants.USER)));
user.setPassword(passwordEncoder.encode(user.getPassword()));
user = userRepository.save(user);
log.debug("Created Information for User: {}", user.getLogin());
return user;
dbUser.setPassword(passwordEncoder.encode(user.getPassword()));
dbUser.setLogin(user.getLogin());
dbUser = userRepository.save(dbUser);
log.debug("Created Information for User: {}", dbUser.getLogin());
return dbUser;
}
public User getUserById(Integer id) {
return userRepository.findById(id).orElseThrow(() -> new RuntimeException("User not found by id"));
}
private void createDefaultUser(String login, String userRole) {
if (getUserByLogin(login) == null) {
UserRole role = userRoleRepository.save(new UserRole(userRole.toString()));
createUser(new User(login, login.equals("admin") ? adminPassword : login, Set.of(role)));
}
}
public void initDefaultAdmin() {
String adminLogin = "admin";
if (getUserByLogin(adminLogin) == null) {
UserRole adminRole = userRoleRepository.save(new UserRole(UserRoleConstants.ADMIN));
createUser(new User(adminLogin, adminPassword, Set.of(adminRole)));
}
createDefaultUser("admin", UserRoleConstants.ADMIN);
}
public void initDefaultAspirant() {
createDefaultUser("aspirant", UserRoleConstants.ASPIRANT);
}
public void initDefaultManager() {
createDefaultUser("manager", UserRoleConstants.MANAGER);
}
public void initDefaultHead() {
createDefaultUser("head", UserRoleConstants.HEAD);
}
}

View File

@ -3,6 +3,6 @@
# You may use, distribute and modify this code, please write to: romanov73@gmail.com.
#
#
messages.app-name=Cеминар «Анализ данных и процессов». УлГТУ
messages.logo-title=Cеминар «Анализ данных и процессов»
messages.app-name=БРС аспиранта УлГТУ
messages.logo-title=БРС аспиранта УлГТУ
messages.menu.home=На главную

Binary file not shown.

View File

@ -0,0 +1,24 @@
(function($) {
$.fn.bootstrapFileInput = function(loadDirectory = false) {
var fileInput = $('<input type="file" class="input-ghost" ' + (loadDirectory ? 'webkitdirectory' : '') +' style="visibility:hidden; height:0">');
fileInput.change(function() {
$('#file-input-list').html('');
const files = $(this).prop('files');
if (files.length == 0) {
return;
}
var filesList = '';
$.each(files, function(index, file){
filesList += '<div style="overflow: hidden"><span id="file-' + index + '"><i class="fa fa-circle-o"></i> ' + file.name + '</span></div>';
});
$('#file-input-list').html(filesList);
});
$(this).find('button.btn-choose').click(function() {
fileInput.click();
});
$(this).find('input').mousedown(function() {
return false;
});
$(this).append(fileInput);
};
})(jQuery);

View File

@ -0,0 +1,17 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<a href="/admin/editAspirant/0" class="btn btn-outline-dark">
<i class="fa fa-plus-square" aria-hidden="true"> Добавить аспиранта</i>
</a>
<ul>
<li th:each="a : ${aspirants}">
<a th:href="@{'/admin/editAspirant/' + ${a.id}}">
<span th:text="${a.surname} + ' '+ ${a.name} + ' ' + ${a.patronymic}"></span>
</a>
</li>
</ul>
</div>
</html>

View File

@ -0,0 +1,112 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<h3>Редактирование аспиранта:</h3>
<form action="#" th:action="@{/admin/saveAspirant}"
th:object="${aspirant}"
method="post">
<input type="hidden" th:field="*{id}">
<input type="hidden" th:field="*{userId}">
<div class="form-group">
<label for="surname">Фамилия</label>
<input th:field="*{surname}"
id="surname"
type="text"
required
class="form-control"
placeholder="Фамилия">
<p th:if="${#fields.hasErrors('surname')}"
th:class="${#fields.hasErrors('surname')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="name">Имя</label>
<input th:field="*{name}"
id="name"
type="text"
required
class="form-control"
placeholder="Имя">
<p th:if="${#fields.hasErrors('name')}"
th:class="${#fields.hasErrors('name')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="patronymic">Отчество</label>
<input th:field="*{patronymic}"
id="patronymic"
type="text"
class="form-control"
placeholder="Отчество">
<p th:if="${#fields.hasErrors('patronymic')}"
th:class="${#fields.hasErrors('patronymic')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="email">Email</label>
<input th:field="*{email}"
id="email"
required
type="email"
class="form-control"
placeholder="Email">
<p th:if="${#fields.hasErrors('email')}"
th:class="${#fields.hasErrors('email')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="course">Курс</label>
<select class="form-select form-control"
id="course" aria-label="multiple select example"
th:field="*{course}">
<option th:each="c : ${courses}"
th:value="${c}"
th:text="${c.name}">
</option>
</select>
</div>
<div class="form-group">
<label for="theme">Тема</label>
<input th:field="*{theme}"
id="theme"
type="text"
class="form-control"
placeholder="Тема">
</div>
<div class="form-group">
<label for="manager">Научный руководитель</label>
<select class="form-select form-control"
id="manager" aria-label="select example"
th:field="*{managerId}">
<option th:each="m : ${managers}"
th:value="${m.id}"
th:text="${m.name}">
</option>
</select>
</div>
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
<button name="delete"
type="submit"
class="btn btn-outline-dark"
onclick="return confirm('Удалить запись?')">
Удалить
</button>
<a href="/admin/aspirants" class="btn btn-outline-dark">Отмена</a>
</form>
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
</div>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<h3>Редактирование показателя:</h3>
<form action="#" th:action="@{/admin/saveIndicator}"
th:object="${indicator}"
method="post"
enctype="multipart/form-data">
<input type="hidden" th:field="*{id}">
<div class="form-group">
<label for="name">Название</label>
<input th:field="*{name}"
id="name"
type="text"
required
class="form-control"
placeholder="Название показателя">
<p th:if="${#fields.hasErrors('name')}"
th:class="${#fields.hasErrors('name')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="name">Максимальная сумма баллов</label>
<input th:field="*{max}"
required
id="max"
type="number"
class="form-control"
min="0"
max="30">
</div>
<div class="form-group">
<label for="name">Описание подтверждающих документов</label>
<textarea th:field="*{proofDocuments}"
required
id="proofDocuments"
class="form-control"
placeholder="Описание подтверждающих документов"
style="height: 100px">
</textarea>
<p th:if="${#fields.hasErrors('proofDocuments')}"
th:class="${#fields.hasErrors('proofDocuments')}? error">
Не может быть пустым
</p>
</div>
<div class="form-group">
<label for="courses">Для каких курсов применяется</label>
<select class="form-select form-control" id="courses" multiple aria-label="multiple select example"
th:field="*{courses}"
>
<option th:each="c : ${courses}"
th:value="${c}"
th:text="${c.name}">
</option>
</select>
</div>
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
<button name="delete"
type="submit"
class="btn btn-outline-dark"
onclick="return confirm('Удалить показатель?')">
Удалить
</button>
<a href="/admin/indicators" class="btn btn-outline-dark">Отмена</a>
</form>
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
</div>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<h3>Редактирование научного руководителя:</h3>
<form action="#" th:action="@{/admin/saveManager}"
th:object="${manager}"
method="post">
<input type="hidden" th:field="*{id}">
<div class="form-group">
<label for="name">ФИО</label>
<input th:field="*{name}"
id="name"
type="text"
required
class="form-control"
placeholder="ФИО">
<p th:if="${#fields.hasErrors('name')}"
th:class="${#fields.hasErrors('name')}? error">
Не может быть пустым
</p>
</div>
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
<button name="delete"
type="submit"
class="btn btn-outline-dark"
onclick="return confirm('Удалить запись?')">
Удалить
</button>
<a href="/admin/aspirants" class="btn btn-outline-dark">Отмена</a>
</form>
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
</div>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<a href="/admin/editIndicator/0" class="btn btn-outline-dark">
<i class="fa fa-plus-square" aria-hidden="true"> Добавить показатель</i>
</a>
<ul>
<li th:each="i : ${indicators}">
<a th:href="@{'/admin/editIndicator/' + ${i.id}}"><span th:text="${i.name}"></span></a>
</li>
</ul>
</div>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<a href="/admin/editManager/0" class="btn btn-outline-dark">
<i class="fa fa-plus-square" aria-hidden="true"> Добавить научного руководителя</i>
</a>
<ul>
<li th:each="m : ${managers}">
<a th:href="@{'/admin/editManager/' + ${m.id}}">
<span th:text="${m.name}"></span>
</a>
</li>
</ul>
</div>
</html>

View File

@ -0,0 +1,114 @@
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
layout:decorate="~{default}">
<div class="container" layout:fragment="content">
<h3 th:text="${'Редактирование отчета аспиранта '} +${report.createDate}"></h3>
<form action="#" th:action="@{/aspirant/saveReport}"
th:object="${report}"
method="post">
<input type="hidden" th:field="*{id}">
<div class="form-group" th:each="i, ind : ${indicators}">
<label th:text="${i.name}"></label>
<div class="form-group">
<button class="form-control btn btn-danger" type="button" onclick="deleteAllFiles();">Удалить все
документы
</button>
</div>
<div id="input-file" class="form-group">
<button class="btn btn-primary btn-upload btn-choose pull-right" type="button">Обзор</button>
<button class="btn btn-success btn-upload" type="button" onclick="uploadFile();">Загрузить</button>
</div>
<div id="file-input-list" class="form-group">
</div>
</div>
<th:block layout:fragment="scripts">
<script src="/js/bootstrap.file-input.js"></script>
<script th:inline="javascript">
/*<![CDATA[*/
$(document).ready(function() {
uploadFile = function(index = 0) {
const files = $('#input-file .input-ghost').prop('files');
if (index == 0) {
showFeedbackMessage();
$('button').prop('disabled', true);
}
if (index >= files.length) {
$('button').prop('disabled', false);
$('#input-file .input-ghost').val('');
return;
}
$('#file-' + index + ' i').removeClass('fa-circle-o').addClass('fa-circle-o-notch fa-spin');
$('#file-' + index).removeClass('alert-danger alert-success');
var response = false;
var formData = new FormData();
formData.append('file', files[index]);
uploadAjax('api/1.0/documents.upload', formData,
(result) => {
if (!result) {
return;
}
response = result.response;
},
null,
() => {
var resultIcon = 'fa-times-circle-o';
var resultStyle = 'alert-danger';
if (response) {
resultIcon = 'fa-check-circle-o';
resultStyle = 'alert-success';
}
$('#file-' + index + ' i').removeClass('fa-circle-o-notch fa-spin').addClass(resultIcon);
$('#file-' + index).addClass(resultStyle);
uploadFile(index + 1);
});
};
deleteAllFiles = function() {
$('#file-input-list').html('');
//input.replaceWith(input = input.val('').clone(true));
$('#spinner').show()
getAjax('api/1.0/documents.delete_all',
(result) => {
if (result.response) {
showFeedbackMessage('Удалено ' + result.response + ' документов');
}
if (result.error) {
showFeedbackMessage(result.error, 'danger');
}
},
null,
() => $('#spinner').hide(),
'DELETE'
);
};
$('#input-file').bootstrapFileInput(true);
});
/*]]>*/
</script>
</th:block>
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
<button name="delete"
type="submit"
class="btn btn-outline-dark"
onclick="return confirm('Удалить запись?')">
Удалить
</button>
<a href="/aspirant/reports" class="btn btn-outline-dark">Отмена</a>
</form>
<div th:if="${indicators.totalPages > 0}" class="pagination">
<span style="float: left; padding: 5px 5px;">Страницы:</span>
</div>
<div th:if="${indicators.totalPages > 0}" class="pagination"
th:each="pageNumber : ${pageNumbers}">
<a th:href="@{/aspirant/aspirantReport(size=${indicators.size}, page=${pageNumber})}"
th:text=${pageNumber}
th:class="${pageNumber == indicators.number+1} ? active"></a>
</div>
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
</div>
</html>

View File

@ -29,26 +29,59 @@
<li class="nav-item">
<a class="nav-link" href="/news/news">Новости</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/meetings/meetings">Заседания</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/organizers">Организаторы</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/docs">Документы</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/reports">Отчеты</a>
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ASPIRANT')">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">Аспиранту</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/aspirant/aspirantReport">Новый отчет аспиранта по БРС</a>
<a class="dropdown-item" href="/aspirant/listAspirantReports">Список отчетов</a>
</div>
</li>
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_MANAGER')">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">Руководителю</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/aspirantList">Список аспирантов</a>
<a class="dropdown-item" href="/listAspirantReports">Список отчетов</a>
</div>
</li>
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_HEAD')">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">Аспирантура</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/listAspirantReports">Список отчетов</a>
</div>
</li>
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ADMIN')">
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">Администратору</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="/admin/indicators">Список показателей</a>
<a class="dropdown-item" href="/admin/managers">Список научных руководителей</a>
<a class="dropdown-item" href="/admin/aspirants">Список аспирантов</a>
<a class="dropdown-item" href="/admin">Новости и заседания</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin">Администратору</a>
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_ADMIN')">Личный кабинет
администратора</a>
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_ASPIRANT')">Личный кабинет
аспиранта</a>
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_MANAGER')">Личный кабинет
руководителя аспиранта</a>
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_HEAD')">Личный кабинет
представителя аспирантуры</a>
</li>
<li>
<div sec:authorize="isAuthenticated()">
<a class="nav-link" href="/logout">Выход</a>
</div>
<div sec:authorize="!isAuthenticated()">
<a class="nav-link" href="/login">Личный кабинет</a>
</div>
</li>
</ul>
</div>
@ -91,7 +124,7 @@
</div>
<footer>
2022
2025
</footer>
</body>
</html>

View File

@ -3,13 +3,8 @@
<div class="container" layout:fragment="content">
<ul class="list-group">
<li class="list-group-item">
<a class="link-dark" href="/docs/polozh.docx">
Положение
</a>
</li>
<li class="list-group-item">
<a class="link-dark" href="/docs/plan2022.docx">
План заседаний на 2022 год.
<a class="link-dark" target="_blank" href="/docs/polozh.pdf">
Положение о балльно-рейтинговой системе оценки успеваемости аспирантов
</a>
</li>
</ul>

View File

@ -45,6 +45,5 @@
th:text=${pageNumber}
th:class="${pageNumber == news.number+1} ? active"></a>
</div>
</div>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
width="1000"
height="1000"
viewBox="0 0 500 500"
xml:space="preserve"
id="svg45"
sodipodi:docname="IS_logo_black.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview47"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="true"
showgrid="false"
showborder="false"
inkscape:zoom="0.769"
inkscape:cx="500"
inkscape:cy="500"
inkscape:window-width="1920"
inkscape:window-height="991"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:current-layer="svg45" />
<desc
id="desc29">Created with Fabric.js 4.6.0</desc>
<defs
id="defs31">
</defs>
<path
id="path33"
style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
d="M 614.48828 177.41406 C 585.03403 177.64615 555.102 180 528 180 C 509.268 180 474.11592 173.20281 457.41992 181.83789 C 441.12592 190.26483 422.34 188.47467 404 190.33789 C 365.3278 194.26683 326.787 197.16411 288 199.82031 C 261.38 201.64331 230.50279 201.95901 212.77539 226.25781 C 196.16547 249.02541 217.5264 250.08661 219.7832 270.00781 C 223.4616 302.47861 220 337.3084 220 370 C 220 424.688 216.64862 482.378 228.69922 536 C 234.13282 560.178 241.07448 585.21445 258.58008 603.81445 C 286.96128 633.96645 327.183 628.83584 364 632.33984 C 434.958 639.09184 507.266 629.02169 578 624.17969 C 620.728 621.25169 671.094 620.42538 710 600.35938 C 785.886 561.21938 770.028 472.564 770 402 C 769.978 343.7938 783.18837 263.01536 746.73438 213.03516 C 735.77437 198.01096 714.65742 193.13757 698.10742 187.56055 C 672.91842 179.07202 643.94253 177.18197 614.48828 177.41406 z M 451.28516 278.24414 C 508.18157 277.94477 575.51534 292.60888 617.99609 321.03906 C 665.52009 352.84446 673.38009 409.60016 625.99609 446.66016 C 609.19809 459.79816 583.47409 470.56595 561.99609 465.75195 C 553.62409 463.87395 546.58609 456.87805 537.99609 456.49805 C 522.09609 455.79605 512.77609 463.8217 495.99609 456.5957 C 476.36009 448.1397 462.80717 414.5508 471.20117 394.2168 C 474.36317 386.5588 491.70145 379.35103 497.93945 387.20703 C 508.38745 400.36503 494.40964 432.52702 516.18164 440.79102 C 530.60964 446.26702 534.58192 411.00817 555.66992 414.32617 C 563.02792 415.48417 559.99497 424.656 562.04297 430 C 565.00297 437.722 572.19609 445.56767 579.99609 448.51367 C 613.82609 461.29167 642.2743 406.694 629.9043 380 C 614.3683 346.4774 578.65809 326.98059 545.99609 313.90039 C 482.01609 288.27899 396.70598 263.8648 347.51758 330 C 318.46498 369.0616 331.97353 426.708 360.51953 462 C 409.14233 522.116 497.53009 557.79392 573.99609 553.91992 C 589.34209 553.14192 620.65517 534.20281 630.95117 522.88281 C 639.49717 513.48281 642.08522 495.18492 661.69922 503.79492 C 677.95722 510.93492 656.70214 530.07166 649.99414 535.34766 C 623.11814 556.49766 583.00409 562 549.99609 562 C 468.35409 562 372.36956 530.03 324.10156 460 C 268.98216 380.028 324.58909 293.80382 413.99609 280.85742 C 425.58059 279.17993 438.15521 278.31323 451.28516 278.24414 z "
transform="scale(0.5)" />
<path
id="path39"
style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
d="M 668.33594 643.47656 C 662.50706 643.55654 656.40463 644.00634 650 644.84766 C 557.68 656.97566 466.83 659.8418 374 659.8418 C 334.445 659.8418 285.9012 644.14103 248 660.95703 C 236.5832 666.02303 220.35223 674.28205 214.67383 685.99805 C 208.78323 698.15205 227.05259 701.474 224.27539 714 C 219.13139 737.202 163.19081 780.43105 192.00977 796.62305 C 213.03631 808.43705 243.23832 802.31272 265.85352 808.63672 C 272.15212 810.39872 271.30588 817.50928 276.70508 819.36328 C 297.12228 826.37328 330.3592 820 352 820 L 522 820 C 564.108 820 614.34895 827.63112 655.62695 819.70312 C 662.58095 818.36712 661.85506 809.62887 670.03906 808.29688 C 720.71106 800.04488 767.32912 814.45956 813.70312 783.85156 C 829.97513 773.11156 793.83588 738.344 786.17188 726 C 755.44819 676.52238 724.68174 642.70346 668.33594 643.47656 z M 632.96094 696.08594 C 656.9772 696.33526 670.5987 710.58 684.6582 732 C 687.2762 735.988 699.90202 751.25736 696.16602 755.94336 C 692.75802 760.21936 680.742 757.31823 676 757.49023 C 655.976 758.22223 636.016 761.75419 616 761.99219 C 537.304 762.92819 456.724 769.21231 378 763.82031 C 355.2814 762.26631 332.628 759.24231 310 756.57031 C 305.7648 756.07031 289.0863 758.23892 287.8125 752.79492 C 284.9009 740.34892 309.79135 708.10719 322.00195 708.11719 C 423.72835 708.20119 520.668 711.33947 622 696.85547 C 625.88675 696.29997 629.53004 696.05032 632.96094 696.08594 z "
transform="scale(0.5)" />
</svg>

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

View File