Skip to content
Snippets Groups Projects
Commit a1fdfd2f authored by Richard Githuba's avatar Richard Githuba
Browse files

buttons hidden and styles updated for categories

parent fdbc66f3
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,7 @@ button { ...@@ -49,7 +49,7 @@ button {
.list-item{ .list-item{
background-color: var(--secondary-color); background-color: var(--secondary-color);
padding: 20px 10px; padding: 20px 20px;
border-left: 4px solid var(--primary-color); border-left: 4px solid var(--primary-color);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -62,6 +62,11 @@ button { ...@@ -62,6 +62,11 @@ button {
font-weight: 450; font-weight: 450;
} }
.list-item > p {
color: var(--secondary-text-color);
font-size: 14px;
}
.list-item:hover { .list-item:hover {
border-left: 4px solid var(--tertiary-color); border-left: 4px solid var(--tertiary-color);
} }
......
.edit-news-page > h1 {
text-align: center;
}
.edit-news-page {
padding: 30px;
display: flex;
align-items: center;
flex-direction: column;
}
.form-container { .form-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -10,19 +21,18 @@ ...@@ -10,19 +21,18 @@
form { form {
background-color: white; background-color: white;
border-radius: 10px; border-radius: 10px;
padding: 30px; width: 80%;
width: 500px;
max-width: 100%;
box-sizing: border-box; box-sizing: border-box;
margin: auto;
} }
h1 { h1 {
text-align: left; text-align: center;
margin-bottom: 20px;
padding: 10px; padding: 10px;
font-size: 32px;
} }
label { label {
display: block; display: block;
font-weight: bold; font-weight: bold;
......
...@@ -46,6 +46,9 @@ function renderHeadings(headings) { ...@@ -46,6 +46,9 @@ function renderHeadings(headings) {
const title = document.createElement('h2') const title = document.createElement('h2')
title.innerHTML = `<i class="bi bi-file-earmark-text"></i> ${heading.infoTitle} ` title.innerHTML = `<i class="bi bi-file-earmark-text"></i> ${heading.infoTitle} `
const shortDesc = document.createElement(`p`)
shortDesc.textContent = `${heading.shortDescription}`
const link = document.createElement('a') const link = document.createElement('a')
link.href = `/info/${heading.informationId}`; link.href = `/info/${heading.informationId}`;
link.classList.add('heading-link'); link.classList.add('heading-link');
...@@ -57,6 +60,7 @@ function renderHeadings(headings) { ...@@ -57,6 +60,7 @@ function renderHeadings(headings) {
link.appendChild(readMore); link.appendChild(readMore);
listItem.appendChild(title) listItem.appendChild(title)
listItem.appendChild(shortDesc);
listItem.appendChild(link) listItem.appendChild(link)
container.appendChild(listItem) container.appendChild(listItem)
}); });
......
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" <html xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6"
>
> >
<head> <head>
<title>Categories</title> <title>Categories</title>
...@@ -11,7 +13,7 @@ ...@@ -11,7 +13,7 @@
<section class="info-database" layout:fragment="content" > <section class="info-database" layout:fragment="content" >
<div class="title-section"> <div class="title-section">
<h1>Community Information Database</h1> <h1>Community Information Database</h1>
<button id="add-new-category"> <button id="add-new-category" sec:authorize="isAuthenticated()">
<i class="bi bi-folder-plus"></i> <i class="bi bi-folder-plus"></i>
New Category New Category
</button> </button>
......
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" <html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity6"
>
<head> <head>
<title>Category Headings</title> <title>Category Headings</title>
<link rel="stylesheet" href="/css/headings/headings.css"> <link rel="stylesheet" href="/css/headings/headings.css">
...@@ -15,9 +17,9 @@ ...@@ -15,9 +17,9 @@
<div class="buttons"> <div class="buttons">
<button id="delete-button" disabled>Delete</button> <button id="delete-button" disabled>Delete</button>
<button id="edit-mode-button">Edit</button> <button id="edit-mode-button" sec:authorize="isAuthenticated()" >Edit</button>
<a id="addInfo"> <a id="addInfo">
<button id="add-new-information"> <button id="add-new-information" sec:authorize="isAuthenticated()" >
<i class="bi bi-folder-plus"></i> <i class="bi bi-folder-plus"></i>
New Information New Information
</button> </button>
......
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
...@@ -8,7 +10,7 @@ ...@@ -8,7 +10,7 @@
<script src="/js/news/editNewsScript.js"></script> <script src="/js/news/editNewsScript.js"></script>
</head> </head>
<body> <section layout:fragment="content" class="edit-news-page">
<h1>Edit or Delete News</h1> <h1>Edit or Delete News</h1>
<form th:action="@{/editNews/{id}(id=${news.news_id})}" th:object="${news}" method="post" onsubmit="return validateForm(event)"> <form th:action="@{/editNews/{id}(id=${news.news_id})}" th:object="${news}" method="post" onsubmit="return validateForm(event)">
<!-- Hidden field to hold the news ID --> <!-- Hidden field to hold the news ID -->
...@@ -66,6 +68,6 @@ ...@@ -66,6 +68,6 @@
</div> </div>
</form> </form>
</body> </section>
</html> </html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment