summaryrefslogtreecommitdiff
path: root/views/account
diff options
context:
space:
mode:
Diffstat (limited to 'views/account')
-rw-r--r--views/account/account.ejs44
-rw-r--r--views/account/changepass.ejs25
-rw-r--r--views/account/editBio.ejs27
-rw-r--r--views/account/saved.ejs33
4 files changed, 129 insertions, 0 deletions
diff --git a/views/account/account.ejs b/views/account/account.ejs
new file mode 100644
index 0000000..3c4e4ea
--- /dev/null
+++ b/views/account/account.ejs
@@ -0,0 +1,44 @@
+<%- include('../partials/header') %>
+<%- include('../partials/nav') %>
+
+<div class='content'>
+ <% if(usr) { %>
+ <% if(usr._id.equals(account.author.id)) { %>
+ <%- include('../partials/settings') %>
+ <% } else { %>
+ <%- include('../partials/categories') %>
+ <% } %>
+ <% } else { %>
+ <%- include('../partials/categories') %>
+ <% } %>
+ <div class='main'>
+ <div class='recList'>
+ <% recipes.map(s => { %>
+ <div class='recCard'>
+ <img src="/images/<%= s.author.username %>/<%= s.picture %>" alt="recipe">
+ <a href='/recipe/<%= s._id %>'><%= s.title %></a>
+ <% if(usr) { %>
+ <% if(usr._id.equals(s.author.id)) { %>
+ <div class='recControl'>
+ <form action="/recipe/<%= s._id %>/edit">
+ <button class='acRecBtns'><i class='fas fa-edit'></i></button>
+ </form>
+ <form action='/recipe/<%= s._id %>?_method=DELETE' method='POST'>
+ <button class='acRecBtns' type='submit'><i class='fas fa-trash'></i></button>
+ </form>
+ </div>
+ <% } %>
+ <% } %>
+ </div>
+ <% }) %>
+ </div>
+ </div>
+ <%- include('../partials/bio') %>
+</div>
+<% if(usr) { %>
+ <%- include('../partials/magicSets') %>
+<% } else { %>
+ <%- include('../partials/magicCats') %>
+<% } %>
+<%- include('../partials/magicBio') %>
+<%- include('../partials/footer') %>
diff --git a/views/account/changepass.ejs b/views/account/changepass.ejs
new file mode 100644
index 0000000..25dc1fe
--- /dev/null
+++ b/views/account/changepass.ejs
@@ -0,0 +1,25 @@
+<%- include('../partials/header') %>
+<%- include('../partials/nav') %>
+
+<div class='content'>
+ <%- include('../partials/settings') %>
+ <div class='main'>
+ <div class='logCard'>
+ <h4 style='text-align: center;'>Edit Bio</h4>
+ <div class='fff'>
+ <form id='logform' action="/account/<%= usr._id %>/changepass" method='POST'>
+ <label for="">Old Password:</label>
+ <input type="password" name='oldpassword'>
+ <label for="">New Password:</label>
+ <input type="password" name='newpassword'>
+ <button><i class='fas fa-edit'></i></button>
+ </form>
+ </div>
+ </div>
+ </div>
+ <%- include('../partials/bio') %>
+</div>
+
+<%- include('../partials/magicSets') %>
+<%- include('../partials/magicBio') %>
+<%- include('../partials/footer') %>
diff --git a/views/account/editBio.ejs b/views/account/editBio.ejs
new file mode 100644
index 0000000..fb0a95b
--- /dev/null
+++ b/views/account/editBio.ejs
@@ -0,0 +1,27 @@
+<%- include('../partials/header') %>
+<%- include('../partials/nav') %>
+
+<div class='content'>
+ <%- include('../partials/settings') %>
+ <div class='main'>
+ <div class='logCard'>
+ <h4 style='text-align: center;'>Edit Bio</h4>
+ <div class='fff'>
+ <form id='logform' action="/account/<%= usr._id %>?_method=PUT" method='POST'>
+ <label for="">Name:</label>
+ <input type="text" name='bio[name]' value='<%= account.bio.name %>'>
+ <label for="">Website:</label>
+ <input type="text" name='bio[website]' value='<%= account.bio.website %>'>
+ <label for="">About:</label>
+ <input type="text" name='bio[about]' value='<%= account.bio.about %>'>
+ <button><i class='fas fa-edit'></i></button>
+ </form>
+ </div>
+ </div>
+ </div>
+ <%- include('../partials/bio') %>
+</div>
+
+<%- include('../partials/magicSets') %>
+<%- include('../partials/magicBio') %>
+<%- include('../partials/footer') %>
diff --git a/views/account/saved.ejs b/views/account/saved.ejs
new file mode 100644
index 0000000..2e4c864
--- /dev/null
+++ b/views/account/saved.ejs
@@ -0,0 +1,33 @@
+<%- include('../partials/header') %>
+<%- include('../partials/nav') %>
+
+<div class='content'>
+ <%- include('../partials/settings') %>
+ <div class='main'>
+ <div class='recList'>
+ <% recipes.map(s => { %>
+ <div class='recCard'>
+ <img src="/images/<%= s.author.username %>/<%= s.picture %>" alt="recipe">
+ <a href='/recipe/<%= s._id %>'><%= s.title %></a>
+ <% if(usr) { %>
+ <% if(usr._id.equals(s.author.id)) { %>
+ <div class='recControl'>
+ <form action="/recipe/<%= s._id %>/edit">
+ <button class='acRecBtns'><i class='fas fa-edit'></i></button>
+ </form>
+ <form action='/recipe/<%= s._id %>?_method=DELETE' method='POST'>
+ <button class='acRecBtns' type='submit'><i class='fas fa-trash'></i></button>
+ </form>
+ </div>
+ <% } %>
+ <% } %>
+ </div>
+ <% }) %>
+ </div>
+ </div>
+ <%- include('../partials/bio') %>
+</div>
+
+<%- include('../partials/magicSets') %>
+<%- include('../partials/magicBio') %>
+<%- include('../partials/footer') %>