From 19b47b79883bee2c459b2582c10aaee8b4c7c84e Mon Sep 17 00:00:00 2001 From: eraden Date: Sat, 9 Nov 2024 17:05:58 +0100 Subject: [PATCH] Add edit, fix svg colors --- cooked/assets/styles.css | 44 +++--- cooked/src/filters.rs | 2 - cooked/src/main.rs | 2 +- cooked/src/routes.rs | 2 +- cooked/tailwind.config.js | 1 + cooked/templates/nav.jinja | 43 ++++-- cooked/templates/recipies/show.html | 83 ----------- cooked/templates/recipies/show.jinja | 13 +- cooked/templates/recipies/update_form.jinja | 155 ++++++++++++++++++++ 9 files changed, 223 insertions(+), 122 deletions(-) delete mode 100644 cooked/templates/recipies/show.html diff --git a/cooked/assets/styles.css b/cooked/assets/styles.css index 4b40f44..534a9e9 100644 --- a/cooked/assets/styles.css +++ b/cooked/assets/styles.css @@ -2317,10 +2317,6 @@ details.collapse summary::-webkit-details-marker{ margin-right: 0.25rem; } -.mr-4{ - margin-right: 1rem; -} - .mr-auto{ margin-right: auto; } @@ -2357,6 +2353,10 @@ details.collapse summary::-webkit-details-marker{ height: 1.5rem; } +.h-8{ + height: 2rem; +} + .w-1\/2{ width: 50%; } @@ -2385,6 +2385,10 @@ details.collapse summary::-webkit-details-marker{ width: 1.5rem; } +.w-8{ + width: 2rem; +} + .w-full{ width: 100%; } @@ -3121,6 +3125,10 @@ code{ justify-content: flex-end; } + .md\:justify-between{ + justify-content: space-between; + } + .md\:text-left{ text-align: left; } @@ -3159,19 +3167,17 @@ code{ } } -@media (prefers-color-scheme: dark){ - .dark\:bg-gray-700{ - --tw-bg-opacity: 1; - background-color: rgb(55 65 81 / var(--tw-bg-opacity)); - } - - .dark\:text-white{ - --tw-text-opacity: 1; - color: rgb(255 255 255 / var(--tw-text-opacity)); - } - - .dark\:hover\:bg-gray-600:hover{ - --tw-bg-opacity: 1; - background-color: rgb(75 85 99 / var(--tw-bg-opacity)); - } +.dark\:bg-gray-700:where(.dark, .dark *){ + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +.dark\:text-white:where(.dark, .dark *){ + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.dark\:hover\:bg-gray-600:hover:where(.dark, .dark *){ + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); } diff --git a/cooked/src/filters.rs b/cooked/src/filters.rs index fb3be73..9115acd 100644 --- a/cooked/src/filters.rs +++ b/cooked/src/filters.rs @@ -1,5 +1,3 @@ -use std::collections::hash_map::Values; - use crate::types::Page; pub fn duration(sec: &&i32) -> ::askama::Result { diff --git a/cooked/src/main.rs b/cooked/src/main.rs index 2b7198e..21c60bd 100644 --- a/cooked/src/main.rs +++ b/cooked/src/main.rs @@ -123,7 +123,7 @@ async fn main() { let redis = Data::new(redis); let qs_config = QsQueryConfig::default() - .error_handler(|err, req| { + .error_handler(|err, _req| { // <- create custom error response error::InternalError::from_response(err, HttpResponse::Conflict().finish()).into() }) diff --git a/cooked/src/routes.rs b/cooked/src/routes.rs index bd5a129..4a93aed 100644 --- a/cooked/src/routes.rs +++ b/cooked/src/routes.rs @@ -12,7 +12,7 @@ use askama::Template; use askama_actix::TemplateToResponse; use sea_orm::{prelude::*, DatabaseTransaction, QueryOrder, QuerySelect, TransactionTrait}; use serde::Deserialize; -use std::collections::{BTreeMap, BTreeSet, HashMap}; +use std::collections::{BTreeMap, BTreeSet}; use serde_qs::actix::QsForm; #[derive(Debug, Template, derive_more::Deref)] diff --git a/cooked/tailwind.config.js b/cooked/tailwind.config.js index 31b452c..910e15c 100644 --- a/cooked/tailwind.config.js +++ b/cooked/tailwind.config.js @@ -1,5 +1,6 @@ /** @type {import('tailwindcss').Config} */ module.exports = { + darkMode: 'selector', content: [ "./templates/**/*.html", "./templates/**/*.jinja", diff --git a/cooked/templates/nav.jinja b/cooked/templates/nav.jinja index 632d9ec..cb7207d 100644 --- a/cooked/templates/nav.jinja +++ b/cooked/templates/nav.jinja @@ -7,42 +7,57 @@ Cooked
- +