From 5a85f1d83acaddbb462a50573525d9cd741ace26 Mon Sep 17 00:00:00 2001 From: jude Date: Sun, 13 Aug 2023 18:29:30 +0100 Subject: [PATCH] Extract error sections to templates --- web/static/js/reminder_errors.ts | 19 +++++++++++ web/templates/dashboard.html.tera | 34 ++++--------------- .../reminder_dashboard/guild_error.html.tera | 17 ++++++++++ .../reminder_errors.html.tera | 5 +++ .../reminder_dashboard/user_error.html.tera | 12 +++++++ 5 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 web/static/js/reminder_errors.ts create mode 100644 web/templates/reminder_dashboard/guild_error.html.tera create mode 100644 web/templates/reminder_dashboard/reminder_errors.html.tera create mode 100644 web/templates/reminder_dashboard/user_error.html.tera diff --git a/web/static/js/reminder_errors.ts b/web/static/js/reminder_errors.ts new file mode 100644 index 0000000..6fa4798 --- /dev/null +++ b/web/static/js/reminder_errors.ts @@ -0,0 +1,19 @@ +let _reminderErrors = []; + +const reminderErrors = () => { + return _reminderErrors; +} + +const guildId = () => { + let selected: HTMLElement = document.querySelector(".guildList a.is-active"); + return selected.dataset["guild"]; +} + + +function loadErrors() { + fetch(`/dashboard/api/guild/${guildId()}/errors`).then(response => response.json()) +} + +document.addEventListener('DOMContentLoaded', () => { + +}) diff --git a/web/templates/dashboard.html.tera b/web/templates/dashboard.html.tera index 6f5c948..26f543b 100644 --- a/web/templates/dashboard.html.tera +++ b/web/templates/dashboard.html.tera @@ -335,34 +335,14 @@ -