Add dark mode support

This commit is contained in:
jude committed 2026-05-16 19:17:29 +01:00
1 parent 9c6c324b02
commit 050277ac8b
20 files changed
+431 -125

No files matched your search

+1 -6
View File
@@ -5,8 +5,6 @@ mod roles;
mod templates;
pub mod todos;
use std::env;
use crate::utils::check_subscription;
use crate::web::guards::transaction::Transaction;
use crate::web::{check_authorization, routes::JsonResult};
@@ -16,10 +14,7 @@ pub use reminders::*;
use rocket::{get, http::CookieJar, serde::json::json, State};
pub use roles::get_guild_roles;
use serenity::all::UserId;
use serenity::{
client::Context,
model::id::{GuildId, RoleId},
};
use serenity::{client::Context, model::id::GuildId};
pub use templates::*;
#[get("/api/guild/<id>")]
@@ -267,9 +267,8 @@ pub async fn edit_reminder(
}
if reminder.channel > 0 {
let channel_guild = ChannelId::new(reminder.channel)
.to_channel_cached(&ctx.cache)
.map(|channel| channel.guild_id);
let channel_guild =
ctx.cache.channel(ChannelId::new(reminder.channel)).map(|channel| channel.guild_id);
match channel_guild {
Some(channel_guild) => {
let channel_matches_guild = channel_guild.get() == id;
@@ -3,13 +3,10 @@ use crate::web::{
check_authorization,
guards::transaction::Transaction,
routes::{
dashboard::{
create_reminder, CreateReminder, ImportBody, ReminderCsv, ReminderTemplateCsv, TodoCsv,
},
dashboard::{ImportBody, ReminderTemplateCsv},
JsonResult,
},
};
use crate::Database;
use base64::{prelude::BASE64_STANDARD, Engine};
use csv::{QuoteStyle, WriterBuilder};
use log::warn;
@@ -20,10 +17,7 @@ use rocket::{
serde::json::{json, Json},
State,
};
use serenity::{
client::Context,
model::id::{ChannelId, GuildId, UserId},
};
use serenity::{client::Context, model::id::GuildId};
use sqlx::{MySql, Pool};
#[get("/api/guild/<id>/export/reminder_templates")]
+2 -4
View File
@@ -2,9 +2,7 @@ use crate::web::{
check_authorization,
guards::transaction::Transaction,
routes::{
dashboard::{
create_reminder, CreateReminder, ImportBody, ReminderCsv, ReminderTemplateCsv, TodoCsv,
},
dashboard::{create_reminder, CreateReminder, ImportBody, ReminderCsv},
JsonResult,
},
};
@@ -21,7 +19,7 @@ use rocket::{
};
use serenity::{
client::Context,
model::id::{ChannelId, GuildId, UserId},
model::id::{GuildId, UserId},
};
use sqlx::{MySql, Pool};
+2 -6
View File
@@ -1,14 +1,10 @@
use crate::web::{
check_authorization,
guards::transaction::Transaction,
routes::{
dashboard::{
create_reminder, CreateReminder, ImportBody, ReminderCsv, ReminderTemplateCsv, TodoCsv,
},
dashboard::{ImportBody, TodoCsv},
JsonResult,
},
};
use crate::Database;
use base64::{prelude::BASE64_STANDARD, Engine};
use csv::{QuoteStyle, WriterBuilder};
use log::warn;
@@ -21,7 +17,7 @@ use rocket::{
};
use serenity::{
client::Context,
model::id::{ChannelId, GuildId, UserId},
model::id::{ChannelId, GuildId},
};
use sqlx::{MySql, Pool};