diff --git a/CHANGELOG.md b/CHANGELOG.md index 38e39d0d6feaad7fe7573f5de5b67aeff4d66da8..fc951c6e54411d34735f723857daf7b1b5026af1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Bug fixes - Fixed inconsistent password schema error handling ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/868)) - Fix cvalidation to stop users being able to disable their own account ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/870)) +- Fix annoucements not showing after `4.4.10` ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/872)) ### Tweaks TBD ### Lang diff --git a/app/frontend/templates/notify.html b/app/frontend/templates/notify.html index 8601cb08cc954c3fdfc102f0c68980ca3678032b..1b31b4964655234e28e26a1c929ee9e92927a288 100644 --- a/app/frontend/templates/notify.html +++ b/app/frontend/templates/notify.html @@ -97,17 +97,60 @@ image.src = "/static/assets/images/faces-clipart/pic-3.png"; return true; } + + + function createAnnouncementItem(value) { + const li = document.createElement("li"); + li.className = "card-header header-sm justify-content-between align-items-center annoucement-item"; + li.id = value.id; + + // Clear button + const iconWrapper = document.createElement("p"); + const icon = document.createElement("i"); + icon.className = "clear-button fa-regular fa-x"; + icon.dataset.id = value.id; + iconWrapper.appendChild(icon); + + // Link section + const a = document.createElement("a"); + a.href = value.link; + a.target = "_blank"; + + const title = document.createElement("h6"); + title.className = "annoucement-title"; + title.textContent = value.title; + + const dateWrapper = document.createElement("small"); + const date = document.createElement("p"); + date.textContent = value.date; + dateWrapper.appendChild(date); + + const desc = document.createElement("p"); + desc.textContent = value.desc; + + // Assemble link + a.appendChild(title); + a.appendChild(dateWrapper); + a.appendChild(desc); + + // Assemble list item + li.appendChild(iconWrapper); + li.appendChild(a); + + return li; + } + function updateAnnouncements(data) { console.log(data); - let text = ""; + const container = document.querySelector("#announcements"); for (let value of data) { - text += `
${value.date}
${value.desc}