Skip to content
Snippets Groups Projects
Commit db8ab3c4 authored by BEAUVAIS ANTOINE's avatar BEAUVAIS ANTOINE
Browse files

Merge branch 'develop' into 'master'

Started Web interface. #4

See merge request !16
parents 9b1c1bca 5507155f
Branches
1 merge request!16Started Web interface. #4
Showing
with 146 additions and 19 deletions
...@@ -10,8 +10,6 @@ import org.springframework.context.annotation.Configuration; ...@@ -10,8 +10,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources; import org.springframework.context.annotation.PropertySources;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
...@@ -20,7 +18,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; ...@@ -20,7 +18,6 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
* @author BEAUVAIS ANTOINE * @author BEAUVAIS ANTOINE
*/ */
@Configuration @Configuration
@EnableWebMvc
@PropertySources( @PropertySources(
@PropertySource("/apikey.properties") @PropertySource("/apikey.properties")
) )
...@@ -76,14 +73,6 @@ public class WebMvcConfig implements WebMvcConfigurer { ...@@ -76,14 +73,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
*/ */
public static final String MAPPING_LOGIN = "/login"; public static final String MAPPING_LOGIN = "/login";
/*
// TODO: Define default servlet.
@Override
public void configureDefaultServletHandling(
DefaultServletHandlerConfigurer configurer) {
configurer.enable();
}*/
/** /**
* Adds interceptors to the application. * Adds interceptors to the application.
* *
......
...@@ -23,10 +23,12 @@ public class LoginController { ...@@ -23,10 +23,12 @@ public class LoginController {
* Logic for handling login. * Logic for handling login.
* *
* TODO: Actual implementation. * TODO: Actual implementation.
* @return the name of the template to use.
*/ */
@GetMapping(MAPPING_LOGIN) @GetMapping(MAPPING_LOGIN)
public void login() public String login()
{ {
return "login";
} }
} }
/*
* CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
* https://cecill.info/licences/Licence_CeCILL-B_V1-fr.html
*/
package fr.unistra.sil.erp.back.controller.web;
/**
* Controller for the root page.
*
* The root page will typically redirect to the
* main interface.
*
* @author BEAUVAIS ANTOINE
*/
public class RootController {
}
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
* <li>Web interface for regular Human-Machine Interface (HMI) interactions. * <li>Web interface for regular Human-Machine Interface (HMI) interactions.
* </ul> * </ul>
* *
* Notice: Only the API is currently implemented (partially) for now. * Currently, the RESTful API is partly implemented and the Web interface
* has only just been started.
* *
* @version 0.0.1 * @version 0.0.1
* @author BEAUVAIS ANTOINE * @author BEAUVAIS ANTOINE
......
...@@ -15,5 +15,6 @@ https://cecill.info/licences/Licence_CeCILL-B_V1-fr.html ...@@ -15,5 +15,6 @@ https://cecill.info/licences/Licence_CeCILL-B_V1-fr.html
<li>a Web interface for managing the software and data.</li> <li>a Web interface for managing the software and data.</li>
</ul> </ul>
<p>Currently, only the RESTful API is partially implemented.</p> <p>Currently, the RESTful API is partly implemented and the Web interface
has only just been started.</p>
</body> </body>
\ No newline at end of file
spring.mvc.static-path-pattern=/static/**
...@@ -8,3 +8,11 @@ web.ui.login.username=Username ...@@ -8,3 +8,11 @@ web.ui.login.username=Username
web.ui.login.password=Password web.ui.login.password=Password
#Login page: Button's label. #Login page: Button's label.
web.ui.login.submit=Log in web.ui.login.submit=Log in
#Product.
web.ui.product=Product
#Products (plural).
web.ui.products=Products
#Financial registry.
web.ui.registry=Registry
#Documents.
web.ui.property.documents=Documents
...@@ -8,3 +8,11 @@ web.ui.login.username=Username ...@@ -8,3 +8,11 @@ web.ui.login.username=Username
web.ui.login.password=Password web.ui.login.password=Password
#Login page: Button's label. #Login page: Button's label.
web.ui.login.submit=Log in web.ui.login.submit=Log in
#Product.
web.ui.product=Product
#Products (plural).
web.ui.products=Products
#Financial registry.
web.ui.registry=Registry
#Documents.
web.ui.property.documents=Documents
...@@ -8,3 +8,11 @@ web.ui.login.username=Nom d'utilisateur ...@@ -8,3 +8,11 @@ web.ui.login.username=Nom d'utilisateur
web.ui.login.password=Mot de passe web.ui.login.password=Mot de passe
#Login page: Button's label. #Login page: Button's label.
web.ui.login.submit=Se connecter web.ui.login.submit=Se connecter
#Product.
web.ui.product=Produit
#Products (plural).
web.ui.products=Produits
#Financial registry.
web.ui.registry=Registre
#Documents.
web.ui.property.documents=Documents
/* Add a black background color to the top navigation */
.topnav {
background-color: #333;
overflow: hidden;
}
/* Style the links inside the navigation bar */
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
/* Change the color of links on hover */
.topnav a:hover {
background-color: #ddd;
color: black;
}
/* Add an active class to highlight the current page */
.topnav a.active {
background-color: #04AA6D;
color: white;
}
/* Hide the link that should open and close the topnav on small screens */
.topnav .icon {
display: none;
}
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
@media screen and (max-width: 600px) {
.topnav a:not(:first-child) {display: none;}
.topnav a.icon {
float: right;
display: block;
}
}
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
@media screen and (max-width: 600px) {
.topnav.responsive {position: relative;}
.topnav.responsive a.icon {
position: absolute;
right: 0;
top: 0;
}
.topnav.responsive a {
float: none;
display: block;
text-align: left;
}
}
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:fragment="sharedHead (pageName)">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/static/main.css">
<title th:text="${pageName} + ' - ' + #{application.name}"></title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head></head>
<body>
<div class="topnav" id="topNavBar" th:fragment="topNavBar">
<a href="/" th:text="#{application.name}"></a>
<a href="#products" class="active" th:text="#{web.ui.products}"></a>
<a href="#registry" th:text="#{web.ui.registry}"></a>
<a href="#documents" th:text="#{web.ui.documents}"></a>
<a href="javascript:void(0);" class="icon" onclick="toggleNavBar()"></a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head></head>
<body>
<div class="topnav" id="topNavBar" th:fragment="topNavBar">
<a href="/" th:text="#{application.name}"></a>
<a href="javascript:void(0);" class="icon" onclick="toggleNavBar()"></a>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr" xmlns:th="http://www.thymeleaf.org"> <html xmlns:th="http://www.thymeleaf.org">
<head> <head th:replace="fragments/head :: sharedHead (pageName=#{web.ui.login.login})">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title th:text="#{web.ui.login.login} + ' - ' + #{application.name}"></title>
</head> </head>
<body> <body>
<div th:replace="fragments/navbarGuest :: topNavBar"></div>
<h1 th:text="#{web.ui.login.login}"></h1> <h1 th:text="#{web.ui.login.login}"></h1>
<p>TODO</p> <p>TODO</p>
</body> </body>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment