diff --git a/apps/home/static/home/js/servers.js b/apps/home/static/home/js/servers.js index 9a42de1..419b908 100644 --- a/apps/home/static/home/js/servers.js +++ b/apps/home/static/home/js/servers.js @@ -311,3 +311,80 @@ const unspotItem = id => { const spotItem = (id, spotStyle) => { $(`.sidebar .sidebar-item[data-id="${id}"]`).addClass(`spot spot-${spotStyle}`); } + + +// region View Other Users + +$(".js-serverUsersBtn").on("click", () => { + createModal({ + title: "Other Users", + texts: [ + {content: "This feature has not yet been implemented."} + ], + buttons: [ + { + className: "btn-secondary px-4", + iconClass: "bi-arrow-return-right", + closeModal: true + } + ] + }); +}); + + +// region View Edit History + +$(".js-serverHistoryBtn").on("click", () => { + createModal({ + title: "Edit History", + texts: [ + {content: "This feature has not yet been implemented."} + ], + buttons: [ + { + className: "btn-secondary px-4", + iconClass: "bi-arrow-return-right", + closeModal: true + } + ] + }); +}); + + +// region Delete Server Data + +$(".js-eraseServerBtn").on("click", () => { + const server = selectedServer; // Store incase it changes + const itemsToLose = arrayToHtmlList([ + "Subscriptions", + "Filters", + "Message Styles", + "Tracked Content" + ]).addClass("mb-3").prop("outerHTML"); + + const eraseServerData = () => { + alert("not implemented") + } + + createModal({ + title: `Delete Data for ${server.name}?`, + texts: [ + {content: "You will lose all data related to this server, including:"}, + {content: itemsToLose, html: true}, + {content: "Please reconsider this decision."} + ], + buttons: [ + { + className: "btn-danger me-3", + iconClass: "bi-trash3", + closeModal: true, + onClick: eraseServerData + }, + { + className: "btn-secondary px-4", + iconClass: "bi-arrow-return-right", + closeModal: true + } + ] + }) +}); \ No newline at end of file diff --git a/apps/home/templates/home/index.html b/apps/home/templates/home/index.html index efe5372..e9ffdf1 100644 --- a/apps/home/templates/home/index.html +++ b/apps/home/templates/home/index.html @@ -89,12 +89,40 @@ Message Styles - +