From 9119b6fa4753cd9b54308005c87653904c6af163 Mon Sep 17 00:00:00 2001 From: "[esekyi]" <[sskert10@gmail.com]> Date: Fri, 30 Aug 2024 07:50:05 +0000 Subject: [PATCH] =?UTF-8?q?[Fixes=F0=9F=9B=A0=EF=B8=8F]=20Added=20new=20UI?= =?UTF-8?q?=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/base.html | 34 +-- app/templates/index.html | 248 ++++++++++++++++++ app/templates/recipes/create.html | 40 --- app/templates/recipes/createPages/create.html | 118 +++++++++ .../recipes/createPages/create_layout.html | 74 ++++++ .../recipes/{ => createPages}/edit.html | 0 app/templates/recipes/list.html | 26 -- .../recipes/readPages/allRecipes.html | 77 ++++++ .../recipes/readPages/read_layout.html | 66 +++++ .../recipe_detail.html} | 0 app/templates/user_auth/index.html | 12 - app/templates/user_auth/login.html | 2 + app/templates/user_auth/register.html | 1 + app/templates/user_auth/user_profile.html | 32 +++ app/utils.py | 7 - 15 files changed, 637 insertions(+), 100 deletions(-) create mode 100644 app/templates/index.html delete mode 100644 app/templates/recipes/create.html create mode 100644 app/templates/recipes/createPages/create.html create mode 100644 app/templates/recipes/createPages/create_layout.html rename app/templates/recipes/{ => createPages}/edit.html (100%) delete mode 100644 app/templates/recipes/list.html create mode 100644 app/templates/recipes/readPages/allRecipes.html create mode 100644 app/templates/recipes/readPages/read_layout.html rename app/templates/recipes/{single_recipe.html => readPages/recipe_detail.html} (100%) delete mode 100644 app/templates/user_auth/index.html create mode 100644 app/templates/user_auth/user_profile.html delete mode 100644 app/utils.py diff --git a/app/templates/base.html b/app/templates/base.html index 980a764..e115eb5 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -7,33 +7,37 @@ {% block title %} - {{title}} | SpiceShare + {% if title%} + {{title}} + {% else %} + SpiceShare + {% endif %} {% endblock %} - +
-

SpiceShare

+

SpiceShare

diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..b617dff --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,248 @@ + + + + + + + SpiceShare - Share Your Taste, Explore New Flavors + + + + + + + +
+
+
+ + +
+
+
+

Welcome to SpiceShare

+

Discover and Share Your Favorite Recipes

+

Share Your Taste, Explore New Flavors

+ Explore + Recipes +
+
+

Image by Freepik

+
+
+ + + + + + + + +
+
+

Ready to Join?

+

Join SpiceShare and start sharing your favorite recipes with the world!

+ Join + Now +
+
+ + + + + + {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} + {% for category, message in messages %} +
+

{{ message }}

+ {% endfor %} +
+ {% endif %} + {% endwith %} + + + + + + + \ No newline at end of file diff --git a/app/templates/recipes/create.html b/app/templates/recipes/create.html deleted file mode 100644 index 7bbfac7..0000000 --- a/app/templates/recipes/create.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends "base.html" %} -{% block content %} -

Create Recipe

-
- -
- - -
- - - - - - - - -
- -
- -
-

Directions

-
- -
- -
- -
-{% endblock %} - diff --git a/app/templates/recipes/createPages/create.html b/app/templates/recipes/createPages/create.html new file mode 100644 index 0000000..6ac9df5 --- /dev/null +++ b/app/templates/recipes/createPages/create.html @@ -0,0 +1,118 @@ +{% extends "recipes/createPages/create_layout.html" %} + +{% block content %} +
+ + +

Add Your Favorite Recipe

+
+ +
+ Image Preview +
+ +
+ +
+
+ +
+
+ + +
+
+ + +
+
+ +
+ + °F +
+
+
+ + + + +
+
+ +
+
+ +
+ + min +
+
+
+ +
+ + min +
+
+
+ +
+ + servings +
+
+
+ + +
+

Ingredients

+
+
+
+ + +
+
+
+ +
+ +
+

Instructions

+
+
+
+ + +
+
+
+ +
+ + +
+ + +
+
+{% endblock %} + diff --git a/app/templates/recipes/createPages/create_layout.html b/app/templates/recipes/createPages/create_layout.html new file mode 100644 index 0000000..fc0f229 --- /dev/null +++ b/app/templates/recipes/createPages/create_layout.html @@ -0,0 +1,74 @@ + + + + + + + + {% if title%} + {{title}} + {% else %} + SpiceShare + {% endif %} + + + + + + + + + + +
+
+
SpiceShare
+ +
+
+ +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+ {% for category, message in messages %} +
+ {{ message }} + +
+ {% endfor %} +
+ {% endif %} + {% endwith %} + + {% block content %} + {% endblock %} + +
+ + + + + + + + \ No newline at end of file diff --git a/app/templates/recipes/edit.html b/app/templates/recipes/createPages/edit.html similarity index 100% rename from app/templates/recipes/edit.html rename to app/templates/recipes/createPages/edit.html diff --git a/app/templates/recipes/list.html b/app/templates/recipes/list.html deleted file mode 100644 index 5740902..0000000 --- a/app/templates/recipes/list.html +++ /dev/null @@ -1,26 +0,0 @@ -{% extends "base.html" %} -{% block content %} -

Recipes

-
- {% for recipe in recipes %} -

- {{ recipe.title }} - View -

- {% if recipe.image_url %} - {{ recipe.title }} image - {% endif %} -
-

Directions

-
    - {% for direction in recipe.instructions %} -
  1. {{ direction.name }}
  2. - {% endfor %} -
-
- - - {% endfor %} - -
- -{% endblock %} \ No newline at end of file diff --git a/app/templates/recipes/readPages/allRecipes.html b/app/templates/recipes/readPages/allRecipes.html new file mode 100644 index 0000000..f752953 --- /dev/null +++ b/app/templates/recipes/readPages/allRecipes.html @@ -0,0 +1,77 @@ +{% extends "recipes/readPages/read_layout.html" %} +{% block content %} +
+

Recipes

+ +
+
+ +
+
+ + {% for recipe in recipes %} +
+
+ {% if recipe.image_url %} + {{recipe.title}} + {% else %} + No Image Available + {% endif %} +
+
+

{{recipe.title}}

+

Tasty enchilada recipe

+

Created by: {{ recipe.user.username }}

+ Read More +
+
+ {% endfor %} + +
+ +
+

Most Recent

+
+ +
+ Spinach Skillet +
+

Spinach Skillet

+

Quick and easy comfort food

+ Read More +
+
+ +
+
+ +
+

Most Viewed

+
+ +
+ Savory Porridge +
+

Savory Porridge

+

Aunt Mary's recipe

+ Read More +
+
+ +
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/app/templates/recipes/readPages/read_layout.html b/app/templates/recipes/readPages/read_layout.html new file mode 100644 index 0000000..398775f --- /dev/null +++ b/app/templates/recipes/readPages/read_layout.html @@ -0,0 +1,66 @@ + + + + + + + + {% if title%} + {{title}} + {% else %} + SpiceShare + {% endif %} + + + + + + + + + +
+
+
SpiceShare
+ +
+
+ +
+ {% with messages = get_flashed_messages(with_categories=true) %} + {% if messages %} +
+ {% for category, message in messages %} +
+ {{ message }} + +
+ {% endfor %} +
+ {% endif %} + {% endwith %} + + {% block content %} + {% endblock %} +
+ + + + \ No newline at end of file diff --git a/app/templates/recipes/single_recipe.html b/app/templates/recipes/readPages/recipe_detail.html similarity index 100% rename from app/templates/recipes/single_recipe.html rename to app/templates/recipes/readPages/recipe_detail.html diff --git a/app/templates/user_auth/index.html b/app/templates/user_auth/index.html deleted file mode 100644 index ee00bde..0000000 --- a/app/templates/user_auth/index.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "base.html" %} - -{% block title %}Home - SpiceShare{% endblock %} - -{% block content %} -
-

Welcome to SpiceShare

-

Discover and share delicious recipes from around the world!

- Explore - Recipes -
-{% endblock %} diff --git a/app/templates/user_auth/login.html b/app/templates/user_auth/login.html index 5e1223e..e30c3e1 100644 --- a/app/templates/user_auth/login.html +++ b/app/templates/user_auth/login.html @@ -8,6 +8,7 @@

Login

+
@@ -19,4 +20,5 @@

Login

+ {% endblock %} \ No newline at end of file diff --git a/app/templates/user_auth/register.html b/app/templates/user_auth/register.html index 38ccdc2..86efefa 100644 --- a/app/templates/user_auth/register.html +++ b/app/templates/user_auth/register.html @@ -8,6 +8,7 @@

Create Account

+
{{ user.first_name }}'s Profile + +
+

Your Information

+

Username: {{ user.username }}

+

Email: {{ user.email }}

+ Edit Profile + Delete Account +
+ +
+

Your Recipes

+ {% if recipes %} + + {% else %} +

You haven't posted any recipes yet.

+ {% endif %} + + Add Recipe +
+{% endblock %} \ No newline at end of file diff --git a/app/utils.py b/app/utils.py deleted file mode 100644 index c615707..0000000 --- a/app/utils.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask import current_app as app - - -def allowed_file(filename): - return '.' in filename and \ - filename.rsplit('.', 1)[1].lower( - ) in app.config['ALLOWED_EXTENSIONS']