-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from vxshxk/gallery-show-recipe
Link gallery images with recipes for easy access
- Loading branch information
Showing
6 changed files
with
190 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
{% load static %} | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>RecipifyAI</title> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css" rel="stylesheet" /> | ||
<link rel="stylesheet" href="{% static 'css/pick.css' %}"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script> | ||
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" rel="stylesheet"/> | ||
</head> | ||
<body> | ||
<div class="navbar-container"> | ||
<nav class="bg-white dark:bg-gray-900 fixed w-full z-20 top-0 start-0 border-b border-gray-200 dark:border-gray-600"> | ||
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4"> | ||
<a href="#" class="flex items-center space-x-3 rtl:space-x-reverse"> | ||
<img src="{% static 'img/logo.jpeg' %}" class="h-8" alt="RecipifyAI Logo"> | ||
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RecipifyAI</span> | ||
</a> | ||
<div class="flex md:order-2 space-x-3 md:space-x-0 rtl:space-x-reverse"> | ||
<button id="menu-button" type="button" class="inline-flex items-center p-2 ml-1 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"> | ||
<span class="sr-only">Open main menu</span> | ||
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> | ||
<path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM4 15a1 1 0 100-2h12a1 1 0 100 2H4z" clip-rule="evenodd"></path> | ||
</svg> | ||
</button> | ||
</div> | ||
<div class="items-center justify-between hidden w-full md:flex md:w-auto md:order-1" id="navbar-sticky"> | ||
<ul class="flex flex-col p-4 md:p-0 mt-4 font-medium border border-gray-100 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700"> | ||
<li> | ||
<a href="{% url 'home' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Home</a> | ||
</li> | ||
<li> | ||
<a href="#" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">About</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'image_upload' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Upload</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'gallery' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Gallery</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'contact' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Contact</a> | ||
</li> | ||
{% if request.user.is_authenticated %} | ||
<li> | ||
<a href="{% url 'logout' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Logout</a> | ||
</li> | ||
{% else %} | ||
<li> | ||
<a href="{% url 'login' %}" class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-blue-500 dark:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700">Login</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
|
||
<!-- Sidebar --> | ||
|
||
<div id="sidebar" class="fixed top-0 left-0 w-64 h-full bg-gray-800 text-white transform -translate-x-full transition-transform duration-300 ease-in-out z-30"> | ||
<button id="close-sidebar" class="absolute top-4 right-4 text-white"> | ||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> | ||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path> | ||
</svg> | ||
</button> | ||
<ul class="flex flex-col p-4 mt-4 space-y-2 font-medium border border-gray-700 rounded-lg bg-gray-800"> | ||
<li> | ||
<a href="{% url 'home' %}" class="block py-2 px-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700" aria-current="page">Home</a> | ||
</li> | ||
<li> | ||
<a href="#" class="block py-2 px-3 text-white rounded hover:bg-gray-700">About</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'image_upload' %}" class="block py-2 px-3 text-white rounded hover:bg-gray-700">Upload</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'gallery' %}" class="block py-2 px-3 text-white rounded hover:bg-gray-700">Gallery</a> | ||
</li> | ||
<li> | ||
<a href="{% url 'contact' %}" class="block py-2 px-3 text-white rounded hover:bg-gray-700">Contact</a> | ||
</li> | ||
{% if requestO.user.is_authenticated %} | ||
<li> | ||
<a href="{% url 'logout' %}" class="block py-2 px-3 text-white rounded hover:bg-gray-700">Logout</a> | ||
</li> | ||
{% else %} | ||
<li> | ||
<a href="{% url 'login' %}" class="block py-2 px-3 text-white rounded hover:bg-gray-700">Login</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
|
||
<div class="recipe-section"> | ||
{% for recipe in recipes %} | ||
<div class="recipe"> | ||
<a href="#" class="block max-w-sm p-6 bg-white border border-gray-200 rounded-lg shadow hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700"> | ||
<div class="recipe-title">{{ recipe.name }}</div> | ||
<div class="ingredients-title">Ingredients Required</div> | ||
<ul style="margin-bottom: 20px;" class="list-disc"> | ||
{{recipe.ingredients}} | ||
</ul> | ||
<button type="button" | ||
onclick="window.location.href='{% url 'show_recipe' recipe.id %}'" | ||
class="text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-purple-300 dark:focus:ring-purple-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 mb-2">Show Recipe | ||
</button> | ||
<button type="button" | ||
onclick="window.location.href='{% url 'delete_recipe' recipe.id %}'" | ||
class="text-white bg-gradient-to-r from-red-400 via-red-500 to-red-600 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 mb-2">Delete Recipe | ||
</button> | ||
</a> | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
body { | ||
padding-top: 65px; /* Adjust based on the height of the nav bar */ | ||
} | ||
|
||
.recipe-display { | ||
display: flex; | ||
gap: 100px; | ||
align-items: flex-start; | ||
justify-content: center; | ||
} | ||
|
||
.recipe-title { | ||
font-weight: 700; | ||
font-size: 20px; | ||
white-space: nowrap; | ||
overflow: break-word; | ||
text-overflow: ellipsis; | ||
min-width: 300px; | ||
max-width: 100%; | ||
overflow: auto; | ||
box-sizing: border-box; | ||
} | ||
|
||
.recipe-section { | ||
margin-top: 100px; | ||
display: flex; | ||
gap: 60px; | ||
justify-content: center; | ||
align-items: flex-start; | ||
} | ||
|
||
|
||
.ingredients-title { | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
font-weight: 500; | ||
font-size: 20px; | ||
} | ||
|
||
.list_disc{ | ||
margin-top: 20px; | ||
} |