summaryrefslogtreecommitdiff
path: root/views/search.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'views/search.ejs')
-rw-r--r--views/search.ejs38
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') %>