diff options
Diffstat (limited to 'views/recipe/create.ejs')
-rw-r--r-- | views/recipe/create.ejs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/views/recipe/create.ejs b/views/recipe/create.ejs new file mode 100644 index 0000000..a6921a8 --- /dev/null +++ b/views/recipe/create.ejs @@ -0,0 +1,51 @@ +<%- include('../partials/header') %> +<%- include('../partials/nav') %> + +<div class='content'> + <%- include('../partials/categories') %> + <div class='main'> + <div class='createCard'> + <h4 style='text-align: center'>Create Recipe</h4> + <form id='createForm' action="/recipe" method='POST'> + <label for="">Title:</label> + <input type="text" name='recipe[title]'> + <label for="">Image:</label> + <!-- <input type="text" name='recipe[picture]'> --> + <!-- <input type="file" name='picture' accept='image/png, image/jpg'> --> + <a href='/recipe/image/upload'>Upload image</a> + <% if(files) { %> + <select id="" name="recipe[picture]"> + <% files.map(f => { %> + <option value='<%= f %>'><%= f %></option> + <% }) %> + </select> + <% } %> + <label for="">Category:</label> + <input type="text" name='recipe[category]'> + <label for="">Ingridients:</label> + <input type="text" name='recipe[ingridients]'> + <label for="">Number of steps:</label> + <div class='stepControl'> + <input id='stpnum' type="number" value=0 name='recipe[nsteps]'> + <div class='stepBtns'> + <button id='minus' onclick='prevent(event)'>-</button> + <button id='plus' onclick='prevent(event)'>+</button> + </div> + </div> + <button id='sub' type="submit">Create</button> + </form> + </div> + </div> + <%- include('../partials/popular') %> +</div> + +<script type='text/javascript' src='/libs/main.js'></script> +<script type='text/javascript'> + const prevent = (e) => { + e.preventDefault(); + } +</script> + +<%- include('../partials/magicCats') %> +<%- include('../partials/magicPops') %> +<%- include('../partials/footer') %> |