From 28afe8ece0349cb940713d487b1c9397fb375ed7 Mon Sep 17 00:00:00 2001 From: artus40 Date: Sat, 2 Feb 2019 21:32:07 +0100 Subject: [PATCH] Adds bulma.css --- .gitignore | 4 +++ cookbook/src/lib.rs | 4 +-- planner/src/bin/weekly.rs | 8 ++---- web/html/index.html | 55 +++++++++++++++++++++++---------------- 4 files changed, 40 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 01e33b8..30b3294 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,7 @@ **/target **/*.rs.bk **/Cargo.lock + +# Node.js +**/node_modules +**/package-lock.json diff --git a/cookbook/src/lib.rs b/cookbook/src/lib.rs index 05d51c7..adc341e 100644 --- a/cookbook/src/lib.rs +++ b/cookbook/src/lib.rs @@ -34,9 +34,7 @@ pub mod recipes { pub fn delete(conn: &SqliteConnection, recipe_id: i32) -> bool { use self::schema::recipes::dsl::*; - diesel::delete( - recipes.filter( - id.eq(recipe_id))) + diesel::delete(recipes.filter(id.eq(recipe_id))) .execute(conn) .is_ok() } diff --git a/planner/src/bin/weekly.rs b/planner/src/bin/weekly.rs index 1e9fab3..7ee4e34 100644 --- a/planner/src/bin/weekly.rs +++ b/planner/src/bin/weekly.rs @@ -5,7 +5,7 @@ extern crate planner; use self::cookbook::*; use self::cookbook::models::Recipe; -use self::planner::solver::{Variables, Domain, Problem, Constraint}; +use self::planner::solver::{Variables, Domain, Problem}; /// We want a mapping of the week meals (matin, midi, soir) /// Breakfast => RecipeCategory::Breakfast @@ -29,11 +29,7 @@ impl Into for Meals { } } } -/// associated with filters for Domain, depending on recipes RecipeCategory -enum RecipeCategory { - Breakfast, - MainCourse -} + /// It may also contains an initial value for each variable fn generate_variables(domain: &Domain) -> Vec<(String, &Domain, Option<&V>)> { let mut vars = Vec::new(); diff --git a/web/html/index.html b/web/html/index.html index d0de205..f939890 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -2,40 +2,51 @@ - + + Hello Bulma! + +
-

Cook Assistant

+
+

Cook Assistant

+

Recettes

+
-
- -

{{ items[active_view].title }}

-
{{ categories[items[active_view].category].name }}
+
+
+ +

{{ items[active_view].title }}

+
{{ categories[items[active_view].category].name }}

{{ items[active_view].ingredients }}

- + +
-
-
-
- +
+
+
+
+ +
+
+
+ +

{{ categories[active_category].name }}

+
-
-
- -

{{ categories[active_category].name }}

-