diff options
author | root <root@vagrantz.xyz> | 2021-04-06 10:57:50 +0000 |
---|---|---|
committer | root <root@vagrantz.xyz> | 2021-04-06 10:57:50 +0000 |
commit | 8170d5bc0544fbc02155b8b57751cd1dec33dd69 (patch) | |
tree | d5cffb086fe6d5585c1e00ea5d5d2d907e6d2cd6 /views/search.ejs |
Diffstat (limited to 'views/search.ejs')
-rw-r--r-- | views/search.ejs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/views/search.ejs b/views/search.ejs new file mode 100644 index 0000000..3bf35be --- /dev/null +++ b/views/search.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.title.toLowerCase().includes(query.toLowerCase())) { %> + <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> + <% } else { %> + + <% } %> + <% }) %> + </div> + </div> + <%- include('partials/popular') %> +</div> + +<%- include('partials/magicCats') %> +<%- include('partials/magicPops') %> +<%- include('partials/footer') %> |