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

More css, also security fix

parent 311fbf1c
No related branches found
No related tags found
1 merge request!36Resolve "As a user I want to be able to use the application on any device e.g. iPhone, iPad, Laptop"
......@@ -2,9 +2,11 @@ package Team5.SmartTowns.security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.provisioning.JdbcUserDetailsManager;
......@@ -24,9 +26,11 @@ public class SecurityConfiguration {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests((requests) -> requests
.requestMatchers("/user/**", "/userProfile").authenticated()
.anyRequest().permitAll()
)
.formLogin((login) -> login
.loginPage("/login").permitAll()
......
/*LandmarkFormTh stylesheet*/
body{
background: rgb(41, 41, 41);
color: wheat;
}
#landmarkSubmission {
background-color: rgb(206, 153, 253);
color: black;
border-color: white;
align-content: center;
text-align: center;
border-radius: 25px;
max-width: 620px;
margin: 0 auto
@media only screen
and (min-device-width: 640px) {
#landmarkSubmission {
background-color: var(--prim-shade-1);
color: black;
border-color: white;
align-content: center;
text-align: center;
border-radius: 25px;
max-width: 620px;
margin: 0 auto
}
#landmarkFormTitle {
color: white;
text-align: center;
}
}
#landmarkFormTitle{
color:white;
text-align: center;
@media only screen
and (max-device-width: 640px) {
/*LandmarkFormTh stylesheet*/
main {
min-height: 30svh;
}
#landmarkSubmission {
background-color: var(--prim-shade-1);
border-color: white;
align-content: center;
text-align: center;
border-radius: 25px;
max-width: 620px;
margin: 0 auto;
display: flex;
flex-direction: column;
row-gap: 2svh;
align-items: center;
& h1 {
}
& label {
font-weight: 600;
}
& select {
font-size: 1em;
}
& input {
font-size: 1em;
}
}
.button {
background-color: var(--prim-shade-3);
border-radius: 20px;
border: var(--prim-shade-2) 5px;
color: #fff;
font-size: xxx-large;
padding: 40px 40px;
font-weight: 600;
letter-spacing: 1px;
text-transform: uppercase;
margin-bottom: 2svh;
cursor: pointer;
box-shadow: rgba(0, 0, 0, 0.2) 0 1svh 1svh;
}
#landmarkFormTitle {
color: white;
text-align: center;
}
}
\ No newline at end of file
......@@ -4,31 +4,31 @@
<meta charset="UTF-8">
<title>Landmark Sign Up</title>
<link rel="stylesheet" th:href="@{css/landmarkFormStyle.css}">
<link rel="stylesheet" th:href="@{css/templatingstyle.css}">
<link rel="stylesheet" th:href="@{css/mobile-style.css}">
<script src="scripts/landmarkFormThScript.js"></script>
</head>
<body>
<header th:insert="~{/fragments/Templating.html :: header}"></header>
<hr style="height:20px; visibility:hidden;" />
<H2 id="landmarkFormTitle"> Interested in joining our trails? Sign up Here! </H2>
<header th:insert="~{/fragments/banners :: header}"></header>
<main>
<!-- Form used to submit potential landmarks for trails-->
<form action="/landmarkSub" id="landmarkSubmission" name="landmarkSubmission" method="post" th:object="${landmarkData}" onsubmit="return landmarkFormValidation()">
<br>
<form action="/landmarkSub" id="landmarkSubmission" name="landmarkSubmission" method="post" th:object="${landmarkData}" onsubmit="return landmarkFormValidation()">
<h1 id="landmarkFormTitle"> Interested in joining our trails? Sign up Here! </h1>
<label>Business Name:
<input type="text" th:field="*{landmarkName}" placeholder="Business name here...">
</label><br>
</label>
<div th:errors="*{landmarkName}" th:if="${#fields.hasErrors('landmarkName')}">ErrorLandmarkName</div>
<br><label>Contact Address:
<label>Contact Address:
<input type="text" th:field="*{landmarkEmail}" placeholder="E-mail here...">
</label><br>
</label>
<div th:errors="*{landmarkEmail}" th:if="${#fields.hasErrors('landmarkEmail')}">ErrorEmail</div>
<br><label>Please Describe Your Business:<br>
<label>Please Describe Your Business:<br>
<textarea th:field="*{landmarkDescription}" rows="18" cols="70" placeholder="Max 200 words please..."></textarea>
</label><br><br>
</label>
<label>Your Location:
<select th:field="*{landmarkLocation}">
<option value="" hidden="true">Select Location</option>
......@@ -37,7 +37,7 @@
<option value="Risca">Risca</option>
<option value="Penarth">Penarth</option>
</select>
</label><br><br>
</label>
<label>Trail:
<select th:field="*{trailID}">
<option value=0 hidden="true">Select Trail</option>
......@@ -48,18 +48,14 @@
<option value=0201>(Risca) Heritage and Culture Trail</option>
<option value=0301>(Penarth) Esplanade Trail</option>
</select>
</label><br><br>
<input type="submit">
<hr style="height:0px; visibility:hidden;" />
</label>
<button class="button" type="submit">Submit</button>
</form>
<hr style="height:40px; visibility:hidden;" />
</main>
<footer th:insert="~{/fragments/Templating.html :: footer}"></footer>
<footer th:insert="~{/fragments/banners :: footer}"></footer>
</body>
</html>
\ No newline at end of file
......@@ -5,17 +5,16 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import javax.sql.DataSource;
@Configuration
public class DatasourceConfig {
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUrl("jdbc:mariadb://localhost:3306/test_towns");
dataSource.setUsername("root");
dataSource.setPassword("comsc");
public class DataSourceConfig {
return dataSource;
}
}
@Bean
public DataSource dataSource(){
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUrl("jdbc:mariadb://localhost:3306/test_towns");
dataSource.setUsername("root");
dataSource.setPassword("comsc");
return dataSource;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment