diff options
Diffstat (limited to 'views/recipe/show.ejs')
-rw-r--r-- | views/recipe/show.ejs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/views/recipe/show.ejs b/views/recipe/show.ejs new file mode 100644 index 0000000..9fcc771 --- /dev/null +++ b/views/recipe/show.ejs @@ -0,0 +1,55 @@ +<%- include('../partials/header') %> +<%- include('../partials/nav') %> + +<div class='content'> + <%- include('../partials/categories') %> + <div class='main'> + <h4 style='text-align: center'><%= recipe.title %>, + by <a style='text-decoration: none;' href="/account/<%= recipe.author.id %>"> + <em><%= recAuthor.bio.name %></em></a> + </h4> + <div class='recIngImg'> + <div class='savImg'> + <img src="/images/<%= recipe.author.username %>/<%= recipe.picture %>" alt="recipe" style='max-width: 25rem'> + <% if(usr) { %> + <% if(account.favorites.includes(recipe._id)) { %> + <form class='saveRecForm' action="/recipe/<%= recipe._id %>/unsave?_method=PUT" method='POST'> + <button id='saveBtn'>Saved</button> + </form> + <% } else { %> + <form class='saveRecForm' action="/recipe/<%= recipe._id %>/save?_method=PUT" method='POST'> + <button id='saveBtn'>Save</button> + </form> + <% } %> + <% } %> + </div> + <div class='Ing'> + <h5>Ingredients:</h5> + <ul> + <% ingridients.map(i => { %> + <li><%= i %></li> + <% }) %> + </ul> + </div> + </div> + <p class='category'><span> + <a style='text-decoration: none;' href="/categories/<%= recipe.category.toLowerCase() %>"> + <%= recipe.category %> + </a> + </span></p> + <div class='steps'> + <h4>Instructions (<%= recipe.steps.length %> steps)</h4> + <% recipe.steps.map(s => { %> + <div> + <h5>Step <%= s.number %>:</h5> + <p><%= s.step %></p> + </div> + <% }) %> + </div> + </div> + <%- include('../partials/popular') %> +</div> + +<%- include('../partials/magicCats') %> +<%- include('../partials/magicPops') %> +<%- include('../partials/footer') %> |