diff options
Diffstat (limited to 'views/category')
-rw-r--r-- | views/category/cats.ejs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/views/category/cats.ejs b/views/category/cats.ejs new file mode 100644 index 0000000..694a03b --- /dev/null +++ b/views/category/cats.ejs @@ -0,0 +1,38 @@ +<%- include('../partials/header') %> +<%- include('../partials/nav') %> +<%- include('../partials/search') %> + +<div class='content'> + <%- include('../partials/categories') %> + <div class='main'> + <div class='recList'> + <% recipes.filter(r => { %> + <% if(r.category.toLowerCase() === query) { %> + <div class='recCard'> + <img src="/images/<%= r.author.username %>/<%= r.picture %>" alt="recipe"> + <a href='/recipe/<%= r._id %>'><%= r.title %></a> + <% if(usr) { %> + <% if(usr._id.equals(r.author.id)) { %> + <div class='recControl'> + <form action="/recipe/<%= r._id %>/edit"> + <button class='acRecBtns'><i class='fas fa-edit'></i></button> + </form> + <form action='/recipe/<%= r._id %>?_method=DELETE' method='POST'> + <button class='acRecBtns' type='submit'><i class='fas fa-trash'></i></button> + </form> + </div> + <% } %> + <% } %> + </div> + <% } %> + <% }) %> + + + </div> + </div> + <%- include('../partials/popular') %> +</div> + +<%- include('../partials/magicCats') %> +<%- include('../partials/magicPops') %> +<%- include('../partials/footer') %> |