Skip to content
Snippets Groups Projects
Commit 6d10e0ec authored by Gabriel Copat's avatar Gabriel Copat
Browse files

Brainstorming work for the next sprint

parent 9eb7587c
Branches
No related tags found
1 merge request!37Resolve "As a repeat trail visitor , I want to be able to create an account so I can save and review my progress."
......@@ -37,6 +37,7 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6:3.1.1.RELEASE'
// https://mvnrepository.com/artifact/org.webjars/openlayers
implementation group: 'org.webjars', name: 'openlayers', version: '5.2.0'
}
......
......@@ -59,7 +59,7 @@ public class RewardsRepositoryJDBC implements RewardsRepository {
/* FINDS ALL STICKERS UNLOCKED BY THE GIVEN USER */
String sql= "SELECT * FROM stickers LEFT JOIN stickerprogress " +
"ON (stickers.id, stickers.packID) = (stickerprogress.stickerID, stickerprogress.packID) " +
"WHERE stickerprogress.userID = ? ";
"WHERE stickerprogress.username = ? ";
return jdbc.query(sql, stickerMapper, userID);
}
......
......@@ -6,6 +6,7 @@ import Team5.SmartTowns.rewards.RewardsRepository;
import Team5.SmartTowns.rewards.Sticker;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.Banner;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Controller;
......@@ -34,6 +35,12 @@ public class UserController {
return mav;
}
@GetMapping("/logout")
public ModelAndView getLogOutPage(){
ModelAndView mav = new ModelAndView("users/logout");
return mav;
}
@PostMapping("/login/register")
public ModelAndView registerUser(@Valid @ModelAttribute("user") NewUser user, BindingResult bindingResult, Model model) {
ModelAndView mav = new ModelAndView("users/login", model.asMap());
......
......@@ -52,6 +52,12 @@ body {
justify-content: center;
align-content: center;
}
.centerAll {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
/*PHONES PORTRAIT*/
@media only screen
......
......@@ -11,7 +11,7 @@
<body>
<header th:replace="~{/fragments/Templating.html :: header}"></header>
<div>TEST</div>
<main>
<section id="allTrailsBar" class="centerFlex">
<img class="trailsImages"
......
......@@ -9,15 +9,15 @@
<li><a id="homeHead" href="/home">Home</a></li>
<li>FAQs</li>
<li>Contact us</li>
<li th:if="${#authentication.principal}!=anonymousUser"><a href="/logout">Log Out</a></li>
<li th:if="${#authentication.principal}==anonymousUser"><a href="/login">Log In</a></li>
</ul>
<label class="work">Who we Work with:</label>
<select>
<ul>
<option value="localauthorities">Local Authorities</option>
<option value="towns">Towns</option>
<option value="businesses">Businesses</option>
<option value="consumers">Consumers</option>
</ul>
<label for="stakeholders" class="work">Who we Work with:</label>
<select id="stakeholders">
<option value="localauthorities">Local Authorities</option>
<option value="towns">Towns</option>
<option value="businesses">Businesses</option>
<option value="consumers">Consumers</option>
</select>
</nav>
</header>
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Logged Out Successfully</title>
<link rel="stylesheet" th:href="@{/css/style.css}">
<link rel="stylesheet" th:href="@{/css/login.css}">
</head>
<body>
<main>
<div class="container centerAll">
<h1>You have successfully logged out</h1>
</div>
</main>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment