├── src └── main │ ├── resources │ ├── messages.properties │ ├── static │ │ ├── images │ │ │ ├── bann.png │ │ │ └── bg.png │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── js │ │ │ ├── dataTables.bootstrap.min.js │ │ │ ├── dataTables.uikit.min.js │ │ │ ├── dataTables.jqueryui.min.js │ │ │ ├── main.js │ │ │ ├── jquery.easing.min.js │ │ │ └── bootbox.min.js │ │ └── css │ │ │ ├── dataTables.uikit.min.css │ │ │ ├── dataTables.bootstrap.min.css │ │ │ ├── main.css │ │ │ ├── bootstrap-datetimepicker.min.css │ │ │ ├── jquery.dataTables.min.css │ │ │ └── dataTables.jqueryui.min.css │ ├── application.properties │ └── templates │ │ ├── withdraw.html │ │ ├── deposit.html │ │ ├── index.html │ │ ├── toSomeoneElse.html │ │ ├── betweenAccounts.html │ │ ├── savingsAccount.html │ │ ├── primaryAccount.html │ │ ├── appointment.html │ │ ├── recipient.html │ │ ├── userFront.html │ │ ├── profile.html │ │ ├── common │ │ └── header.html │ │ └── signup.html │ └── java │ └── com │ └── userfront │ ├── dao │ ├── RoleDao.java │ ├── AppointmentDao.java │ ├── PrimaryTransactionDao.java │ ├── SavingsTransactionDao.java │ ├── UserDao.java │ ├── PrimaryAccountDao.java │ ├── SavingsAccountDao.java │ └── RecipientDao.java │ ├── UserFrontApplication.java │ ├── service │ ├── AppointmentService.java │ ├── AccountService.java │ ├── UserService.java │ ├── UserServiceImpl │ │ ├── AppointmentServiceImpl.java │ │ ├── UserSecurityService.java │ │ ├── UserServiceImpl.java │ │ ├── AccountServiceImpl.java │ │ └── TransactionServiceImpl.java │ └── TransactionService.java │ ├── domain │ ├── security │ │ ├── Authority.java │ │ ├── Role.java │ │ └── UserRole.java │ ├── SavingsAccount.java │ ├── PrimaryAccount.java │ ├── Recipient.java │ ├── Appointment.java │ ├── SavingsTransaction.java │ ├── PrimaryTransaction.java │ └── User.java │ ├── resource │ ├── AppointmentResource.java │ └── UserResource.java │ ├── controller │ ├── UserController.java │ ├── AppointmentController.java │ ├── HomeController.java │ ├── AccountController.java │ └── TransferController.java │ └── config │ ├── RequestFilter.java │ └── SecurityConfig.java ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .gitignore ├── README.md ├── pom.xml ├── mvnw.cmd └── mvnw /src/main/resources/messages.properties: -------------------------------------------------------------------------------- 1 | #signupForm 2 | title.signupForm = Signup 3 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /src/main/resources/static/images/bann.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/images/bann.png -------------------------------------------------------------------------------- /src/main/resources/static/images/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/images/bg.png -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip 2 | -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/resources/static/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ryhan000/Online-Banking-System/HEAD/src/main/resources/static/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/RoleDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | 5 | import com.userfront.domain.security.Role; 6 | 7 | public interface RoleDao extends CrudRepository { 8 | Role findByName(String name); 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | 4 | ### STS ### 5 | .apt_generated 6 | .classpath 7 | .factorypath 8 | .project 9 | .settings 10 | .springBeans 11 | 12 | ### IntelliJ IDEA ### 13 | .idea 14 | *.iws 15 | *.iml 16 | *.ipr 17 | 18 | ### NetBeans ### 19 | nbproject/private/ 20 | build/ 21 | nbbuild/ 22 | dist/ 23 | nbdist/ 24 | .nb-gradle/ -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/AppointmentDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.userfront.domain.Appointment; 8 | 9 | public interface AppointmentDao extends CrudRepository { 10 | 11 | List findAll(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/PrimaryTransactionDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.userfront.domain.PrimaryTransaction; 8 | 9 | public interface PrimaryTransactionDao extends CrudRepository { 10 | 11 | List findAll(); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/SavingsTransactionDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.userfront.domain.SavingsTransaction; 8 | 9 | public interface SavingsTransactionDao extends CrudRepository { 10 | 11 | List findAll(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.userfront.domain.User; 8 | 9 | public interface UserDao extends CrudRepository { 10 | User findByUsername(String username); 11 | User findByEmail(String email); 12 | List findAll(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/UserFrontApplication.java: -------------------------------------------------------------------------------- 1 | package com.userfront; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class UserFrontApplication { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(UserFrontApplication.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/PrimaryAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import com.userfront.domain.PrimaryAccount; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | /** 7 | * Created by z00382545 on 10/21/16. 8 | */ 9 | public interface PrimaryAccountDao extends CrudRepository { 10 | 11 | PrimaryAccount findByAccountNumber (int accountNumber); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/SavingsAccountDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import com.userfront.domain.SavingsAccount; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | /** 7 | * Created by z00382545 on 10/21/16. 8 | */ 9 | public interface SavingsAccountDao extends CrudRepository { 10 | 11 | SavingsAccount findByAccountNumber (int accountNumber); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/AppointmentService.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service; 2 | 3 | import java.util.List; 4 | 5 | import com.userfront.domain.Appointment; 6 | 7 | public interface AppointmentService { 8 | Appointment createAppointment(Appointment appointment); 9 | 10 | List findAll(); 11 | 12 | Appointment findAppointment(Long id); 13 | 14 | void confirmAppointment(Long id); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/dao/RecipientDao.java: -------------------------------------------------------------------------------- 1 | package com.userfront.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.repository.CrudRepository; 6 | 7 | import com.userfront.domain.Recipient; 8 | 9 | public interface RecipientDao extends CrudRepository { 10 | List findAll(); 11 | 12 | Recipient findByName(String recipientName); 13 | 14 | void deleteByName(String recipientName); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/security/Authority.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain.security; 2 | 3 | import org.springframework.security.core.GrantedAuthority; 4 | 5 | 6 | public class Authority implements GrantedAuthority{ 7 | 8 | private final String authority; 9 | 10 | public Authority(String authority) { 11 | this.authority = authority; 12 | } 13 | 14 | @Override 15 | public String getAuthority() { 16 | return authority; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/AccountService.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service; 2 | 3 | import java.security.Principal; 4 | 5 | import com.userfront.domain.PrimaryAccount; 6 | import com.userfront.domain.PrimaryTransaction; 7 | import com.userfront.domain.SavingsAccount; 8 | import com.userfront.domain.SavingsTransaction; 9 | 10 | public interface AccountService { 11 | PrimaryAccount createPrimaryAccount(); 12 | SavingsAccount createSavingsAccount(); 13 | void deposit(String accountType, double amount, Principal principal); 14 | void withdraw(String accountType, double amount, Principal principal); 15 | 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import com.userfront.domain.User; 7 | import com.userfront.domain.security.UserRole; 8 | 9 | public interface UserService { 10 | User findByUsername(String username); 11 | 12 | User findByEmail(String email); 13 | 14 | boolean checkUserExists(String username, String email); 15 | 16 | boolean checkUsernameExists(String username); 17 | 18 | boolean checkEmailExists(String email); 19 | 20 | void save (User user); 21 | 22 | User createUser(User user, Set userRoles); 23 | 24 | User saveUser (User user); 25 | 26 | List findUserList(); 27 | 28 | void enableUser (String username); 29 | 30 | void disableUser (String username); 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Online-Banking-System 2 | Spring Boot Online Banking System 3 | About 4 | This is a project for practicing Spring + Thymeleaf. The idea was to build online banking system. 5 | 6 | It was made using Spring Boot, Spring Security, Thymeleaf, Spring Data JPA, Spring Data REST, JavaScript, JQuery. Database is in memory sql Workbench. 7 | Online Banking Requirements 8 | 9 | About 10 | 11 | The Banking system consists of two parts: User-Front and Admin-Portal. User-Front is a user-facing system and it includes such modules as User Signup/Login, Account, Transfer, Appointment, Transaction and User Profile. Admin-Portal is mainly used by Admin and it involves User Account and Appointment modules. 12 | 13 | 14 | Er diagram 15 | 16 | ![er diagram](https://user-images.githubusercontent.com/34470526/37703339-8e85fcae-2d1f-11e8-900f-94cb2046d97f.png) 17 | 18 | 19 | 20 | Online banking system detail diagram 21 | 22 | ![online banking system detail diagram](https://user-images.githubusercontent.com/34470526/37703353-999023fe-2d1f-11e8-96f6-db40724c5d14.png) 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/security/Role.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain.security; 2 | 3 | import javax.persistence.*; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | 8 | 9 | @Entity 10 | public class Role { 11 | @Id 12 | // @GeneratedValue(strategy = GenerationType.AUTO) 13 | private int roleId; 14 | 15 | private String name; 16 | 17 | @OneToMany(mappedBy = "role", cascade = CascadeType.ALL, fetch = FetchType.LAZY) 18 | private Set userRoles = new HashSet<>(); 19 | 20 | public Role() { 21 | 22 | } 23 | 24 | public int getRoleId() { 25 | return roleId; 26 | } 27 | 28 | public void setRoleId(int roleId) { 29 | this.roleId = roleId; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public Set getUserRoles() { 41 | return userRoles; 42 | } 43 | 44 | public void setUserRoles(Set userRoles) { 45 | this.userRoles = userRoles; 46 | } 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserServiceImpl/AppointmentServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service.UserServiceImpl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.userfront.dao.AppointmentDao; 9 | import com.userfront.domain.Appointment; 10 | import com.userfront.service.AppointmentService; 11 | 12 | @Service 13 | public class AppointmentServiceImpl implements AppointmentService { 14 | 15 | @Autowired 16 | private AppointmentDao appointmentDao; 17 | 18 | public Appointment createAppointment(Appointment appointment) { 19 | return appointmentDao.save(appointment); 20 | } 21 | 22 | public List findAll() { 23 | return appointmentDao.findAll(); 24 | } 25 | 26 | public Appointment findAppointment(Long id) { 27 | return null; 28 | } 29 | 30 | public void confirmAppointment(Long id) { 31 | Appointment appointment = findAppointment(id); 32 | appointment.setConfirmed(true); 33 | appointmentDao.save(appointment); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/resource/AppointmentResource.java: -------------------------------------------------------------------------------- 1 | package com.userfront.resource; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | import com.userfront.domain.Appointment; 12 | import com.userfront.service.AppointmentService; 13 | 14 | @RestController 15 | @RequestMapping("/api/appointment") 16 | @PreAuthorize("hasRole('ADMIN')") 17 | public class AppointmentResource { 18 | 19 | @Autowired 20 | private AppointmentService appointmentService; 21 | 22 | @RequestMapping("/all") 23 | public List findAppointmentList() { 24 | List appointmentList = appointmentService.findAll(); 25 | 26 | return appointmentList; 27 | } 28 | 29 | @RequestMapping("/{id}/confirm") 30 | public void confirmAppointment(@PathVariable("id") Long id) { 31 | appointmentService.confirmAppointment(id); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/security/UserRole.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain.security; 2 | 3 | import com.userfront.domain.User; 4 | 5 | import javax.persistence.*; 6 | 7 | 8 | 9 | @Entity 10 | @Table(name="user_role") 11 | public class UserRole { 12 | @Id 13 | @GeneratedValue(strategy = GenerationType.AUTO) 14 | private long userRoleId; 15 | 16 | public UserRole(User user, Role role) { 17 | this.user = user; 18 | this.role = role; 19 | } 20 | 21 | 22 | @ManyToOne(fetch = FetchType.EAGER) 23 | @JoinColumn(name = "user_id") 24 | private User user; 25 | 26 | 27 | @ManyToOne(fetch = FetchType.EAGER) 28 | @JoinColumn(name = "role_id") 29 | private Role role; 30 | 31 | public UserRole() {} 32 | 33 | public long getUserRoleId() { 34 | return userRoleId; 35 | } 36 | 37 | public void setUserRoleId(long userRoleId) { 38 | this.userRoleId = userRoleId; 39 | } 40 | 41 | public User getUser() { 42 | return user; 43 | } 44 | 45 | public void setUser(User user) { 46 | this.user = user; 47 | } 48 | 49 | public Role getRole() { 50 | return role; 51 | } 52 | 53 | public void setRole(Role role) { 54 | this.role = role; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # =============================== 2 | # = DATA SOURCE 3 | # =============================== 4 | 5 | # Set here configurations for the database connection 6 | 7 | # Connection url for the database "netgloo_blog" 8 | spring.datasource.url = jdbc:mysql://localhost:3306/OnlineBankingSystem 9 | 10 | # Username and secret 11 | spring.datasource.username = root 12 | spring.datasource.password = 13 | 14 | # Keep the connection alive if idle for a long time (needed in production) 15 | spring.datasource.testWhileIdle = true 16 | spring.datasource.validationQuery = SELECT 1 17 | 18 | # =============================== 19 | # = JPA / HIBERNATE 20 | # =============================== 21 | 22 | # Use spring.jpa.properties.* for Hibernate native properties (the prefix is 23 | # stripped before adding them to the entity manager). 24 | 25 | # Show or not log for each sql query 26 | spring.jpa.show-sql = true 27 | 28 | # Hibernate ddl auto (create, create-drop, update): with "update" the database 29 | # schema will be automatically updated accordingly to java entities found in 30 | # the project 31 | spring.jpa.hibernate.ddl-auto = update 32 | 33 | # Allows Hibernate to generate SQL optimized for a particular DBMS 34 | spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserServiceImpl/UserSecurityService.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service.UserServiceImpl; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.core.userdetails.UserDetails; 7 | import org.springframework.security.core.userdetails.UserDetailsService; 8 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.userfront.dao.UserDao; 12 | import com.userfront.domain.User; 13 | 14 | @Service 15 | public class UserSecurityService implements UserDetailsService { 16 | 17 | /** The application logger */ 18 | private static final Logger LOG = LoggerFactory.getLogger(UserSecurityService.class); 19 | 20 | @Autowired 21 | private UserDao userDao; 22 | 23 | @Override 24 | public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { 25 | User user = userDao.findByUsername(username); 26 | if (null == user) { 27 | LOG.warn("Username {} not found", username); 28 | throw new UsernameNotFoundException("Username " + username + " not found"); 29 | } 30 | return user; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/TransactionService.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service; 2 | 3 | import java.security.Principal; 4 | import java.util.List; 5 | 6 | import com.userfront.domain.PrimaryAccount; 7 | import com.userfront.domain.PrimaryTransaction; 8 | import com.userfront.domain.Recipient; 9 | import com.userfront.domain.SavingsAccount; 10 | import com.userfront.domain.SavingsTransaction; 11 | 12 | public interface TransactionService { 13 | List findPrimaryTransactionList(String username); 14 | 15 | List findSavingsTransactionList(String username); 16 | 17 | void savePrimaryDepositTransaction(PrimaryTransaction primaryTransaction); 18 | 19 | void saveSavingsDepositTransaction(SavingsTransaction savingsTransaction); 20 | 21 | void savePrimaryWithdrawTransaction(PrimaryTransaction primaryTransaction); 22 | void saveSavingsWithdrawTransaction(SavingsTransaction savingsTransaction); 23 | 24 | void betweenAccountsTransfer(String transferFrom, String transferTo, String amount, PrimaryAccount primaryAccount, SavingsAccount savingsAccount) throws Exception; 25 | 26 | List findRecipientList(Principal principal); 27 | 28 | Recipient saveRecipient(Recipient recipient); 29 | 30 | Recipient findRecipientByName(String recipientName); 31 | 32 | void deleteRecipientByName(String recipientName); 33 | 34 | void toSomeoneElseTransfer(Recipient recipient, String accountType, String amount, PrimaryAccount primaryAccount, SavingsAccount savingsAccount); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.userfront.controller; 2 | 3 | import java.security.Principal; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.ModelAttribute; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.RequestMethod; 11 | 12 | import com.userfront.domain.User; 13 | import com.userfront.service.UserService; 14 | 15 | @Controller 16 | @RequestMapping("/user") 17 | public class UserController { 18 | 19 | @Autowired 20 | private UserService userService; 21 | 22 | @RequestMapping(value = "/profile", method = RequestMethod.GET) 23 | public String profile(Principal principal, Model model) { 24 | User user = userService.findByUsername(principal.getName()); 25 | 26 | model.addAttribute("user", user); 27 | 28 | return "profile"; 29 | } 30 | 31 | @RequestMapping(value = "/profile", method = RequestMethod.POST) 32 | public String profilePost(@ModelAttribute("user") User newUser, Model model) { 33 | User user = userService.findByUsername(newUser.getUsername()); 34 | user.setUsername(newUser.getUsername()); 35 | user.setFirstName(newUser.getFirstName()); 36 | user.setLastName(newUser.getLastName()); 37 | user.setEmail(newUser.getEmail()); 38 | user.setPhone(newUser.getPhone()); 39 | 40 | model.addAttribute("user", user); 41 | 42 | userService.saveUser(user); 43 | 44 | return "profile"; 45 | } 46 | 47 | 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/SavingsAccount.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.List; 5 | 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.Entity; 8 | import javax.persistence.FetchType; 9 | import javax.persistence.GeneratedValue; 10 | import javax.persistence.GenerationType; 11 | import javax.persistence.Id; 12 | import javax.persistence.OneToMany; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnore; 15 | 16 | @Entity 17 | public class SavingsAccount { 18 | 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.AUTO) 21 | private Long id; 22 | private int accountNumber; 23 | private BigDecimal accountBalance; 24 | 25 | @OneToMany(mappedBy = "savingsAccount", cascade = CascadeType.ALL, fetch = FetchType.LAZY) 26 | @JsonIgnore 27 | private List savingsTransactionList; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public int getAccountNumber() { 38 | return accountNumber; 39 | } 40 | 41 | public void setAccountNumber(int accountNumber) { 42 | this.accountNumber = accountNumber; 43 | } 44 | 45 | public BigDecimal getAccountBalance() { 46 | return accountBalance; 47 | } 48 | 49 | public void setAccountBalance(BigDecimal accountBalance) { 50 | this.accountBalance = accountBalance; 51 | } 52 | 53 | public List getSavingsTransactionList() { 54 | return savingsTransactionList; 55 | } 56 | 57 | public void setSavingsTransactionList(List savingsTransactionList) { 58 | this.savingsTransactionList = savingsTransactionList; 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/PrimaryAccount.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.List; 5 | 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.Entity; 8 | import javax.persistence.FetchType; 9 | import javax.persistence.GeneratedValue; 10 | import javax.persistence.GenerationType; 11 | import javax.persistence.Id; 12 | import javax.persistence.OneToMany; 13 | 14 | import com.fasterxml.jackson.annotation.JsonIgnore; 15 | 16 | @Entity 17 | public class PrimaryAccount { 18 | 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.AUTO) 21 | private Long id; 22 | private int accountNumber; 23 | private BigDecimal accountBalance; 24 | 25 | @OneToMany(mappedBy = "primaryAccount", cascade = CascadeType.ALL, fetch = FetchType.LAZY) 26 | @JsonIgnore 27 | private List primaryTransactionList; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public int getAccountNumber() { 38 | return accountNumber; 39 | } 40 | 41 | public void setAccountNumber(int accountNumber) { 42 | this.accountNumber = accountNumber; 43 | } 44 | 45 | public BigDecimal getAccountBalance() { 46 | return accountBalance; 47 | } 48 | 49 | public void setAccountBalance(BigDecimal accountBalance) { 50 | this.accountBalance = accountBalance; 51 | } 52 | 53 | public List getPrimaryTransactionList() { 54 | return primaryTransactionList; 55 | } 56 | 57 | public void setPrimaryTransactionList(List primaryTransactionList) { 58 | this.primaryTransactionList = primaryTransactionList; 59 | } 60 | 61 | 62 | } 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/main/resources/templates/withdraw.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 |
9 |
10 |
11 | 12 | 17 |
18 |
19 | 20 |
21 | 22 | Amount $ 23 | 24 |
25 | 26 | 29 | 30 | 31 |
32 | 33 |
34 |
35 |
36 |
37 |
38 | 39 | 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/resources/templates/deposit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 |
9 |
10 |
11 | 12 | 17 |
18 |
19 | 20 |
21 | 22 | Amount $ 23 | 24 |
25 | 26 | 29 | 30 | 31 |
32 | 33 |
34 |
35 |
36 |
37 |
38 | 39 | 40 |
41 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/resources/static/js/dataTables.bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables Bootstrap 3 integration 3 | ©2011-2015 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes, 6 | {sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,m,j,n){var o=new f.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 7 | l=0;for(h=f.length;l",{"class":s.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("",{href:"#", 8 | "aria-controls":a.sTableId,"aria-label":t[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('
    ').children("ul"),m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};return f}); 9 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/Recipient.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | import javax.persistence.JoinColumn; 8 | import javax.persistence.ManyToOne; 9 | 10 | import com.fasterxml.jackson.annotation.JsonIgnore; 11 | 12 | @Entity 13 | public class Recipient { 14 | 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.AUTO) 17 | private Long id; 18 | private String name; 19 | private String email; 20 | private String phone; 21 | private String accountNumber; 22 | private String description; 23 | 24 | @ManyToOne 25 | @JoinColumn(name = "user_id") 26 | @JsonIgnore 27 | private User user; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getEmail() { 46 | return email; 47 | } 48 | 49 | public void setEmail(String email) { 50 | this.email = email; 51 | } 52 | 53 | public String getPhone() { 54 | return phone; 55 | } 56 | 57 | public void setPhone(String phone) { 58 | this.phone = phone; 59 | } 60 | 61 | public String getAccountNumber() { 62 | return accountNumber; 63 | } 64 | 65 | public void setAccountNumber(String accountNumber) { 66 | this.accountNumber = accountNumber; 67 | } 68 | 69 | public User getUser() { 70 | return user; 71 | } 72 | 73 | public void setUser(User user) { 74 | this.user = user; 75 | } 76 | 77 | public String getDescription() { 78 | return description; 79 | } 80 | 81 | public void setDescription(String description) { 82 | this.description = description; 83 | } 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/controller/AppointmentController.java: -------------------------------------------------------------------------------- 1 | package com.userfront.controller; 2 | 3 | import java.security.Principal; 4 | import java.text.ParseException; 5 | import java.text.SimpleDateFormat; 6 | import java.util.Date; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.ui.Model; 11 | import org.springframework.web.bind.annotation.ModelAttribute; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestMethod; 14 | 15 | import com.userfront.domain.Appointment; 16 | import com.userfront.domain.User; 17 | import com.userfront.service.AppointmentService; 18 | import com.userfront.service.UserService; 19 | 20 | @Controller 21 | @RequestMapping("/appointment") 22 | public class AppointmentController { 23 | 24 | @Autowired 25 | private AppointmentService appointmentService; 26 | 27 | @Autowired 28 | private UserService userService; 29 | 30 | @RequestMapping(value = "/create",method = RequestMethod.GET) 31 | public String createAppointment(Model model) { 32 | Appointment appointment = new Appointment(); 33 | model.addAttribute("appointment", appointment); 34 | model.addAttribute("dateString", ""); 35 | 36 | return "appointment"; 37 | } 38 | 39 | @RequestMapping(value = "/create",method = RequestMethod.POST) 40 | public String createAppointmentPost(@ModelAttribute("appointment") Appointment appointment, @ModelAttribute("dateString") String date, Model model, Principal principal) throws ParseException { 41 | 42 | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd hh:mm"); 43 | Date d1 = format1.parse( date ); 44 | appointment.setDate(d1); 45 | 46 | User user = userService.findByUsername(principal.getName()); 47 | appointment.setUser(user); 48 | 49 | appointmentService.createAppointment(appointment); 50 | 51 | return "redirect:/userFront"; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/Appointment.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.util.Date; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.ManyToOne; 11 | 12 | @Entity 13 | public class Appointment { 14 | 15 | @Id 16 | @GeneratedValue(strategy = GenerationType.AUTO) 17 | private Long id; 18 | private Date date; 19 | private String location; 20 | private String description; 21 | private boolean confirmed; 22 | 23 | @ManyToOne 24 | @JoinColumn(name = "user_id") 25 | private User user; 26 | 27 | public Long getId() { 28 | return id; 29 | } 30 | 31 | public void setId(Long id) { 32 | this.id = id; 33 | } 34 | 35 | public Date getDate() { 36 | return date; 37 | } 38 | 39 | public void setDate(Date date) { 40 | this.date = date; 41 | } 42 | 43 | public String getLocation() { 44 | return location; 45 | } 46 | 47 | public void setLocation(String location) { 48 | this.location = location; 49 | } 50 | 51 | public String getDescription() { 52 | return description; 53 | } 54 | 55 | public void setDescription(String description) { 56 | this.description = description; 57 | } 58 | 59 | public User getUser() { 60 | return user; 61 | } 62 | 63 | public void setUser(User user) { 64 | this.user = user; 65 | } 66 | 67 | public boolean isConfirmed() { 68 | return confirmed; 69 | } 70 | 71 | public void setConfirmed(boolean confirmed) { 72 | this.confirmed = confirmed; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "Appointment{" + 78 | "id=" + id + 79 | ", date=" + date + 80 | ", location='" + location + '\'' + 81 | ", description='" + description + '\'' + 82 | ", user=" + user + 83 | '}'; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/config/RequestFilter.java: -------------------------------------------------------------------------------- 1 | package com.userfront.config; 2 | 3 | import javax.servlet.Filter; 4 | import javax.servlet.FilterChain; 5 | import javax.servlet.FilterConfig; 6 | import javax.servlet.ServletRequest; 7 | import javax.servlet.ServletResponse; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.springframework.core.Ordered; 12 | import org.springframework.core.annotation.Order; 13 | import org.springframework.stereotype.Component; 14 | 15 | @Component 16 | @Order(Ordered.HIGHEST_PRECEDENCE) 17 | public class RequestFilter implements Filter { 18 | 19 | public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) { 20 | HttpServletResponse response = (HttpServletResponse) res; 21 | HttpServletRequest request = (HttpServletRequest) req; 22 | 23 | response.setHeader("Access-Control-Allow-Origin", "http://localhost:4200"); 24 | response.setHeader("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, DELETE"); 25 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with"); 26 | response.setHeader("Access-Control-Max-Age", "3600"); 27 | response.setHeader("Access-Control-Allow-Credentials", "true"); 28 | 29 | if (!(request.getMethod().equalsIgnoreCase("OPTIONS"))) { 30 | try { 31 | chain.doFilter(req, res); 32 | } catch(Exception e) { 33 | e.printStackTrace(); 34 | } 35 | } else { 36 | System.out.println("Pre-flight"); 37 | response.setHeader("Access-Control-Allow-Methods", "POST,GET,DELETE"); 38 | response.setHeader("Access-Control-Max-Age", "3600"); 39 | response.setHeader("Access-Control-Allow-Headers", "authorization, content-type," + 40 | "access-control-request-headers,access-control-request-method,accept,origin,authorization,x-requested-with"); 41 | response.setStatus(HttpServletResponse.SC_OK); 42 | } 43 | 44 | } 45 | 46 | public void init(FilterConfig filterConfig) {} 47 | 48 | public void destroy() {} 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/resource/UserResource.java: -------------------------------------------------------------------------------- 1 | package com.userfront.resource; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.access.prepost.PreAuthorize; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | import org.springframework.web.bind.annotation.RequestParam; 11 | import org.springframework.web.bind.annotation.RestController; 12 | 13 | import com.userfront.domain.PrimaryTransaction; 14 | import com.userfront.domain.SavingsTransaction; 15 | import com.userfront.domain.User; 16 | import com.userfront.service.TransactionService; 17 | import com.userfront.service.UserService; 18 | 19 | @RestController 20 | @RequestMapping("/api") 21 | @PreAuthorize("hasRole('ADMIN')") 22 | public class UserResource { 23 | 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Autowired 28 | private TransactionService transactionService; 29 | 30 | @RequestMapping(value = "/user/all", method = RequestMethod.GET) 31 | public List userList() { 32 | return userService.findUserList(); 33 | } 34 | 35 | @RequestMapping(value = "/user/primary/transaction", method = RequestMethod.GET) 36 | public List getPrimaryTransactionList(@RequestParam("username") String username) { 37 | return transactionService.findPrimaryTransactionList(username); 38 | } 39 | 40 | @RequestMapping(value = "/user/savings/transaction", method = RequestMethod.GET) 41 | public List getSavingsTransactionList(@RequestParam("username") String username) { 42 | return transactionService.findSavingsTransactionList(username); 43 | } 44 | 45 | @RequestMapping("/user/{username}/enable") 46 | public void enableUser(@PathVariable("username") String username) { 47 | userService.enableUser(username); 48 | } 49 | 50 | @RequestMapping("/user/{username}/disable") 51 | public void diableUser(@PathVariable("username") String username) { 52 | userService.disableUser(username); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/resources/static/js/dataTables.uikit.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables UIkit 3 integration 3 | */ 4 | (function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,c){a||(a=window);if(!c||!c.fn.dataTable)c=require("datatables.net")(a,c).$;return b(c,a,a.document)}:b(jQuery,window,document)})(function(b,a,c){var g=b.fn.dataTable;b.extend(!0,g.defaults,{dom:"<'row uk-grid'<'uk-width-1-2'l><'uk-width-1-2'f>><'row uk-grid dt-merge-grid'<'uk-width-1-1'tr>><'row uk-grid dt-merge-grid'<'uk-width-2-5'i><'uk-width-3-5'p>>", 5 | renderer:"uikit"});b.extend(g.ext.classes,{sWrapper:"dataTables_wrapper uk-form dt-uikit",sFilterInput:"uk-form-small",sLengthSelect:"uk-form-small",sProcessing:"dataTables_processing uk-panel"});g.ext.renderer.pageButton.uikit=function(a,h,r,m,j,n){var o=new g.Api(a),s=a.oClasses,k=a.oLanguage.oPaginate,t=a.oLanguage.oAria.paginate||{},f,d,p=0,q=function(c,g){var l,h,i,e,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")}; 6 | l=0;for(h=g.length;l';d=j';d=j",{"class":s.sPageButton+" "+d,id:0===r&&"string"===typeof e?a.sTableId+"_"+e:null}).append(b(-1!=d.indexOf("disabled")||-1!=d.indexOf("active")?"":"",{href:"#","aria-controls":a.sTableId,"aria-label":t[e],"data-dt-idx":p,tabindex:a.iTabIndex}).html(f)).appendTo(c),a.oApi._fnBindAction(i,{action:e},m),p++)}},i;try{i=b(h).find(c.activeElement).data("dt-idx")}catch(u){}q(b(h).empty().html('
      ').children("ul"), 8 | m);i&&b(h).find("[data-dt-idx="+i+"]").focus()};return g}); 9 | -------------------------------------------------------------------------------- /src/main/resources/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | bann 7 | 44 | -------------------------------------------------------------------------------- /src/main/resources/templates/toSomeoneElse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |
      10 |
      11 | 12 | 16 |
      17 |
      18 | 19 |
      20 | 21 | 26 |
      27 |
      28 | 29 |
      30 | 31 | Amount $ 32 | 33 |
      34 | 35 | 38 | 39 | 40 |
      41 | 42 |
      43 |
      44 |
      45 |
      46 |
      47 | 48 | 49 |
      50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/resources/templates/betweenAccounts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |
      10 |
      11 | 12 | 17 |
      18 |
      19 | 20 |
      21 | 22 | 27 |
      28 |
      29 | 30 |
      31 | 32 | Amount $ 33 | 34 |
      35 | 36 | 39 | 40 | 41 |
      42 | 43 |
      44 |
      45 |
      46 |
      47 |
      48 | 49 | 50 |
      51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/resources/static/js/dataTables.jqueryui.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | DataTables jQuery UI integration 3 | ©2011-2014 SpryMedia Ltd - datatables.net/license 4 | */ 5 | (function(a){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(b){return a(b,window,document)}):"object"===typeof exports?module.exports=function(b,d){b||(b=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(b,d).$;return a(d,b,b.document)}:a(jQuery,window,document)})(function(a){var b=a.fn.dataTable;a.extend(!0,b.defaults,{dom:'<"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix ui-corner-tl ui-corner-tr"lfr>t<"fg-toolbar ui-toolbar ui-widget-header ui-helper-clearfix ui-corner-bl ui-corner-br"ip>', 6 | renderer:"jqueryui"});a.extend(b.ext.classes,{sWrapper:"dataTables_wrapper dt-jqueryui",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"ui-state-disabled",sPageButtonDisabled:"ui-state-disabled",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default sorting_asc",sSortDesc:"ui-state-default sorting_desc",sSortable:"ui-state-default sorting",sSortableAsc:"ui-state-default sorting_asc_disabled",sSortableDesc:"ui-state-default sorting_desc_disabled", 7 | sSortableNone:"ui-state-default sorting_disabled",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sHeaderTH:"ui-state-default",sFooterTH:"ui-state-default"});b.ext.renderer.header.jqueryui=function(b,h,e,c){var f="css_right ui-icon ui-icon-carat-2-n-s",g=-1!==a.inArray("asc",e.asSorting),i=-1!==a.inArray("desc",e.asSorting);!e.bSortable||!g&&!i?f="":g&&!i?f="css_right ui-icon ui-icon-carat-1-n":!g&&i&&(f="css_right ui-icon ui-icon-carat-1-s"); 8 | a("
      ").addClass("DataTables_sort_wrapper").append(h.contents()).append(a("").addClass(c.sSortIcon+" "+f)).appendTo(h);a(b.nTable).on("order.dt",function(a,g,i,j){b===g&&(a=e.idx,h.removeClass(c.sSortAsc+" "+c.sSortDesc).addClass("asc"==j[a]?c.sSortAsc:"desc"==j[a]?c.sSortDesc:e.sSortingClass),h.find("span."+c.sSortIcon).removeClass("css_right ui-icon ui-icon-triangle-1-n css_right ui-icon ui-icon-triangle-1-s css_right ui-icon ui-icon-carat-2-n-s css_right ui-icon ui-icon-carat-1-n css_right ui-icon ui-icon-carat-1-s").addClass("asc"== 9 | j[a]?"css_right ui-icon ui-icon-triangle-1-n":"desc"==j[a]?"css_right ui-icon ui-icon-triangle-1-s":f))})};b.TableTools&&a.extend(!0,b.TableTools.classes,{container:"DTTT_container ui-buttonset ui-buttonset-multi",buttons:{normal:"DTTT_button ui-button ui-state-default"},collection:{container:"DTTT_collection ui-buttonset ui-buttonset-multi"}});return b}); 10 | -------------------------------------------------------------------------------- /src/main/resources/static/js/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by z00382545 on 10/20/16. 3 | */ 4 | 5 | (function ($) { 6 | $.toggleShowPassword = function (options) { 7 | var settings = $.extend({ 8 | field: "#password", 9 | control: "#toggle_show_password", 10 | }, options); 11 | 12 | var control = $(settings.control); 13 | var field = $(settings.field) 14 | 15 | control.bind('click', function () { 16 | if (control.is(':checked')) { 17 | field.attr('type', 'text'); 18 | } else { 19 | field.attr('type', 'password'); 20 | } 21 | }) 22 | }; 23 | 24 | $.transferDisplay = function () { 25 | $("#transferFrom").change(function() { 26 | if ($("#transferFrom").val() == 'Primary') { 27 | $('#transferTo').val('Savings'); 28 | } else if ($("#transferFrom").val() == 'Savings') { 29 | $('#transferTo').val('Primary'); 30 | } 31 | }); 32 | 33 | $("#transferTo").change(function() { 34 | if ($("#transferTo").val() == 'Primary') { 35 | $('#transferFrom').val('Savings'); 36 | } else if ($("#transferTo").val() == 'Savings') { 37 | $('#transferFrom').val('Primary'); 38 | } 39 | }); 40 | }; 41 | 42 | 43 | 44 | }(jQuery)); 45 | 46 | $(document).ready(function() { 47 | var confirm = function() { 48 | bootbox.confirm({ 49 | title: "Appointment Confirmation", 50 | message: "Do you really want to schedule this appointment?", 51 | buttons: { 52 | cancel: { 53 | label: ' Cancel' 54 | }, 55 | confirm: { 56 | label: ' Confirm' 57 | } 58 | }, 59 | callback: function (result) { 60 | if (result == true) { 61 | $('#appointmentForm').submit(); 62 | } else { 63 | console.log("Scheduling cancelled."); 64 | } 65 | } 66 | }); 67 | }; 68 | 69 | $.toggleShowPassword({ 70 | field: '#password', 71 | control: "#showPassword" 72 | }); 73 | 74 | $.transferDisplay(); 75 | 76 | $(".form_datetime").datetimepicker({ 77 | format: "yyyy-mm-dd hh:mm", 78 | autoclose: true, 79 | todayBtn: true, 80 | startDate: "2013-02-14 10:00", 81 | minuteStep: 10 82 | }); 83 | 84 | $('#submitAppointment').click(function () { 85 | confirm(); 86 | }); 87 | 88 | }); 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /src/main/resources/templates/savingsAccount.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 | 10 |
      11 | 12 |
      13 | 14 |
      15 |
      16 |
      17 |
      18 |
      19 |
      20 |
      21 |
      22 |

      Savings Balance:

      23 |
      24 |
      25 |

      ...

      26 |
      27 |
      28 |
      29 | 33 |
      34 |
      35 |
      36 | 37 | 38 | 39 | 40 |
      41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
      Post DateDescriptionTypeStatusAmountAvailable Balance
      ..................
      63 |
      64 |
      65 | 66 | 67 |
      68 | 69 | 70 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.userfront.controller; 2 | 3 | import java.security.Principal; 4 | import java.util.HashSet; 5 | import java.util.Set; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.ModelAttribute; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | 14 | import com.userfront.dao.RoleDao; 15 | import com.userfront.domain.PrimaryAccount; 16 | import com.userfront.domain.SavingsAccount; 17 | import com.userfront.domain.User; 18 | import com.userfront.domain.security.UserRole; 19 | import com.userfront.service.UserService; 20 | 21 | @Controller 22 | public class HomeController { 23 | 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Autowired 28 | private RoleDao roleDao; 29 | 30 | @RequestMapping("/") 31 | public String home() { 32 | return "redirect:/index"; 33 | } 34 | 35 | @RequestMapping("/index") 36 | public String index() { 37 | return "index"; 38 | } 39 | 40 | @RequestMapping(value = "/signup", method = RequestMethod.GET) 41 | public String signup(Model model) { 42 | User user = new User(); 43 | 44 | model.addAttribute("user", user); 45 | 46 | return "signup"; 47 | } 48 | 49 | @RequestMapping(value = "/signup", method = RequestMethod.POST) 50 | public String signupPost(@ModelAttribute("user") User user, Model model) { 51 | 52 | if(userService.checkUserExists(user.getUsername(), user.getEmail())) { 53 | 54 | if (userService.checkEmailExists(user.getEmail())) { 55 | model.addAttribute("emailExists", true); 56 | } 57 | 58 | if (userService.checkUsernameExists(user.getUsername())) { 59 | model.addAttribute("usernameExists", true); 60 | } 61 | 62 | return "signup"; 63 | } else { 64 | Set userRoles = new HashSet<>(); 65 | userRoles.add(new UserRole(user, roleDao.findByName("ROLE_USER"))); 66 | 67 | userService.createUser(user, userRoles); 68 | 69 | return "redirect:/"; 70 | } 71 | } 72 | 73 | @RequestMapping("/userFront") 74 | public String userFront(Principal principal, Model model) { 75 | User user = userService.findByUsername(principal.getName()); 76 | PrimaryAccount primaryAccount = user.getPrimaryAccount(); 77 | SavingsAccount savingsAccount = user.getSavingsAccount(); 78 | 79 | model.addAttribute("primaryAccount", primaryAccount); 80 | model.addAttribute("savingsAccount", savingsAccount); 81 | 82 | return "userFront"; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/resources/templates/primaryAccount.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
      9 |
      10 |
      11 | 12 |
      13 | 14 |
      15 | 16 |
      17 |
      18 |
      19 |
      20 |
      21 |
      22 |
      23 |
      24 |

      Primary Balance:

      25 |
      26 |
      27 |

      ...

      29 |
      30 |
      31 |
      32 | 36 |
      37 | 38 |
      39 |
      40 | 41 | 42 | 43 | 44 |
      45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 |
      Post DateDescriptionTypeStatusAmountAvailable Balance
      ..................
      67 |
      68 |
      69 | 70 | 71 |
      72 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/SavingsTransaction.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | 13 | @Entity 14 | public class SavingsTransaction { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | private Long id; 19 | private Date date; 20 | private String description; 21 | private String type; 22 | private String status; 23 | private double amount; 24 | private BigDecimal availableBalance; 25 | 26 | @ManyToOne 27 | @JoinColumn(name = "savings_account_id") 28 | private SavingsAccount savingsAccount; 29 | 30 | public SavingsTransaction() {} 31 | 32 | public SavingsTransaction(Date date, String description, String type, String status, double amount, BigDecimal availableBalance, SavingsAccount savingsAccount) { 33 | this.date = date; 34 | this.description = description; 35 | this.type = type; 36 | this.status = status; 37 | this.amount = amount; 38 | this.availableBalance = availableBalance; 39 | this.savingsAccount = savingsAccount; 40 | } 41 | 42 | public Long getId() { 43 | return id; 44 | } 45 | 46 | public void setId(Long id) { 47 | this.id = id; 48 | } 49 | 50 | public Date getDate() { 51 | return date; 52 | } 53 | 54 | public void setDate(Date date) { 55 | this.date = date; 56 | } 57 | 58 | public String getDescription() { 59 | return description; 60 | } 61 | 62 | public void setDescription(String description) { 63 | this.description = description; 64 | } 65 | 66 | public String getType() { 67 | return type; 68 | } 69 | 70 | public void setType(String type) { 71 | this.type = type; 72 | } 73 | 74 | public String getStatus() { 75 | return status; 76 | } 77 | 78 | public void setStatus(String status) { 79 | this.status = status; 80 | } 81 | 82 | public double getAmount() { 83 | return amount; 84 | } 85 | 86 | public void setAmount(double amount) { 87 | this.amount = amount; 88 | } 89 | 90 | public BigDecimal getAvailableBalance() { 91 | return availableBalance; 92 | } 93 | 94 | public void setAvailableBalance(BigDecimal availableBalance) { 95 | this.availableBalance = availableBalance; 96 | } 97 | 98 | public SavingsAccount getSavingsAccount() { 99 | return savingsAccount; 100 | } 101 | 102 | public void setSavingsAccount(SavingsAccount savingsAccount) { 103 | this.savingsAccount = savingsAccount; 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/PrimaryTransaction.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.math.BigDecimal; 4 | import java.util.Date; 5 | 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | 13 | @Entity 14 | public class PrimaryTransaction { 15 | 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | private Long id; 19 | private Date date; 20 | private String description; 21 | private String type; 22 | private String status; 23 | private double amount; 24 | private BigDecimal availableBalance; 25 | 26 | public PrimaryTransaction() {} 27 | 28 | 29 | public PrimaryTransaction(Date date, String description, String type, String status, double amount, BigDecimal availableBalance, PrimaryAccount primaryAccount) { 30 | this.date = date; 31 | this.description = description; 32 | this.type = type; 33 | this.status = status; 34 | this.amount = amount; 35 | this.availableBalance = availableBalance; 36 | this.primaryAccount = primaryAccount; 37 | } 38 | 39 | @ManyToOne 40 | @JoinColumn(name = "primary_account_id") 41 | private PrimaryAccount primaryAccount; 42 | 43 | public Long getId() { 44 | return id; 45 | } 46 | 47 | public void setId(Long id) { 48 | this.id = id; 49 | } 50 | 51 | public Date getDate() { 52 | return date; 53 | } 54 | 55 | public void setDate(Date date) { 56 | this.date = date; 57 | } 58 | 59 | public String getDescription() { 60 | return description; 61 | } 62 | 63 | public void setDescription(String description) { 64 | this.description = description; 65 | } 66 | 67 | public String getType() { 68 | return type; 69 | } 70 | 71 | public void setType(String type) { 72 | this.type = type; 73 | } 74 | 75 | public String getStatus() { 76 | return status; 77 | } 78 | 79 | public void setStatus(String status) { 80 | this.status = status; 81 | } 82 | 83 | public double getAmount() { 84 | return amount; 85 | } 86 | 87 | public void setAmount(double amount) { 88 | this.amount = amount; 89 | } 90 | 91 | public BigDecimal getAvailableBalance() { 92 | return availableBalance; 93 | } 94 | 95 | public void setAvailableBalance(BigDecimal availableBalance) { 96 | this.availableBalance = availableBalance; 97 | } 98 | 99 | public PrimaryAccount getPrimaryAccount() { 100 | return primaryAccount; 101 | } 102 | 103 | public void setPrimaryAccount(PrimaryAccount primaryAccount) { 104 | this.primaryAccount = primaryAccount; 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/main/resources/templates/appointment.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |

      Schedule An Appointment

      10 |
      11 | 12 | 13 |
      14 | 15 |
      16 | 19 | 20 | 21 |
      22 |
      23 | 24 |
      25 | 26 | 38 |
      39 | 40 |
      41 | 42 | 43 |
      44 | 45 | 46 | 49 | 50 | Submit Scheduling 51 |
      52 | 53 |
      54 |
      55 |
      56 |
      57 |
      58 |
      59 | 60 |
      61 | 62 | 63 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/config/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.userfront.config; 2 | 3 | import java.security.SecureRandom; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.context.annotation.Configuration; 8 | import org.springframework.core.env.Environment; 9 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; 10 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; 11 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 12 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 13 | import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; 14 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 15 | import org.springframework.security.web.util.matcher.AntPathRequestMatcher; 16 | 17 | import com.userfront.service.UserServiceImpl.UserSecurityService; 18 | 19 | @Configuration 20 | @EnableWebSecurity 21 | @EnableGlobalMethodSecurity(prePostEnabled=true) 22 | public class SecurityConfig extends WebSecurityConfigurerAdapter { 23 | 24 | @Autowired 25 | private Environment env; 26 | 27 | @Autowired 28 | private UserSecurityService userSecurityService; 29 | 30 | private static final String SALT = "salt"; // Salt should be protected carefully 31 | 32 | @Bean 33 | public BCryptPasswordEncoder passwordEncoder() { 34 | return new BCryptPasswordEncoder(12, new SecureRandom(SALT.getBytes())); 35 | } 36 | 37 | private static final String[] PUBLIC_MATCHERS = { 38 | "/webjars/**", 39 | "/css/**", 40 | "/js/**", 41 | "/images/**", 42 | "/", 43 | "/about/**", 44 | "/contact/**", 45 | "/error/**/*", 46 | "/console/**", 47 | "/signup" 48 | }; 49 | 50 | @Override 51 | protected void configure(HttpSecurity http) throws Exception { 52 | http 53 | .authorizeRequests(). 54 | // antMatchers("/**"). 55 | antMatchers(PUBLIC_MATCHERS). 56 | permitAll().anyRequest().authenticated(); 57 | 58 | http 59 | .csrf().disable().cors().disable() 60 | .formLogin().failureUrl("/index?error").defaultSuccessUrl("/userFront").loginPage("/index").permitAll() 61 | .and() 62 | .logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout")).logoutSuccessUrl("/index?logout").deleteCookies("remember-me").permitAll() 63 | .and() 64 | .rememberMe(); 65 | } 66 | 67 | 68 | 69 | @Autowired 70 | public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { 71 | // auth.inMemoryAuthentication().withUser("user").password("password").roles("USER"); //This is in-memory authentication 72 | auth.userDetailsService(userSecurityService).passwordEncoder(passwordEncoder()); 73 | } 74 | 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/resources/static/css/dataTables.uikit.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.row.uk-grid.dt-merge-grid{margin-top:5px}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th,table.dataTable thead>tr>td{position:relative}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th.sorting:after,table.dataTable thead>tr>th.sorting_asc:after,table.dataTable thead>tr>th.sorting_desc:after,table.dataTable thead>tr>td.sorting:after,table.dataTable thead>tr>td.sorting_asc:after,table.dataTable thead>tr>td.sorting_desc:after{position:absolute;top:7px;right:8px;display:block;font-family:'FontAwesome'}table.dataTable thead>tr>th.sorting:after,table.dataTable thead>tr>td.sorting:after{content:"\f0dc";color:#ddd;font-size:0.8em;padding-top:0.12em}table.dataTable thead>tr>th.sorting_asc:after,table.dataTable thead>tr>td.sorting_asc:after{content:"\f0de"}table.dataTable thead>tr>th.sorting_desc:after,table.dataTable thead>tr>td.sorting_desc:after{content:"\f0dd"}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.uk-table-condensed>thead>tr>th{padding-right:20px}table.dataTable.uk-table-condensed .sorting:after,table.dataTable.uk-table-condensed .sorting_asc:after,table.dataTable.uk-table-condensed .sorting_desc:after{top:6px;right:6px} 2 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/controller/AccountController.java: -------------------------------------------------------------------------------- 1 | package com.userfront.controller; 2 | 3 | import java.security.Principal; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.ui.Model; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | 13 | import com.userfront.domain.PrimaryAccount; 14 | import com.userfront.domain.PrimaryTransaction; 15 | import com.userfront.domain.SavingsAccount; 16 | import com.userfront.domain.SavingsTransaction; 17 | import com.userfront.domain.User; 18 | import com.userfront.service.AccountService; 19 | import com.userfront.service.TransactionService; 20 | import com.userfront.service.UserService; 21 | 22 | @Controller 23 | @RequestMapping("/account") 24 | public class AccountController { 25 | 26 | @Autowired 27 | private UserService userService; 28 | 29 | @Autowired 30 | private AccountService accountService; 31 | 32 | @Autowired 33 | private TransactionService transactionService; 34 | 35 | @RequestMapping("/primaryAccount") 36 | public String primaryAccount(Model model, Principal principal) { 37 | List primaryTransactionList = transactionService.findPrimaryTransactionList(principal.getName()); 38 | 39 | User user = userService.findByUsername(principal.getName()); 40 | PrimaryAccount primaryAccount = user.getPrimaryAccount(); 41 | 42 | model.addAttribute("primaryAccount", primaryAccount); 43 | model.addAttribute("primaryTransactionList", primaryTransactionList); 44 | 45 | return "primaryAccount"; 46 | } 47 | 48 | @RequestMapping("/savingsAccount") 49 | public String savingsAccount(Model model, Principal principal) { 50 | List savingsTransactionList = transactionService.findSavingsTransactionList(principal.getName()); 51 | User user = userService.findByUsername(principal.getName()); 52 | SavingsAccount savingsAccount = user.getSavingsAccount(); 53 | 54 | model.addAttribute("savingsAccount", savingsAccount); 55 | model.addAttribute("savingsTransactionList", savingsTransactionList); 56 | 57 | return "savingsAccount"; 58 | } 59 | 60 | @RequestMapping(value = "/deposit", method = RequestMethod.GET) 61 | public String deposit(Model model) { 62 | model.addAttribute("accountType", ""); 63 | model.addAttribute("amount", ""); 64 | 65 | return "deposit"; 66 | } 67 | 68 | @RequestMapping(value = "/deposit", method = RequestMethod.POST) 69 | public String depositPOST(@ModelAttribute("amount") String amount, @ModelAttribute("accountType") String accountType, Principal principal) { 70 | accountService.deposit(accountType, Double.parseDouble(amount), principal); 71 | 72 | return "redirect:/userFront"; 73 | } 74 | 75 | @RequestMapping(value = "/withdraw", method = RequestMethod.GET) 76 | public String withdraw(Model model) { 77 | model.addAttribute("accountType", ""); 78 | model.addAttribute("amount", ""); 79 | 80 | return "withdraw"; 81 | } 82 | 83 | @RequestMapping(value = "/withdraw", method = RequestMethod.POST) 84 | public String withdrawPOST(@ModelAttribute("amount") String amount, @ModelAttribute("accountType") String accountType, Principal principal) { 85 | accountService.withdraw(accountType, Double.parseDouble(amount), principal); 86 | 87 | return "redirect:/userFront"; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.userFront 7 | userFront 8 | 0.0.1-SNAPSHOT 9 | jar 10 | 11 | UserFront 12 | User Front for online Banking System 13 | 14 | 15 | org.springframework.boot 16 | spring-boot-starter-parent 17 | 2.0.0.M7 18 | 19 | 20 | 21 | 22 | UTF-8 23 | UTF-8 24 | 1.8 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | 36 | 37 | org.springframework.boot 38 | spring-boot-starter-thymeleaf 39 | 40 | 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-starter-jdbc 45 | 46 | 47 | 48 | 49 | org.springframework.boot 50 | spring-boot-starter-data-jpa 51 | 52 | 53 | 54 | 55 | mysql 56 | mysql-connector-java 57 | 58 | 59 | 60 | org.springframework.boot 61 | spring-boot-starter-security 62 | 63 | 64 | 65 | 66 | org.springframework.boot 67 | spring-boot-starter-test 68 | test 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | org.springframework.boot 78 | spring-boot-maven-plugin 79 | 80 | 81 | 82 | 83 | 84 | 85 | spring-snapshots 86 | Spring Snapshots 87 | https://repo.spring.io/snapshot 88 | 89 | true 90 | 91 | 92 | 93 | spring-milestones 94 | Spring Milestones 95 | https://repo.spring.io/milestone 96 | 97 | false 98 | 99 | 100 | 101 | 102 | 103 | 104 | spring-snapshots 105 | Spring Snapshots 106 | https://repo.spring.io/snapshot 107 | 108 | true 109 | 110 | 111 | 112 | spring-milestones 113 | Spring Milestones 114 | https://repo.spring.io/milestone 115 | 116 | false 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserServiceImpl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service.UserServiceImpl; 2 | 3 | import java.util.List; 4 | import java.util.Set; 5 | 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 10 | import org.springframework.stereotype.Service; 11 | import org.springframework.transaction.annotation.Transactional; 12 | 13 | import com.userfront.dao.RoleDao; 14 | import com.userfront.dao.UserDao; 15 | import com.userfront.domain.User; 16 | import com.userfront.domain.security.UserRole; 17 | import com.userfront.service.AccountService; 18 | import com.userfront.service.UserService; 19 | 20 | @Service 21 | @Transactional 22 | public class UserServiceImpl implements UserService{ 23 | 24 | private static final Logger LOG = LoggerFactory.getLogger(UserService.class); 25 | 26 | @Autowired 27 | private UserDao userDao; 28 | 29 | @Autowired 30 | private RoleDao roleDao; 31 | 32 | @Autowired 33 | private BCryptPasswordEncoder passwordEncoder; 34 | 35 | @Autowired 36 | private AccountService accountService; 37 | 38 | public void save(User user) { 39 | userDao.save(user); 40 | } 41 | 42 | public User findByUsername(String username) { 43 | return userDao.findByUsername(username); 44 | } 45 | 46 | public User findByEmail(String email) { 47 | return userDao.findByEmail(email); 48 | } 49 | 50 | 51 | public User createUser(User user, Set userRoles) { 52 | User localUser = userDao.findByUsername(user.getUsername()); 53 | 54 | if (localUser != null) { 55 | LOG.info("User with username {} already exist. Nothing will be done. ", user.getUsername()); 56 | } else { 57 | String encryptedPassword = passwordEncoder.encode(user.getPassword()); 58 | user.setPassword(encryptedPassword); 59 | 60 | for (UserRole ur : userRoles) { 61 | roleDao.save(ur.getRole()); 62 | } 63 | 64 | user.getUserRoles().addAll(userRoles); 65 | 66 | user.setPrimaryAccount(accountService.createPrimaryAccount()); 67 | user.setSavingsAccount(accountService.createSavingsAccount()); 68 | 69 | localUser = userDao.save(user); 70 | } 71 | 72 | return localUser; 73 | } 74 | 75 | public boolean checkUserExists(String username, String email){ 76 | if (checkUsernameExists(username) || checkEmailExists(username)) { 77 | return true; 78 | } else { 79 | return false; 80 | } 81 | } 82 | 83 | public boolean checkUsernameExists(String username) { 84 | if (null != findByUsername(username)) { 85 | return true; 86 | } 87 | 88 | return false; 89 | } 90 | 91 | public boolean checkEmailExists(String email) { 92 | if (null != findByEmail(email)) { 93 | return true; 94 | } 95 | 96 | return false; 97 | } 98 | 99 | public User saveUser (User user) { 100 | return userDao.save(user); 101 | } 102 | 103 | public List findUserList() { 104 | return userDao.findAll(); 105 | } 106 | 107 | public void enableUser (String username) { 108 | User user = findByUsername(username); 109 | user.setEnabled(true); 110 | userDao.save(user); 111 | } 112 | 113 | public void disableUser (String username) { 114 | User user = findByUsername(username); 115 | user.setEnabled(false); 116 | System.out.println(user.isEnabled()); 117 | userDao.save(user); 118 | System.out.println(username + " is disabled."); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/main/resources/static/css/dataTables.bootstrap.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:8px;right:8px;display:block;font-family:'Glyphicons Halflings';opacity:0.5}table.dataTable thead .sorting:after{opacity:0.2;content:"\e150"}table.dataTable thead .sorting_asc:after{content:"\e155"}table.dataTable thead .sorting_desc:after{content:"\e156"}table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{color:#eee}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-condensed>thead>tr>th{padding-right:20px}table.dataTable.table-condensed .sorting:after,table.dataTable.table-condensed .sorting_asc:after,table.dataTable.table-condensed .sorting_desc:after{top:6px;right:6px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0} 2 | -------------------------------------------------------------------------------- /src/main/resources/templates/recipient.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |

      Recipient Information

      10 |
      11 | 12 | 13 |
      14 | 15 | 17 |
      18 |
      19 | 20 | 22 |
      23 |
      24 | 25 | 27 |
      28 |
      29 | 30 | 32 |
      33 |
      34 | 35 | 37 |
      38 | 39 | 42 | 43 | 44 |
      45 | 46 |
      47 |
      48 |
      49 |
      50 |
      51 |
      52 |

      List of Recipients

      53 |
      54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 |
      Recipient NameRecipient EmailRecipient PhoneRecipient Account NumberDescription
      ...............delete
      76 |
      77 |
      78 |
      79 | 80 | 81 |
      82 | 83 | 84 | -------------------------------------------------------------------------------- /src/main/resources/templates/userFront.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |
      10 | 11 |
      12 | 13 |
      14 |
      15 |
      16 |
      17 |
      18 |
      19 | 20 |

      Primary Balance:

      21 |
      22 |
      23 |

      ...

      24 |
      25 |
      26 |
      27 | 28 | 33 | 34 |
      35 | 36 |
      37 |
      38 |
      39 |
      40 |

      Savings Balance:

      41 |
      42 |
      43 |

      ...

      44 |
      45 |
      46 |
      47 | 48 | 53 | 54 |
      55 |
      56 | 57 |
      58 |
      59 |
      60 |
      61 |
      62 | 63 |
      64 |
      65 |
      Deposit
      66 |
      67 |
      68 |
      69 | 70 | 75 | 76 |
      77 |
      78 | 79 | 80 |
      81 |
      82 |
      83 |
      84 |
      85 | 86 |
      87 |
      88 |
      Withdraw
      89 |
      90 |
      91 |
      92 | 93 | 98 | 99 |
      100 |
      101 |
      102 | 103 | 104 | 105 |
      106 | 107 | 108 |
      109 | 110 | 111 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserServiceImpl/AccountServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service.UserServiceImpl; 2 | 3 | import java.math.BigDecimal; 4 | import java.security.Principal; 5 | import java.util.Date; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.userfront.dao.PrimaryAccountDao; 11 | import com.userfront.dao.SavingsAccountDao; 12 | import com.userfront.domain.PrimaryAccount; 13 | import com.userfront.domain.PrimaryTransaction; 14 | import com.userfront.domain.SavingsAccount; 15 | import com.userfront.domain.SavingsTransaction; 16 | import com.userfront.domain.User; 17 | import com.userfront.service.AccountService; 18 | import com.userfront.service.TransactionService; 19 | import com.userfront.service.UserService; 20 | 21 | @Service 22 | public class AccountServiceImpl implements AccountService { 23 | 24 | private static int nextAccountNumber = 11223145; 25 | 26 | @Autowired 27 | private PrimaryAccountDao primaryAccountDao; 28 | 29 | @Autowired 30 | private SavingsAccountDao savingsAccountDao; 31 | 32 | @Autowired 33 | private UserService userService; 34 | 35 | @Autowired 36 | private TransactionService transactionService; 37 | 38 | public PrimaryAccount createPrimaryAccount() { 39 | PrimaryAccount primaryAccount = new PrimaryAccount(); 40 | primaryAccount.setAccountBalance(new BigDecimal(0.0)); 41 | primaryAccount.setAccountNumber(accountGen()); 42 | 43 | primaryAccountDao.save(primaryAccount); 44 | 45 | return primaryAccountDao.findByAccountNumber(primaryAccount.getAccountNumber()); 46 | } 47 | 48 | public SavingsAccount createSavingsAccount() { 49 | SavingsAccount savingsAccount = new SavingsAccount(); 50 | savingsAccount.setAccountBalance(new BigDecimal(0.0)); 51 | savingsAccount.setAccountNumber(accountGen()); 52 | 53 | savingsAccountDao.save(savingsAccount); 54 | 55 | return savingsAccountDao.findByAccountNumber(savingsAccount.getAccountNumber()); 56 | } 57 | 58 | public void deposit(String accountType, double amount, Principal principal) { 59 | User user = userService.findByUsername(principal.getName()); 60 | 61 | if (accountType.equalsIgnoreCase("Primary")) { 62 | PrimaryAccount primaryAccount = user.getPrimaryAccount(); 63 | primaryAccount.setAccountBalance(primaryAccount.getAccountBalance().add(new BigDecimal(amount))); 64 | primaryAccountDao.save(primaryAccount); 65 | 66 | Date date = new Date(); 67 | 68 | PrimaryTransaction primaryTransaction = new PrimaryTransaction(date, "Deposit to Primary Account", "Account", "Finished", amount, primaryAccount.getAccountBalance(), primaryAccount); 69 | transactionService.savePrimaryDepositTransaction(primaryTransaction); 70 | 71 | } else if (accountType.equalsIgnoreCase("Savings")) { 72 | SavingsAccount savingsAccount = user.getSavingsAccount(); 73 | savingsAccount.setAccountBalance(savingsAccount.getAccountBalance().add(new BigDecimal(amount))); 74 | savingsAccountDao.save(savingsAccount); 75 | 76 | Date date = new Date(); 77 | SavingsTransaction savingsTransaction = new SavingsTransaction(date, "Deposit to savings Account", "Account", "Finished", amount, savingsAccount.getAccountBalance(), savingsAccount); 78 | transactionService.saveSavingsDepositTransaction(savingsTransaction); 79 | } 80 | } 81 | 82 | public void withdraw(String accountType, double amount, Principal principal) { 83 | User user = userService.findByUsername(principal.getName()); 84 | 85 | if (accountType.equalsIgnoreCase("Primary")) { 86 | PrimaryAccount primaryAccount = user.getPrimaryAccount(); 87 | primaryAccount.setAccountBalance(primaryAccount.getAccountBalance().subtract(new BigDecimal(amount))); 88 | primaryAccountDao.save(primaryAccount); 89 | 90 | Date date = new Date(); 91 | 92 | PrimaryTransaction primaryTransaction = new PrimaryTransaction(date, "Withdraw from Primary Account", "Account", "Finished", amount, primaryAccount.getAccountBalance(), primaryAccount); 93 | transactionService.savePrimaryWithdrawTransaction(primaryTransaction); 94 | } else if (accountType.equalsIgnoreCase("Savings")) { 95 | SavingsAccount savingsAccount = user.getSavingsAccount(); 96 | savingsAccount.setAccountBalance(savingsAccount.getAccountBalance().subtract(new BigDecimal(amount))); 97 | savingsAccountDao.save(savingsAccount); 98 | 99 | Date date = new Date(); 100 | SavingsTransaction savingsTransaction = new SavingsTransaction(date, "Withdraw from savings Account", "Account", "Finished", amount, savingsAccount.getAccountBalance(), savingsAccount); 101 | transactionService.saveSavingsWithdrawTransaction(savingsTransaction); 102 | } 103 | } 104 | 105 | private int accountGen() { 106 | return ++nextAccountNumber; 107 | } 108 | 109 | 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/controller/TransferController.java: -------------------------------------------------------------------------------- 1 | package com.userfront.controller; 2 | 3 | import java.security.Principal; 4 | import java.util.List; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Controller; 8 | import org.springframework.transaction.annotation.Transactional; 9 | import org.springframework.ui.Model; 10 | import org.springframework.web.bind.annotation.ModelAttribute; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | 15 | import com.userfront.domain.PrimaryAccount; 16 | import com.userfront.domain.Recipient; 17 | import com.userfront.domain.SavingsAccount; 18 | import com.userfront.domain.User; 19 | import com.userfront.service.TransactionService; 20 | import com.userfront.service.UserService; 21 | 22 | @Controller 23 | @RequestMapping("/transfer") 24 | public class TransferController { 25 | 26 | @Autowired 27 | private TransactionService transactionService; 28 | 29 | @Autowired 30 | private UserService userService; 31 | 32 | @RequestMapping(value = "/betweenAccounts", method = RequestMethod.GET) 33 | public String betweenAccounts(Model model) { 34 | model.addAttribute("transferFrom", ""); 35 | model.addAttribute("transferTo", ""); 36 | model.addAttribute("amount", ""); 37 | 38 | return "betweenAccounts"; 39 | } 40 | 41 | @RequestMapping(value = "/betweenAccounts", method = RequestMethod.POST) 42 | public String betweenAccountsPost( 43 | @ModelAttribute("transferFrom") String transferFrom, 44 | @ModelAttribute("transferTo") String transferTo, 45 | @ModelAttribute("amount") String amount, 46 | Principal principal 47 | ) throws Exception { 48 | User user = userService.findByUsername(principal.getName()); 49 | PrimaryAccount primaryAccount = user.getPrimaryAccount(); 50 | SavingsAccount savingsAccount = user.getSavingsAccount(); 51 | transactionService.betweenAccountsTransfer(transferFrom, transferTo, amount, primaryAccount, savingsAccount); 52 | 53 | return "redirect:/userFront"; 54 | } 55 | 56 | @RequestMapping(value = "/recipient", method = RequestMethod.GET) 57 | public String recipient(Model model, Principal principal) { 58 | List recipientList = transactionService.findRecipientList(principal); 59 | 60 | Recipient recipient = new Recipient(); 61 | 62 | model.addAttribute("recipientList", recipientList); 63 | model.addAttribute("recipient", recipient); 64 | 65 | return "recipient"; 66 | } 67 | 68 | @RequestMapping(value = "/recipient/save", method = RequestMethod.POST) 69 | public String recipientPost(@ModelAttribute("recipient") Recipient recipient, Principal principal) { 70 | 71 | User user = userService.findByUsername(principal.getName()); 72 | recipient.setUser(user); 73 | transactionService.saveRecipient(recipient); 74 | 75 | return "redirect:/transfer/recipient"; 76 | } 77 | 78 | @RequestMapping(value = "/recipient/edit", method = RequestMethod.GET) 79 | public String recipientEdit(@RequestParam(value = "recipientName") String recipientName, Model model, Principal principal){ 80 | 81 | Recipient recipient = transactionService.findRecipientByName(recipientName); 82 | List recipientList = transactionService.findRecipientList(principal); 83 | 84 | model.addAttribute("recipientList", recipientList); 85 | model.addAttribute("recipient", recipient); 86 | 87 | return "recipient"; 88 | } 89 | 90 | @RequestMapping(value = "/recipient/delete", method = RequestMethod.GET) 91 | @Transactional 92 | public String recipientDelete(@RequestParam(value = "recipientName") String recipientName, Model model, Principal principal){ 93 | 94 | transactionService.deleteRecipientByName(recipientName); 95 | 96 | List recipientList = transactionService.findRecipientList(principal); 97 | 98 | Recipient recipient = new Recipient(); 99 | model.addAttribute("recipient", recipient); 100 | model.addAttribute("recipientList", recipientList); 101 | 102 | 103 | return "recipient"; 104 | } 105 | 106 | @RequestMapping(value = "/toSomeoneElse",method = RequestMethod.GET) 107 | public String toSomeoneElse(Model model, Principal principal) { 108 | List recipientList = transactionService.findRecipientList(principal); 109 | 110 | model.addAttribute("recipientList", recipientList); 111 | model.addAttribute("accountType", ""); 112 | 113 | return "toSomeoneElse"; 114 | } 115 | 116 | @RequestMapping(value = "/toSomeoneElse",method = RequestMethod.POST) 117 | public String toSomeoneElsePost(@ModelAttribute("recipientName") String recipientName, @ModelAttribute("accountType") String accountType, @ModelAttribute("amount") String amount, Principal principal) { 118 | User user = userService.findByUsername(principal.getName()); 119 | Recipient recipient = transactionService.findRecipientByName(recipientName); 120 | transactionService.toSomeoneElseTransfer(recipient, accountType, amount, user.getPrimaryAccount(), user.getSavingsAccount()); 121 | 122 | return "redirect:/userFront"; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /src/main/resources/static/js/jquery.easing.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 3 | * 4 | * Uses the built in easing capabilities added In jQuery 1.1 5 | * to offer multiple easing options 6 | * 7 | * TERMS OF USE - EASING EQUATIONS 8 | * 9 | * Open source under the BSD License. 10 | * 11 | * Copyright © 2001 Robert Penner 12 | * All rights reserved. 13 | * 14 | * TERMS OF USE - jQuery Easing 15 | * 16 | * Open source under the BSD License. 17 | * 18 | * Copyright © 2008 George McGinley Smith 19 | * All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without modification, 22 | * are permitted provided that the following conditions are met: 23 | * 24 | * Redistributions of source code must retain the above copyright notice, this list of 25 | * conditions and the following disclaimer. 26 | * Redistributions in binary form must reproduce the above copyright notice, this list 27 | * of conditions and the following disclaimer in the documentation and/or other materials 28 | * provided with the distribution. 29 | * 30 | * Neither the name of the author nor the names of contributors may be used to endorse 31 | * or promote products derived from this software without specific prior written permission. 32 | * 33 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 34 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 35 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 36 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 37 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 38 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 39 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 40 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 41 | * OF THE POSSIBILITY OF SUCH DAMAGE. 42 | * 43 | */ 44 | jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g&2 63 | echo Please set the JAVA_HOME variable in your environment to match the >&2 64 | echo location of your Java installation. >&2 65 | echo. 66 | goto error 67 | 68 | :OkJHome 69 | if exist "%JAVA_HOME%\bin\java.exe" goto init 70 | 71 | echo. 72 | echo Error: JAVA_HOME is set to an invalid directory. >&2 73 | echo JAVA_HOME = "%JAVA_HOME%" >&2 74 | echo Please set the JAVA_HOME variable in your environment to match the >&2 75 | echo location of your Java installation. >&2 76 | echo. 77 | goto error 78 | 79 | @REM ==== END VALIDATION ==== 80 | 81 | :init 82 | 83 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 84 | @REM Fallback to current working directory if not found. 85 | 86 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 87 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 88 | 89 | set EXEC_DIR=%CD% 90 | set WDIR=%EXEC_DIR% 91 | :findBaseDir 92 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 93 | cd .. 94 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 95 | set WDIR=%CD% 96 | goto findBaseDir 97 | 98 | :baseDirFound 99 | set MAVEN_PROJECTBASEDIR=%WDIR% 100 | cd "%EXEC_DIR%" 101 | goto endDetectBaseDir 102 | 103 | :baseDirNotFound 104 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 105 | cd "%EXEC_DIR%" 106 | 107 | :endDetectBaseDir 108 | 109 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 110 | 111 | @setlocal EnableExtensions EnableDelayedExpansion 112 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 113 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 114 | 115 | :endReadAdditionalConfig 116 | 117 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 118 | 119 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 120 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 121 | 122 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 123 | if ERRORLEVEL 1 goto error 124 | goto end 125 | 126 | :error 127 | set ERROR_CODE=1 128 | 129 | :end 130 | @endlocal & set ERROR_CODE=%ERROR_CODE% 131 | 132 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 133 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 134 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 135 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 136 | :skipRcPost 137 | 138 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 139 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 140 | 141 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 142 | 143 | exit /B %ERROR_CODE% 144 | -------------------------------------------------------------------------------- /src/main/resources/templates/profile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
      7 |
      8 |
      9 |

      My Profile

      10 |
      11 |
      12 | 13 | 14 |
      15 | 16 |
      17 |
      18 | 19 | 22 |
      23 |
      24 |
      25 | 26 |
      27 | 28 |
      29 |
      30 | 31 | 34 |
      35 |
      36 |
      37 | 38 |
      39 | 40 |
      41 |
      42 | 43 | 45 |
      46 |
      47 |
      48 | 49 |
      50 | Email already exists 52 |
      53 |
      54 | 56 | 58 |
      59 |
      60 |
      61 | 62 |
      63 | Username already exists 65 |
      66 |
      67 | 68 | 71 |
      72 |
      73 |
      74 | 75 |
      76 | 78 |
      79 | 80 |
      81 |
      82 |
      83 |
      84 |
      85 |

      Your Account Information

      86 |
      87 |
      88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 |
      Primary Account NumberSavings Account Number
      ......
      99 |
      100 |
      101 |
      102 |
      103 | 104 | 105 |
      106 | 107 | 108 | -------------------------------------------------------------------------------- /src/main/resources/templates/common/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | User Front 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
      35 | bann 36 | 37 | 95 |
      96 | 97 |
      98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 |
      119 | 120 | 121 | -------------------------------------------------------------------------------- /src/main/java/com/userfront/domain/User.java: -------------------------------------------------------------------------------- 1 | package com.userfront.domain; 2 | 3 | import java.util.Collection; 4 | import java.util.HashSet; 5 | import java.util.List; 6 | import java.util.Set; 7 | 8 | import javax.persistence.CascadeType; 9 | import javax.persistence.Column; 10 | import javax.persistence.Entity; 11 | import javax.persistence.FetchType; 12 | import javax.persistence.GeneratedValue; 13 | import javax.persistence.GenerationType; 14 | import javax.persistence.Id; 15 | import javax.persistence.OneToMany; 16 | import javax.persistence.OneToOne; 17 | 18 | import org.springframework.security.core.GrantedAuthority; 19 | import org.springframework.security.core.userdetails.UserDetails; 20 | 21 | import com.fasterxml.jackson.annotation.JsonIgnore; 22 | import com.userfront.domain.security.Authority; 23 | import com.userfront.domain.security.UserRole; 24 | 25 | @Entity 26 | public class User implements UserDetails{ 27 | 28 | @Id 29 | @GeneratedValue(strategy = GenerationType.AUTO) 30 | @Column(name = "userId", nullable = false, updatable = false) 31 | private Long userId; 32 | private String username; 33 | private String password; 34 | private String firstName; 35 | private String lastName; 36 | 37 | @Column(name = "email", nullable = false, unique = true) 38 | private String email; 39 | private String phone; 40 | 41 | private boolean enabled=true; 42 | 43 | @OneToOne 44 | private PrimaryAccount primaryAccount; 45 | 46 | @OneToOne 47 | private SavingsAccount savingsAccount; 48 | 49 | @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY) 50 | @JsonIgnore 51 | private List appointmentList; 52 | 53 | @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY) 54 | private List recipientList; 55 | 56 | @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.EAGER) 57 | @JsonIgnore 58 | private Set userRoles = new HashSet<>(); 59 | 60 | public Set getUserRoles() { 61 | return userRoles; 62 | } 63 | 64 | public void setUserRoles(Set userRoles) { 65 | this.userRoles = userRoles; 66 | } 67 | 68 | public Long getUserId() { 69 | return userId; 70 | } 71 | 72 | public void setUserId(Long userId) { 73 | this.userId = userId; 74 | } 75 | 76 | public String getUsername() { 77 | return username; 78 | } 79 | 80 | public void setUsername(String username) { 81 | this.username = username; 82 | } 83 | 84 | public String getFirstName() { 85 | return firstName; 86 | } 87 | 88 | public void setFirstName(String firstName) { 89 | this.firstName = firstName; 90 | } 91 | 92 | public String getLastName() { 93 | return lastName; 94 | } 95 | 96 | public void setLastName(String lastName) { 97 | this.lastName = lastName; 98 | } 99 | 100 | public String getEmail() { 101 | return email; 102 | } 103 | 104 | public void setEmail(String email) { 105 | this.email = email; 106 | } 107 | 108 | public String getPhone() { 109 | return phone; 110 | } 111 | 112 | public void setPhone(String phone) { 113 | this.phone = phone; 114 | } 115 | 116 | public List getAppointmentList() { 117 | return appointmentList; 118 | } 119 | 120 | public void setAppointmentList(List appointmentList) { 121 | this.appointmentList = appointmentList; 122 | } 123 | 124 | public List getRecipientList() { 125 | return recipientList; 126 | } 127 | 128 | public void setRecipientList(List recipientList) { 129 | this.recipientList = recipientList; 130 | } 131 | 132 | public String getPassword() { 133 | return password; 134 | } 135 | 136 | public void setPassword(String password) { 137 | this.password = password; 138 | } 139 | 140 | public PrimaryAccount getPrimaryAccount() { 141 | return primaryAccount; 142 | } 143 | 144 | public void setPrimaryAccount(PrimaryAccount primaryAccount) { 145 | this.primaryAccount = primaryAccount; 146 | } 147 | 148 | public SavingsAccount getSavingsAccount() { 149 | return savingsAccount; 150 | } 151 | 152 | public void setSavingsAccount(SavingsAccount savingsAccount) { 153 | this.savingsAccount = savingsAccount; 154 | } 155 | 156 | public void setEnabled(boolean enabled) { 157 | this.enabled = enabled; 158 | } 159 | 160 | @Override 161 | public String toString() { 162 | return "User{" + 163 | "userId=" + userId + 164 | ", username='" + username + '\'' + 165 | ", password='" + password + '\'' + 166 | ", firstName='" + firstName + '\'' + 167 | ", lastName='" + lastName + '\'' + 168 | ", email='" + email + '\'' + 169 | ", phone='" + phone + '\'' + 170 | ", appointmentList=" + appointmentList + 171 | ", recipientList=" + recipientList + 172 | ", userRoles=" + userRoles + 173 | '}'; 174 | } 175 | 176 | @Override 177 | public Collection getAuthorities() { 178 | Set authorities = new HashSet<>(); 179 | userRoles.forEach(ur -> authorities.add(new Authority(ur.getRole().getName()))); 180 | return authorities; 181 | } 182 | 183 | @Override 184 | public boolean isAccountNonExpired() { 185 | // TODO Auto-generated method stub 186 | return true; 187 | } 188 | 189 | @Override 190 | public boolean isAccountNonLocked() { 191 | // TODO Auto-generated method stub 192 | return true; 193 | } 194 | 195 | @Override 196 | public boolean isCredentialsNonExpired() { 197 | // TODO Auto-generated method stub 198 | return true; 199 | } 200 | 201 | @Override 202 | public boolean isEnabled() { 203 | return enabled; 204 | } 205 | 206 | 207 | } 208 | -------------------------------------------------------------------------------- /src/main/resources/templates/signup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
      8 |
      9 |
      10 |
      11 |
      12 |

      signup

      13 |
      14 |
      15 |
      16 | 105 |
      106 |
      107 |
      108 | 109 | 110 |
      111 | 112 | 113 | -------------------------------------------------------------------------------- /src/main/resources/static/css/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: transparent; 3 | } 4 | 5 | html { 6 | background: url("/images/bg.png") no-repeat center center fixed; 7 | -webkit-background-size: cover; 8 | -moz-background-size: cover; 9 | -o-background-size: cover; 10 | background-size: cover; 11 | } 12 | 13 | .form-basic { 14 | max-width: 640px; 15 | margin: 0 auto; 16 | padding: 55px; 17 | box-sizing: border-box; 18 | background-color: #ffffff; 19 | box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); 20 | font: bold 14px sans-serif; 21 | text-align: center; 22 | } 23 | 24 | .form-basic .form-row { 25 | text-align: left; 26 | margin-bottom: 22px; 27 | } 28 | 29 | .form-basic .form-title-row { 30 | text-align: center; 31 | margin-bottom: 55px; 32 | } 33 | 34 | /* The form title */ 35 | .form-basic h1 { 36 | display: inline-block; 37 | box-sizing: border-box; 38 | color: #4c565e; 39 | font-size: 24px; 40 | padding: 0 10px 15px; 41 | border-bottom: 2px solid #6caee0; 42 | margin: 0; 43 | } 44 | 45 | .form-basic .form-row>label span { 46 | display: inline-block; 47 | box-sizing: border-box; 48 | color: #5F5F5F; 49 | width: 180px; 50 | text-align: right; 51 | vertical-align: top; 52 | padding: 12px 25px; 53 | } 54 | 55 | .form-basic input { 56 | color: #5f5f5f; 57 | box-sizing: border-box; 58 | width: 240px; 59 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08); 60 | padding: 12px; 61 | border: 1px solid #dbdbdb; 62 | } 63 | 64 | .form-basic input[type=radio], .form-basic input[type=checkbox] { 65 | box-shadow: none; 66 | width: auto; 67 | } 68 | 69 | .form-basic input[type=checkbox] { 70 | margin-top: 13px; 71 | } 72 | 73 | .form-basic select { 74 | background-color: #ffffff; 75 | color: #5f5f5f; 76 | box-sizing: border-box; 77 | max-width: 240px; 78 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08); 79 | padding: 12px 8px; 80 | border: 1px solid #dbdbdb; 81 | } 82 | 83 | .form-basic textarea { 84 | color: #5f5f5f; 85 | box-sizing: border-box; 86 | width: 240px; 87 | height: 80px; 88 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08); 89 | font: normal 13px sans-serif; 90 | padding: 12px; 91 | border: 1px solid #dbdbdb; 92 | resize: vertical; 93 | } 94 | 95 | .form-basic .form-radio-buttons { 96 | display: inline-block; 97 | vertical-align: top; 98 | } 99 | 100 | .form-basic .form-radio-buttons>div { 101 | margin-top: 10px; 102 | } 103 | 104 | .form-basic .form-radio-buttons label span { 105 | margin-left: 8px; 106 | color: #5f5f5f; 107 | font-weight: normal; 108 | } 109 | 110 | .form-basic .form-radio-buttons input { 111 | width: auto; 112 | } 113 | 114 | .form-basic button { 115 | display: block; 116 | border-radius: 2px; 117 | background-color: #6caee0; 118 | color: #ffffff; 119 | font-weight: bold; 120 | box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08); 121 | padding: 14px 22px; 122 | border: 0; 123 | margin: 40px 183px 0; 124 | } 125 | 126 | /* Making the form responsive. Remove this media query 127 | if you don't need the form to work on mobile devices. */ 128 | @media ( max-width : 600px) { 129 | .form-basic { 130 | padding: 30px; 131 | max-width: 480px; 132 | } 133 | .form-basic .form-row { 134 | max-width: 300px; 135 | margin: 25px auto; 136 | text-align: left; 137 | } 138 | .form-basic .form-title-row { 139 | margin-bottom: 50px; 140 | } 141 | .form-basic .form-row>label span { 142 | display: block; 143 | text-align: left; 144 | padding: 0 0 15px; 145 | } 146 | .form-basic select { 147 | width: 240px; 148 | } 149 | .form-basic input[type=checkbox] { 150 | margin-top: 0; 151 | } 152 | .form-basic .form-radio-buttons>div { 153 | margin: 0 0 10px; 154 | } 155 | .form-basic button { 156 | margin: 0; 157 | } 158 | } 159 | 160 | .main { 161 | margin-top: 70px; 162 | } 163 | 164 | .main-center { 165 | margin-top: 30px; 166 | margin: 0 auto; 167 | max-width: 330px; 168 | padding: 40px 40px; 169 | } 170 | 171 | .responstable { 172 | margin: 1em 0; 173 | width: 100%; 174 | overflow: hidden; 175 | background: #FFF; 176 | color: #024457; 177 | border-radius: 10px; 178 | border: 1px solid #167F92; 179 | } 180 | 181 | .responstable tr { 182 | border: 1px solid #D9E4E6; 183 | } 184 | 185 | .responstable tr:nth-child(odd) { 186 | background-color: #EAF3F3; 187 | } 188 | 189 | .responstable th { 190 | display: none; 191 | border: 1px solid #FFF; 192 | background-color: #167F92; 193 | color: #FFF; 194 | padding: 1em; 195 | } 196 | 197 | .responstable th:first-child { 198 | display: table-cell; 199 | text-align: center; 200 | } 201 | 202 | .responstable th:nth-child(2) { 203 | display: table-cell; 204 | } 205 | 206 | .responstable th:nth-child(2) span { 207 | display: none; 208 | } 209 | 210 | .responstable th:nth-child(2):after { 211 | content: attr(data-th); 212 | } 213 | 214 | @media ( min-width : 480px) { 215 | .responstable th:nth-child(2) span { 216 | display: block; 217 | } 218 | .responstable th:nth-child(2):after { 219 | display: none; 220 | } 221 | } 222 | 223 | .responstable td { 224 | display: block; 225 | word-wrap: break-word; 226 | max-width: 7em; 227 | } 228 | 229 | .responstable td:first-child { 230 | display: table-cell; 231 | text-align: center; 232 | border-right: 1px solid #D9E4E6; 233 | } 234 | 235 | @media ( min-width : 480px) { 236 | .responstable td { 237 | border: 1px solid #D9E4E6; 238 | } 239 | } 240 | 241 | .responstable th, .responstable td { 242 | text-align: left; 243 | margin: .5em 1em; 244 | } 245 | 246 | @media ( min-width : 480px) { 247 | .responstable th, .responstable td { 248 | display: table-cell; 249 | padding: 1em; 250 | } 251 | } 252 | 253 | body { 254 | padding: 0 2em; 255 | font-family: Arial, sans-serif; 256 | color: #024457; 257 | /*background: #f2f2f2;*/ 258 | } 259 | 260 | h1 { 261 | font-family: Verdana; 262 | font-weight: normal; 263 | /*color: #024457;*/ 264 | } 265 | 266 | h1 span { 267 | color: #167F92; 268 | } 269 | 270 | .box { 271 | border: 2px solid red; 272 | } 273 | 274 | hr { 275 | -moz-border-bottom-colors: none; 276 | -moz-border-image: none; 277 | -moz-border-left-colors: none; 278 | -moz-border-right-colors: none; 279 | -moz-border-top-colors: none; 280 | border-color: #EEEEEE -moz-use-text-color #FFFFFF; 281 | border-style: solid none; 282 | border-width: 1px 0; 283 | margin: 18px 0; 284 | border: 0; 285 | height: 1px; 286 | background: #333; 287 | background-image: linear-gradient(to right, #ccc, #333, #ccc); 288 | } -------------------------------------------------------------------------------- /src/main/java/com/userfront/service/UserServiceImpl/TransactionServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.userfront.service.UserServiceImpl; 2 | 3 | import java.math.BigDecimal; 4 | import java.security.Principal; 5 | import java.util.Date; 6 | import java.util.List; 7 | import java.util.stream.Collectors; 8 | 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.userfront.dao.PrimaryAccountDao; 13 | import com.userfront.dao.PrimaryTransactionDao; 14 | import com.userfront.dao.RecipientDao; 15 | import com.userfront.dao.SavingsAccountDao; 16 | import com.userfront.dao.SavingsTransactionDao; 17 | import com.userfront.domain.PrimaryAccount; 18 | import com.userfront.domain.PrimaryTransaction; 19 | import com.userfront.domain.Recipient; 20 | import com.userfront.domain.SavingsAccount; 21 | import com.userfront.domain.SavingsTransaction; 22 | import com.userfront.domain.User; 23 | import com.userfront.service.TransactionService; 24 | import com.userfront.service.UserService; 25 | 26 | @Service 27 | public class TransactionServiceImpl implements TransactionService { 28 | 29 | @Autowired 30 | private UserService userService; 31 | 32 | @Autowired 33 | private PrimaryTransactionDao primaryTransactionDao; 34 | 35 | @Autowired 36 | private SavingsTransactionDao savingsTransactionDao; 37 | 38 | @Autowired 39 | private PrimaryAccountDao primaryAccountDao; 40 | 41 | @Autowired 42 | private SavingsAccountDao savingsAccountDao; 43 | 44 | @Autowired 45 | private RecipientDao recipientDao; 46 | 47 | 48 | public List findPrimaryTransactionList(String username){ 49 | User user = userService.findByUsername(username); 50 | List primaryTransactionList = user.getPrimaryAccount().getPrimaryTransactionList(); 51 | 52 | return primaryTransactionList; 53 | } 54 | 55 | public List findSavingsTransactionList(String username) { 56 | User user = userService.findByUsername(username); 57 | List savingsTransactionList = user.getSavingsAccount().getSavingsTransactionList(); 58 | 59 | return savingsTransactionList; 60 | } 61 | 62 | public void savePrimaryDepositTransaction(PrimaryTransaction primaryTransaction) { 63 | primaryTransactionDao.save(primaryTransaction); 64 | } 65 | 66 | public void saveSavingsDepositTransaction(SavingsTransaction savingsTransaction) { 67 | savingsTransactionDao.save(savingsTransaction); 68 | } 69 | 70 | public void savePrimaryWithdrawTransaction(PrimaryTransaction primaryTransaction) { 71 | primaryTransactionDao.save(primaryTransaction); 72 | } 73 | 74 | public void saveSavingsWithdrawTransaction(SavingsTransaction savingsTransaction) { 75 | savingsTransactionDao.save(savingsTransaction); 76 | } 77 | 78 | public void betweenAccountsTransfer(String transferFrom, String transferTo, String amount, PrimaryAccount primaryAccount, SavingsAccount savingsAccount) throws Exception { 79 | if (transferFrom.equalsIgnoreCase("Primary") && transferTo.equalsIgnoreCase("Savings")) { 80 | primaryAccount.setAccountBalance(primaryAccount.getAccountBalance().subtract(new BigDecimal(amount))); 81 | savingsAccount.setAccountBalance(savingsAccount.getAccountBalance().add(new BigDecimal(amount))); 82 | primaryAccountDao.save(primaryAccount); 83 | savingsAccountDao.save(savingsAccount); 84 | 85 | Date date = new Date(); 86 | 87 | PrimaryTransaction primaryTransaction = new PrimaryTransaction(date, "Between account transfer from "+transferFrom+" to "+transferTo, "Account", "Finished", Double.parseDouble(amount), primaryAccount.getAccountBalance(), primaryAccount); 88 | primaryTransactionDao.save(primaryTransaction); 89 | } else if (transferFrom.equalsIgnoreCase("Savings") && transferTo.equalsIgnoreCase("Primary")) { 90 | primaryAccount.setAccountBalance(primaryAccount.getAccountBalance().add(new BigDecimal(amount))); 91 | savingsAccount.setAccountBalance(savingsAccount.getAccountBalance().subtract(new BigDecimal(amount))); 92 | primaryAccountDao.save(primaryAccount); 93 | savingsAccountDao.save(savingsAccount); 94 | 95 | Date date = new Date(); 96 | 97 | SavingsTransaction savingsTransaction = new SavingsTransaction(date, "Between account transfer from "+transferFrom+" to "+transferTo, "Transfer", "Finished", Double.parseDouble(amount), savingsAccount.getAccountBalance(), savingsAccount); 98 | savingsTransactionDao.save(savingsTransaction); 99 | } else { 100 | throw new Exception("Invalid Transfer"); 101 | } 102 | } 103 | 104 | public List findRecipientList(Principal principal) { 105 | String username = principal.getName(); 106 | List recipientList = recipientDao.findAll().stream() //convert list to stream 107 | .filter(recipient -> username.equals(recipient.getUser().getUsername())) //filters the line, equals to username 108 | .collect(Collectors.toList()); 109 | 110 | return recipientList; 111 | } 112 | 113 | public Recipient saveRecipient(Recipient recipient) { 114 | return recipientDao.save(recipient); 115 | } 116 | 117 | public Recipient findRecipientByName(String recipientName) { 118 | return recipientDao.findByName(recipientName); 119 | } 120 | 121 | public void deleteRecipientByName(String recipientName) { 122 | recipientDao.deleteByName(recipientName); 123 | } 124 | 125 | public void toSomeoneElseTransfer(Recipient recipient, String accountType, String amount, PrimaryAccount primaryAccount, SavingsAccount savingsAccount) { 126 | if (accountType.equalsIgnoreCase("Primary")) { 127 | primaryAccount.setAccountBalance(primaryAccount.getAccountBalance().subtract(new BigDecimal(amount))); 128 | primaryAccountDao.save(primaryAccount); 129 | 130 | Date date = new Date(); 131 | 132 | PrimaryTransaction primaryTransaction = new PrimaryTransaction(date, "Transfer to recipient "+recipient.getName(), "Transfer", "Finished", Double.parseDouble(amount), primaryAccount.getAccountBalance(), primaryAccount); 133 | primaryTransactionDao.save(primaryTransaction); 134 | } else if (accountType.equalsIgnoreCase("Savings")) { 135 | savingsAccount.setAccountBalance(savingsAccount.getAccountBalance().subtract(new BigDecimal(amount))); 136 | savingsAccountDao.save(savingsAccount); 137 | 138 | Date date = new Date(); 139 | 140 | SavingsTransaction savingsTransaction = new SavingsTransaction(date, "Transfer to recipient "+recipient.getName(), "Transfer", "Finished", Double.parseDouble(amount), savingsAccount.getAccountBalance(), savingsAccount); 141 | savingsTransactionDao.save(savingsTransaction); 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Migwn, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | # TODO classpath? 118 | fi 119 | 120 | if [ -z "$JAVA_HOME" ]; then 121 | javaExecutable="`which javac`" 122 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 123 | # readlink(1) is not available as standard on Solaris 10. 124 | readLink=`which readlink` 125 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 126 | if $darwin ; then 127 | javaHome="`dirname \"$javaExecutable\"`" 128 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 129 | else 130 | javaExecutable="`readlink -f \"$javaExecutable\"`" 131 | fi 132 | javaHome="`dirname \"$javaExecutable\"`" 133 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 134 | JAVA_HOME="$javaHome" 135 | export JAVA_HOME 136 | fi 137 | fi 138 | fi 139 | 140 | if [ -z "$JAVACMD" ] ; then 141 | if [ -n "$JAVA_HOME" ] ; then 142 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 143 | # IBM's JDK on AIX uses strange locations for the executables 144 | JAVACMD="$JAVA_HOME/jre/sh/java" 145 | else 146 | JAVACMD="$JAVA_HOME/bin/java" 147 | fi 148 | else 149 | JAVACMD="`which java`" 150 | fi 151 | fi 152 | 153 | if [ ! -x "$JAVACMD" ] ; then 154 | echo "Error: JAVA_HOME is not defined correctly." >&2 155 | echo " We cannot execute $JAVACMD" >&2 156 | exit 1 157 | fi 158 | 159 | if [ -z "$JAVA_HOME" ] ; then 160 | echo "Warning: JAVA_HOME environment variable is not set." 161 | fi 162 | 163 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 164 | 165 | # traverses directory structure from process work directory to filesystem root 166 | # first directory with .mvn subdirectory is considered project base directory 167 | find_maven_basedir() { 168 | 169 | if [ -z "$1" ] 170 | then 171 | echo "Path not specified to find_maven_basedir" 172 | return 1 173 | fi 174 | 175 | basedir="$1" 176 | wdir="$1" 177 | while [ "$wdir" != '/' ] ; do 178 | if [ -d "$wdir"/.mvn ] ; then 179 | basedir=$wdir 180 | break 181 | fi 182 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 183 | if [ -d "${wdir}" ]; then 184 | wdir=`cd "$wdir/.."; pwd` 185 | fi 186 | # end of workaround 187 | done 188 | echo "${basedir}" 189 | } 190 | 191 | # concatenates all lines of a file 192 | concat_lines() { 193 | if [ -f "$1" ]; then 194 | echo "$(tr -s '\n' ' ' < "$1")" 195 | fi 196 | } 197 | 198 | BASE_DIR=`find_maven_basedir "$(pwd)"` 199 | if [ -z "$BASE_DIR" ]; then 200 | exit 1; 201 | fi 202 | 203 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 204 | echo $MAVEN_PROJECTBASEDIR 205 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 206 | 207 | # For Cygwin, switch paths to Windows format before running java 208 | if $cygwin; then 209 | [ -n "$M2_HOME" ] && 210 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 211 | [ -n "$JAVA_HOME" ] && 212 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 213 | [ -n "$CLASSPATH" ] && 214 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 215 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 216 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 217 | fi 218 | 219 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 220 | 221 | exec "$JAVACMD" \ 222 | $MAVEN_OPTS \ 223 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 224 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 225 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 226 | -------------------------------------------------------------------------------- /src/main/resources/static/js/bootbox.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bootbox.js v4.4.0 3 | * 4 | * http://bootboxjs.com/license.txt 5 | */ 6 | !function(a,b){"use strict";"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):a.bootbox=b(a.jQuery)}(this,function a(b,c){"use strict";function d(a){var b=q[o.locale];return b?b[a]:q.en[a]}function e(a,c,d){a.stopPropagation(),a.preventDefault();var e=b.isFunction(d)&&d.call(c,a)===!1;e||c.modal("hide")}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,c){var d=0;b.each(a,function(a,b){c(a,b,d++)})}function h(a){var c,d;if("object"!=typeof a)throw new Error("Please supply an object of options");if(!a.message)throw new Error("Please specify a message");return a=b.extend({},o,a),a.buttons||(a.buttons={}),c=a.buttons,d=f(c),g(c,function(a,e,f){if(b.isFunction(e)&&(e=c[a]={callback:e}),"object"!==b.type(e))throw new Error("button with key "+a+" must be an object");e.label||(e.label=a),e.className||(e.className=2>=d&&f===d-1?"btn-primary":"btn-default")}),a}function i(a,b){var c=a.length,d={};if(1>c||c>2)throw new Error("Invalid argument length");return 2===c||"string"==typeof a[0]?(d[b[0]]=a[0],d[b[1]]=a[1]):d=a[0],d}function j(a,c,d){return b.extend(!0,{},a,i(c,d))}function k(a,b,c,d){var e={className:"bootbox-"+a,buttons:l.apply(null,b)};return m(j(e,d,c),b)}function l(){for(var a={},b=0,c=arguments.length;c>b;b++){var e=arguments[b],f=e.toLowerCase(),g=e.toUpperCase();a[f]={label:d(g)}}return a}function m(a,b){var d={};return g(b,function(a,b){d[b]=!0}),g(a.buttons,function(a){if(d[a]===c)throw new Error("button key "+a+" is not allowed (options are "+b.join("\n")+")")}),a}var n={dialog:"",header:"",footer:"",closeButton:"",form:"
      ",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"
      ",date:"",time:"",number:"",password:""}},o={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},p={};p.alert=function(){var a;if(a=k("alert",["ok"],["message","callback"],arguments),a.callback&&!b.isFunction(a.callback))throw new Error("alert requires callback property to be a function when provided");return a.buttons.ok.callback=a.onEscape=function(){return b.isFunction(a.callback)?a.callback.call(this):!0},p.dialog(a)},p.confirm=function(){var a;if(a=k("confirm",["cancel","confirm"],["message","callback"],arguments),a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,!1)},a.buttons.confirm.callback=function(){return a.callback.call(this,!0)},!b.isFunction(a.callback))throw new Error("confirm requires a callback");return p.dialog(a)},p.prompt=function(){var a,d,e,f,h,i,k;if(f=b(n.form),d={className:"bootbox-prompt",buttons:l("cancel","confirm"),value:"",inputType:"text"},a=m(j(d,arguments,["title","callback"]),["cancel","confirm"]),i=a.show===c?!0:a.show,a.message=f,a.buttons.cancel.callback=a.onEscape=function(){return a.callback.call(this,null)},a.buttons.confirm.callback=function(){var c;switch(a.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":c=h.val();break;case"checkbox":var d=h.find("input:checked");c=[],g(d,function(a,d){c.push(b(d).val())})}return a.callback.call(this,c)},a.show=!1,!a.title)throw new Error("prompt requires a title");if(!b.isFunction(a.callback))throw new Error("prompt requires a callback");if(!n.inputs[a.inputType])throw new Error("invalid prompt type");switch(h=b(n.inputs[a.inputType]),a.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":h.val(a.value);break;case"select":var o={};if(k=a.inputOptions||[],!b.isArray(k))throw new Error("Please pass an array of input options");if(!k.length)throw new Error("prompt with select requires options");g(k,function(a,d){var e=h;if(d.value===c||d.text===c)throw new Error("given options in wrong format");d.group&&(o[d.group]||(o[d.group]=b("").attr("label",d.group)),e=o[d.group]),e.append("")}),g(o,function(a,b){h.append(b)}),h.val(a.value);break;case"checkbox":var q=b.isArray(a.value)?a.value:[a.value];if(k=a.inputOptions||[],!k.length)throw new Error("prompt with checkbox requires options");if(!k[0].value||!k[0].text)throw new Error("given options in wrong format");h=b("
      "),g(k,function(c,d){var e=b(n.inputs[a.inputType]);e.find("input").attr("value",d.value),e.find("label").append(d.text),g(q,function(a,b){b===d.value&&e.find("input").prop("checked",!0)}),h.append(e)})}return a.placeholder&&h.attr("placeholder",a.placeholder),a.pattern&&h.attr("pattern",a.pattern),a.maxlength&&h.attr("maxlength",a.maxlength),f.append(h),f.on("submit",function(a){a.preventDefault(),a.stopPropagation(),e.find(".btn-primary").click()}),e=p.dialog(a),e.off("shown.bs.modal"),e.on("shown.bs.modal",function(){h.focus()}),i===!0&&e.modal("show"),e},p.dialog=function(a){a=h(a);var d=b(n.dialog),f=d.find(".modal-dialog"),i=d.find(".modal-body"),j=a.buttons,k="",l={onEscape:a.onEscape};if(b.fn.modal===c)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(g(j,function(a,b){k+="",l[a]=b.callback}),i.find(".bootbox-body").html(a.message),a.animate===!0&&d.addClass("fade"),a.className&&d.addClass(a.className),"large"===a.size?f.addClass("modal-lg"):"small"===a.size&&f.addClass("modal-sm"),a.title&&i.before(n.header),a.closeButton){var m=b(n.closeButton);a.title?d.find(".modal-header").prepend(m):m.css("margin-top","-10px").prependTo(i)}return a.title&&d.find(".modal-title").html(a.title),k.length&&(i.after(n.footer),d.find(".modal-footer").html(k)),d.on("hidden.bs.modal",function(a){a.target===this&&d.remove()}),d.on("shown.bs.modal",function(){d.find(".btn-primary:first").focus()}),"static"!==a.backdrop&&d.on("click.dismiss.bs.modal",function(a){d.children(".modal-backdrop").length&&(a.currentTarget=d.children(".modal-backdrop").get(0)),a.target===a.currentTarget&&d.trigger("escape.close.bb")}),d.on("escape.close.bb",function(a){l.onEscape&&e(a,d,l.onEscape)}),d.on("click",".modal-footer button",function(a){var c=b(this).data("bb-handler");e(a,d,l[c])}),d.on("click",".bootbox-close-button",function(a){e(a,d,l.onEscape)}),d.on("keyup",function(a){27===a.which&&d.trigger("escape.close.bb")}),b(a.container).append(d),d.modal({backdrop:a.backdrop?"static":!1,keyboard:!1,show:!1}),a.show&&d.modal("show"),d},p.setDefaults=function(){var a={};2===arguments.length?a[arguments[0]]=arguments[1]:a=arguments[0],b.extend(o,a)},p.hideAll=function(){return b(".bootbox").modal("hide"),p};var q={bg_BG:{OK:"Ок",CANCEL:"Отказ",CONFIRM:"Потвърждавам"},br:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Sim"},cs:{OK:"OK",CANCEL:"Zrušit",CONFIRM:"Potvrdit"},da:{OK:"OK",CANCEL:"Annuller",CONFIRM:"Accepter"},de:{OK:"OK",CANCEL:"Abbrechen",CONFIRM:"Akzeptieren"},el:{OK:"Εντάξει",CANCEL:"Ακύρωση",CONFIRM:"Επιβεβαίωση"},en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},es:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Aceptar"},et:{OK:"OK",CANCEL:"Katkesta",CONFIRM:"OK"},fa:{OK:"قبول",CANCEL:"لغو",CONFIRM:"تایید"},fi:{OK:"OK",CANCEL:"Peruuta",CONFIRM:"OK"},fr:{OK:"OK",CANCEL:"Annuler",CONFIRM:"D'accord"},he:{OK:"אישור",CANCEL:"ביטול",CONFIRM:"אישור"},hu:{OK:"OK",CANCEL:"Mégsem",CONFIRM:"Megerősít"},hr:{OK:"OK",CANCEL:"Odustani",CONFIRM:"Potvrdi"},id:{OK:"OK",CANCEL:"Batal",CONFIRM:"OK"},it:{OK:"OK",CANCEL:"Annulla",CONFIRM:"Conferma"},ja:{OK:"OK",CANCEL:"キャンセル",CONFIRM:"確認"},lt:{OK:"Gerai",CANCEL:"Atšaukti",CONFIRM:"Patvirtinti"},lv:{OK:"Labi",CANCEL:"Atcelt",CONFIRM:"Apstiprināt"},nl:{OK:"OK",CANCEL:"Annuleren",CONFIRM:"Accepteren"},no:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},pl:{OK:"OK",CANCEL:"Anuluj",CONFIRM:"Potwierdź"},pt:{OK:"OK",CANCEL:"Cancelar",CONFIRM:"Confirmar"},ru:{OK:"OK",CANCEL:"Отмена",CONFIRM:"Применить"},sq:{OK:"OK",CANCEL:"Anulo",CONFIRM:"Prano"},sv:{OK:"OK",CANCEL:"Avbryt",CONFIRM:"OK"},th:{OK:"ตกลง",CANCEL:"ยกเลิก",CONFIRM:"ยืนยัน"},tr:{OK:"Tamam",CANCEL:"İptal",CONFIRM:"Onayla"},zh_CN:{OK:"OK",CANCEL:"取消",CONFIRM:"确认"},zh_TW:{OK:"OK",CANCEL:"取消",CONFIRM:"確認"}};return p.addLocale=function(a,c){return b.each(["OK","CANCEL","CONFIRM"],function(a,b){if(!c[b])throw new Error("Please supply a translation for '"+b+"'")}),q[a]={OK:c.OK,CANCEL:c.CANCEL,CONFIRM:c.CONFIRM},p},p.removeLocale=function(a){return delete q[a],p},p.setLocale=function(a){return p.setDefaults("locale",a)},p.init=function(c){return a(c||b)},p}); -------------------------------------------------------------------------------- /src/main/resources/static/css/bootstrap-datetimepicker.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Datetimepicker for Bootstrap 3 | * 4 | * Copyright 2012 Stefan Petre 5 | * Improvements by Andrew Rowls 6 | * Licensed under the Apache License v2.0 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | */.datetimepicker{padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker-inline{width:220px}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=" datetimepicker-dropdown"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,0.2);position:absolute}[class*=" datetimepicker-dropdown"]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute}[class*=" datetimepicker-dropdown-top"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,0.2);border-bottom:0}[class*=" datetimepicker-dropdown-top"]:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker>div{display:none}.datetimepicker.minutes div.datetimepicker-minutes{display:block}.datetimepicker.hours div.datetimepicker-hours{display:block}.datetimepicker.days div.datetimepicker-days{display:block}.datetimepicker.months div.datetimepicker-months{display:block}.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker td,.datetimepicker th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}.table-striped .datetimepicker table tr td,.table-striped .datetimepicker table tr th{background-color:transparent}.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.hour:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.day:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.old,.datetimepicker table tr td.new{color:#999}.datetimepicker table tr td.disabled,.datetimepicker table tr td.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td.today,.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled:hover{background-color:#fde19a;background-image:-moz-linear-gradient(top,#fdd49a,#fdf59a);background-image:-ms-linear-gradient(top,#fdd49a,#fdf59a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdd49a),to(#fdf59a));background-image:-webkit-linear-gradient(top,#fdd49a,#fdf59a);background-image:-o-linear-gradient(top,#fdd49a,#fdf59a);background-image:linear-gradient(top,#fdd49a,#fdf59a);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a',endColorstr='#fdf59a',GradientType=0);border-color:#fdf59a #fdf59a #fbed50;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today:hover:hover,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today.disabled:hover:hover,.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today:hover.disabled,.datetimepicker table tr td.today.disabled.disabled,.datetimepicker table tr td.today.disabled:hover.disabled,.datetimepicker table tr td.today[disabled],.datetimepicker table tr td.today:hover[disabled],.datetimepicker table tr td.today.disabled[disabled],.datetimepicker table tr td.today.disabled:hover[disabled]{background-color:#fdf59a}.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:hover.active{background-color:#fbf069}.datetimepicker table tr td.active,.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active:hover:hover,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active.disabled:hover:hover,.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active:hover.disabled,.datetimepicker table tr td.active.disabled.disabled,.datetimepicker table tr td.active.disabled:hover.disabled,.datetimepicker table tr td.active[disabled],.datetimepicker table tr td.active:hover[disabled],.datetimepicker table tr td.active.disabled[disabled],.datetimepicker table tr td.active.disabled:hover[disabled]{background-color:#04c}.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:hover.active{background-color:#039}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-hours table tr td span.hour_am,.datetimepicker .datetimepicker-hours table tr td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.disabled,.datetimepicker table tr td span.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td span.active,.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc',endColorstr='#0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active:hover:hover,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active.disabled:hover:hover,.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active:hover.disabled,.datetimepicker table tr td span.active.disabled.disabled,.datetimepicker table tr td span.active.disabled:hover.disabled,.datetimepicker table tr td span.active[disabled],.datetimepicker table tr td span.active:hover[disabled],.datetimepicker table tr td span.active.disabled[disabled],.datetimepicker table tr td span.active.disabled:hover[disabled]{background-color:#04c}.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:hover.active{background-color:#039}.datetimepicker table tr td span.old{color:#999}.datetimepicker th.switch{width:145px}.datetimepicker th span.glyphicon{pointer-events:none}.datetimepicker thead tr:first-child th,.datetimepicker tfoot th{cursor:pointer}.datetimepicker thead tr:first-child th:hover,.datetimepicker tfoot th:hover{background:#eee}.input-append.date .add-on i,.input-prepend.date .add-on i,.input-group.date .input-group-addon span{cursor:pointer;width:14px;height:14px} -------------------------------------------------------------------------------- /src/main/resources/static/css/jquery.dataTables.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}} 2 | -------------------------------------------------------------------------------- /src/main/resources/static/css/dataTables.jqueryui.min.css: -------------------------------------------------------------------------------- 1 | table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}table.dataTable thead th div.DataTables_sort_wrapper{position:relative}table.dataTable thead th div.DataTables_sort_wrapper span{position:absolute;top:50%;margin-top:-8px;right:-18px}table.dataTable thead th.ui-state-default,table.dataTable tfoot th.ui-state-default{border-left-width:0}table.dataTable thead th.ui-state-default:first-child,table.dataTable tfoot th.ui-state-default:first-child{border-left-width:1px}.dataTables_wrapper .dataTables_paginate .fg-button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;border:1px solid transparent}.dataTables_wrapper .dataTables_paginate .fg-button:active{outline:none}.dataTables_wrapper .dataTables_paginate .fg-button:first-child{border-top-left-radius:3px;border-bottom-left-radius:3px}.dataTables_wrapper .dataTables_paginate .fg-button:last-child{border-top-right-radius:3px;border-bottom-right-radius:3px}.dataTables_wrapper .ui-widget-header{font-weight:normal}.dataTables_wrapper .ui-toolbar{padding:8px}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:none}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:inherit} 2 | --------------------------------------------------------------------------------