From ed7b77cc61275bb488e0b54cacd6d5e64cc7f0fc Mon Sep 17 00:00:00 2001 From: dorian Date: Mon, 17 Jun 2024 15:19:16 +0200 Subject: [PATCH 1/2] Adding Front --- .idea/.gitignore | 5 + .idea/Daidokoro.iml | 12 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .../Component/accueil/accueil.component.html | 62 ++++ .../Component/accueil/accueil.component.ts | 14 + .../recipe-list/recipe-list.component.html | 123 +++++++ .../recipe-list/recipe-list.component.ts | 22 ++ daidokoro/src/app/Model/recipe.model.ts | 6 + daidokoro/src/app/Service/recipe.service.ts | 18 + daidokoro/src/app/app.component.html | 337 +----------------- daidokoro/src/app/app.component.ts | 3 +- 12 files changed, 279 insertions(+), 337 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Daidokoro.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 daidokoro/src/app/Component/accueil/accueil.component.html create mode 100644 daidokoro/src/app/Component/accueil/accueil.component.ts create mode 100644 daidokoro/src/app/Component/recipe-list/recipe-list.component.html create mode 100644 daidokoro/src/app/Component/recipe-list/recipe-list.component.ts create mode 100644 daidokoro/src/app/Model/recipe.model.ts create mode 100644 daidokoro/src/app/Service/recipe.service.ts diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/Daidokoro.iml b/.idea/Daidokoro.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/Daidokoro.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5067127 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/daidokoro/src/app/Component/accueil/accueil.component.html b/daidokoro/src/app/Component/accueil/accueil.component.html new file mode 100644 index 0000000..45c1d10 --- /dev/null +++ b/daidokoro/src/app/Component/accueil/accueil.component.html @@ -0,0 +1,62 @@ + + + + + Daidokoro + + + + + + + +
+
+

Liste Recettes

+ +
+
+ + + diff --git a/daidokoro/src/app/Component/accueil/accueil.component.ts b/daidokoro/src/app/Component/accueil/accueil.component.ts new file mode 100644 index 0000000..03a28cb --- /dev/null +++ b/daidokoro/src/app/Component/accueil/accueil.component.ts @@ -0,0 +1,14 @@ +import { Component } from '@angular/core'; +import {RecipeListComponent} from "../recipe-list/recipe-list.component"; + +@Component({ + selector: 'app-accueil', + standalone: true, + imports: [ + RecipeListComponent + ], + templateUrl: './accueil.component.html' +}) +export class AccueilComponent { + +} diff --git a/daidokoro/src/app/Component/recipe-list/recipe-list.component.html b/daidokoro/src/app/Component/recipe-list/recipe-list.component.html new file mode 100644 index 0000000..c923d26 --- /dev/null +++ b/daidokoro/src/app/Component/recipe-list/recipe-list.component.html @@ -0,0 +1,123 @@ + + + + +
+ Recette 1 +
+

Recette 1

+

Description courte de la recette 1.

+ +
+
+ +
+ Recette 2 +
+

Recette 2

+

Description courte de la recette 2.

+ + +
+
+ +
+ Recette 3 +
+

Recette 3

+

Description courte de la recette 3.

+ +
+
+ +
+ Recette 4 +
+

Recette 4

+

Description courte de la recette 4.

+ +
+
+ +
+ Recette 5 +
+

Recette 5

+

Description courte de la recette 5.

+ +
+
+ +
+ Recette 6 +
+

Recette 6

+

Description courte de la recette 6.

+ +
+
+ + diff --git a/daidokoro/src/app/Component/recipe-list/recipe-list.component.ts b/daidokoro/src/app/Component/recipe-list/recipe-list.component.ts new file mode 100644 index 0000000..2e08b25 --- /dev/null +++ b/daidokoro/src/app/Component/recipe-list/recipe-list.component.ts @@ -0,0 +1,22 @@ +import { Component, OnInit } from '@angular/core'; +import { RecipeService } from '../../Service/recipe.service'; +import { Recipe } from '../../Model/recipe.model'; +import {NgOptimizedImage} from "@angular/common"; + +@Component({ + selector: 'app-recipe-list', + templateUrl: './recipe-list.component.html', + imports: [ + NgOptimizedImage + ], + standalone: true +}) +export class RecipeListComponent implements OnInit { + recipes: Recipe[] = []; + + constructor(private recipeService: RecipeService) {} + + ngOnInit(): void { + this.recipes = this.recipeService.getRecipes(); + } +} diff --git a/daidokoro/src/app/Model/recipe.model.ts b/daidokoro/src/app/Model/recipe.model.ts new file mode 100644 index 0000000..601b384 --- /dev/null +++ b/daidokoro/src/app/Model/recipe.model.ts @@ -0,0 +1,6 @@ +export interface Recipe { + name: string; + date: string; + image: string; + ingredients: { name: string; quantity: string }[]; +} diff --git a/daidokoro/src/app/Service/recipe.service.ts b/daidokoro/src/app/Service/recipe.service.ts new file mode 100644 index 0000000..e61209a --- /dev/null +++ b/daidokoro/src/app/Service/recipe.service.ts @@ -0,0 +1,18 @@ +import { Injectable } from '@angular/core'; +import { Recipe } from '../Model/recipe.model'; + +@Injectable({ + providedIn: 'root' +}) +export class RecipeService { + private recipes: Recipe[] = JSON.parse(localStorage.getItem('recipes') || '[]'); + + getRecipes(): Recipe[] { + return this.recipes; + } + + addRecipe(recipe: Recipe): void { + this.recipes.push(recipe); + localStorage.setItem('recipes', JSON.stringify(this.recipes)); + } +} diff --git a/daidokoro/src/app/app.component.html b/daidokoro/src/app/app.component.html index 36093e1..1faa227 100644 --- a/daidokoro/src/app/app.component.html +++ b/daidokoro/src/app/app.component.html @@ -1,336 +1 @@ - - - - - - - - - - - -
-
-
- -

Hello, {{ title }}

-

Congratulations! Your app is running. 🎉

-
- -
-
- @for (item of [ - { title: 'Explore the Docs', link: 'https://angular.dev' }, - { title: 'Learn with Tutorials', link: 'https://angular.dev/tutorials' }, - { title: 'CLI Docs', link: 'https://angular.dev/tools/cli' }, - { title: 'Angular Language Service', link: 'https://angular.dev/tools/language-service' }, - { title: 'Angular DevTools', link: 'https://angular.dev/tools/devtools' }, - ]; track item.title) { - - {{ item.title }} - - - - - } -
- -
-
-
- - - - - - - - - - - + diff --git a/daidokoro/src/app/app.component.ts b/daidokoro/src/app/app.component.ts index 2e2d8f8..7907d77 100644 --- a/daidokoro/src/app/app.component.ts +++ b/daidokoro/src/app/app.component.ts @@ -1,10 +1,11 @@ import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; +import {AccueilComponent} from "./Component/accueil/accueil.component"; @Component({ selector: 'app-root', standalone: true, - imports: [RouterOutlet], + imports: [RouterOutlet, AccueilComponent], templateUrl: './app.component.html', styleUrl: './app.component.css' }) From a6e933e2108743880ed0355ba71a29528006c21c Mon Sep 17 00:00:00 2001 From: dorian Date: Mon, 24 Jun 2024 10:34:29 +0200 Subject: [PATCH 2/2] Adding Front --- .idea/vcs.xml | 6 +++ .idea/workspace.xml | 108 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..34894ae --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + { + "associatedIndex": 7 +} + + + + + + + { + "keyToString": { + "ASKED_ADD_EXTERNAL_FILES": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "master", + "last_opened_file_path": "/home/dorian/Documents/but3/Angular/Daidokoro", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "settings.editor.selected.configurable": "preferences.lookFeel", + "ts.external.directory.path": "/home/dorian/Documents/but3/Angular/Daidokoro/daidokoro/node_modules/typescript/lib", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + + 1718535175328 + + + + + + + + + + + + \ No newline at end of file