Users can upload photos

This commit is contained in:
Lucas Jensen
2022-05-26 21:22:59 -07:00
parent 70a86fc06f
commit c474aaae3f
9 changed files with 211 additions and 18 deletions

18
templates/email.html Normal file
View File

@@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block title %}{{content.get_name()}}{% endblock %}
{% block html_head %}
{% endblock %}
{% block content %}
<h1>{{ content.get_name() }}</h1>
<form method="post">
<label for="email">Email: </label>
<input name="email" id="email" type="email">
<button type="submit">Send!</button>
</form>
{% endblock %}

View File

@@ -9,7 +9,6 @@
<h1>{{ content.get_name() }} Recipe</h1>
<p>Number of loaves: {{ content.get_num_loaves() }}</p>
<table>
@@ -32,10 +31,27 @@
<button type="submit">Go!</button>
</form>
<input type="button" onclick="location.href='/recipes/{{_id}}/delete'" value=Delete />
<form method="post">
<form name="photo upload" id="photo upload" method="post" enctype="multipart/form-data">
<label for="photo">Upload a Photo: </label>
<input id="photo" type="file" name="photo">
<input type="submit">
</form>
<input type="button" onclick="location.href='/recipes/{{_id}}/delete'" value=Delete />
<form name="download" id="download" method="post">
<button type="submit">Download</button>
</form>
<a href="/recipes/{{_id}}/email">Email me!</a>
<div>
<!--<p>Photos: {{photos}}</p>-->
{% for photo in photos %}
<!-- <p>{{photo}}</p>-->
<img src="{{ url_for('static', filename=photo) }}" width="250" alt="bread photo">
{% endfor %}
</div>
{% endblock %}