diff options
Diffstat (limited to 'views/partials')
| -rw-r--r-- | views/partials/bio.ejs | 19 | ||||
| -rw-r--r-- | views/partials/categories.ejs | 8 | ||||
| -rw-r--r-- | views/partials/footer.ejs | 3 | ||||
| -rw-r--r-- | views/partials/header.ejs | 25 | ||||
| -rw-r--r-- | views/partials/magicBio.ejs | 21 | ||||
| -rw-r--r-- | views/partials/magicCats.ejs | 8 | ||||
| -rw-r--r-- | views/partials/magicPops.ejs | 14 | ||||
| -rw-r--r-- | views/partials/magicSets.ejs | 15 | ||||
| -rw-r--r-- | views/partials/nav.ejs | 59 | ||||
| -rw-r--r-- | views/partials/popular.ejs | 14 | ||||
| -rw-r--r-- | views/partials/search.ejs | 18 | ||||
| -rw-r--r-- | views/partials/settings.ejs | 15 | 
12 files changed, 219 insertions, 0 deletions
| diff --git a/views/partials/bio.ejs b/views/partials/bio.ejs new file mode 100644 index 0000000..198aa27 --- /dev/null +++ b/views/partials/bio.ejs @@ -0,0 +1,19 @@ +<div class='pops'> +    <div class='bioDisplay'> +        <h4><%= account.bio.name %></h4> +        <ul> +            <li> +                <p>Email:</p> +                <p><%= account.author.username %></p> +            </li> +            <li> +                <p>Website:</p> +                <p><%= account.bio.website %></p> +            </li> +            <li> +                <p>About:</p> +                <p><%= account.bio.about %></p> +            </li> +        </ul> +    </div> +</div>
\ No newline at end of file diff --git a/views/partials/categories.ejs b/views/partials/categories.ejs new file mode 100644 index 0000000..638b2bb --- /dev/null +++ b/views/partials/categories.ejs @@ -0,0 +1,8 @@ +<div class='cats'> +    <h4>Categories</h4> +    <ul> +        <% cats.map(c => { %> +            <li><a href='/categories/<%= c.toLowerCase() %>'><%= c %></a></li> +        <% }) %>  +    </ul> +</div>
\ No newline at end of file diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs new file mode 100644 index 0000000..89a9ee1 --- /dev/null +++ b/views/partials/footer.ejs @@ -0,0 +1,3 @@ +<script type='text/javascript' src="/libs/resp.js"></script> +</body> +</html> diff --git a/views/partials/header.ejs b/views/partials/header.ejs new file mode 100644 index 0000000..13a6cf0 --- /dev/null +++ b/views/partials/header.ejs @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +    <meta charset="UTF-8"> +    <meta name="viewport" content="width=device-width, initial-scale=1.0"> +    <title>Recipes</title> +    <link rel="stylesheet" type='text/css' href="/main.css"> +    <script defer src="/libs/fontawesome/all.min.js"></script> +    <script type='text/javascript' src="/libs/jquery/jquery-3.6.0.min.js"></script> +</head> +<body> +<% if(error && error.length > 0) { %> +    <div"> +        <div class='flashCardError' role="alert"> +            <%= error %> +        </div> +    </div> +<% } %> +<% if(success && success.length > 0) { %> +    <div> +        <div class='flashCardSuccess' role="alert"> +            <%= success %> +        </div> +    </div> +<% } %> diff --git a/views/partials/magicBio.ejs b/views/partials/magicBio.ejs new file mode 100644 index 0000000..4d448a1 --- /dev/null +++ b/views/partials/magicBio.ejs @@ -0,0 +1,21 @@ +<div class='magicPops invis'> +    <div class='magicbioDisplay'> +        <h4><%= account.bio.name %></h4> +        <ul> +            <% if(usr) { %> +                <li> +                    <p>Email:</p> +                    <p><%= account.author.username %></p> +                </li> +            <% } %> +            <li> +                <p>Website:</p> +                <p><%= account.bio.website %></p> +            </li> +            <li> +                <p>About:</p> +                <p><%= account.bio.about %></p> +            </li> +        </ul> +    </div> +</div> diff --git a/views/partials/magicCats.ejs b/views/partials/magicCats.ejs new file mode 100644 index 0000000..fb49d05 --- /dev/null +++ b/views/partials/magicCats.ejs @@ -0,0 +1,8 @@ +<div class='magicCats invis'> +    <h4>Categories</h4> +    <ul> +        <% cats.map(c => { %> +            <li><a href='/categories/<%= c.toLowerCase() %>'><%= c %></a></li> +        <% }) %>  +    </ul> +</div> diff --git a/views/partials/magicPops.ejs b/views/partials/magicPops.ejs new file mode 100644 index 0000000..3583b7b --- /dev/null +++ b/views/partials/magicPops.ejs @@ -0,0 +1,14 @@ +<div class='magicPops invis'> +    <h4>Popular</h4> +    <div class='popCard'> +        <% popular.map(p => { %> +            <div class='popular'> +                <h5><%= p.title %></h5> +                <img src="/images/<%= p.author.username %>/<%= p.picture %>" alt="recipe" style='width: 10rem; height: 10rem; object-fit: cover;'> +                <form action="/recipe/<%= p._id %>"> +                    <button>See Recipe</button>     +                </form> +            </div> +        <% }) %> +    </div> +</div> diff --git a/views/partials/magicSets.ejs b/views/partials/magicSets.ejs new file mode 100644 index 0000000..b61d3bb --- /dev/null +++ b/views/partials/magicSets.ejs @@ -0,0 +1,15 @@ +<div class='magicSets invis'> +    <h4>Settings</h4> +    <ul> +        <li><a href='/account/<%= usr._id %>/bio/edit'>Edit Bio</a></li> +        <li><a href='/account/<%= usr._id %>/saved'>Saved Recipes</a></li> +        <li><a href='/account/<%= usr._id %>/changepass'>Change Password</a></li> +        <li> +            <form action="/account/<%= usr._id %>?_method=DELETE" method='POST'> +                <button style='background-color: rgba(255,255,255,0); border: none; padding: 0; color: blueviolet; font-size: medium;'> +                    Delete Account +                </button> +            </form> +        </li> +    </ul> +</div> diff --git a/views/partials/nav.ejs b/views/partials/nav.ejs new file mode 100644 index 0000000..838d228 --- /dev/null +++ b/views/partials/nav.ejs @@ -0,0 +1,59 @@ +<div class='nav'> +    <% if(page === 'home') { %> +        <% if(usr) { %> +            <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +            <h4><a href='/recipe/create'>Create</a></h4> +            <h4><a href='/account/<%= usr._id %>'>Account</a></h4> +            <h4><a href='/logout'>Logout</a></h4> +        <% } else { %> +            <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +            <h4><a href="/login">Login</a></h4> +            <h4><a href='/register'>Register</a></h4> +        <% } %> +    <% } else if(page === 'login') { %> +            <h4><a href="/">Recipes</a></h4> +            <h4><a href="/login" style='background-color: crimson'>Login</a></h4> +            <h4><a href='/register'>Register</a></h4> +    <% } else if(page === 'register') { %> +            <h4><a href="/">Recipes</a></h4> +            <h4><a href="/login">Login</a></h4> +            <h4><a href='/register' style='background-color: crimson'>Register</a></h4> +    <% } else if(page === 'create') { %> +        <% if(usr) { %> +            <h4><a href="/">Recipes</a></h4> +            <h4><a href='/recipe/create' style='background-color: crimson'>Create</a></h4> +            <h4><a href='/account/<%= usr._id %>'>Account</a></h4> +            <h4><a href='/logout'>Logout</a></h4> +        <% } %> +    <% } else if(page === 'account') { %> +        <% if(usr) { %> +            <h4><a href="/">Recipes</a></h4> +            <h4><a href='/recipe/create'>Create</a></h4> +            <h4><a href='/account/<%= usr._id %>' style='background-color: crimson'>Account</a></h4> +            <h4><a href='/logout'>Logout</a></h4> +        <% } else { %> +            <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +            <h4><a href="/login">Login</a></h4> +            <h4><a href='/register'>Register</a></h4> +        <% } %> +    <% } else if(page === 'show') { %> +        <% if(usr) { %> +            <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +            <h4><a href='/recipe/create'>Create</a></h4> +            <h4><a href='/account/<%= usr._id %>'>Account</a></h4> +            <h4><a href='/logout'>Logout</a></h4> +        <% } else { %> +            <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +            <h4><a href="/login">Login</a></h4> +            <h4><a href='/register'>Register</a></h4> +        <% } %> +    <% } else if(page === 'search') { %> +        <h4><a href="/" style='background-color: crimson'>Recipes</a></h4> +        <h4><a href="/login">Login</a></h4> +        <h4><a href='/register'>Register</a></h4> +    <% } else { %> +            <h4><a href="/">Recipes</a></h4> +            <h4><a href="/login">Login</a></h4> +            <h4><a href='/register'>Register</a></h4> +    <% } %>  +</div>
\ No newline at end of file diff --git a/views/partials/popular.ejs b/views/partials/popular.ejs new file mode 100644 index 0000000..af83f34 --- /dev/null +++ b/views/partials/popular.ejs @@ -0,0 +1,14 @@ +<div class='pops'> +    <h4>Popular</h4> +    <div class='popCard'> +        <% popular.map(p => { %> +            <div class='popular'> +                <h5><%= p.title %></h5> +                <img src="/images/<%= p.author.username %>/<%= p.picture %>" alt="recipe" style='width: 10rem; height: 10rem; object-fit: cover;'> +                <form action="/recipe/<%= p._id %>"> +                    <button>See Recipe</button>     +                </form> +            </div> +        <% }) %> +    </div> +</div> diff --git a/views/partials/search.ejs b/views/partials/search.ejs new file mode 100644 index 0000000..f838b4c --- /dev/null +++ b/views/partials/search.ejs @@ -0,0 +1,18 @@ +<div class='searchbox'> +    <h2>Search Recipes</h2> +    <form id='searchForm'> +        <% if(page === 'search') { %> +            <input id='srchInpt' type="text" value='<%= query %>'> +            <button id='srchBtn' type='submit'> +                <i class='fas fa-search'></i> +            </button> +        <% } else {%> +            <input id='srchInpt' type="text"> +            <button id='srchBtn' type='submit'> +                <i class='fas fa-search'></i> +            </button> +        <% } %> +    </form> +</div> + +<script type='text/javascript' src="/libs/search.js"></script>
\ No newline at end of file diff --git a/views/partials/settings.ejs b/views/partials/settings.ejs new file mode 100644 index 0000000..08ac1cd --- /dev/null +++ b/views/partials/settings.ejs @@ -0,0 +1,15 @@ +<div class='sets'> +    <h4>Settings</h4> +    <ul> +        <li><a href='/account/<%= usr._id %>/bio/edit'>Edit Bio</a></li> +        <li><a href='/account/<%= usr._id %>/saved'>Saved Recipes</a></li> +        <li><a href='/account/<%= usr._id %>/changepass'>Change Password</a></li> +        <li> +            <form action="/account/<%= usr._id %>?_method=DELETE" method='POST'> +                <button style='background-color: rgba(255,255,255,0); border: none; padding: 0; color: blueviolet; font-size: medium;'> +                    Delete Account +                </button> +            </form> +        </li> +    </ul> +</div>
\ No newline at end of file | 
