Added button to home header "Приготовить из того что есть" "Cook from what I have" #6

Open
opened 2020-05-14 21:29:55 +03:00 by Ghost · 0 comments
Ghost commented 2020-05-14 21:29:55 +03:00 (Migrated from codeberg.org)

Create ingredients table where all the ingredients are going to be stored.

        create table ingredients (
            id int unsigned auto_increment primary key,
            name_ru varchar(255),
            name_en varchar(255),
            validated bit default 0
        );
  • Add page where admin can add, remove or validate ingredients in ingredients table. It must be handle with ajax. And it has to work pretty fast. When you validate ingredient you must give a translation to it, without translation it must not work.
  • When you add ingredient to a recipe it will suggest you to choose from existing.
  • When you're trying to add ingredient but it doesn't exit in the database, you can still add it, it will be created in ingredients table but with the flag validated=0, which means that it wasn't validated yet.
  • You can pick what ingredients are optional.
  • On home page add button, after clicking it you'll be given a popup window with interface where you can choose or write ingredients that you have, and then click search button. Some ingredients has to be included in the list, for example salt and sugar.
  • After clicking search button it will show you all recipes that you can cook via AJAX request. It will compare given items to non-optional items in recipes. Optional ingredients must be skipped, things like: salt, sugar, paper. If we found at least 2 recipes, we will return them into javascript, javascript will show them and will make another request for more results, we need to pass ids of 2 recipes in order to exclude them from results. If there is no matching recipes, we will say that, but still we are going to show some results, where we don't match 1 or 2 ingredients. User must see what ingredients are missing from particular recipe.
Create ingredients table where all the ingredients are going to be stored. ```sql create table ingredients ( id int unsigned auto_increment primary key, name_ru varchar(255), name_en varchar(255), validated bit default 0 ); ``` - Add page where admin can add, remove or validate ingredients in ingredients table. It must be handle with ajax. And it has to work pretty fast. When you validate ingredient you must give a translation to it, without translation it must not work. - When you add ingredient to a recipe it will suggest you to choose from existing. - When you're trying to add ingredient but it doesn't exit in the database, you can still add it, it will be created in ingredients table but with the flag `validated=0`, which means that it wasn't validated yet. - You can pick what ingredients are optional. - On home page add button, after clicking it you'll be given a popup window with interface where you can choose or write ingredients that you have, and then click search button. Some ingredients has to be included in the list, for example salt and sugar. - After clicking search button it will show you all recipes that you can cook via **AJAX** request. It will compare given items to non-optional items in recipes. Optional ingredients must be skipped, things like: salt, sugar, paper. If we found at least 2 recipes, we will return them into _javascript_, javascript will show them and will make another request for more results, we need to pass ids of 2 recipes in order to exclude them from results. If there is no matching recipes, we will say that, but still we are going to show some results, where we don't match 1 or 2 ingredients. User must see what ingredients are missing from particular recipe.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
archive/reciper#6
No description provided.