From f4f3a16bca576c202887799066bd896863612e2b Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 24 Oct 2023 15:08:15 +0200 Subject: partial theme implementation --- common/src/user.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/src') diff --git a/common/src/user.rs b/common/src/user.rs index 3c1c5b0..0d4806e 100644 --- a/common/src/user.rs +++ b/common/src/user.rs @@ -1,4 +1,6 @@ use crate::{stream::StreamFormat, user}; +#[cfg(feature = "rocket")] +use rocket::{FromFormField, UriDisplayQuery}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fmt::Display}; @@ -8,9 +10,18 @@ pub struct User { pub display_name: String, pub password: Vec, pub admin: bool, + pub theme: Theme, pub permissions: PermissionSet, } +#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq)] +#[cfg_attr(feature = "rocket", derive(FromFormField, UriDisplayQuery))] +#[serde(rename_all = "snake_case")] +pub enum Theme { + Dark, + Light, +} + #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PermissionSet(pub HashMap); -- cgit v1.2.3-70-g09d2