diff --git a/src/main/resources/static/css/headings/headings.css b/src/main/resources/static/css/headings/headings.css index 547d068352bfa01d97e645c8d7e79d2b32e5ab71..0a6bf08ecc08d3ee1d97546675c96e05e37863b3 100644 --- a/src/main/resources/static/css/headings/headings.css +++ b/src/main/resources/static/css/headings/headings.css @@ -49,7 +49,7 @@ button { .list-item{ background-color: var(--secondary-color); - padding: 20px 10px; + padding: 20px 20px; border-left: 4px solid var(--primary-color); display: flex; flex-direction: column; @@ -62,6 +62,11 @@ button { font-weight: 450; } +.list-item > p { + color: var(--secondary-text-color); + font-size: 14px; +} + .list-item:hover { border-left: 4px solid var(--tertiary-color); } diff --git a/src/main/resources/static/css/news/editNewsStyle.css b/src/main/resources/static/css/news/editNewsStyle.css index 0b575d42276f870de0cd3951de929305e89ca890..cc837a082563098a28f4d6af79eab7a41b95456a 100644 --- a/src/main/resources/static/css/news/editNewsStyle.css +++ b/src/main/resources/static/css/news/editNewsStyle.css @@ -1,3 +1,14 @@ +.edit-news-page > h1 { + text-align: center; +} + +.edit-news-page { + padding: 30px; + display: flex; + align-items: center; + flex-direction: column; +} + .form-container { display: flex; justify-content: center; @@ -10,19 +21,18 @@ form { background-color: white; border-radius: 10px; - padding: 30px; - width: 500px; - max-width: 100%; + width: 80%; box-sizing: border-box; - margin: auto; } h1 { - text-align: left; - margin-bottom: 20px; + text-align: center; + padding: 10px; + font-size: 32px; } + label { display: block; font-weight: bold; diff --git a/src/main/resources/static/js/headings/headings.js b/src/main/resources/static/js/headings/headings.js index 969fb7a02573bae898a124eaa60037b0fd4936cb..1e3cd429dc7c996a6e9b69b2f460e47bb4ffad01 100644 --- a/src/main/resources/static/js/headings/headings.js +++ b/src/main/resources/static/js/headings/headings.js @@ -46,6 +46,9 @@ function renderHeadings(headings) { const title = document.createElement('h2') 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') link.href = `/info/${heading.informationId}`; link.classList.add('heading-link'); @@ -57,6 +60,7 @@ function renderHeadings(headings) { link.appendChild(readMore); listItem.appendChild(title) + listItem.appendChild(shortDesc); listItem.appendChild(link) container.appendChild(listItem) }); diff --git a/src/main/resources/templates/categories/categories.html b/src/main/resources/templates/categories/categories.html index 8a4e5917e918dd1dd2650944b8dcde296f475094..2172142e1270a028988f88629dcdb0e1aa1365bc 100644 --- a/src/main/resources/templates/categories/categories.html +++ b/src/main/resources/templates/categories/categories.html @@ -1,7 +1,9 @@ <!DOCTYPE html> <html xmlns:th="http://www.thymeleaf.org" 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> <title>Categories</title> @@ -11,7 +13,7 @@ <section class="info-database" layout:fragment="content" > <div class="title-section"> <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> New Category </button> diff --git a/src/main/resources/templates/headings/headings.html b/src/main/resources/templates/headings/headings.html index 80cf562f5e032c351038c644a6f272581870b88c..c4b59610ebbe8b344c357d800ae7a9bfa63ea6b0 100644 --- a/src/main/resources/templates/headings/headings.html +++ b/src/main/resources/templates/headings/headings.html @@ -1,6 +1,8 @@ <!DOCTYPE html> <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> <title>Category Headings</title> <link rel="stylesheet" href="/css/headings/headings.css"> @@ -15,9 +17,9 @@ <div class="buttons"> <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"> - <button id="add-new-information"> + <button id="add-new-information" sec:authorize="isAuthenticated()" > <i class="bi bi-folder-plus"></i> New Information </button> diff --git a/src/main/resources/templates/news/editNews.html b/src/main/resources/templates/news/editNews.html index 9719d75d7d30f2fa5af6fcc0ca25f692b93cf017..6f19a254acf53ed8ba24975b99a7d4cd659439f7 100644 --- a/src/main/resources/templates/news/editNews.html +++ b/src/main/resources/templates/news/editNews.html @@ -1,5 +1,7 @@ <!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> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> @@ -8,7 +10,7 @@ <script src="/js/news/editNewsScript.js"></script> </head> -<body> +<section layout:fragment="content" class="edit-news-page"> <h1>Edit or Delete News</h1> <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 --> @@ -66,6 +68,6 @@ </div> </form> -</body> +</section> </html>